Skip to content

Commit 99b3235

Browse files
committed
update: island custom nb
1 parent 90a28e1 commit 99b3235

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

other/materials_designer/create_island_defect_custom.ipynb

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@
7070
"id": "c360bd0ea9a5f262"
7171
},
7272
{
73+
"metadata": {},
7374
"cell_type": "code",
7475
"source": [
7576
"import numpy as np\n",
7677
"from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n",
7778
"\n",
7879
"# Custom Coordinate Condition for a torus shape\n",
7980
"class CustomCoordinateCondition(CoordinateCondition):\n",
80-
" center: List[float] = [0.5, 0.5, 0.5]\n",
81+
" center: List[float] = [0.5, 0.5, 0.0]\n",
8182
" major_radius: float = 0.5\n",
8283
" minor_radius: float = 0.1 \n",
8384
"\n",
@@ -89,10 +90,7 @@
8990
" distance_to_torus = np.sqrt((xy_distance - self.major_radius) ** 2 + (coord[2] - self.center[2]) ** 2)\n",
9091
" return distance_to_torus <= self.minor_radius\n"
9192
],
92-
"metadata": {
93-
"collapsed": false
94-
},
95-
"id": "9d8b1890b34d850a",
93+
"id": "55f4289a6545c504",
9694
"outputs": [],
9795
"execution_count": null
9896
},
@@ -107,17 +105,16 @@
107105
"id": "535bbac2c3f2832b"
108106
},
109107
{
108+
"metadata": {},
110109
"cell_type": "code",
111110
"source": [
112111
"CENTER_POSITION = [0.5, 0.5, 0.5] # Center of the torus in crystal coordinates\n",
113112
"MAJOR_RADIUS = 0.3 # Major radius of the torus\n",
114113
"MINOR_RADIUS = 0.1 # Minor radius of the torus\n",
114+
"USE_CARTESIAN_COORDINATES = False # Use Cartesian coordinates for the condition\n",
115115
"\n",
116116
"NUMBER_OF_ADDED_LAYERS = 3 # Number of layers to add to the defect\n",
117-
"USE_CARTESIAN_COORDINATES = False\n",
118117
"\n",
119-
"AUTO_ADD_VACUUM = True # Automatically add vacuum to the slab\n",
120-
"VACUUM_THICKNESS = 5.0 # Thickness of the vacuum to add\n",
121118
"\n",
122119
"# Create slab with default parameters if imported material is not a slab\n",
123120
"DEFAULT_SLAB_PARAMETERS = {\n",
@@ -128,10 +125,7 @@
128125
" \"xy_supercell_matrix\": [[10, 0], [0, 10]]\n",
129126
"}"
130127
],
131-
"metadata": {
132-
"collapsed": false
133-
},
134-
"id": "79924b8b23c8850b",
128+
"id": "4f6c437b81325730",
135129
"outputs": [],
136130
"execution_count": null
137131
},

0 commit comments

Comments
 (0)