コード例 #1
0
ファイル: subduction1_gen.py プロジェクト: svn2github/Escript
  
  l01=Line(p0,p1)
  l13=Line(p1,p3)
  l32=Line(p3,p2)
  l20=Line(p2,p0)
  
  l45=Line(p4,p5)
  l57=Line(p5,p7)
  l76=Line(p7,p6)
  l64=Line(p6,p4)
  
  l15=Line(p1,p5)
  l40=Line(p4,p0)
  l37=Line(p3,p7)
  l62=Line(p6,p2)

  bottom=PlaneSurface(-CurveLoop(l01,l13,l32,l20))
  top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
  front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
  back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
  left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
  right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
  v=Volume(SurfaceLoop(top,bottom,front,back,left,right))
  des.addItems(v, PropertySet("subduction", left))

des.setScriptFileName("sub.geo")
des.setMeshFileName("sub.msh")

dom=MakeDomain(des, useMacroElements=True)
dom.write("sub.fly")
コード例 #2
0
p6 = Point(0., 1., 1.)
p7 = Point(1., 1., 1.)

l01 = Line(p0, p1)
l13 = Line(p1, p3)
l32 = Line(p3, p2)
l20 = Line(p2, p0)

l45 = Line(p4, p5)
l57 = Line(p5, p7)
l76 = Line(p7, p6)
l64 = Line(p6, p4)

l15 = Line(p1, p5)
l40 = Line(p4, p0)
l37 = Line(p3, p7)
l62 = Line(p6, p2)

bottom = PlaneSurface(-CurveLoop(l01, l13, l32, l20))
top = PlaneSurface(CurveLoop(l45, l57, l76, l64))
front = PlaneSurface(CurveLoop(l01, l15, -l45, l40))
back = PlaneSurface(CurveLoop(l32, -l62, -l76, -l37))
left = PlaneSurface(CurveLoop(-l40, -l64, l62, l20))
right = PlaneSurface(CurveLoop(-l15, l13, l37, -l57))
v = Volume(SurfaceLoop(top, bottom, front, back, left, right))
des = Design(dim=3, order=2, element_size=1, keep_files=True)
des.addItems(v)

dom = MakeDomain(des)
dom.write("brick.fly")
コード例 #3
0
    l01 = Line(p0, p1)
    l13 = Line(p1, p3)
    l32 = Line(p3, p2)
    l20 = Line(p2, p0)

    l45 = Line(p4, p5)
    l57 = Line(p5, p7)
    l76 = Line(p7, p6)
    l64 = Line(p6, p4)

    l15 = Line(p1, p5)
    l40 = Line(p4, p0)
    l37 = Line(p3, p7)
    l62 = Line(p6, p2)

    bottom = PlaneSurface(-CurveLoop(l01, l13, l32, l20))
    top = PlaneSurface(CurveLoop(l45, l57, l76, l64))
    front = PlaneSurface(CurveLoop(l01, l15, -l45, l40))
    back = PlaneSurface(CurveLoop(l32, -l62, -l76, -l37))
    left = PlaneSurface(CurveLoop(-l40, -l64, l62, l20))
    right = PlaneSurface(CurveLoop(-l15, l13, l37, -l57))
    v = Volume(SurfaceLoop(top, bottom, front, back, left, right))
    des.addItems(v, PropertySet("subduction", left))

des.setScriptFileName("sub.geo")
des.setMeshFileName("sub.msh")

dom = MakeDomain(des, useMacroElements=True)
dom.write("sub.fly")
コード例 #4
0
ファイル: brick.py プロジェクト: svn2github/Escript
l01=Line(p0,p1)
l13=Line(p1,p3)
l32=Line(p3,p2)
l20=Line(p2,p0)

l45=Line(p4,p5)
l57=Line(p5,p7)
l76=Line(p7,p6)
l64=Line(p6,p4)

l15=Line(p1,p5)
l40=Line(p4,p0)
l37=Line(p3,p7)
l62=Line(p6,p2)

bottom=PlaneSurface(-CurveLoop(l01,l13,l32,l20))
top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
v=Volume(SurfaceLoop(top,bottom,front,back,left,right))
des=Design(dim=3, order=2, element_size = 1, keep_files=True)
des.addItems(v)

dom=MakeDomain(des)
dom.write("brick.fly")



コード例 #5
0
__copyright__ = """Copyright (c) 2003-2018 by The University of Queensland
http://www.uq.edu.au
Primary Business: Queensland, Australia"""
__license__ = """Licensed under the Apache License, version 2.0
http://www.apache.org/licenses/LICENSE-2.0"""
__url__ = "https://launchpad.net/escript-finley"

from esys.escript import *
from esys.pycad import *
from esys.pycad.gmsh import Design
from esys.dudley import MakeDomain

p0 = Point(0., 0.)
p1 = Point(1., 0.)
p2 = Point(1., 1.)
p3 = Point(0., 1.)

l01 = Line(p0, p1)
l12 = Line(p1, p2)
l23 = Line(p2, p3)
l30 = Line(p3, p0)

s = PlaneSurface(CurveLoop(l01, l12, l23, l30))
des = Design(dim=2, order=1, element_size=1, keep_files=True)
des.setMeshFileName("rec.geo")
des.addItems(s)

dom = MakeDomain(des)
dom.write("rec.fly")
コード例 #6
0
ファイル: rectangle.py プロジェクト: svn2github/Escript
__copyright__="""Copyright (c) 2003-2016 by The University of Queensland
http://www.uq.edu.au
Primary Business: Queensland, Australia"""
__license__="""Licensed under the Apache License, version 2.0
http://www.apache.org/licenses/LICENSE-2.0"""
__url__="https://launchpad.net/escript-finley"

from esys.escript import *
from esys.pycad import *
from esys.pycad.gmsh import Design
from esys.dudley import MakeDomain


p0=Point(0.,0.)
p1=Point(1.,0.)
p2=Point(1.,1.)
p3=Point(0.,1.)

l01=Line(p0,p1)
l12=Line(p1,p2)
l23=Line(p2,p3)
l30=Line(p3,p0)

s=PlaneSurface(CurveLoop(l01,l12,l23,l30))
des=Design(dim=2, order=1, element_size = 1, keep_files=True)
des.setMeshFileName("rec.geo")
des.addItems(s)

dom=MakeDomain(des)
dom.write("rec.fly")