8 |
|
|
9 |
# run by scons build/posix/modellib/test/python/drucker_prager.passed from check out cd. |
# run by scons build/posix/modellib/test/python/drucker_prager.passed from check out cd. |
10 |
|
|
11 |
|
import os |
12 |
from esys.modellib.mechanics import DruckerPrager |
from esys.modellib.mechanics import DruckerPrager |
13 |
from esys.escript.modelframe import Link,Simulation |
from esys.escript.modelframe import Link,Simulation |
14 |
from esys.modellib.geometry import RectangularDomain, VectorConstrainer, UpdateGeometry |
from esys.modellib.geometry import RectangularDomain, VectorConstrainer, UpdateGeometry |
15 |
from esys.modellib.input import Sequencer, InterpolateOverBox |
from esys.modellib.input import Sequencer, InterpolateOverBox |
16 |
|
from esys.modellib.visualization import WriteVTK |
17 |
|
|
18 |
|
try: |
19 |
|
WORKDIR=os.environ['MODELLIB_WORKDIR'] |
20 |
|
except KeyError: |
21 |
|
WORKDIR='.' |
22 |
|
|
23 |
|
|
24 |
debug=True |
debug=True |
25 |
|
|
26 |
dom=RectangularDomain(debug) |
dom=RectangularDomain(debug) |
27 |
|
dom.l=[5.,1.,1.] |
28 |
|
dom.n=[25,5,5] |
29 |
dom.order=1 |
dom.order=1 |
30 |
|
|
31 |
|
|
32 |
sq=Sequencer(debug) |
sq=Sequencer(debug) |
33 |
sq.t=0 |
sq.t=0 |
34 |
sq.t_end=1. |
sq.t_end=3.0 |
35 |
sq.dt_max=0.1 |
sq.dt_max=10. |
36 |
|
|
37 |
iob=InterpolateOverBox(debug) |
iob=InterpolateOverBox(debug) |
38 |
iob.domain=Link(dom,"domain") |
iob.domain=Link(dom,"domain") |
45 |
iob.value_left_top_back=[1.,0.,0.] |
iob.value_left_top_back=[1.,0.,0.] |
46 |
iob.value_right_top_back=[0.,0.,0.] |
iob.value_right_top_back=[0.,0.,0.] |
47 |
|
|
48 |
|
iob.value_left_bottom_front=[1.,0.] |
49 |
|
iob.value_right_bottom_front=[0.,0.] |
50 |
|
iob.value_left_bottom_back=[1.,0.] |
51 |
|
iob.value_right_bottom_back=[0.,0.] |
52 |
|
iob.value_left_top_front=[1.,0.] |
53 |
|
iob.value_right_top_front=[0.,0.] |
54 |
|
iob.value_left_top_back=[1.,0.] |
55 |
|
iob.value_right_top_back=[0.,0.] |
56 |
|
|
57 |
m=DruckerPrager(debug) |
m=DruckerPrager(debug) |
58 |
m.domain=Link(dom,"domain") |
m.domain=Link(dom,"domain") |
59 |
|
|
68 |
cv.front= [False, False, True] |
cv.front= [False, False, True] |
69 |
cv.back= [False, False, False] |
cv.back= [False, False, False] |
70 |
|
|
71 |
|
m.velocity=Link(iob,"out") |
72 |
m.prescribed_velocity=Link(cv,"value_of_constraint") |
m.prescribed_velocity=Link(cv,"value_of_constraint") |
73 |
m.location_prescribed_velocity=Link(cv,"location_of_constraint") |
m.location_prescribed_velocity=Link(cv,"location_of_constraint") |
74 |
|
m.rel_tol=0.005 |
75 |
|
|
76 |
m.expansion_coefficient= 0. |
m.expansion_coefficient= 0. |
77 |
m.bulk_modulus=100. |
m.bulk_modulus=10000. |
78 |
m.shear_modulus=1. |
m.shear_modulus=1. |
79 |
m.plastic_stress=0. |
m.plastic_stress=0. |
80 |
m.friction_parameter=0. |
m.friction_parameter=0. |
81 |
m.dilatancy_parameter=0. |
m.dilatancy_parameter=0. |
82 |
m.shear_length=m.shear_modulus*100. |
m.shear_length=m.shear_modulus*2000. |
83 |
|
|
84 |
|
|
85 |
ug=UpdateGeometry(debug) |
ug=UpdateGeometry(debug) |
86 |
ug.domain=Link(dom,"domain") |
ug.domain=Link(dom,"domain") |
87 |
ug.displacement=Link(m,"displacement") |
ug.displacement=Link(m,"displacement") |
88 |
|
|
89 |
s=Simulation([sq,m,ug],debug=True) |
vis=WriteVTK() |
90 |
|
vis.t=Link(sq) |
91 |
|
vis.vector=Link(m,"velocity") |
92 |
|
# vis.scalar=Link(m,"plastic_stress") |
93 |
|
vis.tensor=Link(m,"stress") |
94 |
|
vis.dt=0.2 |
95 |
|
vis.filename=WORKDIR+"/temp.xml" |
96 |
|
|
97 |
|
s=Simulation([sq,m,vis],debug=True) |
98 |
s.run() |
s.run() |