/[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 147 - (show annotations)
Fri Aug 12 01:45:47 2005 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/finley/test/python/debugIntegrate2.py
File MIME type: text/x-python
File size: 1498 byte(s)
erge of development branch dev-02 back to main trunk on 2005-08-12

1
2 from escript.escript import *
3 from escript.linearPDEs import *
4 from finley import finley
5
6 def makeParallelFaultSystem2D(xne=1,yne=1,xl=1.,yfaults=[0.,1.],integrationOrder=0,p1=0,p2=0):
7 """
8 generates a 2D rectangular domain and a system of parallel faults at yfaults
9
10 input data :
11 xne - the number of elements over the horizontal edge of the rectangular mesh
12 xl - length of the horizontal edge of the domain
13 yfault[y0,...yi,...y1] where y0 and y1 are the extremity of the block and yi the fault position in the (Oy) direction
14 output data :
15 a mesh with horizontal discontinuities at yi positions
16 """
17
18 #yne=xne*1./(xl+1.e-15)
19
20 mshs=[]
21 for i in range(len(yfaults)-1):
22 yl=yfaults[i+1]-yfaults[i]
23 msh=finley.Rectangle(xne,yne,1,xl,yl,p1,p2,useElementsOnFace=True)
24 msh1=msh
25 #print "mesh done"
26 msh1.setX(msh.getX()+[0.,yfaults[i]])
27 #print "Xnew"
28 mshs.append(msh1)
29 #print "apres append"
30 #results=finley.joinFaces(mshs)
31 mesh_joint=finley.JoinFaces(mshs)
32 #print "apres faces jointes"
33 return mesh_joint
34
35 def main():
36
37 xne=10
38 yne=20
39 xl=10
40 yl=10
41 yfaults=[0.,5.,10.]
42 numberfaults=1
43
44 mesh=makeParallelFaultSystem2D(xne,yne,xl,yfaults,0,0,0)
45
46 v=Vector(10.,ContinuousFunction(mesh))
47
48 on_elem_v=interpolate(v,Function(mesh))
49
50 value_integratedEL_vec=integrate(on_elem_v)
51
52 print "vector--------"
53 print "value interpolation",value_integratedEL_vec
54 print "--------"
55
56 main()

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26