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, 2007 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 |
from esys.escript import * |
24 |
from esys.pycad import * |
25 |
from esys.pycad.gmsh import Design |
26 |
from esys.finley import MakeDomain |
27 |
|
28 |
|
29 |
p0=Point(0.,0.,0.) |
30 |
p1=Point(1.,0.,0.) |
31 |
p2=Point(0.,1.,0.) |
32 |
p3=Point(1.,1.,0.) |
33 |
p4=Point(0.,0.,1.) |
34 |
p5=Point(1.,0.,1.) |
35 |
p6=Point(0.,1.,1.) |
36 |
p7=Point(1.,1.,1.) |
37 |
|
38 |
l01=Line(p0,p1) |
39 |
l13=Line(p1,p3) |
40 |
l32=Line(p3,p2) |
41 |
l20=Line(p2,p0) |
42 |
|
43 |
l45=Line(p4,p5) |
44 |
l57=Line(p5,p7) |
45 |
l76=Line(p7,p6) |
46 |
l64=Line(p6,p4) |
47 |
|
48 |
l15=Line(p1,p5) |
49 |
l40=Line(p4,p0) |
50 |
l37=Line(p3,p7) |
51 |
l62=Line(p6,p2) |
52 |
|
53 |
bottom=PlaneSurface(-CurveLoop(l01,l13,l32,l20)) |
54 |
top=PlaneSurface(CurveLoop(l45,l57,l76,l64)) |
55 |
front=PlaneSurface(CurveLoop(l01,l15,-l45,l40)) |
56 |
back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37)) |
57 |
left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20)) |
58 |
right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57)) |
59 |
v=Volume(SurfaceLoop(top,bottom,front,back,left,right)) |
60 |
des=Design(dim=3, order=2, element_size = 1, keep_files=True) |
61 |
des.addItems(v) |
62 |
|
63 |
dom=MakeDomain(des) |
64 |
dom.write("brick.fly") |
65 |
|
66 |
|
67 |
|