/[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 918 - (show annotations)
Wed Jan 3 06:30:00 2007 UTC (13 years, 7 months ago) by gross
File MIME type: text/x-python
File size: 2639 byte(s)
fixes on ESySXML to get runmodel going.

    * object ids are now local for read and write of XML
    * ParameterSets are now written with class name
    * ParameterSets linked by other ParameterSets (previously only Models) are written now 
    * list are now lists of str (rather than bools), lists with bool, int or float are mapped to numarray
    * numarray are writen with generic types Bool, Int, Float (portability!)


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, VectorConstrainerOverBox, 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 dbg=True
25
26 dom=RectangularDomain(debug=dbg)
27 dom.dim=3
28 dom.l=[0.5,1.,1.]
29 dom.n=[30,6,6]
30 dom.order=1
31 dom.integrationOrder=-1
32
33
34 sq=Sequencer(debug=dbg)
35 sq.t=0
36 sq.t_end=0.8
37 sq.dt_max=100.
38
39 iob=InterpolateOverBox(debug=dbg)
40 iob.domain=Link(dom,"domain")
41 iob.value_left_bottom_front=[-1.,0.,0.]
42 iob.value_right_bottom_front=[0.,0.,0.]
43 iob.value_left_bottom_back=[-1.,0.,0.]
44 iob.value_right_bottom_back=[0.,0.,0.]
45 iob.value_left_top_front=[-1.,0.,0.]
46 iob.value_right_top_front=[0.,0.,0.]
47 iob.value_left_top_back=[-1.,0.,0.]
48 iob.value_right_top_back=[0.,0.,0.]
49
50 # iob.value_left_bottom_front=[-1.,0.]
51 # iob.value_right_bottom_front=[0.,0.]
52 # iob.value_left_bottom_back=[-1.,0.]
53 # iob.value_right_bottom_back=[0.,0.]
54 # iob.value_left_top_front=[-1.,0.]
55 # iob.value_right_top_front=[0.,0.]
56 # iob.value_left_top_back=[-1.,0.]
57 # iob.value_right_top_back=[0.,0.]
58
59 m=DruckerPrager(debug=dbg)
60 m.domain=Link(dom,"domain")
61
62 cv=VectorConstrainerOverBox(debug=dbg)
63 cv.domain=Link(dom,"domain")
64 cv.value=Link(iob,"out")
65
66 cv.left=[True, False, False]
67 cv.right= [True, True, True]
68 cv.bottom= [False, False, False]
69 cv.top= [False, False, False]
70 cv.front= [False, False, False]
71 cv.back= [False, False, False]
72
73 m.velocity=Link(iob,"out")
74 m.prescribed_velocity=Link(cv,"value_of_constraint")
75 m.location_prescribed_velocity=Link(cv,"location_of_constraint")
76 m.rel_tol=0.01
77
78 m.expansion_coefficient= 0.
79 m.bulk_modulus=1000.
80 m.shear_modulus=1.
81 m.plastic_stress=0.
82 m.friction_parameter=0.
83 m.dilatancy_parameter=0.
84 m.shear_length=m.shear_modulus*0.9
85
86
87 ug=UpdateGeometry(debug=dbg)
88 ug.domain=Link(dom,"domain")
89 ug.displacement=Link(m,"displacement")
90
91 vis=WriteVTK(debug=dbg)
92 vis.t=Link(sq)
93 vis.data0=Link(m,"plastic_stress")
94 vis.data1=Link(m,"velocity")
95 vis.data2=Link(m,"stress")
96 vis.dt=0.01
97 vis.filename=WORKDIR+"/temp.xml"
98
99 s=Simulation([sq,m,vis],debug=True)
100 s.writeXML()
101 s.run()

  ViewVC Help
Powered by ViewVC 1.1.26