/[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 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 10 months ago) by ksteube
File MIME type: text/x-python
File size: 3062 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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

  ViewVC Help
Powered by ViewVC 1.1.26