/[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 850 - (show annotations)
Sun Sep 17 23:27:00 2006 UTC (13 years, 6 months ago) by gross
File MIME type: text/x-python
File size: 2558 byte(s)
some problems with vtk writer fixed
1 # $Id$
2
3 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
4 http://www.access.edu.au
5 Primary Business: Queensland, Australia"""
6 __license__="""Licensed under the Open Software License version 3.0
7 http://www.opensource.org/licenses/osl-3.0.php"""
8
9 # 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
13 from esys.escript.modelframe import Link,Simulation
14 from esys.modellib.geometry import RectangularDomain, VectorConstrainer, UpdateGeometry
15 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
25
26 dom=RectangularDomain(debug)
27 dom.l=[1.,1.,1.]
28 dom.n=[50,50,2]
29 dom.order=2
30 dom.integrationOrder=2
31
32
33 sq=Sequencer(debug)
34 sq.t=0
35 sq.t_end=3
36 sq.dt_max=0.3
37
38 iob=InterpolateOverBox(debug)
39 iob.domain=Link(dom,"domain")
40 iob.value_left_bottom_front=[1.,0.,0.]
41 iob.value_right_bottom_front=[0.,0.,0.]
42 iob.value_left_bottom_back=[1.,0.,0.]
43 iob.value_right_bottom_back=[0.,0.,0.]
44 iob.value_left_top_front=[1.,0.,0.]
45 iob.value_right_top_front=[0.,0.,0.]
46 iob.value_left_top_back=[1.,0.,0.]
47 iob.value_right_top_back=[0.,0.,0.]
48
49 iob.value_left_bottom_front=[-1.,0.]
50 iob.value_right_bottom_front=[0.,0.]
51 iob.value_left_bottom_back=[-1.,0.]
52 iob.value_right_bottom_back=[0.,0.]
53 iob.value_left_top_front=[-1.,0.]
54 iob.value_right_top_front=[0.,0.]
55 iob.value_left_top_back=[-1.,0.]
56 iob.value_right_top_back=[0.,0.]
57
58 m=DruckerPrager(debug)
59 m.domain=Link(dom,"domain")
60
61 cv=VectorConstrainer(debug)
62 cv.domain=Link(dom,"domain")
63 cv.value=Link(iob,"out")
64
65 cv.left=[True, False, False]
66 cv.right= [True, False, False]
67 cv.bottom= [False, True, False]
68 cv.top= [False, False, False]
69 cv.front= [False, False, True]
70 cv.back= [False, False, False]
71
72 m.velocity=Link(iob,"out")
73 m.prescribed_velocity=Link(cv,"value_of_constraint")
74 m.location_prescribed_velocity=Link(cv,"location_of_constraint")
75 m.rel_tol=0.01
76
77 m.expansion_coefficient= 0.
78 m.bulk_modulus=1000.
79 m.shear_modulus=1.
80 m.plastic_stress=0.
81 m.friction_parameter=0.
82 m.dilatancy_parameter=0.
83 m.shear_length=m.shear_modulus*0.75*1.
84
85
86 ug=UpdateGeometry(debug)
87 ug.domain=Link(dom,"domain")
88 ug.displacement=Link(m,"displacement")
89
90 vis=WriteVTK(debug)
91 vis.t=Link(sq)
92 vis.scalar=Link(m,"plastic_stress")
93 vis.vector=Link(m,"velocity")
94 vis.tensor=Link(m,"stress")
95 vis.dt=0.5
96 vis.filename=WORKDIR+"/temp.xml"
97
98 s=Simulation([sq,m,vis],debug=True)
99 s.run()

  ViewVC Help
Powered by ViewVC 1.1.26