To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 973adb6c authored by florez's avatar florez
Browse files

material load needs to come before mesh

parent 88cf9567
This diff is collapsed.
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};
%% 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]
This diff is collapsed.
SetFactory("OpenCASCADE");
Circle(1) = {0,0,0,0.5,0,Pi}; //Point 1, 2
Circle(2) = {0, 0, 1, 0.5, 0, Pi}; //Point 3, 4
Circle(3) = {0,0,0,0.5, Pi, 2*Pi}; //Point 1, 2
Circle(4) = {0, 0, 1, 0.5, Pi, 2*Pi}; //Point 3, 4
Line(5) = {1, 3};
Line(6) = {2, 4};
Line(7) = {1, 2};
Line(8) = {3, 4};
Line Loop(9) = {1, 6, -2, -5};
Line Loop(10) = {3, 5, -4, -6};
Curve Loop(11) = {1, 7};
Curve Loop(12) = {2, 8};
Curve Loop(13) = {3, 7};
Curve Loop(14) = {4, 8};
Curve Loop(15) = {5, 8, -6, -7};
Plane Surface(1) = {11};
Plane Surface(2) = {12};
// Plane Surface(100) = {13};
// Plane Surface(101) = {14};
Plane Surface(102) = {15};
Surface(3) = {9};
// Surface(4) = {10};
// Surface Loop(5) = {4, 101, 102, 100};
Surface Loop(6) = {3, 1, 102, 2};
Physical Surface("bottom") = {1};
Physical Surface("top") = {2};
// Volume(1) = {5};
Volume(2) = {6};
Physical Volume("volume") = {2};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
View " "{
SL(-0.5,-6.12323e-17,1,-0.5,-6.12323e-17,0.9){0,0};
SL(0.4,1.04095e-16,0,0.5,6.12323e-17,0){1,1};
SL(-0.5,-6.12323e-17,0,-0.4,-4.28626e-17,0){2,2};
SL(0.5,6.12323e-17,1,0.490393,-0.0975452,1){3,3};
SL(-0.490393,-0.0975452,1,-0.5,-6.12323e-17,1){4,4};
SL(0.490393,-0.0975452,1,0.46194,-0.191342,1){5,5};
SL(0.46194,-0.191342,1,0.415735,-0.277785,1){6,6};
SL(0.415735,-0.277785,1,0.353553,-0.353553,1){7,7};
SL(0.353553,-0.353553,1,0.277785,-0.415735,1){8,8};
SL(0.277785,-0.415735,1,0.191342,-0.46194,1){9,9};
SL(0.191342,-0.46194,1,0.0975452,-0.490393,1){10,10};
SL(0.0975452,-0.490393,1,1.80697e-15,-0.5,1){11,11};
SL(1.80697e-15,-0.5,1,-0.0975452,-0.490393,1){12,12};
SL(-0.0975452,-0.490393,1,-0.191342,-0.46194,1){13,13};
SL(-0.191342,-0.46194,1,-0.277785,-0.415735,1){14,14};
SL(-0.277785,-0.415735,1,-0.353553,-0.353553,1){15,15};
SL(-0.353553,-0.353553,1,-0.415735,-0.277785,1){16,16};
SL(-0.415735,-0.277785,1,-0.46194,-0.191342,1){17,17};
SL(-0.46194,-0.191342,1,-0.490393,-0.0975452,1){18,18};
SL(-0.4,-4.28626e-17,0,-0.3,-2.44929e-17,0){19,19};
SL(-0.3,-2.44929e-17,0,-0.2,-6.12323e-18,0){20,20};
SL(-0.2,-6.12323e-18,0,-0.1,1.22465e-17,0){21,21};
SL(-0.1,1.22465e-17,0,0,3.06162e-17,0){22,22};
SL(0,3.06162e-17,0,0.1,4.89859e-17,0){23,23};
SL(0.1,4.89859e-17,0,0.2,6.73556e-17,0){24,24};
SL(0.2,6.73556e-17,0,0.3,8.57253e-17,0){25,25};
SL(0.3,8.57253e-17,0,0.4,1.04095e-16,0){26,26};
SL(-0.5,-6.12323e-17,1,-0.4,-4.28626e-17,1){27,27};
SL(-0.4,-4.28626e-17,1,-0.3,-2.44929e-17,1){28,28};
SL(-0.3,-2.44929e-17,1,-0.2,-6.12323e-18,1){29,29};
SL(-0.2,-6.12323e-18,1,-0.1,1.22465e-17,1){30,30};
SL(-0.1,1.22465e-17,1,0,3.06162e-17,1){31,31};
SL(0,3.06162e-17,1,0.1,4.89859e-17,1){32,32};
SL(0.1,4.89859e-17,1,0.2,6.73556e-17,1){33,33};
SL(0.2,6.73556e-17,1,0.3,8.57253e-17,1){34,34};
SL(0.4,1.04095e-16,1,0.5,6.12323e-17,1){35,35};
SL(-0.5,-6.12323e-17,0.1,-0.5,-6.12323e-17,0){36,36};
SL(-0.5,-6.12323e-17,0.2,-0.5,-6.12323e-17,0.1){37,37};
SL(-0.5,-6.12323e-17,0.3,-0.5,-6.12323e-17,0.2){38,38};
SL(-0.5,-6.12323e-17,0.4,-0.5,-6.12323e-17,0.3){39,39};
SL(-0.5,-6.12323e-17,0.5,-0.5,-6.12323e-17,0.4){40,40};
SL(-0.5,-6.12323e-17,0.6,-0.5,-6.12323e-17,0.5){41,41};
SL(-0.5,-6.12323e-17,0.7,-0.5,-6.12323e-17,0.6){42,42};
SL(-0.5,-6.12323e-17,0.8,-0.5,-6.12323e-17,0.7){43,43};
SL(-0.5,-6.12323e-17,0.9,-0.5,-6.12323e-17,0.8){44,44};
SL(0.5,6.12323e-17,1,0.490393,-0.0975452,1){45,45};
SL(0.490393,-0.0975452,1,0.46194,-0.191342,1){46,46};
SL(0.46194,-0.191342,1,0.415735,-0.277785,1){47,47};
SL(0.415735,-0.277785,1,0.353553,-0.353553,1){48,48};
SL(0.353553,-0.353553,1,0.277785,-0.415735,1){49,49};
SL(0.277785,-0.415735,1,0.191342,-0.46194,1){50,50};
SL(0.191342,-0.46194,1,0.0975452,-0.490393,1){51,51};
SL(0.0975452,-0.490393,1,1.80697e-15,-0.5,1){52,52};
SL(1.80697e-15,-0.5,1,-0.0975452,-0.490393,1){53,53};
SL(-0.0975452,-0.490393,1,-0.191342,-0.46194,1){54,54};
SL(-0.191342,-0.46194,1,-0.277785,-0.415735,1){55,55};
SL(-0.277785,-0.415735,1,-0.353553,-0.353553,1){56,56};
SL(-0.353553,-0.353553,1,-0.415735,-0.277785,1){57,57};
SL(-0.415735,-0.277785,1,-0.46194,-0.191342,1){58,58};
SL(-0.490393,-0.0975452,1,-0.5,-6.12323e-17,1){59,59};
SL(0.5,6.12323e-17,0,0.5,1.22465e-16,0.1){60,60};
SL(0.5,1.22465e-16,0.1,0.5,1.22465e-16,0.2){61,61};
SL(0.5,1.22465e-16,0.2,0.5,1.22465e-16,0.3){62,62};
SL(0.5,1.22465e-16,0.3,0.5,1.22465e-16,0.4){63,63};
SL(0.5,1.22465e-16,0.4,0.5,1.22465e-16,0.5){64,64};
SL(0.5,1.22465e-16,0.5,0.5,1.22465e-16,0.6){65,65};
SL(0.5,1.22465e-16,0.6,0.5,1.22465e-16,0.7){66,66};
SL(0.5,1.22465e-16,0.7,0.5,1.22465e-16,0.8){67,67};
SL(0.5,1.22465e-16,0.9,0.5,6.12323e-17,1){68,68};
SL(0.3,8.57253e-17,1,0.4,1.04095e-16,1){69,69};
SL(-0.46194,-0.191342,1,-0.490393,-0.0975452,1){70,70};
SL(0.5,1.22465e-16,0.8,0.5,1.22465e-16,0.9){71,71};
};
This diff is collapsed.
//+
SetFactory("OpenCASCADE");
//+
Cylinder(1) = {0, 0, 0, 0, 0, 1, 0.5, 2*Pi};
//+
Surface Loop(2) = {1, 2, 3};
//+
Volume(2) = {2};
Physical Surface("bottom") = {3};
Physical Surface("top") = {2};
Physical Volume("mass") = {2};
This diff is collapsed.
//+
SetFactory("OpenCASCADE");
//+
Cylinder(1) = {0, 0, 0, 0, 0, 1, 0.5, 2*Pi};
//+
//Surface Loop(2) = {1, 2, 3};
//+
//Volume(2) = {2};
Physical Surface("bottom") = {3};
Physical Surface("top") = {2};
Physical Volume("some") = {1};
\ No newline at end of file
This diff is collapsed.
Merge "cylinder.stp";
SetFactory("Built-in");
//+
Recombine Surface {4, 1};
//+
Recombine Surface {2, 1, 4, 3};
//+
Recombine Surface {2, 1, 4, 3};
//+
Recombine Surface {2, 1, 4, 3};
//+
MeshSize {3, 1, 4, 2} = 0.1;
//+
MeshSize {3, 1, 4, 2} = 0.05;
//+
MeshSize {3, 1, 4, 2} = 2;
//+
MeshSize {3, 1, 4, 2} = 0.001;
//+
Curve Loop(7) = {4};
//+
Plane Surface(5) = {7};
//+
Physical Surface("Inside") = {4};
//+
MeshSize {1, 3, 2, 4} = 0.1;
//+
MeshSize {1, 3, 2, 4} = 1;
//+
MeshSize {1, 3, 2, 4} = 10;
//+
MeshSize {1, 3, 2, 4} = 1000;
//+
MeshSize {1, 3, 2, 4} = 500;
//+
MeshSize {1, 3, 2, 4} = 500;
//+
MeshSize {1, 3, 2, 4} = 200;
//+
MeshSize {1, 3, 2, 4} = 50;
//+
MeshSize {1, 3, 4, 2} = 20;
//+
MeshSize {1, 3, 2, 4} = 500;
$MeshFormat
4.1 0 8
$EndMeshFormat
$Entities
8 6 2 0
1 0 0 0 0
2 1 0 0 0
3 -0.4999999999999998 0.8660254037844387 0 0
4 -0.5000000000000004 -0.8660254037844384 0 0
5 0 0 10 0
6 1 0 10 0
7 -0.4999999999999998 0.8660254037844387 10 0
8 -0.5000000000000004 -0.8660254037844384 10 0
1 -0.4999999999999998 0 0 1 0.9983081582712682 0 0 2 2 -3
2 -0.9932383577419432 -0.8660254037844386 0 -0.5 0.866025403784439 0 0 2 3 -4
3 -0.5000000000000004 -0.9983081582712682 0 1 1.665334536937735e-16 0 0 2 4 -2
4 -0.4999999999999998 0 10 1 0.9983081582712682 10 0 2 6 -7
5 -0.9932383577419432 -0.8660254037844386 10 -0.5 0.866025403784439 10 0 2 7 -8
6 -0.5000000000000004 -0.9983081582712682 10 1 1.665334536937735e-16 10 0 2 8 -6
1 -0.9932383577419432 -0.9983081582712682 0 1 0.9983081582712682 0 0 3 1 2 3
2 -0.9932383577419432 -0.9983081582712682 10 1 0.9983081582712682 10 0 3 4 5 6
$EndEntities
$Nodes
16 76 1 76
0 1 0 1
1
0 0 0
0 2 0 1
2
1 0 0
0 3 0 1
3
-0.4999999999999998 0.8660254037844387 0
0 4 0 1
4
-0.5000000000000004 -0.8660254037844384 0
0 5 0 1
5
0 0 10
0 6 0 1
6
1 0 10
0 7 0 1
7
-0.4999999999999998 0.8660254037844387 10
0 8 0 1
8
-0.5000000000000004 -0.8660254037844384 10
1 1 0 4
9
10
11
12
0.9135454572049513 0.4067366440587774 0
0.6691306046349795 0.7431448270295816 0
0.3090169923092427 0.9510565169663417 0
-0.1045284642815645 0.994521895261707 0
1 2 0 4
13
14
15
16
-0.8090169950810331 0.5877852513206302 0
-0.9781476012268401 0.2079116884982156 0
-0.9781476002519894 -0.2079116930845272 0
-0.8090169937363013 -0.5877852531714943 0
1 3 0 4
17
18
19
20
-0.1045284622502921 -0.9945218954752024 0
0.30901699635185 -0.951056515652819 0
0.6691306079854299 -0.7431448240128224 0
0.9135454580920364 -0.4067366420663514 0
1 4 0 4
21
22
23
24
0.9135454572049513 0.4067366440587774 10
0.6691306046349795 0.7431448270295816 10
0.3090169923092427 0.9510565169663417 10
-0.1045284642815645 0.994521895261707 10
1 5 0 4
25
26
27
28
-0.8090169950810331 0.5877852513206302 10
-0.9781476012268401 0.2079116884982156 10
-0.9781476002519894 -0.2079116930845272 10
-0.8090169937363013 -0.5877852531714943 10
1 6 0 4
29
30
31
32
-0.1045284622502921 -0.9945218954752024 10
0.30901699635185 -0.951056515652819 10
0.6691306079854299 -0.7431448240128224 10
0.9135454580920364 -0.4067366420663514 10
2 1 0 22
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
-0.4135454581254429 -0.4592887617466681 0
0.3586636904399069 0.6233108954615405 0
0.5142999893642952 -0.3746885289135919 0
-0.5843131382167875 0.2512155342436214 0
-0.1909830062417072 0.5877852531708454 0
0.0691663035992533 -0.6525773565542949 0
0.6045284631011147 0.1284964918883672 0
-0.7370831896953947 -0.009630384459983727 0
-0.3736191368743351 -0.07941520029734764 0
-0.2301468837319993 0.2397662948189617 0
-0.006804659428745562 -0.06292065860249636 0
0.1961929519589293 0.3280066564150433 0
-0.1178271396805306 -0.3626346463954796 0
0.5644454417581223 0.4440181131401474 0
0.3736191390490459 -0.647127328324319 0
-0.230909325554682 -0.7106658310767089 0
0.730909326329408 -0.1553595728750666 0
0.3516498816161224 -0.07474549001743327 0
-0.5000000005641374 0.5553062573703903 0
-0.6826361317495985 -0.3039291888751113 0
0.1035110712930455 0.7101386956212686 0
0.1973505857532401 -0.3624490014679358 0
2 2 0 22
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
-0.4819707121284427 -0.5337231008513558 10
0.3090169934559188 0.5352331358438651 10
0.5152774051036455 -0.3733432315125985 10
-0.4194828619441121 0.4780849475330147 10
0.06460214398276543 -0.6146483332069383 10
-0.6180339892996958 -1.448910314061594e-09 10
0.6420115103882927 0.1358764309416624 10
-0.2186121940666673 0.7039837225688523 10
-0.03992632037681249 0.3798735612512203 10
-0.299150596066515 0.144790833384966 10
0.05773834660422503 0.02591516882119098 10
-0.2513259110428465 -0.287950217155399 10
0.3084754545618241 0.2241205376823588 10
0.6045284624834868 0.4392156385638607 10
0.3736191390490459 -0.647127328324319 10
0.1797529758691714 -0.311341283990325 10
0.730909326329408 -0.1553595728750666 10
-0.2478630846497401 -0.6740286589466788 10
-0.6433953528512104 -0.3178898062088442 10
-0.6826361324316929 0.3039291863255435 10
0.07810766744913732 0.7431448261878042 10
0.4056941698094277 -0.07568865848879631 10
$EndNodes
$Elements
16 152 1 152
0 1 15 1
1 1
0 2 15 1
2 2
0 3 15 1
3 3
0 4 15 1
4 4
0 5 15 1
5 5
0 6 15 1
6 6
0 7 15 1
7 7
0 8 15 1
8 8
1 1 1 5
9 2 9
10 9 10
11 10 11
12 11 12
13 12 3
1 2 1 5
14 3 13
15 13 14
16 14 15
17 15 16
18 16 4
1 3 1 5
19 4 17
20 17 18
21 18 19
22 19 20
23 20 2
1 4 1 5
24 6 21
25 21 22
26 22 23
27 23 24
28 24 7
1 5 1 5
29 7 25
30 25 26
31 26 27
32 27 28
33 28 8
1 6 1 5
34 8 29
35 29 30
36 30 31
37 31 32
38 32 6
2 1 2 57
39 44 39 46
40 34 44 46
41 37 44 53
42 44 34 53
43 39 44 50
44 2 9 39
45 17 18 38
46 13 14 36
47 10 11 34
48 19 20 35
49 16 4 33
50 12 3 37
51 37 42 44
52 42 41 43
53 42 37 51
54 36 42 51
55 43 41 45
56 42 43 44
57 36 41 42
58 2 39 49
59 3 13 51
60 4 17 48
61 38 18 47
62 9 10 46
63 36 14 40
64 33 41 52
65 41 40 52
66 14 15 40
67 18 19 47
68 17 38 48
69 34 11 53
70 36 40 41
71 13 36 51
72 20 2 49
73 15 16 52
74 11 12 53
75 35 20 49
76 39 9 46
77 10 34 46
78 16 33 52
79 19 35 47
80 12 37 53
81 33 4 48
82 37 3 51
83 41 33 45
84 44 43 50
85 35 49 50
86 49 39 50
87 38 45 48
88 45 33 48
89 38 47 54
90 47 35 54
91 35 50 54
92 50 43 54
93 40 15 52
94 43 45 54
95 45 38 54
2 2 2 57
96 59 66 72
97 66 55 72
98 66 60 73
99 55 66 73
100 66 59 70
101 6 21 61
102 29 30 59
103 7 25 58
104 22 23 56
105 26 27 60
106 31 32 57
107 28 8 55
108 64 60 66
109 63 64 65
110 60 64 74
111 64 58 74
112 63 65 67
113 65 64 66
114 63 58 64
115 6 61 71
116 8 29 72
117 21 22 68
118 59 30 69
119 7 58 62
120 63 56 75
121 25 26 74
122 30 31 69
123 62 63 75
124 29 59 72
125 56 23 75
126 60 27 73
127 24 7 62
128 32 6 71
129 57 32 71
130 27 28 73
131 61 21 68