source: issm/trunk/test/NightlyRun/test1602.py@ 16137

Last change on this file since 16137 was 16137, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 16135

File size: 1.5 KB
Line 
1import numpy
2import sys
3from model import *
4from triangle import *
5from setmask import *
6from parameterize import *
7from setflowequation import *
8from EnumDefinitions import *
9from solve import *
10from MatlabFuncs import *
11
12md=triangle(model(),'../Exp/Square.exp',150000.)
13md=setmask(md,'../Exp/SquareShelf.exp','')
14md=parameterize(md,'../Par/SquareSheetShelf.py')
15md.extrude(5,1.)
16md=setflowequation(md,'HO','all')
17md.stressbalance.spcvx[numpy.nonzero(md.mesh.y>0.)]=float('NaN')
18md.initialization.vx[:]=0.
19md.initialization.vy[:]=0.
20md.initialization.vel=numpy.zeros_like(md.initialization.vx)
21
22md.cluster=generic('name',oshostname(),'np',3)
23md=solve(md,StressbalanceSolutionEnum())
24vel0=md.results.StressbalanceSolution.Vel
25
26theta=30.*numpy.pi/180.
27x=md.mesh.x
28y=md.mesh.y
29md.mesh.x=numpy.cos(theta)*x-numpy.sin(theta)*y
30md.mesh.y=numpy.sin(theta)*x+numpy.cos(theta)*y
31
32md.stressbalance.referential[:,0:3]=numpy.tile([numpy.cos(theta),numpy.sin(theta),0],(md.mesh.numberofvertices,1))
33md.stressbalance.referential[:,3: ]=numpy.tile([0,0,1],(md.mesh.numberofvertices,1))
34md=solve(md,StressbalanceSolutionEnum())
35vel1=md.results.StressbalanceSolution.Vel
36
37#plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference','view#all',2)
38print "Error between Cartesian and rotated CS: %g" % (numpy.max(numpy.abs(vel0-vel1))/(numpy.max(numpy.abs(vel0))+sys.float_info.epsilon))
39
40#Fields and tolerances to track changes
41field_names =['vel1']
42field_tolerances=[1e-9]
43field_values=[\
44 vel1, \
45 ];
Note: See TracBrowser for help on using the repository browser.