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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 707 - (show annotations)
Wed Apr 12 23:58:02 2006 UTC (13 years, 11 months ago) by gross
File MIME type: text/x-python
File size: 86457 byte(s)
latex build documentation is working now
1 # $Id$
2
3 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
4 http://www.access.edu.au
5 Primary Business: Queensland, Australia"""
6 __license__="""Licensed under the Open Software License version 3.0
7 http://www.opensource.org/licenses/osl-3.0.php"""
8 import sys
9 import unittest
10 from esys.escript import *
11 from esys.finley import ReadMesh
12
13 class Test_VisualizationInterface(unittest.TestCase):
14 def check_vtk(self,f,reference_f):
15 out_string=open(os.environ['FINLEY_WORKDIR']+"/"+f).read().splitlines()
16 ref_string=open(os.environ['FINLEY_TEST_DATA']+"/"+reference_f).read().splitlines()
17 c=0
18 for l in range(0,len(ref_string)):
19 if not ref_string[l].strip()[:2]=="<!":
20 self.failUnlessEqual(out_string[c].strip().replace("e-00","e+00"),ref_string[l].strip(),"line %d (%s) in vtk files does not match reference (%s)"%(c,out_string[c].strip(),ref_string[l].strip()))
21 c+=1
22
23 def check_dx(self,f,reference_f):
24 out_string=open(os.environ['FINLEY_WORKDIR']+"/"+f).read().splitlines()
25 ref_string=open(os.environ['FINLEY_TEST_DATA']+"/"+reference_f).read().splitlines()
26 c=0
27 for l in range(0,len(ref_string)):
28 if not ref_string[l].strip()[0]=="#":
29 self.failUnlessEqual(out_string[c].strip().replace("e-00","e+00"),ref_string[l].strip(),"line %d (%s) in dx file does not match reference (%s)"%(c,out_string[c].strip(),ref_string[l].strip()))
30 c+=1
31
32 class Test_VTKFiles(Test_VisualizationInterface):
33 # ======================================================================================================================
34 def test_hex_2D_order2_vtk(self):
35 reference="hex_2D_o2.xml"
36 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
37 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2.xml",domain=dom)
38 self.check_vtk("hex_2D_order2.xml",reference)
39
40 def test_hex_2D_order2_AllPoints_Scalar_vtk(self):
41 reference="hex_2D_o1_node_3xs.xml"
42 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
43 x=Solution(dom).getX()
44 x_r=ReducedSolution(dom).getX()
45 x_n=ContinuousFunction(dom).getX()
46 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_AllPoints_Scalar.xml",data_r=x_r[0],data_n=x_n[0],data=x[0])
47 self.check_vtk("hex_2D_order2_AllPoints_Scalar.xml",reference)
48 def test_hex_2D_order2_02Points_Scalar_vtk(self):
49 reference="hex_2D_o2_node_2xs.xml"
50 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
51 x=Solution(dom).getX()
52 x_n=ContinuousFunction(dom).getX()
53 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_O2Points_Scalar.xml",data_n=x_n[0],data=x[0])
54 self.check_vtk("hex_2D_order2_O2Points_Scalar.xml",reference)
55 def test_hex_2D_order2_2Cells_Scalar_vtk(self):
56 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
57 x=Function(dom).getX()
58 x_b=FunctionOnBoundary(dom).getX()
59 try:
60 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_2Cells_Scalar.xml",data=x[0],data_b=x_b[0])
61 self.fail("non-matching data not detected.")
62 except StandardError:
63 pass
64 def test_hex_2D_order2_BoundrayPoint_Scalar_vtk(self):
65 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
66 x=ContinuousFunction(dom).getX()
67 x_b=FunctionOnBoundary(dom).getX()
68 try:
69 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_BoundrayPoint_Scalar.xml",data=x[0],data_b=x_b[0])
70 self.fail("non-matching data not detected.")
71 except StandardError:
72 pass
73 def test_hex_2D_order2_Cells_AllData_vtk(self):
74 reference="hex_2D_o2_cell_all.xml"
75 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
76 x=Function(dom).getX()
77 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_Cells_AllData.xml",data_s=x[0],data_v=x[0]*[1.,2.],data_t=x[0]*[[11.,12.],[21.,22.]],data_t2=x[0]*[[-11.,-12.],[-21.,-22.]])
78 self.check_vtk("hex_2D_order2_Cells_AllData.xml",reference)
79
80 def test_hex_2D_order2_CellsPoints_AllData_vtk(self):
81 reference="hex_2D_o2_cellnode_all.xml"
82 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
83 x_c=Function(dom).getX()
84 x_p=ContinuousFunction(dom).getX()
85 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_CellsPoints_AllData.xml",data_sp=x_p[0],
86 data_vp=x_p[0]*[1.,2.],
87 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
88 data_sc=x_c[0],
89 data_vc=x_c[0]*[1.,2.],
90 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
91 self.check_vtk("hex_2D_order2_CellsPoints_AllData.xml",reference)
92 # ======================================================================================================================
93 def test_hex_contact_2D_order1_ContinuousFunction_Scalar_vtk(self):
94 reference="hex_2D_o1_node_s.xml"
95 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
96 x=ContinuousFunction(dom).getX()
97 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Scalar.xml",data=x[0])
98 self.check_vtk("hex_contact_2D_order1_ContinuousFunction_Scalar.xml",reference)
99 def test_hex_contact_2D_order1_ContinuousFunction_Vector_vtk(self):
100 reference="hex_2D_o1_node_v.xml"
101 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
102 x=ContinuousFunction(dom).getX()
103 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Vector.xml",data=x[0]*[1.,2.])
104 self.check_vtk("hex_contact_2D_order1_ContinuousFunction_Vector.xml",reference)
105 def test_hex_contact_2D_order1_ContinuousFunction_Tensor_vtk(self):
106 reference="hex_2D_o1_node_t.xml"
107 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
108 x=ContinuousFunction(dom).getX()
109 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
110 self.check_vtk("hex_contact_2D_order1_ContinuousFunction_Tensor.xml",reference)
111 def test_hex_contact_2D_order1_Solution_Scalar_vtk(self):
112 reference="hex_2D_o1_node_s.xml"
113 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
114 x=Solution(dom).getX()
115 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Scalar.xml",data=x[0])
116 self.check_vtk("hex_contact_2D_order1_Solution_Scalar.xml",reference)
117 def test_hex_contact_2D_order1_Solution_Vector_vtk(self):
118 reference="hex_2D_o1_node_v.xml"
119 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
120 x=Solution(dom).getX()
121 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Vector.xml",data=x[0]*[1.,2.])
122 self.check_vtk("hex_contact_2D_order1_Solution_Vector.xml",reference)
123 def test_hex_contact_2D_order1_Solution_Tensor_vtk(self):
124 reference="hex_2D_o1_node_t.xml"
125 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
126 x=Solution(dom).getX()
127 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
128 self.check_vtk("hex_contact_2D_order1_Solution_Tensor.xml",reference)
129 def test_hex_contact_2D_order1_ReducedSolution_Scalar_vtk(self):
130 reference="hex_2D_o1_node_s.xml"
131 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
132 x=ReducedSolution(dom).getX()
133 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Scalar.xml",data=x[0])
134 self.check_vtk("hex_contact_2D_order1_ReducedSolution_Scalar.xml",reference)
135 def test_hex_contact_2D_order1_ReducedSolution_Vector_vtk(self):
136 reference="hex_2D_o1_node_v.xml"
137 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
138 x=ReducedSolution(dom).getX()
139 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Vector.xml",data=x[0]*[1.,2.])
140 self.check_vtk("hex_contact_2D_order1_ReducedSolution_Vector.xml",reference)
141 def test_hex_contact_2D_order1_ReducedSolution_Tensor_vtk(self):
142 reference="hex_2D_o1_node_t.xml"
143 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
144 x=ReducedSolution(dom).getX()
145 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
146 self.check_vtk("hex_contact_2D_order1_ReducedSolution_Tensor.xml",reference)
147 def test_hex_contact_2D_order1_Function_Scalar_vtk(self):
148 reference="hex_2D_o1_cell_s.xml"
149 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
150 x=Function(dom).getX()
151 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Scalar.xml",data=x[0])
152 self.check_vtk("hex_contact_2D_order1_Function_Scalar.xml",reference)
153 def test_hex_contact_2D_order1_Function_Vector_vtk(self):
154 reference="hex_2D_o1_cell_v.xml"
155 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
156 x=Function(dom).getX()
157 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Vector.xml",data=x[0]*[1.,2.])
158 self.check_vtk("hex_contact_2D_order1_Function_Vector.xml",reference)
159 def test_hex_contact_2D_order1_Function_Tensor_vtk(self):
160 reference="hex_2D_o1_cell_t.xml"
161 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
162 x=Function(dom).getX()
163 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
164 self.check_vtk("hex_contact_2D_order1_Function_Tensor.xml",reference)
165 def test_hex_contact_2D_order1_FunctionOnBoundary_Scalar_vtk(self):
166 reference="hex_2D_o1_boundary_s.xml"
167 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
168 x=FunctionOnBoundary(dom).getX()
169 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Scalar.xml",data=x[0])
170 self.check_vtk("hex_contact_2D_order1_FunctionOnBoundary_Scalar.xml",reference)
171 def test_hex_contact_2D_order1_FunctionOnBoundary_Vector_vtk(self):
172 reference="hex_2D_o1_boundary_v.xml"
173 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
174 x=FunctionOnBoundary(dom).getX()
175 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.])
176 self.check_vtk("hex_contact_2D_order1_FunctionOnBoundary_Vector.xml",reference)
177 def test_hex_contact_2D_order1_FunctionOnBoundary_Tensor_vtk(self):
178 reference="hex_2D_o1_boundary_t.xml"
179 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
180 x=FunctionOnBoundary(dom).getX()
181 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
182 self.check_vtk("hex_contact_2D_order1_FunctionOnBoundary_Tensor.xml",reference)
183 def test_hex_contact_2D_order1_onFace_FunctionOnBoundary_Scalar_vtk(self):
184 reference="hex_2D_o1_f_boundary_s.xml"
185 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
186 x=FunctionOnBoundary(dom).getX()
187 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnBoundary_Scalar.xml",data=x[0])
188 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnBoundary_Scalar.xml",reference)
189 def test_hex_contact_2D_order1_onFace_FunctionOnBoundary_Vector_vtk(self):
190 reference="hex_2D_o1_f_boundary_v.xml"
191 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
192 x=FunctionOnBoundary(dom).getX()
193 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.])
194 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnBoundary_Vector.xml",reference)
195 def test_hex_contact_2D_order1_onFace_FunctionOnBoundary_Tensor_vtk(self):
196 reference="hex_2D_o1_f_boundary_t.xml"
197 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
198 x=FunctionOnBoundary(dom).getX()
199 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
200 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnBoundary_Tensor.xml",reference)
201 def test_hex_contact_2D_order1_FunctionOnContactZero_Scalar_vtk(self):
202 reference="hex_2D_o1_contact_s.xml"
203 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
204 x=FunctionOnContactZero(dom).getX()
205 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactZero_Scalar.xml",data=x[0])
206 self.check_vtk("hex_contact_2D_order1_FunctionOnContactZero_Scalar.xml",reference)
207 def test_hex_contact_2D_order1_FunctionOnContactZero_Vector_vtk(self):
208 reference="hex_2D_o1_contact_v.xml"
209 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
210 x=FunctionOnContactZero(dom).getX()
211 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.])
212 self.check_vtk("hex_contact_2D_order1_FunctionOnContactZero_Vector.xml",reference)
213 def test_hex_contact_2D_order1_FunctionOnContactZero_Tensor_vtk(self):
214 reference="hex_2D_o1_contact_t.xml"
215 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
216 x=FunctionOnContactZero(dom).getX()
217 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
218 self.check_vtk("hex_contact_2D_order1_FunctionOnContactZero_Tensor.xml",reference)
219 def test_hex_contact_2D_order1_onFace_FunctionOnContactZero_Scalar_vtk(self):
220 reference="hex_2D_o1_contact_s.xml"
221 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
222 x=FunctionOnContactZero(dom).getX()
223 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactZero_Scalar.xml",data=x[0])
224 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactZero_Scalar.xml",reference)
225 def test_hex_contact_2D_order1_onFace_FunctionOnContactZero_Vector_vtk(self):
226 reference="hex_2D_o1_contact_v.xml"
227 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
228 x=FunctionOnContactZero(dom).getX()
229 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.])
230 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactZero_Vector.xml",reference)
231 def test_hex_contact_2D_order1_onFace_FunctionOnContactZero_Tensor_vtk(self):
232 reference="hex_2D_o1_contact_t.xml"
233 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
234 x=FunctionOnContactZero(dom).getX()
235 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
236 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactZero_Tensor.xml",reference)
237 def test_hex_contact_2D_order1_FunctionOnContactOne_Scalar_vtk(self):
238 reference="hex_2D_o1_contact_s.xml"
239 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
240 x=FunctionOnContactOne(dom).getX()
241 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactOne_Scalar.xml",data=x[0])
242 self.check_vtk("hex_contact_2D_order1_FunctionOnContactOne_Scalar.xml",reference)
243 def test_hex_contact_2D_order1_FunctionOnContactOne_Vector_vtk(self):
244 reference="hex_2D_o1_contact_v.xml"
245 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
246 x=FunctionOnContactOne(dom).getX()
247 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.])
248 self.check_vtk("hex_contact_2D_order1_FunctionOnContactOne_Vector.xml",reference)
249 def test_hex_contact_2D_order1_FunctionOnContactOne_Tensor_vtk(self):
250 reference="hex_2D_o1_contact_t.xml"
251 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
252 x=FunctionOnContactOne(dom).getX()
253 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
254 self.check_vtk("hex_contact_2D_order1_FunctionOnContactOne_Tensor.xml",reference)
255 def test_hex_contact_2D_order1_onFace_FunctionOnContactOne_Scalar_vtk(self):
256 reference="hex_2D_o1_contact_s.xml"
257 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
258 x=FunctionOnContactOne(dom).getX()
259 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactOne_Scalar.xml",data=x[0])
260 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactOne_Scalar.xml",reference)
261 def test_hex_contact_2D_order1_onFace_FunctionOnContactOne_Vector_vtk(self):
262 reference="hex_2D_o1_contact_v.xml"
263 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
264 x=FunctionOnContactOne(dom).getX()
265 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.])
266 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactOne_Vector.xml",reference)
267 def test_hex_contact_2D_order1_onFace_FunctionOnContactOne_Tensor_vtk(self):
268 reference="hex_2D_o1_contact_t.xml"
269 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1_onFace.msh")
270 x=FunctionOnContactOne(dom).getX()
271 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_onFace_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
272 self.check_vtk("hex_contact_2D_order1_onFace_FunctionOnContactOne_Tensor.xml",reference)
273 # ======================================================================================================================
274 def test_hex_contact_2D_order2_ContinuousFunction_Scalar_vtk(self):
275 reference="hex_2D_o2_node_s.xml"
276 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
277 x=ContinuousFunction(dom).getX()
278 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Scalar.xml",data=x[0])
279 self.check_vtk("hex_contact_2D_order2_ContinuousFunction_Scalar.xml",reference)
280 def test_hex_contact_2D_order2_ContinuousFunction_Vector_vtk(self):
281 reference="hex_2D_o2_node_v.xml"
282 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
283 x=ContinuousFunction(dom).getX()
284 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Vector.xml",data=x[0]*[1.,2.])
285 self.check_vtk("hex_contact_2D_order2_ContinuousFunction_Vector.xml",reference)
286 def test_hex_contact_2D_order2_ContinuousFunction_Tensor_vtk(self):
287 reference="hex_2D_o2_node_t.xml"
288 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
289 x=ContinuousFunction(dom).getX()
290 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
291 self.check_vtk("hex_contact_2D_order2_ContinuousFunction_Tensor.xml",reference)
292 def test_hex_contact_2D_order2_Solution_Scalar_vtk(self):
293 reference="hex_2D_o2_node_s.xml"
294 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
295 x=Solution(dom).getX()
296 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Scalar.xml",data=x[0])
297 self.check_vtk("hex_contact_2D_order2_Solution_Scalar.xml",reference)
298 def test_hex_contact_2D_order2_Solution_Vector_vtk(self):
299 reference="hex_2D_o2_node_v.xml"
300 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
301 x=Solution(dom).getX()
302 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Vector.xml",data=x[0]*[1.,2.])
303 self.check_vtk("hex_contact_2D_order2_Solution_Vector.xml",reference)
304 def test_hex_contact_2D_order2_Solution_Tensor_vtk(self):
305 reference="hex_2D_o2_node_t.xml"
306 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
307 x=Solution(dom).getX()
308 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
309 self.check_vtk("hex_contact_2D_order2_Solution_Tensor.xml",reference)
310 def test_hex_contact_2D_order2_ReducedSolution_Scalar_vtk(self):
311 reference="hex_2D_o1_node_s.xml"
312 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
313 x=ReducedSolution(dom).getX()
314 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Scalar.xml",data=x[0])
315 self.check_vtk("hex_contact_2D_order2_ReducedSolution_Scalar.xml",reference)
316 def test_hex_contact_2D_order2_ReducedSolution_Vector_vtk(self):
317 reference="hex_2D_o1_node_v.xml"
318 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
319 x=ReducedSolution(dom).getX()
320 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Vector.xml",data=x[0]*[1.,2.])
321 self.check_vtk("hex_contact_2D_order2_ReducedSolution_Vector.xml",reference)
322 def test_hex_contact_2D_order2_ReducedSolution_Tensor_vtk(self):
323 reference="hex_2D_o1_node_t.xml"
324 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
325 x=ReducedSolution(dom).getX()
326 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
327 self.check_vtk("hex_contact_2D_order2_ReducedSolution_Tensor.xml",reference)
328 def test_hex_contact_2D_order2_Function_Scalar_vtk(self):
329 reference="hex_2D_o2_cell_s.xml"
330 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
331 x=Function(dom).getX()
332 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Scalar.xml",data=x[0])
333 self.check_vtk("hex_contact_2D_order2_Function_Scalar.xml",reference)
334 def test_hex_contact_2D_order2_Function_Vector_vtk(self):
335 reference="hex_2D_o2_cell_v.xml"
336 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
337 x=Function(dom).getX()
338 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Vector.xml",data=x[0]*[1.,2.])
339 self.check_vtk("hex_contact_2D_order2_Function_Vector.xml",reference)
340 def test_hex_contact_2D_order2_Function_Tensor_vtk(self):
341 reference="hex_2D_o2_cell_t.xml"
342 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
343 x=Function(dom).getX()
344 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
345 self.check_vtk("hex_contact_2D_order2_Function_Tensor.xml",reference)
346 def test_hex_contact_2D_order2_FunctionOnBoundary_Scalar_vtk(self):
347 reference="hex_2D_o2_boundary_s.xml"
348 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
349 x=FunctionOnBoundary(dom).getX()
350 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Scalar.xml",data=x[0])
351 self.check_vtk("hex_contact_2D_order2_FunctionOnBoundary_Scalar.xml",reference)
352 def test_hex_contact_2D_order2_FunctionOnBoundary_Vector_vtk(self):
353 reference="hex_2D_o2_boundary_v.xml"
354 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
355 x=FunctionOnBoundary(dom).getX()
356 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.])
357 self.check_vtk("hex_contact_2D_order2_FunctionOnBoundary_Vector.xml",reference)
358 def test_hex_contact_2D_order2_FunctionOnBoundary_Tensor_vtk(self):
359 reference="hex_2D_o2_boundary_t.xml"
360 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
361 x=FunctionOnBoundary(dom).getX()
362 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
363 self.check_vtk("hex_contact_2D_order2_FunctionOnBoundary_Tensor.xml",reference)
364 def test_hex_contact_2D_order2_onFace_FunctionOnBoundary_Scalar_vtk(self):
365 reference="hex_2D_o2_f_boundary_s.xml"
366 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
367 x=FunctionOnBoundary(dom).getX()
368 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnBoundary_Scalar.xml",data=x[0])
369 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnBoundary_Scalar.xml",reference)
370 def test_hex_contact_2D_order2_onFace_FunctionOnBoundary_Vector_vtk(self):
371 reference="hex_2D_o2_f_boundary_v.xml"
372 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
373 x=FunctionOnBoundary(dom).getX()
374 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.])
375 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnBoundary_Vector.xml",reference)
376 def test_hex_contact_2D_order2_onFace_FunctionOnBoundary_Tensor_vtk(self):
377 reference="hex_2D_o2_f_boundary_t.xml"
378 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
379 x=FunctionOnBoundary(dom).getX()
380 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
381 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnBoundary_Tensor.xml",reference)
382 def test_hex_contact_2D_order2_FunctionOnContactZero_Scalar_vtk(self):
383 reference="hex_2D_o2_contact_s.xml"
384 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
385 x=FunctionOnContactZero(dom).getX()
386 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactZero_Scalar.xml",data=x[0])
387 self.check_vtk("hex_contact_2D_order2_FunctionOnContactZero_Scalar.xml",reference)
388 def test_hex_contact_2D_order2_FunctionOnContactZero_Vector_vtk(self):
389 reference="hex_2D_o2_contact_v.xml"
390 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
391 x=FunctionOnContactZero(dom).getX()
392 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.])
393 self.check_vtk("hex_contact_2D_order2_FunctionOnContactZero_Vector.xml",reference)
394 def test_hex_contact_2D_order2_FunctionOnContactZero_Tensor_vtk(self):
395 reference="hex_2D_o2_contact_t.xml"
396 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
397 x=FunctionOnContactZero(dom).getX()
398 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
399 self.check_vtk("hex_contact_2D_order2_FunctionOnContactZero_Tensor.xml",reference)
400 def test_hex_contact_2D_order2_onFace_FunctionOnContactZero_Scalar_vtk(self):
401 reference="hex_2D_o2_contact_s.xml"
402 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
403 x=FunctionOnContactZero(dom).getX()
404 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactZero_Scalar.xml",data=x[0])
405 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactZero_Scalar.xml",reference)
406 def test_hex_contact_2D_order2_onFace_FunctionOnContactZero_Vector_vtk(self):
407 reference="hex_2D_o2_contact_v.xml"
408 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
409 x=FunctionOnContactZero(dom).getX()
410 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.])
411 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactZero_Vector.xml",reference)
412 def test_hex_contact_2D_order2_onFace_FunctionOnContactZero_Tensor_vtk(self):
413 reference="hex_2D_o2_contact_t.xml"
414 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
415 x=FunctionOnContactZero(dom).getX()
416 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
417 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactZero_Tensor.xml",reference)
418 def test_hex_contact_2D_order2_FunctionOnContactOne_Scalar_vtk(self):
419 reference="hex_2D_o2_contact_s.xml"
420 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
421 x=FunctionOnContactOne(dom).getX()
422 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactOne_Scalar.xml",data=x[0])
423 self.check_vtk("hex_contact_2D_order2_FunctionOnContactOne_Scalar.xml",reference)
424 def test_hex_contact_2D_order2_FunctionOnContactOne_Vector_vtk(self):
425 reference="hex_2D_o2_contact_v.xml"
426 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
427 x=FunctionOnContactOne(dom).getX()
428 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.])
429 self.check_vtk("hex_contact_2D_order2_FunctionOnContactOne_Vector.xml",reference)
430 def test_hex_contact_2D_order2_FunctionOnContactOne_Tensor_vtk(self):
431 reference="hex_2D_o2_contact_t.xml"
432 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
433 x=FunctionOnContactOne(dom).getX()
434 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
435 self.check_vtk("hex_contact_2D_order2_FunctionOnContactOne_Tensor.xml",reference)
436 def test_hex_contact_2D_order2_onFace_FunctionOnContactOne_Scalar_vtk(self):
437 reference="hex_2D_o2_contact_s.xml"
438 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
439 x=FunctionOnContactOne(dom).getX()
440 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactOne_Scalar.xml",data=x[0])
441 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactOne_Scalar.xml",reference)
442 def test_hex_contact_2D_order2_onFace_FunctionOnContactOne_Vector_vtk(self):
443 reference="hex_2D_o2_contact_v.xml"
444 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
445 x=FunctionOnContactOne(dom).getX()
446 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.])
447 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactOne_Vector.xml",reference)
448 def test_hex_contact_2D_order2_onFace_FunctionOnContactOne_Tensor_vtk(self):
449 reference="hex_2D_o2_contact_t.xml"
450 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2_onFace.msh")
451 x=FunctionOnContactOne(dom).getX()
452 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_onFace_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.],[21.,22.]])
453 self.check_vtk("hex_contact_2D_order2_onFace_FunctionOnContactOne_Tensor.xml",reference)
454
455
456 # ======================================================================================================================
457 def test_hex_contact_3D_order1_ContinuousFunction_Scalar_vtk(self):
458 reference="hex_3D_o1_node_s.xml"
459 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
460 x=ContinuousFunction(dom).getX()
461 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Scalar.xml",data=x[0])
462 self.check_vtk("hex_contact_3D_order1_ContinuousFunction_Scalar.xml",reference)
463 def test_hex_contact_3D_order1_ContinuousFunction_Vector_vtk(self):
464 reference="hex_3D_o1_node_v.xml"
465 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
466 x=ContinuousFunction(dom).getX()
467 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Vector.xml",data=x[0]*[1.,2.,3.])
468 self.check_vtk("hex_contact_3D_order1_ContinuousFunction_Vector.xml",reference)
469 def test_hex_contact_3D_order1_ContinuousFunction_Tensor_vtk(self):
470 reference="hex_3D_o1_node_t.xml"
471 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
472 x=ContinuousFunction(dom).getX()
473 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
474 self.check_vtk("hex_contact_3D_order1_ContinuousFunction_Tensor.xml",reference)
475 def test_hex_contact_3D_order1_Solution_Scalar_vtk(self):
476 reference="hex_3D_o1_node_s.xml"
477 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
478 x=Solution(dom).getX()
479 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Scalar.xml",data=x[0])
480 self.check_vtk("hex_contact_3D_order1_Solution_Scalar.xml",reference)
481 def test_hex_contact_3D_order1_Solution_Vector_vtk(self):
482 reference="hex_3D_o1_node_v.xml"
483 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
484 x=Solution(dom).getX()
485 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Vector.xml",data=x[0]*[1.,2.,3.])
486 self.check_vtk("hex_contact_3D_order1_Solution_Vector.xml",reference)
487 def test_hex_contact_3D_order1_Solution_Tensor_vtk(self):
488 reference="hex_3D_o1_node_t.xml"
489 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
490 x=Solution(dom).getX()
491 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
492 self.check_vtk("hex_contact_3D_order1_Solution_Tensor.xml",reference)
493 def test_hex_contact_3D_order1_ReducedSolution_Scalar_vtk(self):
494 reference="hex_3D_o1_node_s.xml"
495 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
496 x=ReducedSolution(dom).getX()
497 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Scalar.xml",data=x[0])
498 self.check_vtk("hex_contact_3D_order1_ReducedSolution_Scalar.xml",reference)
499 def test_hex_contact_3D_order1_ReducedSolution_Vector_vtk(self):
500 reference="hex_3D_o1_node_v.xml"
501 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
502 x=ReducedSolution(dom).getX()
503 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Vector.xml",data=x[0]*[1.,2.,3.])
504 self.check_vtk("hex_contact_3D_order1_ReducedSolution_Vector.xml",reference)
505 def test_hex_contact_3D_order1_ReducedSolution_Tensor_vtk(self):
506 reference="hex_3D_o1_node_t.xml"
507 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
508 x=ReducedSolution(dom).getX()
509 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
510 self.check_vtk("hex_contact_3D_order1_ReducedSolution_Tensor.xml",reference)
511 def test_hex_contact_3D_order1_Function_Scalar_vtk(self):
512 reference="hex_3D_o1_cell_s.xml"
513 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
514 x=Function(dom).getX()
515 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Scalar.xml",data=x[0])
516 self.check_vtk("hex_contact_3D_order1_Function_Scalar.xml",reference)
517 def test_hex_contact_3D_order1_Function_Vector_vtk(self):
518 reference="hex_3D_o1_cell_v.xml"
519 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
520 x=Function(dom).getX()
521 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Vector.xml",data=x[0]*[1.,2.,3.])
522 self.check_vtk("hex_contact_3D_order1_Function_Vector.xml",reference)
523 def test_hex_contact_3D_order1_Function_Tensor_vtk(self):
524 reference="hex_3D_o1_cell_t.xml"
525 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
526 x=Function(dom).getX()
527 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
528 self.check_vtk("hex_contact_3D_order1_Function_Tensor.xml",reference)
529 def test_hex_contact_3D_order1_FunctionOnBoundary_Scalar_vtk(self):
530 reference="hex_3D_o1_boundary_s.xml"
531 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
532 x=FunctionOnBoundary(dom).getX()
533 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Scalar.xml",data=x[0])
534 self.check_vtk("hex_contact_3D_order1_FunctionOnBoundary_Scalar.xml",reference)
535 def test_hex_contact_3D_order1_FunctionOnBoundary_Vector_vtk(self):
536 reference="hex_3D_o1_boundary_v.xml"
537 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
538 x=FunctionOnBoundary(dom).getX()
539 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.,3.])
540 self.check_vtk("hex_contact_3D_order1_FunctionOnBoundary_Vector.xml",reference)
541 def test_hex_contact_3D_order1_FunctionOnBoundary_Tensor_vtk(self):
542 reference="hex_3D_o1_boundary_t.xml"
543 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
544 x=FunctionOnBoundary(dom).getX()
545 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
546 self.check_vtk("hex_contact_3D_order1_FunctionOnBoundary_Tensor.xml",reference)
547 def test_hex_contact_3D_order1_onFace_FunctionOnBoundary_Scalar_vtk(self):
548 reference="hex_3D_o1_f_boundary_s.xml"
549 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
550 x=FunctionOnBoundary(dom).getX()
551 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnBoundary_Scalar.xml",data=x[0])
552 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnBoundary_Scalar.xml",reference)
553 def test_hex_contact_3D_order1_onFace_FunctionOnBoundary_Vector_vtk(self):
554 reference="hex_3D_o1_f_boundary_v.xml"
555 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
556 x=FunctionOnBoundary(dom).getX()
557 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.,3.])
558 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnBoundary_Vector.xml",reference)
559 def test_hex_contact_3D_order1_onFace_FunctionOnBoundary_Tensor_vtk(self):
560 reference="hex_3D_o1_f_boundary_t.xml"
561 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
562 x=FunctionOnBoundary(dom).getX()
563 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
564 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnBoundary_Tensor.xml",reference)
565 def test_hex_contact_3D_order1_FunctionOnContactZero_Scalar_vtk(self):
566 reference="hex_3D_o1_contact_s.xml"
567 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
568 x=FunctionOnContactZero(dom).getX()
569 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactZero_Scalar.xml",data=x[0])
570 self.check_vtk("hex_contact_3D_order1_FunctionOnContactZero_Scalar.xml",reference)
571 def test_hex_contact_3D_order1_FunctionOnContactZero_Vector_vtk(self):
572 reference="hex_3D_o1_contact_v.xml"
573 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
574 x=FunctionOnContactZero(dom).getX()
575 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.,3.])
576 self.check_vtk("hex_contact_3D_order1_FunctionOnContactZero_Vector.xml",reference)
577 def test_hex_contact_3D_order1_FunctionOnContactZero_Tensor_vtk(self):
578 reference="hex_3D_o1_contact_t.xml"
579 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
580 x=FunctionOnContactZero(dom).getX()
581 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
582 self.check_vtk("hex_contact_3D_order1_FunctionOnContactZero_Tensor.xml",reference)
583 def test_hex_contact_3D_order1_onFace_FunctionOnContactZero_Scalar_vtk(self):
584 reference="hex_3D_o1_contact_s.xml"
585 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
586 x=FunctionOnContactZero(dom).getX()
587 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactZero_Scalar.xml",data=x[0])
588 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactZero_Scalar.xml",reference)
589 def test_hex_contact_3D_order1_onFace_FunctionOnContactZero_Vector_vtk(self):
590 reference="hex_3D_o1_contact_v.xml"
591 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
592 x=FunctionOnContactZero(dom).getX()
593 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.,3.])
594 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactZero_Vector.xml",reference)
595 def test_hex_contact_3D_order1_onFace_FunctionOnContactZero_Tensor_vtk(self):
596 reference="hex_3D_o1_contact_t.xml"
597 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
598 x=FunctionOnContactZero(dom).getX()
599 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
600 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactZero_Tensor.xml",reference)
601 def test_hex_contact_3D_order1_FunctionOnContactOne_Scalar_vtk(self):
602 reference="hex_3D_o1_contact_s.xml"
603 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
604 x=FunctionOnContactOne(dom).getX()
605 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactOne_Scalar.xml",data=x[0])
606 self.check_vtk("hex_contact_3D_order1_FunctionOnContactOne_Scalar.xml",reference)
607 def test_hex_contact_3D_order1_FunctionOnContactOne_Vector_vtk(self):
608 reference="hex_3D_o1_contact_v.xml"
609 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
610 x=FunctionOnContactOne(dom).getX()
611 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.,3.])
612 self.check_vtk("hex_contact_3D_order1_FunctionOnContactOne_Vector.xml",reference)
613 def test_hex_contact_3D_order1_FunctionOnContactOne_Tensor_vtk(self):
614 reference="hex_3D_o1_contact_t.xml"
615 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
616 x=FunctionOnContactOne(dom).getX()
617 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
618 self.check_vtk("hex_contact_3D_order1_FunctionOnContactOne_Tensor.xml",reference)
619 def test_hex_contact_3D_order1_onFace_FunctionOnContactOne_Scalar_vtk(self):
620 reference="hex_3D_o1_contact_s.xml"
621 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
622 x=FunctionOnContactOne(dom).getX()
623 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactOne_Scalar.xml",data=x[0])
624 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactOne_Scalar.xml",reference)
625 def test_hex_contact_3D_order1_onFace_FunctionOnContactOne_Vector_vtk(self):
626 reference="hex_3D_o1_contact_v.xml"
627 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
628 x=FunctionOnContactOne(dom).getX()
629 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.,3.])
630 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactOne_Vector.xml",reference)
631 def test_hex_contact_3D_order1_onFace_FunctionOnContactOne_Tensor_vtk(self):
632 reference="hex_3D_o1_contact_t.xml"
633 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1_onFace.msh")
634 x=FunctionOnContactOne(dom).getX()
635 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_onFace_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
636 self.check_vtk("hex_contact_3D_order1_onFace_FunctionOnContactOne_Tensor.xml",reference)
637 # ======================================================================================================================
638 def test_hex_contact_3D_order2_ContinuousFunction_Scalar_vtk(self):
639 reference="hex_3D_o2_node_s.xml"
640 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
641 x=ContinuousFunction(dom).getX()
642 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Scalar.xml",data=x[0])
643 self.check_vtk("hex_contact_3D_order2_ContinuousFunction_Scalar.xml",reference)
644 def test_hex_contact_3D_order2_ContinuousFunction_Vector_vtk(self):
645 reference="hex_3D_o2_node_v.xml"
646 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
647 x=ContinuousFunction(dom).getX()
648 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Vector.xml",data=x[0]*[1.,2.,3.])
649 self.check_vtk("hex_contact_3D_order2_ContinuousFunction_Vector.xml",reference)
650 def test_hex_contact_3D_order2_ContinuousFunction_Tensor_vtk(self):
651 reference="hex_3D_o2_node_t.xml"
652 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
653 x=ContinuousFunction(dom).getX()
654 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
655 self.check_vtk("hex_contact_3D_order2_ContinuousFunction_Tensor.xml",reference)
656 def test_hex_contact_3D_order2_Solution_Scalar_vtk(self):
657 reference="hex_3D_o2_node_s.xml"
658 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
659 x=Solution(dom).getX()
660 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Scalar.xml",data=x[0])
661 self.check_vtk("hex_contact_3D_order2_Solution_Scalar.xml",reference)
662 def test_hex_contact_3D_order2_Solution_Vector_vtk(self):
663 reference="hex_3D_o2_node_v.xml"
664 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
665 x=Solution(dom).getX()
666 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Vector.xml",data=x[0]*[1.,2.,3.])
667 self.check_vtk("hex_contact_3D_order2_Solution_Vector.xml",reference)
668 def test_hex_contact_3D_order2_Solution_Tensor_vtk(self):
669 reference="hex_3D_o2_node_t.xml"
670 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
671 x=Solution(dom).getX()
672 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
673 self.check_vtk("hex_contact_3D_order2_Solution_Tensor.xml",reference)
674 def test_hex_contact_3D_order2_ReducedSolution_Scalar_vtk(self):
675 reference="hex_3D_o1_node_s.xml"
676 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
677 x=ReducedSolution(dom).getX()
678 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Scalar.xml",data=x[0])
679 self.check_vtk("hex_contact_3D_order2_ReducedSolution_Scalar.xml",reference)
680 def test_hex_contact_3D_order2_ReducedSolution_Vector_vtk(self):
681 reference="hex_3D_o1_node_v.xml"
682 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
683 x=ReducedSolution(dom).getX()
684 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Vector.xml",data=x[0]*[1.,2.,3.])
685 self.check_vtk("hex_contact_3D_order2_ReducedSolution_Vector.xml",reference)
686 def test_hex_contact_3D_order2_ReducedSolution_Tensor_vtk(self):
687 reference="hex_3D_o1_node_t.xml"
688 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
689 x=ReducedSolution(dom).getX()
690 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
691 self.check_vtk("hex_contact_3D_order2_ReducedSolution_Tensor.xml",reference)
692 def test_hex_contact_3D_order2_Function_Scalar_vtk(self):
693 reference="hex_3D_o2_cell_s.xml"
694 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
695 x=Function(dom).getX()
696 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Scalar.xml",data=x[0])
697 self.check_vtk("hex_contact_3D_order2_Function_Scalar.xml",reference)
698 def test_hex_contact_3D_order2_Function_Vector_vtk(self):
699 reference="hex_3D_o2_cell_v.xml"
700 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
701 x=Function(dom).getX()
702 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Vector.xml",data=x[0]*[1.,2.,3.])
703 self.check_vtk("hex_contact_3D_order2_Function_Vector.xml",reference)
704 def test_hex_contact_3D_order2_Function_Tensor_vtk(self):
705 reference="hex_3D_o2_cell_t.xml"
706 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
707 x=Function(dom).getX()
708 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
709 self.check_vtk("hex_contact_3D_order2_Function_Tensor.xml",reference)
710 def test_hex_contact_3D_order2_FunctionOnBoundary_Scalar_vtk(self):
711 reference="hex_3D_o2_boundary_s.xml"
712 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
713 x=FunctionOnBoundary(dom).getX()
714 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Scalar.xml",data=x[0])
715 self.check_vtk("hex_contact_3D_order2_FunctionOnBoundary_Scalar.xml",reference)
716 def test_hex_contact_3D_order2_FunctionOnBoundary_Vector_vtk(self):
717 reference="hex_3D_o2_boundary_v.xml"
718 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
719 x=FunctionOnBoundary(dom).getX()
720 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.,3.])
721 self.check_vtk("hex_contact_3D_order2_FunctionOnBoundary_Vector.xml",reference)
722 def test_hex_contact_3D_order2_FunctionOnBoundary_Tensor_vtk(self):
723 reference="hex_3D_o2_boundary_t.xml"
724 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
725 x=FunctionOnBoundary(dom).getX()
726 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
727 self.check_vtk("hex_contact_3D_order2_FunctionOnBoundary_Tensor.xml",reference)
728 def test_hex_contact_3D_order2_onFace_FunctionOnBoundary_Scalar_vtk(self):
729 reference="hex_3D_o2_f_boundary_s.xml"
730 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
731 x=FunctionOnBoundary(dom).getX()
732 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnBoundary_Scalar.xml",data=x[0])
733 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnBoundary_Scalar.xml",reference)
734 def test_hex_contact_3D_order2_onFace_FunctionOnBoundary_Vector_vtk(self):
735 reference="hex_3D_o2_f_boundary_v.xml"
736 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
737 x=FunctionOnBoundary(dom).getX()
738 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnBoundary_Vector.xml",data=x[0]*[1.,2.,3.])
739 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnBoundary_Vector.xml",reference)
740 def test_hex_contact_3D_order2_onFace_FunctionOnBoundary_Tensor_vtk(self):
741 reference="hex_3D_o2_f_boundary_t.xml"
742 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
743 x=FunctionOnBoundary(dom).getX()
744 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnBoundary_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
745 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnBoundary_Tensor.xml",reference)
746 def test_hex_contact_3D_order2_FunctionOnContactZero_Scalar_vtk(self):
747 reference="hex_3D_o2_contact_s.xml"
748 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
749 x=FunctionOnContactZero(dom).getX()
750 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactZero_Scalar.xml",data=x[0])
751 self.check_vtk("hex_contact_3D_order2_FunctionOnContactZero_Scalar.xml",reference)
752 def test_hex_contact_3D_order2_FunctionOnContactZero_Vector_vtk(self):
753 reference="hex_3D_o2_contact_v.xml"
754 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
755 x=FunctionOnContactZero(dom).getX()
756 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.,3.])
757 self.check_vtk("hex_contact_3D_order2_FunctionOnContactZero_Vector.xml",reference)
758 def test_hex_contact_3D_order2_FunctionOnContactZero_Tensor_vtk(self):
759 reference="hex_3D_o2_contact_t.xml"
760 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
761 x=FunctionOnContactZero(dom).getX()
762 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
763 self.check_vtk("hex_contact_3D_order2_FunctionOnContactZero_Tensor.xml",reference)
764 def test_hex_contact_3D_order2_onFace_FunctionOnContactZero_Scalar_vtk(self):
765 reference="hex_3D_o2_contact_s.xml"
766 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
767 x=FunctionOnContactZero(dom).getX()
768 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactZero_Scalar.xml",data=x[0])
769 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactZero_Scalar.xml",reference)
770 def test_hex_contact_3D_order2_onFace_FunctionOnContactZero_Vector_vtk(self):
771 reference="hex_3D_o2_contact_v.xml"
772 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
773 x=FunctionOnContactZero(dom).getX()
774 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactZero_Vector.xml",data=x[0]*[1.,2.,3.])
775 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactZero_Vector.xml",reference)
776 def test_hex_contact_3D_order2_onFace_FunctionOnContactZero_Tensor_vtk(self):
777 reference="hex_3D_o2_contact_t.xml"
778 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
779 x=FunctionOnContactZero(dom).getX()
780 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactZero_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
781 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactZero_Tensor.xml",reference)
782 def test_hex_contact_3D_order2_FunctionOnContactOne_Scalar_vtk(self):
783 reference="hex_3D_o2_contact_s.xml"
784 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
785 x=FunctionOnContactOne(dom).getX()
786 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactOne_Scalar.xml",data=x[0])
787 self.check_vtk("hex_contact_3D_order2_FunctionOnContactOne_Scalar.xml",reference)
788 def test_hex_contact_3D_order2_FunctionOnContactOne_Vector_vtk(self):
789 reference="hex_3D_o2_contact_v.xml"
790 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
791 x=FunctionOnContactOne(dom).getX()
792 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.,3.])
793 self.check_vtk("hex_contact_3D_order2_FunctionOnContactOne_Vector.xml",reference)
794 def test_hex_contact_3D_order2_FunctionOnContactOne_Tensor_vtk(self):
795 reference="hex_3D_o2_contact_t.xml"
796 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
797 x=FunctionOnContactOne(dom).getX()
798 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
799 self.check_vtk("hex_contact_3D_order2_FunctionOnContactOne_Tensor.xml",reference)
800 def test_hex_contact_3D_order2_onFace_FunctionOnContactOne_Scalar_vtk(self):
801 reference="hex_3D_o2_contact_s.xml"
802 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
803 x=FunctionOnContactOne(dom).getX()
804 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactOne_Scalar.xml",data=x[0])
805 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactOne_Scalar.xml",reference)
806 def test_hex_contact_3D_order2_onFace_FunctionOnContactOne_Vector_vtk(self):
807 reference="hex_3D_o2_contact_v.xml"
808 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
809 x=FunctionOnContactOne(dom).getX()
810 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactOne_Vector.xml",data=x[0]*[1.,2.,3.])
811 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactOne_Vector.xml",reference)
812 def test_hex_contact_3D_order2_onFace_FunctionOnContactOne_Tensor_vtk(self):
813 reference="hex_3D_o2_contact_t.xml"
814 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2_onFace.msh")
815 x=FunctionOnContactOne(dom).getX()
816 saveVTK(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_onFace_FunctionOnContactOne_Tensor.xml",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
817 self.check_vtk("hex_contact_3D_order2_onFace_FunctionOnContactOne_Tensor.xml",reference)
818
819 class Test_DXFiles(Test_VisualizationInterface):
820 # ======================================================================================================================
821 def test_hex_2D_order2_dx(self):
822 reference="hex_2D_o1.dx"
823 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
824 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2.dx",domain=dom)
825 self.check_dx("hex_2D_order2.dx",reference)
826
827 def test_hex_2D_order2_AllPoints_Scalar_dx(self):
828 reference="hex_2D_o1_node_3xs.dx"
829 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
830 x=Solution(dom).getX()
831 x_r=ReducedSolution(dom).getX()
832 x_n=ContinuousFunction(dom).getX()
833 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_AllPoints_Scalar.dx",data_r=x_r[0],data_n=x_n[0],data=x[0])
834 self.check_dx("hex_2D_order2_AllPoints_Scalar.dx",reference)
835 def test_hex_2D_order2_02Points_Scalar_dx(self):
836 reference="hex_2D_o1_node_2xs.dx"
837 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
838 x=Solution(dom).getX()
839 x_n=ContinuousFunction(dom).getX()
840 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_O2Points_Scalar.dx",data_n=x_n[0],data=x[0])
841 self.check_dx("hex_2D_order2_O2Points_Scalar.dx",reference)
842 def test_hex_2D_order2_2Cells_Scalar_dx(self):
843 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
844 x=Function(dom).getX()
845 x_b=FunctionOnBoundary(dom).getX()
846 try:
847 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_2Cells_Scalar.dx",data=x[0],data_b=x_b[0])
848 self.fail("non-matching data not detected.")
849 except StandardError:
850 pass
851 def test_hex_2D_order2_BoundrayPoint_Scalar_dx(self):
852 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
853 x=ContinuousFunction(dom).getX()
854 x_b=FunctionOnBoundary(dom).getX()
855 try:
856 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_BoundrayPoint_Scalar.dx",data=x[0],data_b=x_b[0])
857 self.fail("non-matching data not detected.")
858 except StandardError:
859 pass
860 def test_hex_2D_order2_Cells_AllData_dx(self):
861 reference="hex_2D_o1_cell_all.dx"
862 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
863 x=Function(dom).getX()
864 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_Cells_AllData.dx",data_s=x[0],data_v=x[0]*[1.,2.],data_t=x[0]*[[11.,12.],[21.,22.]],data_t2=x[0]*[[-11.,-12.],[-21.,-22.]])
865 self.check_dx("hex_2D_order2_Cells_AllData.dx",reference)
866
867 def test_hex_2D_order2_CellsPoints_AllData_dx(self):
868 reference="hex_2D_o1_cellnode_all.dx"
869 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_2D_order2.msh")
870 x_c=Function(dom).getX()
871 x_p=ContinuousFunction(dom).getX()
872 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_2D_order2_CellsPoints_AllData.dx",data_sp=x_p[0],
873 data_vp=x_p[0]*[1.,2.],
874 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
875 data_sc=x_c[0],
876 data_vc=x_c[0]*[1.,2.],
877 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
878 self.check_dx("hex_2D_order2_CellsPoints_AllData.dx",reference)
879 # ======================================================================================================================
880 def test_hex_contact_2D_order1_ContinuousFunction_Scalar_dx(self):
881 reference="hex_2D_o1_node_s.dx"
882 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
883 x=ContinuousFunction(dom).getX()
884 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Scalar.dx",data=x[0])
885 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Scalar.dx",reference)
886 def test_hex_contact_2D_order1_ContinuousFunction_Vector_dx(self):
887 reference="hex_2D_o1_node_v.dx"
888 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
889 x=ContinuousFunction(dom).getX()
890 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Vector.dx",data=x[0]*[1.,2.])
891 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Vector.dx",reference)
892 def test_hex_contact_2D_order1_ContinuousFunction_Tensor_dx(self):
893 reference="hex_2D_o1_node_t.dx"
894 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
895 x=ContinuousFunction(dom).getX()
896 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ContinuousFunction_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
897 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Tensor.dx",reference)
898 def test_hex_contact_2D_order1_Solution_Scalar_dx(self):
899 reference="hex_2D_o1_node_s.dx"
900 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
901 x=Solution(dom).getX()
902 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Scalar.dx",data=x[0])
903 self.check_dx("hex_contact_2D_order1_Solution_Scalar.dx",reference)
904 def test_hex_contact_2D_order1_Solution_Vector_dx(self):
905 reference="hex_2D_o1_node_v.dx"
906 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
907 x=Solution(dom).getX()
908 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Vector.dx",data=x[0]*[1.,2.])
909 self.check_dx("hex_contact_2D_order1_Solution_Vector.dx",reference)
910 def test_hex_contact_2D_order1_Solution_Tensor_dx(self):
911 reference="hex_2D_o1_node_t.dx"
912 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
913 x=Solution(dom).getX()
914 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Solution_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
915 self.check_dx("hex_contact_2D_order1_Solution_Tensor.dx",reference)
916 def test_hex_contact_2D_order1_ReducedSolution_Scalar_dx(self):
917 reference="hex_2D_o1_node_s.dx"
918 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
919 x=ReducedSolution(dom).getX()
920 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Scalar.dx",data=x[0])
921 self.check_dx("hex_contact_2D_order1_ReducedSolution_Scalar.dx",reference)
922 def test_hex_contact_2D_order1_ReducedSolution_Vector_dx(self):
923 reference="hex_2D_o1_node_v.dx"
924 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
925 x=ReducedSolution(dom).getX()
926 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Vector.dx",data=x[0]*[1.,2.])
927 self.check_dx("hex_contact_2D_order1_ReducedSolution_Vector.dx",reference)
928 def test_hex_contact_2D_order1_ReducedSolution_Tensor_dx(self):
929 reference="hex_2D_o1_node_t.dx"
930 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
931 x=ReducedSolution(dom).getX()
932 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_ReducedSolution_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
933 self.check_dx("hex_contact_2D_order1_ReducedSolution_Tensor.dx",reference)
934 def test_hex_contact_2D_order1_Function_Scalar_dx(self):
935 reference="hex_2D_o1_cell_s.dx"
936 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
937 x=Function(dom).getX()
938 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Scalar.dx",data=x[0])
939 self.check_dx("hex_contact_2D_order1_Function_Scalar.dx",reference)
940 def test_hex_contact_2D_order1_Function_Vector_dx(self):
941 reference="hex_2D_o1_cell_v.dx"
942 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
943 x=Function(dom).getX()
944 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Vector.dx",data=x[0]*[1.,2.])
945 self.check_dx("hex_contact_2D_order1_Function_Vector.dx",reference)
946 def test_hex_contact_2D_order1_Function_Tensor_dx(self):
947 reference="hex_2D_o1_cell_t.dx"
948 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
949 x=Function(dom).getX()
950 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_Function_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
951 self.check_dx("hex_contact_2D_order1_Function_Tensor.dx",reference)
952 def test_hex_contact_2D_order1_FunctionOnBoundary_Scalar_dx(self):
953 reference="hex_2D_o1_boundary_s.dx"
954 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
955 x=FunctionOnBoundary(dom).getX()
956 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Scalar.dx",data=x[0])
957 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Scalar.dx",reference)
958 def test_hex_contact_2D_order1_FunctionOnBoundary_Vector_dx(self):
959 reference="hex_2D_o1_boundary_v.dx"
960 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
961 x=FunctionOnBoundary(dom).getX()
962 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Vector.dx",data=x[0]*[1.,2.])
963 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Vector.dx",reference)
964 def test_hex_contact_2D_order1_FunctionOnBoundary_Tensor_dx(self):
965 reference="hex_2D_o1_boundary_t.dx"
966 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order1.msh")
967 x=FunctionOnBoundary(dom).getX()
968 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order1_FunctionOnBoundary_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
969 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Tensor.dx",reference)
970 # ======================================================================================================================
971 def test_hex_contact_2D_order2_ContinuousFunction_Scalar_dx(self):
972 reference="hex_2D_o2_node_s.dx"
973 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
974 x=ContinuousFunction(dom).getX()
975 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Scalar.dx",data=x[0])
976 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Scalar.dx",reference)
977 def test_hex_contact_2D_order2_ContinuousFunction_Vector_dx(self):
978 reference="hex_2D_o2_node_v.dx"
979 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
980 x=ContinuousFunction(dom).getX()
981 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Vector.dx",data=x[0]*[1.,2.])
982 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Vector.dx",reference)
983 def test_hex_contact_2D_order2_ContinuousFunction_Tensor_dx(self):
984 reference="hex_2D_o2_node_t.dx"
985 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
986 x=ContinuousFunction(dom).getX()
987 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ContinuousFunction_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
988 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Tensor.dx",reference)
989 def test_hex_contact_2D_order2_Solution_Scalar_dx(self):
990 reference="hex_2D_o2_node_s.dx"
991 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
992 x=Solution(dom).getX()
993 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Scalar.dx",data=x[0])
994 self.check_dx("hex_contact_2D_order2_Solution_Scalar.dx",reference)
995 def test_hex_contact_2D_order2_Solution_Vector_dx(self):
996 reference="hex_2D_o2_node_v.dx"
997 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
998 x=Solution(dom).getX()
999 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Vector.dx",data=x[0]*[1.,2.])
1000 self.check_dx("hex_contact_2D_order2_Solution_Vector.dx",reference)
1001 def test_hex_contact_2D_order2_Solution_Tensor_dx(self):
1002 reference="hex_2D_o2_node_t.dx"
1003 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1004 x=Solution(dom).getX()
1005 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Solution_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
1006 self.check_dx("hex_contact_2D_order2_Solution_Tensor.dx",reference)
1007 def test_hex_contact_2D_order2_ReducedSolution_Scalar_dx(self):
1008 reference="hex_2D_o1_node_s.dx"
1009 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1010 x=ReducedSolution(dom).getX()
1011 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Scalar.dx",data=x[0])
1012 self.check_dx("hex_contact_2D_order2_ReducedSolution_Scalar.dx",reference)
1013 def test_hex_contact_2D_order2_ReducedSolution_Vector_dx(self):
1014 reference="hex_2D_o1_node_v.dx"
1015 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1016 x=ReducedSolution(dom).getX()
1017 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Vector.dx",data=x[0]*[1.,2.])
1018 self.check_dx("hex_contact_2D_order2_ReducedSolution_Vector.dx",reference)
1019 def test_hex_contact_2D_order2_ReducedSolution_Tensor_dx(self):
1020 reference="hex_2D_o1_node_t.dx"
1021 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1022 x=ReducedSolution(dom).getX()
1023 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_ReducedSolution_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
1024 self.check_dx("hex_contact_2D_order2_ReducedSolution_Tensor.dx",reference)
1025 def test_hex_contact_2D_order2_Function_Scalar_dx(self):
1026 reference="hex_2D_o2_cell_s.dx"
1027 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1028 x=Function(dom).getX()
1029 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Scalar.dx",data=x[0])
1030 self.check_dx("hex_contact_2D_order2_Function_Scalar.dx",reference)
1031 def test_hex_contact_2D_order2_Function_Vector_dx(self):
1032 reference="hex_2D_o2_cell_v.dx"
1033 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1034 x=Function(dom).getX()
1035 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Vector.dx",data=x[0]*[1.,2.])
1036 self.check_dx("hex_contact_2D_order2_Function_Vector.dx",reference)
1037 def test_hex_contact_2D_order2_Function_Tensor_dx(self):
1038 reference="hex_2D_o2_cell_t.dx"
1039 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1040 x=Function(dom).getX()
1041 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_Function_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
1042 self.check_dx("hex_contact_2D_order2_Function_Tensor.dx",reference)
1043 def test_hex_contact_2D_order2_FunctionOnBoundary_Scalar_dx(self):
1044 reference="hex_2D_o2_boundary_s.dx"
1045 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1046 x=FunctionOnBoundary(dom).getX()
1047 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Scalar.dx",data=x[0])
1048 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Scalar.dx",reference)
1049 def test_hex_contact_2D_order2_FunctionOnBoundary_Vector_dx(self):
1050 reference="hex_2D_o2_boundary_v.dx"
1051 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1052 x=FunctionOnBoundary(dom).getX()
1053 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Vector.dx",data=x[0]*[1.,2.])
1054 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Vector.dx",reference)
1055 def test_hex_contact_2D_order2_FunctionOnBoundary_Tensor_dx(self):
1056 reference="hex_2D_o2_boundary_t.dx"
1057 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_2D_order2.msh")
1058 x=FunctionOnBoundary(dom).getX()
1059 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_2D_order2_FunctionOnBoundary_Tensor.dx",data=x[0]*[[11.,12.],[21.,22.]])
1060 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Tensor.dx",reference)
1061 # ======================================================================================================================
1062 def test_hex_contact_3D_order1_ContinuousFunction_Scalar_dx(self):
1063 reference="hex_3D_o1_node_s.dx"
1064 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1065 x=ContinuousFunction(dom).getX()
1066 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Scalar.dx",data=x[0])
1067 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Scalar.dx",reference)
1068 def test_hex_contact_3D_order1_ContinuousFunction_Vector_dx(self):
1069 reference="hex_3D_o1_node_v.dx"
1070 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1071 x=ContinuousFunction(dom).getX()
1072 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Vector.dx",data=x[0]*[1.,2.,3.])
1073 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Vector.dx",reference)
1074 def test_hex_contact_3D_order1_ContinuousFunction_Tensor_dx(self):
1075 reference="hex_3D_o1_node_t.dx"
1076 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1077 x=ContinuousFunction(dom).getX()
1078 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ContinuousFunction_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1079 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Tensor.dx",reference)
1080 def test_hex_contact_3D_order1_Solution_Scalar_dx(self):
1081 reference="hex_3D_o1_node_s.dx"
1082 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1083 x=Solution(dom).getX()
1084 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Scalar.dx",data=x[0])
1085 self.check_dx("hex_contact_3D_order1_Solution_Scalar.dx",reference)
1086 def test_hex_contact_3D_order1_Solution_Vector_dx(self):
1087 reference="hex_3D_o1_node_v.dx"
1088 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1089 x=Solution(dom).getX()
1090 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Vector.dx",data=x[0]*[1.,2.,3.])
1091 self.check_dx("hex_contact_3D_order1_Solution_Vector.dx",reference)
1092 def test_hex_contact_3D_order1_Solution_Tensor_dx(self):
1093 reference="hex_3D_o1_node_t.dx"
1094 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1095 x=Solution(dom).getX()
1096 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Solution_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1097 self.check_dx("hex_contact_3D_order1_Solution_Tensor.dx",reference)
1098 def test_hex_contact_3D_order1_ReducedSolution_Scalar_dx(self):
1099 reference="hex_3D_o1_node_s.dx"
1100 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1101 x=ReducedSolution(dom).getX()
1102 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Scalar.dx",data=x[0])
1103 self.check_dx("hex_contact_3D_order1_ReducedSolution_Scalar.dx",reference)
1104 def test_hex_contact_3D_order1_ReducedSolution_Vector_dx(self):
1105 reference="hex_3D_o1_node_v.dx"
1106 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1107 x=ReducedSolution(dom).getX()
1108 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Vector.dx",data=x[0]*[1.,2.,3.])
1109 self.check_dx("hex_contact_3D_order1_ReducedSolution_Vector.dx",reference)
1110 def test_hex_contact_3D_order1_ReducedSolution_Tensor_dx(self):
1111 reference="hex_3D_o1_node_t.dx"
1112 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1113 x=ReducedSolution(dom).getX()
1114 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_ReducedSolution_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1115 self.check_dx("hex_contact_3D_order1_ReducedSolution_Tensor.dx",reference)
1116 def test_hex_contact_3D_order1_Function_Scalar_dx(self):
1117 reference="hex_3D_o1_cell_s.dx"
1118 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1119 x=Function(dom).getX()
1120 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Scalar.dx",data=x[0])
1121 self.check_dx("hex_contact_3D_order1_Function_Scalar.dx",reference)
1122 def test_hex_contact_3D_order1_Function_Vector_dx(self):
1123 reference="hex_3D_o1_cell_v.dx"
1124 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1125 x=Function(dom).getX()
1126 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Vector.dx",data=x[0]*[1.,2.,3.])
1127 self.check_dx("hex_contact_3D_order1_Function_Vector.dx",reference)
1128 def test_hex_contact_3D_order1_Function_Tensor_dx(self):
1129 reference="hex_3D_o1_cell_t.dx"
1130 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1131 x=Function(dom).getX()
1132 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_Function_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1133 self.check_dx("hex_contact_3D_order1_Function_Tensor.dx",reference)
1134 def test_hex_contact_3D_order1_FunctionOnBoundary_Scalar_dx(self):
1135 reference="hex_3D_o1_boundary_s.dx"
1136 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1137 x=FunctionOnBoundary(dom).getX()
1138 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Scalar.dx",data=x[0])
1139 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Scalar.dx",reference)
1140 def test_hex_contact_3D_order1_FunctionOnBoundary_Vector_dx(self):
1141 reference="hex_3D_o1_boundary_v.dx"
1142 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1143 x=FunctionOnBoundary(dom).getX()
1144 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Vector.dx",data=x[0]*[1.,2.,3.])
1145 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Vector.dx",reference)
1146 def test_hex_contact_3D_order1_FunctionOnBoundary_Tensor_dx(self):
1147 reference="hex_3D_o1_boundary_t.dx"
1148 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order1.msh")
1149 x=FunctionOnBoundary(dom).getX()
1150 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order1_FunctionOnBoundary_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1151 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Tensor.dx",reference)
1152 # ======================================================================================================================
1153 def test_hex_contact_3D_order2_ContinuousFunction_Scalar_dx(self):
1154 reference="hex_3D_o1_node_s.dx"
1155 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1156 x=ContinuousFunction(dom).getX()
1157 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Scalar.dx",data=x[0])
1158 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Scalar.dx",reference)
1159 def test_hex_contact_3D_order2_ContinuousFunction_Vector_dx(self):
1160 reference="hex_3D_o1_node_v.dx"
1161 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1162 x=ContinuousFunction(dom).getX()
1163 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Vector.dx",data=x[0]*[1.,2.,3.])
1164 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Vector.dx",reference)
1165 def test_hex_contact_3D_order2_ContinuousFunction_Tensor_dx(self):
1166 reference="hex_3D_o1_node_t.dx"
1167 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1168 x=ContinuousFunction(dom).getX()
1169 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ContinuousFunction_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1170 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Tensor.dx",reference)
1171 def test_hex_contact_3D_order2_Solution_Scalar_dx(self):
1172 reference="hex_3D_o1_node_s.dx"
1173 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1174 x=Solution(dom).getX()
1175 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Scalar.dx",data=x[0])
1176 self.check_dx("hex_contact_3D_order2_Solution_Scalar.dx",reference)
1177 def test_hex_contact_3D_order2_Solution_Vector_dx(self):
1178 reference="hex_3D_o1_node_v.dx"
1179 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1180 x=Solution(dom).getX()
1181 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Vector.dx",data=x[0]*[1.,2.,3.])
1182 self.check_dx("hex_contact_3D_order2_Solution_Vector.dx",reference)
1183 def test_hex_contact_3D_order2_Solution_Tensor_dx(self):
1184 reference="hex_3D_o1_node_t.dx"
1185 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1186 x=Solution(dom).getX()
1187 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Solution_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1188 self.check_dx("hex_contact_3D_order2_Solution_Tensor.dx",reference)
1189 def test_hex_contact_3D_order2_ReducedSolution_Scalar_dx(self):
1190 reference="hex_3D_o1_node_s.dx"
1191 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1192 x=ReducedSolution(dom).getX()
1193 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Scalar.dx",data=x[0])
1194 self.check_dx("hex_contact_3D_order2_ReducedSolution_Scalar.dx",reference)
1195 def test_hex_contact_3D_order2_ReducedSolution_Vector_dx(self):
1196 reference="hex_3D_o1_node_v.dx"
1197 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1198 x=ReducedSolution(dom).getX()
1199 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Vector.dx",data=x[0]*[1.,2.,3.])
1200 self.check_dx("hex_contact_3D_order2_ReducedSolution_Vector.dx",reference)
1201 def test_hex_contact_3D_order2_ReducedSolution_Tensor_dx(self):
1202 reference="hex_3D_o1_node_t.dx"
1203 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1204 x=ReducedSolution(dom).getX()
1205 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_ReducedSolution_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1206 self.check_dx("hex_contact_3D_order2_ReducedSolution_Tensor.dx",reference)
1207 def test_hex_contact_3D_order2_Function_Scalar_dx(self):
1208 reference="hex_3D_o1_cell_s.dx"
1209 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1210 x=Function(dom).getX()
1211 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Scalar.dx",data=x[0])
1212 self.check_dx("hex_contact_3D_order2_Function_Scalar.dx",reference)
1213 def test_hex_contact_3D_order2_Function_Vector_dx(self):
1214 reference="hex_3D_o1_cell_v.dx"
1215 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1216 x=Function(dom).getX()
1217 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Vector.dx",data=x[0]*[1.,2.,3.])
1218 self.check_dx("hex_contact_3D_order2_Function_Vector.dx",reference)
1219 def test_hex_contact_3D_order2_Function_Tensor_dx(self):
1220 reference="hex_3D_o1_cell_t.dx"
1221 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1222 x=Function(dom).getX()
1223 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_Function_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1224 self.check_dx("hex_contact_3D_order2_Function_Tensor.dx",reference)
1225 def test_hex_contact_3D_order2_FunctionOnBoundary_Scalar_dx(self):
1226 reference="hex_3D_o1_boundary_s.dx"
1227 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1228 x=FunctionOnBoundary(dom).getX()
1229 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Scalar.dx",data=x[0])
1230 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Scalar.dx",reference)
1231 def test_hex_contact_3D_order2_FunctionOnBoundary_Vector_dx(self):
1232 reference="hex_3D_o1_boundary_v.dx"
1233 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1234 x=FunctionOnBoundary(dom).getX()
1235 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Vector.dx",data=x[0]*[1.,2.,3.])
1236 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Vector.dx",reference)
1237 def test_hex_contact_3D_order2_FunctionOnBoundary_Tensor_dx(self):
1238 reference="hex_3D_o1_boundary_t.dx"
1239 dom=ReadMesh(os.environ['FINLEY_TEST_DATA']+"/hex_contact_3D_order2.msh")
1240 x=FunctionOnBoundary(dom).getX()
1241 saveDX(os.environ['FINLEY_WORKDIR']+"/hex_contact_3D_order2_FunctionOnBoundary_Tensor.dx",data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
1242 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Tensor.dx",reference)
1243
1244 if __name__ == '__main__':
1245 suite = unittest.TestSuite()
1246 suite.addTest(unittest.makeSuite(Test_VTKFiles))
1247 suite.addTest(unittest.makeSuite(Test_DXFiles))
1248 s=unittest.TextTestRunner(verbosity=2).run(suite)
1249 if s.wasSuccessful():
1250 sys.exit(0)
1251 else:
1252 sys.exit(1)

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26