from molecular_builder import create_bulk_crystal, carve_geometry, fetch_prepared_system from molecular_builder.geometry import BerkovichGeometry, CylinderGeometry slab = fetch_prepared_system("vashishta_1990_like_amorphous_silica/quench_950K") slab.cell[2,2] = 80 # Expand cell in z direction to fit indenter indenter = create_bulk_crystal("diamond", (144, 144, 80), round="down") carve_geometry(indenter, BerkovichGeometry((75, 75, 40)), side="out") carve_geometry(indenter, CylinderGeometry((75, 75, 50), 60, 200, orientation=(0,0,1)), side="out") atoms = slab+indenter atoms.write("indenter_and_glass.data", format="lammps-data")
import numpy as np from molecular_builder import fetch_prepared_system, carve_geometry from molecular_builder.geometry import SphereGeometry from pack_water import PackWater from pack_water.geometry import BoxGeometry, Fixed import ase # Fetch amorphous silica silica = fetch_prepared_system("amorphous_silica_1") num_spheres = 20 for sphere in range(num_spheres): i, j, k, l = np.random.uniform(size=4) x, y, z, r = i * 357, j * 143, k * 143, l * 30 geometry = SphereGeometry([x, y, z], r, periodic_boundary_condition=(True, True, True)) tmp_carved = carve_geometry(silica, geometry, side="in") print(f"tmp carved: {tmp_carved}") # Write amorphous silica with voids to pdb-filetype silica.write("amorphous_void.pdb", format="proteindatabank") # Fill voids with water packer = PackWater(filetype="pdb") packer.append(Fixed("amorphous_void.pdb", 0, 0, 0, number=1)) packer.append(BoxGeometry(0, 0, 0, 358, 143.2, 143.2, density=0.998)) packer(outfile="water.data")
from molecular_builder import create_bulk_crystal, carve_geometry, fetch_prepared_system, write from molecular_builder.geometry import BerkovichGeometry, CylinderGeometry slab = fetch_prepared_system( "vashishta_1990_like_amorphous_silica/quench_950K", type_mapping=[(1, 14), (2, 8)]) print(slab.numbers) slab.cell[2, 2] = 80 # Expand cell in z direction to fit indenter indenter = create_bulk_crystal("diamond", (144, 144, 80), round="down") carve_geometry(indenter, BerkovichGeometry((75, 75, 40)), side="out") carve_geometry(indenter, CylinderGeometry((75, 75, 50), 60, 200, orientation=(0, 0, 1)), side="out") atoms = slab + indenter write(atoms, "indenter_over_silica.png", bond_specs=[("Si", "O", 1.9)], camera_dir=(2, 1.5, -0.4), atom_radii=[("Si", 0.2), ("O", 0.2)], size=(1280, 960))
from molecular_builder import fetch_prepared_system, write atoms = fetch_prepared_system( "vashishta_1990_like_amorphous_silica_quench_300K", type_mapping=[[1, 14], [2, 8]]) write(atoms, "amorphous_silica.png")