/[escript]/trunk/modellib/test/python/drucker_prager.py
ViewVC logotype

Contents of /trunk/modellib/test/python/drucker_prager.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1809 - (show annotations)
Thu Sep 25 06:43:44 2008 UTC (11 years, 3 months ago) by ksteube
File MIME type: text/x-python
File size: 3110 byte(s)
Copyright updated in all python files

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2008 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="http://www.uq.edu.au/esscc/escript-finley"
21
22 # run by scons build/posix/modellib/test/python/drucker_prager.passed from check out cd.
23
24 import os
25 from esys.modellib.mechanics import DruckerPrager
26 from esys.escript.modelframe import Link,Simulation
27 from esys.modellib.geometry import RectangularDomain, VectorConstrainerOverBox, UpdateGeometry
28 from esys.modellib.input import Sequencer, InterpolateOverBox
29 from esys.modellib.visualization import WriteVTK
30
31 try:
32 WORKDIR=os.environ['MODELLIB_WORKDIR']
33 except KeyError:
34 WORKDIR='.'
35
36
37 dbg=True
38
39 dom=RectangularDomain(debug=dbg)
40 dom.dim=3
41 dom.l=[0.5,1.,1.]
42 dom.n=[30,6,6]
43 dom.order=1
44 dom.integrationOrder=-1
45
46
47 sq=Sequencer(debug=dbg)
48 sq.t=0
49 sq.t_end=0.8
50 sq.dt_max=100.
51
52 iob=InterpolateOverBox(debug=dbg)
53 iob.domain=Link(dom,"domain")
54 iob.value_left_bottom_front=[-1.,0.,0.]
55 iob.value_right_bottom_front=[0.,0.,0.]
56 iob.value_left_bottom_back=[-1.,0.,0.]
57 iob.value_right_bottom_back=[0.,0.,0.]
58 iob.value_left_top_front=[-1.,0.,0.]
59 iob.value_right_top_front=[0.,0.,0.]
60 iob.value_left_top_back=[-1.,0.,0.]
61 iob.value_right_top_back=[0.,0.,0.]
62
63 # iob.value_left_bottom_front=[-1.,0.]
64 # iob.value_right_bottom_front=[0.,0.]
65 # iob.value_left_bottom_back=[-1.,0.]
66 # iob.value_right_bottom_back=[0.,0.]
67 # iob.value_left_top_front=[-1.,0.]
68 # iob.value_right_top_front=[0.,0.]
69 # iob.value_left_top_back=[-1.,0.]
70 # iob.value_right_top_back=[0.,0.]
71
72 m=DruckerPrager(debug=dbg)
73 m.domain=Link(dom,"domain")
74
75 cv=VectorConstrainerOverBox(debug=dbg)
76 cv.domain=Link(dom,"domain")
77 cv.value=Link(iob,"out")
78
79 cv.left=[True, False, False]
80 cv.right= [True, True, True]
81 cv.bottom= [False, False, False]
82 cv.top= [False, False, False]
83 cv.front= [False, False, False]
84 cv.back= [False, False, False]
85
86 m.velocity=Link(iob,"out")
87 m.prescribed_velocity=Link(cv,"value_of_constraint")
88 m.location_prescribed_velocity=Link(cv,"location_of_constraint")
89 m.rel_tol=0.01
90
91 m.expansion_coefficient= 0.
92 m.bulk_modulus=1000.
93 m.shear_modulus=1.
94 m.plastic_stress=0.
95 m.friction_parameter=0.
96 m.dilatancy_parameter=0.
97 m.shear_length=m.shear_modulus*0.9
98
99
100 ug=UpdateGeometry(debug=dbg)
101 ug.domain=Link(dom,"domain")
102 ug.displacement=Link(m,"displacement")
103
104 vis=WriteVTK(debug=dbg)
105 vis.t=Link(sq)
106 vis.data0=Link(m,"plastic_stress")
107 vis.data1=Link(m,"velocity")
108 vis.data2=Link(m,"stress")
109 vis.dt=0.01
110 vis.filename=WORKDIR+"/temp.xml"
111
112 s=Simulation([sq,cv,m,vis],debug=True)
113 s.writeXML()
114 s.run()

  ViewVC Help
Powered by ViewVC 1.1.26