/[escript]/trunk/doc/examples/usersguide/brick.py
ViewVC logotype

Annotation of /trunk/doc/examples/usersguide/brick.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3321 - (hide annotations)
Thu Oct 28 05:02:41 2010 UTC (8 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 1775 byte(s)
a problem with surface orientation fixed.
1 gross 2683
2     ########################################################
3     #
4 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
5 gross 2683 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7     #
8     # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11     #
12     ########################################################
13    
14 jfenwick 2881 __copyright__="""Copyright (c) 2003-2010 by University of Queensland
15 gross 2683 Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18     __license__="""Licensed under the Open Software License version 3.0
19     http://www.opensource.org/licenses/osl-3.0.php"""
20     __url__="https://launchpad.net/escript-finley"
21    
22     from esys.escript import *
23     from esys.pycad import *
24     from esys.pycad.gmsh import Design
25     from esys.finley import MakeDomain
26    
27    
28     p0=Point(0.,0.,0.)
29     p1=Point(1.,0.,0.)
30     p2=Point(0.,1.,0.)
31     p3=Point(1.,1.,0.)
32     p4=Point(0.,0.,1.)
33     p5=Point(1.,0.,1.)
34     p6=Point(0.,1.,1.)
35     p7=Point(1.,1.,1.)
36    
37     l01=Line(p0,p1)
38     l13=Line(p1,p3)
39     l32=Line(p3,p2)
40     l20=Line(p2,p0)
41    
42     l45=Line(p4,p5)
43     l57=Line(p5,p7)
44     l76=Line(p7,p6)
45     l64=Line(p6,p4)
46    
47     l15=Line(p1,p5)
48     l40=Line(p4,p0)
49     l37=Line(p3,p7)
50     l62=Line(p6,p2)
51    
52 gross 3321 bottom=PlaneSurface(-CurveLoop(l01,l13,l32,l20))
53 gross 2683 top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
54     front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
55     back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
56     left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
57     right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
58 gross 3321 v=Volume(SurfaceLoop(top,bottom,front,back,left,right))
59 gross 2683
60     des=Design(dim=3, order=2, element_size = 0.1, keep_files=True)
61     des.setScriptFileName("brick.geo")
62 gross 3321 des.addItems(v, top, bottom,back, front, left , right)
63 gross 2683
64     dom=MakeDomain(des)
65     dom.write("brick.fly")

  ViewVC Help
Powered by ViewVC 1.1.26