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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 912 - (hide annotations)
Wed Dec 6 03:29:49 2006 UTC (16 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 2600 byte(s)
modellib.WriteVTK has been rewritten. Instead of only three data objects scalar,
vector, tensor it takes now up to 20 data objects data0 ... data19 and writes it into a 
single VTK file. There is also the possibilty to define individiual name tags name0,..., name19.
If no name is given the corresponding attribute name of the Link target is used. 
This simplifies the usage and increases efficiency.



1 gross 821 # $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 gross 829 import os
12 gross 821 from esys.modellib.mechanics import DruckerPrager
13     from esys.escript.modelframe import Link,Simulation
14 gross 911 from esys.modellib.geometry import RectangularDomain, VectorConstrainerOverBox, UpdateGeometry
15 gross 821 from esys.modellib.input import Sequencer, InterpolateOverBox
16 gross 829 from esys.modellib.visualization import WriteVTK
17 gross 821
18 gross 829 try:
19     WORKDIR=os.environ['MODELLIB_WORKDIR']
20     except KeyError:
21     WORKDIR='.'
22    
23    
24 gross 821 debug=True
25    
26     dom=RectangularDomain(debug)
27 gross 872 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 gross 821
33    
34     sq=Sequencer(debug)
35     sq.t=0
36 gross 872 sq.t_end=0.8
37     sq.dt_max=100.
38 gross 821
39     iob=InterpolateOverBox(debug)
40     iob.domain=Link(dom,"domain")
41 gross 872 iob.value_left_bottom_front=[-1.,0.,0.]
42 gross 821 iob.value_right_bottom_front=[0.,0.,0.]
43 gross 872 iob.value_left_bottom_back=[-1.,0.,0.]
44 gross 821 iob.value_right_bottom_back=[0.,0.,0.]
45 gross 872 iob.value_left_top_front=[-1.,0.,0.]
46 gross 821 iob.value_right_top_front=[0.,0.,0.]
47 gross 872 iob.value_left_top_back=[-1.,0.,0.]
48 gross 821 iob.value_right_top_back=[0.,0.,0.]
49    
50 gross 872 # 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 gross 829
59 gross 821 m=DruckerPrager(debug)
60     m.domain=Link(dom,"domain")
61    
62 gross 911 cv=VectorConstrainerOverBox(debug)
63 gross 821 cv.domain=Link(dom,"domain")
64     cv.value=Link(iob,"out")
65 gross 825
66 gross 821 cv.left=[True, False, False]
67 gross 872 cv.right= [True, True, True]
68     cv.bottom= [False, False, False]
69 gross 821 cv.top= [False, False, False]
70 gross 872 cv.front= [False, False, False]
71 gross 821 cv.back= [False, False, False]
72    
73 gross 829 m.velocity=Link(iob,"out")
74 gross 821 m.prescribed_velocity=Link(cv,"value_of_constraint")
75     m.location_prescribed_velocity=Link(cv,"location_of_constraint")
76 gross 841 m.rel_tol=0.01
77 gross 821
78 gross 825 m.expansion_coefficient= 0.
79 gross 834 m.bulk_modulus=1000.
80 gross 825 m.shear_modulus=1.
81     m.plastic_stress=0.
82     m.friction_parameter=0.
83     m.dilatancy_parameter=0.
84 gross 872 m.shear_length=m.shear_modulus*0.9
85 gross 821
86 gross 825
87 gross 823 ug=UpdateGeometry(debug)
88     ug.domain=Link(dom,"domain")
89     ug.displacement=Link(m,"displacement")
90    
91 gross 841 vis=WriteVTK(debug)
92 gross 829 vis.t=Link(sq)
93 gross 912 vis.data0=Link(m,"plastic_stress")
94     vis.data1=Link(m,"velocity")
95     vis.data2=Link(m,"stress")
96 gross 872 vis.dt=0.01
97 gross 829 vis.filename=WORKDIR+"/temp.xml"
98    
99     s=Simulation([sq,m,vis],debug=True)
100 gross 821 s.run()

  ViewVC Help
Powered by ViewVC 1.1.26