|
50 | 50 | "cell_type": "code", |
51 | 51 | "outputs": [], |
52 | 52 | "source": [ |
53 | | - "DEFECT_TYPE = \"adatom\" \n", |
54 | | - "PLACEMENT_METHOD = \"equidistant\" # Choose between \"equidistant\", \"crystal_site\", \"closest_site\", and \"coordinate\"\n", |
55 | | - "CHEMICAL_ELEMENT = \"Si\" # Element to be placed at the site \n", |
56 | | - "APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] # Position of the defect in crystal coordinates\n", |
57 | | - "USE_CARTESIAN_COORDINATES = False # If True, the position is in Cartesian coordinates\n", |
58 | | - "DISTANCE_Z = 2.0 # Distance of the defect from the surface in Angstrom\n", |
59 | | - "\n", |
| 53 | + "DEFECT_CONFIGS = [\n", |
| 54 | + " {\n", |
| 55 | + " \"defect_type\": \"adatom\" ,\n", |
| 56 | + " \"placement_method\": \"equidistant\",\n", |
| 57 | + " \"chemical_element\": \"Si\",\n", |
| 58 | + " \"position_on_surface\": [0.5, 0.5],\n", |
| 59 | + " \"distance_z\": 2.0,\n", |
| 60 | + " \"use_cartesian_coordinates\": False\n", |
| 61 | + " }, \n", |
| 62 | + "]\n", |
60 | 63 | "# Slab parameters\n", |
61 | 64 | "MILLER_INDICES = (1, 1, 1) # Miller indices of the surface\n", |
62 | 65 | "SLAB_THICKNESS = 3 # Thickness of the slab in unit cells\n", |
63 | 66 | "VACUUM = 6 # Vacuum thickness in Angstrom\n", |
64 | | - "SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] " |
| 67 | + "SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] # Supercell matrix for the slab" |
65 | 68 | ], |
66 | 69 | "metadata": { |
67 | 70 | "collapsed": false |
|
101 | 104 | { |
102 | 105 | "cell_type": "markdown", |
103 | 106 | "source": [ |
104 | | - "### 1.3. Get input material\n", |
105 | | - "Materials are loaded with `get_materials()`." |
| 107 | + "### 1.3. Get input material" |
106 | 108 | ], |
107 | 109 | "metadata": { |
108 | 110 | "collapsed": false |
|
175 | 177 | "source": [ |
176 | 178 | "from mat3ra.made.tools.build.defect import AdatomSlabPointDefectConfiguration\n", |
177 | 179 | "\n", |
178 | | - "adatom_config = AdatomSlabPointDefectConfiguration(crystal=slab, \n", |
179 | | - " defect_type=DEFECT_TYPE, \n", |
180 | | - " placement_method=PLACEMENT_METHOD,\n", |
181 | | - " chemical_element=CHEMICAL_ELEMENT, \n", |
182 | | - " position_on_surface=APPROXIMATE_POSITION_ON_SURFACE,\n", |
183 | | - " distance_z=DISTANCE_Z, \n", |
184 | | - " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n", |
185 | | - ")" |
| 180 | + "defect_configurations = [\n", |
| 181 | + " AdatomSlabPointDefectConfiguration(\n", |
| 182 | + " crystal=slab,\n", |
| 183 | + " defect_type=defect[\"defect_type\"],\n", |
| 184 | + " placement_method=defect[\"placement_method\"],\n", |
| 185 | + " chemical_element=defect[\"chemical_element\"],\n", |
| 186 | + " position_on_surface=defect[\"position_on_surface\"],\n", |
| 187 | + " distance_z=defect[\"distance_z\"],\n", |
| 188 | + " use_cartesian_coordinates=defect[\"use_cartesian_coordinates\"]\n", |
| 189 | + " ) for defect in DEFECT_CONFIGS\n", |
| 190 | + "]" |
186 | 191 | ], |
187 | 192 | "metadata": { |
188 | 193 | "collapsed": false |
|
204 | 209 | "cell_type": "code", |
205 | 210 | "outputs": [], |
206 | 211 | "source": [ |
207 | | - "from mat3ra.made.tools.build.defect import create_slab_defect\n", |
208 | | - "slab_with_adatom = create_slab_defect(adatom_config)" |
| 212 | + "from mat3ra.made.tools.build.defect import create_defects\n", |
| 213 | + "slab_with_adatom = create_defects(defect_configurations)" |
209 | 214 | ], |
210 | 215 | "metadata": { |
211 | 216 | "collapsed": false |
|
230 | 235 | "from utils.visualize import visualize_materials as visualize\n", |
231 | 236 | "\n", |
232 | 237 | "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", |
233 | | - " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n", |
| 238 | + " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}],\n", |
234 | 239 | " rotation=\"-90x\"\n", |
235 | 240 | " )\n", |
236 | 241 | "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", |
237 | | - " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n", |
| 242 | + " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}],\n", |
238 | 243 | ")" |
239 | 244 | ], |
240 | 245 | "metadata": { |
|
0 commit comments