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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 617 - (show annotations)
Wed Mar 22 02:58:17 2006 UTC (13 years, 8 months ago) by elspeth
File MIME type: text/x-python
File size: 78253 byte(s)
More copyright.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26