/[escript]/trunk/finley/test/python/debugIntegrate2.py
ViewVC logotype

Contents of /trunk/finley/test/python/debugIntegrate2.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2344 - (show annotations)
Mon Mar 30 02:13:58 2009 UTC (10 years, 4 months ago) by jfenwick
File MIME type: text/x-python
File size: 2258 byte(s)
Change __url__ to launchpad site

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2008 by University of Queensland
5 # 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 __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15 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.escript.linearPDEs import *
24 from esysi import finley
25
26 def makeParallelFaultSystem2D(xne=1,yne=1,xl=1.,yfaults=[0.,1.],integrationOrder=0,p1=0,p2=0):
27 """
28 generates a 2D rectangular domain and a system of parallel faults at yfaults
29
30 input data :
31 xne - the number of elements over the horizontal edge of the rectangular mesh
32 xl - length of the horizontal edge of the domain
33 yfault[y0,...yi,...y1] where y0 and y1 are the extremity of the block and yi the fault position in the (Oy) direction
34 output data :
35 a mesh with horizontal discontinuities at yi positions
36 """
37
38 #yne=xne*1./(xl+1.e-15)
39
40 mshs=[]
41 for i in range(len(yfaults)-1):
42 yl=yfaults[i+1]-yfaults[i]
43 msh=finley.Rectangle(xne,yne,1,xl,yl,p1,p2,useElementsOnFace=True)
44 msh1=msh
45 #print "mesh done"
46 msh1.setX(msh.getX()+[0.,yfaults[i]])
47 #print "Xnew"
48 mshs.append(msh1)
49 #print "apres append"
50 #results=finley.joinFaces(mshs)
51 mesh_joint=finley.JoinFaces(mshs)
52 #print "apres faces jointes"
53 return mesh_joint
54
55 def main():
56
57 xne=10
58 yne=20
59 xl=10
60 yl=10
61 yfaults=[0.,5.,10.]
62 numberfaults=1
63
64 mesh=makeParallelFaultSystem2D(xne,yne,xl,yfaults,0,0,0)
65
66 v=Vector(10.,ContinuousFunction(mesh))
67
68 on_elem_v=interpolate(v,Function(mesh))
69
70 value_integratedEL_vec=integrate(on_elem_v)
71
72 print "vector--------"
73 print "value interpolation",value_integratedEL_vec
74 print "--------"
75
76 main()

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26