Commit 2f2ec880 authored by florez's avatar florez
Browse files

wall with rips

parent 973adb6c
SetFactory("OpenCASCADE");
Point(1) = {0, 0, 0};
Point(2) = {0, .5, 0};
Circle(1) = {0,0,0,0.5,0,2*Pi};
Extrude {0, 0, 1} {
Curve{1};
}
//+
Curve Loop(2) = {3};
//+
Plane Surface(2) = {2};
Curve Loop(3) = {1};
Plane Surface(3) = {3};
Physical Surface("bottom") = {3};
Physical Surface("top") = {2};
Physical Surface("surface") = {1};
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import akantu as aka"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c1339e28-e6b1-4155-b25e-f3b848025838",
"metadata": {},
"outputs": [],
"source": [
"material_file = \"\"\"\n",
"material elastic [\n",
" name = steel\n",
" rho = 1 # density\n",
" E = 1 # young's modulus\n",
" nu = 0.3 # poisson's ratio\n",
"]\"\"\"\n",
"# writing the material file\n",
"open('material.dat', 'w').write(material_file)\n",
"#reading the material file\n",
"material_file = 'material.dat'\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "30c1bb68-80b2-41ea-9aa6-a08daf741c9b",
"metadata": {},
"outputs": [],
"source": [
"mesh = aka.Mesh(3)\n",
"mesh.read('cyl_02.msh')\n",
"\n",
"model = aka.SolidMechanicsModel(mesh)\n",
"model.initFull(_analysis_method=aka._static)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "23cdc1b2-692e-4457-a454-89d49722e94a",
"metadata": {},
"outputs": [],
"source": [
"mesh.createBoundaryGroupFromGeometry()\n",
"aka.parseInput(material_file)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a1d797dd-c63c-4b8b-9aaa-5d00947a414a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" [0.00000000e+00, 0.00000000e+00, 1.00506689e-05],\n",
" [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" ...,\n",
" [0.00000000e+00, 0.00000000e+00, 2.04378535e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.01312308e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"for dir in [aka._x, aka._y, aka._z]:\n",
" model.applyBC(aka.FixedValue(0, dir), \"bottom\")\n",
"\n",
"# trac = np.eye(3)\n",
"trac = [0, 0, 1]\n",
"model.applyBC(aka.FromTraction(trac), \"top\")\n",
"model.getExternalForce()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e26678ea-2a60-44fb-8956-6ce84db4174f",
"metadata": {},
"outputs": [
{
"ename": "Exception",
"evalue": "akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-68da59902414>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msolver\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"convergence_type\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maka\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSolveConvergenceCriteria\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidual\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msolveStep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]"
]
}
],
"source": [
"solver = model.getNonLinearSolver()\n",
"solver.set(\"max_iterations\", 2)\n",
"solver.set(\"threshold\", 1e-10)\n",
"solver.set(\"convergence_type\", aka.SolveConvergenceCriteria.residual)\n",
"\n",
"model.solveStep()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc tags:
``` python
import numpy as np
import akantu as aka
```
%% Cell type:code id:c1339e28-e6b1-4155-b25e-f3b848025838 tags:
``` python
material_file = """
material elastic [
name = steel
rho = 1 # density
E = 1 # young's modulus
nu = 0.3 # poisson's ratio
]"""
# writing the material file
open('material.dat', 'w').write(material_file)
#reading the material file
material_file = 'material.dat'
```
%% Cell type:code id:30c1bb68-80b2-41ea-9aa6-a08daf741c9b tags:
``` python
mesh = aka.Mesh(3)
mesh.read('cyl_02.msh')
model = aka.SolidMechanicsModel(mesh)
model.initFull(_analysis_method=aka._static)
```
%% Cell type:code id:23cdc1b2-692e-4457-a454-89d49722e94a tags:
``` python
mesh.createBoundaryGroupFromGeometry()
aka.parseInput(material_file)
```
%% Cell type:code id:a1d797dd-c63c-4b8b-9aaa-5d00947a414a tags:
``` python
for dir in [aka._x, aka._y, aka._z]:
model.applyBC(aka.FixedValue(0, dir), "bottom")
# trac = np.eye(3)
trac = [0, 0, 1]
model.applyBC(aka.FromTraction(trac), "top")
model.getExternalForce()
```
%%%% Output: execute_result
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[0.00000000e+00, 0.00000000e+00, 1.00506689e-05],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
...,
[0.00000000e+00, 0.00000000e+00, 2.04378535e-03],
[0.00000000e+00, 0.00000000e+00, 2.01312308e-03],
[0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])
%% Cell type:code id:e26678ea-2a60-44fb-8956-6ce84db4174f tags:
``` python
solver = model.getNonLinearSolver()
solver.set("max_iterations", 2)
solver.set("threshold", 1e-10)
solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
model.solveStep()
```
%%%% Output: error
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-6-68da59902414> in <module>
4 solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
5
----> 6 model.solveStep()
Exception: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]
$MeshFormat
4.1 0 8
$EndMeshFormat
$PhysicalNames
3
2 1 "bottom"
2 2 "top"
2 3 "surface"
$EndPhysicalNames
$Entities
4 3 3 0
1 0 0 0 0
2 0 0.5 0 0
3 0.5 0 0 0
4 0.5 0 1 0
1 -0.5000000999999999 -0.5000000999999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -3
2 0.4999999 -1e-07 -9.999999994736442e-08 0.5000000999999999 1e-07 1.0000001 0 2 3 -4
3 -0.5000000999999999 -0.5000000999999999 0.9999999000000001 0.5000000999999999 0.5000000999999999 1.0000001 0 2 4 -4
1 -0.5000000999999999 -0.5000000999999999 -9.999999994736442e-08 0.5000000999999999 0.5000000999999999 1.0000001 1 3 4 2 3 -2 1
2 -0.5000000999999999 -0.5000000999999999 0.9999999000000001 0.5000000999999999 0.5000000999999999 1.0000001 1 2 1 3
3 -0.5000000999999999 -0.5000000999999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 1 1 1 1
$EndEntities
$Nodes
8 2418 1 2418
0 3 0 1
1
0.5 0 0
0 4 0 1
2
0.5 0 1
1 1 0 63
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
0.4903926402016153 0.09754516100806389 0
0.4619397662556436 0.1913417161825444 0
0.415734806151273 0.2777851165098005 0
0.3535533905932744 0.3535533905932731 0
0.2777851165098021 0.415734806151272 0
0.1913417161825461 0.4619397662556429 0
0.09754516100806568 0.4903926402016149 0
1.695950706916419e-15 0.5 0
-0.09754516100806203 0.4903926402016157 0
-0.1913417161825426 0.4619397662556443 0
-0.277785116509799 0.4157348061512741 0
-0.3535533905932717 0.3535533905932758 0
-0.415734806151271 0.2777851165098036 0
-0.4619397662556421 0.1913417161825478 0
-0.4903926402016146 0.09754516100806734 0
-0.5 3.613946018757869e-15 0
-0.490392640201616 -0.09754516100806004 0
-0.4619397662556449 -0.1913417161825411 0
-0.4157348061512744 -0.2777851165097984 0
-0.353553390593276 -0.3535533905932715 0
-0.2777851165098037 -0.4157348061512709 0
-0.1913417161825472 -0.4619397662556424 0
-0.09754516100806651 -0.4903926402016148 0
-2.312294559186364e-15 -0.5 0
0.09754516100806197 -0.4903926402016157 0
0.1913417161825429 -0.4619397662556442 0
0.2777851165098002 -0.4157348061512732 0
0.3535533905932731 -0.3535533905932745 0
0.4157348061512721 -0.2777851165098019 0
0.4619397662556433 -0.1913417161825452 0
0.4903926402016152 -0.09754516100806436 0
0.4975923633360985 0.04900857016478017 0
0.4784701678661045 0.1451423386272308 0
0.4409606321741778 0.2356983684129983 0
0.386505226681369 0.3171966420818221 0
0.3171966420818236 0.3865052266813678 0
0.235698368413 0.4409606321741769 0
0.1451423386272326 0.478470167866104 0
0.04900857016478193 0.4975923633360983 0
-0.04900857016477844 0.4975923633360986 0
-0.145142338627229 0.4784701678661051 0
-0.2356983684129965 0.4409606321741787 0
-0.3171966420818206 0.3865052266813702 0
-0.3865052266813665 0.3171966420818251 0
-0.440960632174176 0.2356983684130017 0
-0.4784701678661035 0.1451423386272344 0
-0.4975923633360981 0.04900857016478373 0
-0.4975923633360988 -0.04900857016477653 0
-0.4784701678661056 -0.1451423386272273 0
-0.4409606321741793 -0.2356983684129955 0
-0.3865052266813706 -0.3171966420818202 0
-0.3171966420818254 -0.3865052266813663 0
-0.2356983684130013 -0.4409606321741762 0
-0.1451423386272333 -0.4784701678661038 0
-0.04900857016478288 -0.4975923633360982 0
0.04900857016477828 -0.4975923633360986 0
0.1451423386272289 -0.4784701678661051 0
0.2356983684129972 -0.4409606321741784 0
0.3171966420818217 -0.3865052266813693 0
0.386505226681368 -0.3171966420818233 0
0.4409606321741772 -0.2356983684129994 0
0.4784701678661043 -0.1451423386272317 0
0.4975923633360985 -0.04900857016478025 0
1 2 0 19
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
0.5 0 0.1
0.5 0 0.2
0.5 0 0.3
0.5 0 0.4
0.5 0 0.5
0.5 0 0.6
0.5 0 0.7
0.5 0 0.8
0.5 0 0.9
0.5 0 0.05
0.5 0 0.15
0.5 0 0.25
0.5 0 0.35
0.5 0 0.45
0.5 0 0.55
0.5 0 0.6499999999999999
0.5 0 0.75
0.5 0 0.8500000000000001
0.5 0 0.95
1 3 0 63
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
0.4903926402016153 0.09754516100806389 1
0.4619397662556436 0.1913417161825444 1
0.415734806151273 0.2777851165098005 1
0.3535533905932744 0.3535533905932731 1
0.2777851165098021 0.415734806151272 1
0.1913417161825461 0.4619397662556429 1
0.09754516100806568 0.4903926402016149 1
1.695950706916419e-15 0.5 1
-0.09754516100806203 0.4903926402016157 1
-0.1913417161825426 0.4619397662556443 1
-0.277785116509799 0.4157348061512741 1
-0.3535533905932717 0.3535533905932758 1
-0.415734806151271 0.2777851165098036 1
-0.4619397662556421 0.1913417161825478 1
-0.4903926402016146 0.09754516100806734 1
-0.5 3.613946018757869e-15 1
-0.490392640201616 -0.09754516100806004 1
-0.4619397662556449 -0.1913417161825411 1
-0.4157348061512744 -0.2777851165097984 1
-0.353553390593276 -0.3535533905932715 1
-0.2777851165098037 -0.4157348061512709 1
-0.1913417161825472 -0.4619397662556424 1
-0.09754516100806651 -0.4903926402016148 1
-2.312294559186364e-15 -0.5 1
0.09754516100806197 -0.4903926402016157 1
0.1913417161825429 -0.4619397662556442 1
0.2777851165098002 -0.4157348061512732 1
0.3535533905932731 -0.3535533905932745 1
0.4157348061512721 -0.2777851165098019 1
0.4619397662556433 -0.1913417161825452 1
0.4903926402016152 -0.09754516100806436 1
0.4975923633360985 0.04900857016478017 1
0.4784701678661045 0.1451423386272308 1
0.4409606321741778 0.2356983684129983 1
0.386505226681369 0.3171966420818221 1
0.3171966420818236 0.3865052266813678 1
0.235698368413 0.4409606321741769 1
0.1451423386272326 0.478470167866104 1
0.04900857016478193 0.4975923633360983 1
-0.04900857016477844 0.4975923633360986 1
-0.145142338627229 0.4784701678661051 1
-0.2356983684129965 0.4409606321741787 1
-0.3171966420818206 0.3865052266813702 1
-0.3865052266813665 0.3171966420818251 1
-0.440960632174176 0.2356983684130017 1
-0.4784701678661035 0.1451423386272344 1
-0.4975923633360981 0.04900857016478373 1
-0.4975923633360988 -0.04900857016477653 1
-0.4784701678661056 -0.1451423386272273 1
-0.4409606321741793 -0.2356983684129955 1
-0.3865052266813706 -0.3171966420818202 1
-0.3171966420818254 -0.3865052266813663 1
-0.2356983684130013 -0.4409606321741762 1
-0.1451423386272333 -0.4784701678661038 1
-0.04900857016478288 -0.4975923633360982 1
0.04900857016477828 -0.4975923633360986 1
0.1451423386272289 -0.4784701678661051 1
0.2356983684129972 -0.4409606321741784 1
0.3171966420818217 -0.3865052266813693 1
0.386505226681368 -0.3171966420818233 1
0.4409606321741772 -0.2356983684129994 1
0.4784701678661043 -0.1451423386272317 1
0.4975923633360985 -0.04900857016478025 1
2 1 0 1485
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259