-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelasticity_iga.py
57 lines (45 loc) · 1.07 KB
/
elasticity_iga.py
1
2
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
filename_domain = 'ig_domain_3d.iga'
regions = {
'Omega' : 'all',
'Gamma1' : ('vertices of set xi10', 'facet'),
'Gamma2' : ('vertices of set xi11', 'facet'),
}
fields = {
'displacement': ('real', 'vector', 'Omega', None, 'H1', 'iga'),
}
variables = {
'u' : ('unknown field', 'displacement', 0),
'v' : ('test field', 'displacement', 'u'),
}
ebcs = {
'u1' : ('Gamma1', {'u.all' : 0.0}),
'u2' : ('Gamma2', {'u.0' : 0.01, 'u.[1,2]' : 'get_ebcs'}),
}
def get_ebcs(ts, coors, **kwargs):
import numpy as nm
aux = nm.empty_like(coors[:, 1:])
aux[:, 0] = -0.02 * coors[:, 1]
aux[:, 1] = -0.02 + (0.15 * (coors[:, 0] - 1.0))**2
return aux.T.flat
functions = {
'get_ebcs' : (get_ebcs,),
}
materials = {
'm' : ({
'lam' : 5.769, 'mu' : 3.846,
},),
}
integrals = {
'i' : 4,
}
equations = {
'balance_of_forces'
: """dw_lin_elastic_iso.i.Omega(m.lam, m.mu, v, u) = 0""",
}
solvers = {
'ls' : ('ls.scipy_direct', {}),
'newton' : ('nls.newton', {
'i_max' : 1,
'eps_a' : 1e-10,
}),
}