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

Contents of /trunk-mpi-branch/finley/test/python/run_visualization_interface.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations)
Tue Oct 25 01:51:20 2005 UTC (14 years, 1 month ago) by jgs
Original Path: trunk/esys2/finley/test/python/test_visualization_interface.py
File MIME type: text/x-python
File size: 77965 byte(s)
Merge of development branch dev-02 back to main trunk on 2005-10-25

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26