/[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 6651 - (show annotations)
Wed Feb 7 02:12:08 2018 UTC (15 months, 1 week ago) by jfenwick
File MIME type: text/x-python
File size: 3285 byte(s)
Make everyone sad by touching all the files

Copyright dates update

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

  ViewVC Help
Powered by ViewVC 1.1.26