/[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 836 - (show annotations)
Mon Sep 4 22:37:25 2006 UTC (14 years, 1 month ago) by gross
File MIME type: text/x-python
File size: 2526 byte(s)
new implementation of the tangential operator and a restriction of time step size change added
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=[20,20,2]
29 dom.order=2
30
31
32 sq=Sequencer(debug)
33 sq.t=0
34 sq.t_end=0.8
35 sq.dt_max=0.1
36
37 iob=InterpolateOverBox(debug)
38 iob.domain=Link(dom,"domain")
39 iob.value_left_bottom_front=[1.,0.,0.]
40 iob.value_right_bottom_front=[0.,0.,0.]
41 iob.value_left_bottom_back=[1.,0.,0.]
42 iob.value_right_bottom_back=[0.,0.,0.]
43 iob.value_left_top_front=[1.,0.,0.]
44 iob.value_right_top_front=[0.,0.,0.]
45 iob.value_left_top_back=[1.,0.,0.]
46 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)
58 m.domain=Link(dom,"domain")
59
60 cv=VectorConstrainer(debug)
61 cv.domain=Link(dom,"domain")
62 cv.value=Link(iob,"out")
63
64 cv.left=[True, False, False]
65 cv.right= [True, False, False]
66 cv.bottom= [False, True, False]
67 cv.top= [False, False, False]
68 cv.front= [False, False, True]
69 cv.back= [False, False, False]
70
71 m.velocity=Link(iob,"out")
72 m.prescribed_velocity=Link(cv,"value_of_constraint")
73 m.location_prescribed_velocity=Link(cv,"location_of_constraint")
74 m.rel_tol=0.00001
75
76 m.expansion_coefficient= 0.
77 m.bulk_modulus=1000.
78 m.shear_modulus=1.
79 m.plastic_stress=0.
80 m.friction_parameter=0.
81 m.dilatancy_parameter=0.
82 m.shear_length=m.shear_modulus/5.
83
84
85 ug=UpdateGeometry(debug)
86 ug.domain=Link(dom,"domain")
87 ug.displacement=Link(m,"displacement")
88
89 vis=WriteVTK()
90 vis.t=Link(sq)
91 vis.scalar=Link(m,"plastic_stress")
92 vis.vector=Link(m,"velocity")
93 vis.tensor=Link(m,"stress")
94 vis.dt=0.5
95 vis.filename=WORKDIR+"/temp.xml"
96
97 s=Simulation([sq,m,vis],debug=True)
98 s.run()

  ViewVC Help
Powered by ViewVC 1.1.26