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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4576 - (show annotations)
Mon Dec 9 23:35:30 2013 UTC (5 years, 9 months ago) by sshaw
File MIME type: text/x-python
File size: 43245 byte(s)
python3ified things, replaced mixed whitespace and xrange calls
1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2013 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 __copyright__="""Copyright (c) 2003-2013 by University of Queensland
17 http://www.uq.edu.au
18 Primary Business: Queensland, Australia"""
19 __license__="""Licensed under the Open Software License version 3.0
20 http://www.opensource.org/licenses/osl-3.0.php"""
21 __url__="https://launchpad.net/escript-finley"
22
23 import unittest
24 from esys.escript import *
25 from esys.finley import ReadMesh
26
27 try:
28 FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
29 except KeyError:
30 FINLEY_TEST_DATA='.'
31
32 try:
33 FINLEY_WORKDIR=os.environ['FINLEY_WORKDIR']
34 except KeyError:
35 FINLEY_WORKDIR='.'
36
37 FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
38 # if os.name == "nt":
39 # FINLEY_TEST_MESH_PATH = os.path.join(FINLEY_TEST_MESH_PATH,"win32")
40 FINLEY_WORKDIR_PATH=FINLEY_WORKDIR
41
42 class Test_VisualizationInterface(unittest.TestCase):
43 def check_dx(self,f,reference_f):
44 out_string=open(os.path.join(FINLEY_WORKDIR_PATH,f)).read().splitlines()
45 ref_string=open(os.path.join(FINLEY_TEST_MESH_PATH,reference_f)).read().splitlines()
46 c=0
47 for l in range(0,len(ref_string)):
48 if not ref_string[l].strip()[0]=="#":
49 line=out_string[c].strip()
50 if os.name == "nt":
51 line=line.replace("e+00","e+0").replace("e-00","e-0")
52 line=line.replace("e-00","e+00").replace("-0.000000e+00","0.000000e+00")
53 self.assertEqual(line,ref_string[l].strip(),"line %d (%s) in dx file does not match reference (%s)"%(c,line,ref_string[l].strip()))
54 c+=1
55
56 class Test_DXFiles(Test_VisualizationInterface):
57 # ===========================================================================
58 def test_hex_2D_order2_dx(self):
59 reference="hex_2D_o1.dx"
60 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
61 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2.dx"),domain=dom)
62 self.check_dx("hex_2D_order2.dx",reference)
63
64 def test_hex_2D_order2_AllPoints_Scalar_dx(self):
65 reference="hex_2D_o1_node_3xs.dx"
66 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
67 x=Solution(dom).getX()
68 x_r=ReducedSolution(dom).getX()
69 x_n=ContinuousFunction(dom).getX()
70 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2_AllPoints_Scalar.dx"),data_r=x_r[0],data_n=x_n[0],data=x[0])
71 self.check_dx("hex_2D_order2_AllPoints_Scalar.dx",reference)
72 def test_hex_2D_order2_02Points_Scalar_dx(self):
73 reference="hex_2D_o1_node_2xs.dx"
74 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
75 x=Solution(dom).getX()
76 x_n=ContinuousFunction(dom).getX()
77 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2_O2Points_Scalar.dx"),data_n=x_n[0],data=x[0])
78 self.check_dx("hex_2D_order2_O2Points_Scalar.dx",reference)
79 def test_hex_2D_order2_2Cells_Scalar_dx(self):
80 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
81 x=Function(dom).getX()
82 x_b=FunctionOnBoundary(dom).getX()
83 try:
84 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2_2Cells_Scalar.dx"),data=x[0],data_b=x_b[0])
85 self.fail("non-matching data not detected.")
86 except Exception:
87 pass
88 def test_hex_2D_order2_BoundaryPoint_Scalar_dx(self):
89 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
90 x=ContinuousFunction(dom).getX()
91 x_b=FunctionOnBoundary(dom).getX()
92 try:
93 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2_BoundaryPoint_Scalar.dx"),data=x[0],data_b=x_b[0])
94 self.fail("non-matching data not detected.")
95 except Exception:
96 pass
97 def test_hex_2D_order2_Cells_AllData_dx(self):
98 reference="hex_2D_o1_cell_all.dx"
99 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
100 x=Function(dom).getX()
101 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"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.]])
102 self.check_dx("hex_2D_order2_Cells_AllData.dx",reference)
103
104 def test_hex_2D_order2_CellsPoints_AllData_dx(self):
105 reference="hex_2D_o1_cellnode_all.dx"
106 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_2D_order2.msh"),optimize=False)
107 x_c=Function(dom).getX()
108 x_p=ContinuousFunction(dom).getX()
109 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_2D_order2_CellsPoints_AllData.dx"),data_sp=x_p[0],
110 data_vp=x_p[0]*[1.,2.],
111 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
112 data_sc=x_c[0],
113 data_vc=x_c[0]*[1.,2.],
114 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
115 self.check_dx("hex_2D_order2_CellsPoints_AllData.dx",reference)
116 # ======================================================================================================================
117 def test_hex_contact_2D_order1_ContinuousFunction_Scalar_dx(self):
118 reference="hex_2D_o1_node_s.dx"
119 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
120 x=ContinuousFunction(dom).getX()
121 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ContinuousFunction_Scalar.dx"),data=x[0])
122 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Scalar.dx",reference)
123 def test_hex_contact_2D_order1_ContinuousFunction_Vector_dx(self):
124 reference="hex_2D_o1_node_v.dx"
125 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
126 x=ContinuousFunction(dom).getX()
127 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ContinuousFunction_Vector.dx"),data=x[0]*[1.,2.])
128 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Vector.dx",reference)
129 def test_hex_contact_2D_order1_ContinuousFunction_Tensor_dx(self):
130 reference="hex_2D_o1_node_t.dx"
131 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
132 x=ContinuousFunction(dom).getX()
133 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ContinuousFunction_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
134 self.check_dx("hex_contact_2D_order1_ContinuousFunction_Tensor.dx",reference)
135 def test_hex_contact_2D_order1_Solution_Scalar_dx(self):
136 reference="hex_2D_o1_node_s.dx"
137 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
138 x=Solution(dom).getX()
139 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Solution_Scalar.dx"),data=x[0])
140 self.check_dx("hex_contact_2D_order1_Solution_Scalar.dx",reference)
141 def test_hex_contact_2D_order1_Solution_Vector_dx(self):
142 reference="hex_2D_o1_node_v.dx"
143 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
144 x=Solution(dom).getX()
145 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Solution_Vector.dx"),data=x[0]*[1.,2.])
146 self.check_dx("hex_contact_2D_order1_Solution_Vector.dx",reference)
147 def test_hex_contact_2D_order1_Solution_Tensor_dx(self):
148 reference="hex_2D_o1_node_t.dx"
149 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
150 x=Solution(dom).getX()
151 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Solution_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
152 self.check_dx("hex_contact_2D_order1_Solution_Tensor.dx",reference)
153 def test_hex_contact_2D_order1_ReducedSolution_Scalar_dx(self):
154 reference="hex_2D_o1_node_s.dx"
155 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
156 x=ReducedSolution(dom).getX()
157 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedSolution_Scalar.dx"),data=x[0])
158 self.check_dx("hex_contact_2D_order1_ReducedSolution_Scalar.dx",reference)
159 def test_hex_contact_2D_order1_ReducedSolution_Vector_dx(self):
160 reference="hex_2D_o1_node_v.dx"
161 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
162 x=ReducedSolution(dom).getX()
163 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedSolution_Vector.dx"),data=x[0]*[1.,2.])
164 self.check_dx("hex_contact_2D_order1_ReducedSolution_Vector.dx",reference)
165 def test_hex_contact_2D_order1_ReducedSolution_Tensor_dx(self):
166 reference="hex_2D_o1_node_t.dx"
167 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
168 x=ReducedSolution(dom).getX()
169 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedSolution_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
170 self.check_dx("hex_contact_2D_order1_ReducedSolution_Tensor.dx",reference)
171 def test_hex_contact_2D_order1_Function_Scalar_dx(self):
172 reference="hex_2D_o1_cell_s.dx"
173 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
174 x=Function(dom).getX()
175 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Function_Scalar.dx"),data=x[0])
176 self.check_dx("hex_contact_2D_order1_Function_Scalar.dx",reference)
177 def test_hex_contact_2D_order1_Function_Vector_dx(self):
178 reference="hex_2D_o1_cell_v.dx"
179 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
180 x=Function(dom).getX()
181 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Function_Vector.dx"),data=x[0]*[1.,2.])
182 self.check_dx("hex_contact_2D_order1_Function_Vector.dx",reference)
183 def test_hex_contact_2D_order1_Function_Tensor_dx(self):
184 reference="hex_2D_o1_cell_t.dx"
185 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
186 x=Function(dom).getX()
187 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_Function_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
188 self.check_dx("hex_contact_2D_order1_Function_Tensor.dx",reference)
189 def test_hex_contact_2D_order1_ReducedFunction_Scalar_dx(self):
190 reference="hex_2D_o1_cell_s.dx"
191 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
192 x=ReducedFunction(dom).getX()
193 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunction_Scalar.dx"),data=x[0])
194 self.check_dx("hex_contact_2D_order1_ReducedFunction_Scalar.dx",reference)
195 def test_hex_contact_2D_order1_ReducedFunction_Vector_dx(self):
196 reference="hex_2D_o1_cell_v.dx"
197 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
198 x=ReducedFunction(dom).getX()
199 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunction_Vector.dx"),data=x[0]*[1.,2.])
200 self.check_dx("hex_contact_2D_order1_ReducedFunction_Vector.dx",reference)
201 def test_hex_contact_2D_order1_ReducedFunction_Tensor_dx(self):
202 reference="hex_2D_o1_cell_t.dx"
203 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
204 x=ReducedFunction(dom).getX()
205 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunction_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
206 self.check_dx("hex_contact_2D_order1_ReducedFunction_Tensor.dx",reference)
207 def test_hex_contact_2D_order1_FunctionOnBoundary_Scalar_dx(self):
208 reference="hex_2D_o1_boundary_s.dx"
209 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
210 x=FunctionOnBoundary(dom).getX()
211 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_FunctionOnBoundary_Scalar.dx"),data=x[0])
212 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Scalar.dx",reference)
213 def test_hex_contact_2D_order1_FunctionOnBoundary_Vector_dx(self):
214 reference="hex_2D_o1_boundary_v.dx"
215 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
216 x=FunctionOnBoundary(dom).getX()
217 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_FunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.])
218 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Vector.dx",reference)
219 def test_hex_contact_2D_order1_FunctionOnBoundary_Tensor_dx(self):
220 reference="hex_2D_o1_boundary_t.dx"
221 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
222 x=FunctionOnBoundary(dom).getX()
223 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_FunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
224 self.check_dx("hex_contact_2D_order1_FunctionOnBoundary_Tensor.dx",reference)
225 def test_hex_contact_2D_order1_ReducedFunctionOnBoundary_Scalar_dx(self):
226 reference="hex_2D_o1_boundary_s.dx"
227 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
228 x=ReducedFunctionOnBoundary(dom).getX()
229 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunctionOnBoundary_Scalar.dx"),data=x[0])
230 self.check_dx("hex_contact_2D_order1_ReducedFunctionOnBoundary_Scalar.dx",reference)
231 def test_hex_contact_2D_order1_ReducedFunctionOnBoundary_Vector_dx(self):
232 reference="hex_2D_o1_boundary_v.dx"
233 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
234 x=ReducedFunctionOnBoundary(dom).getX()
235 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.])
236 self.check_dx("hex_contact_2D_order1_ReducedFunctionOnBoundary_Vector.dx",reference)
237 def test_hex_contact_2D_order1_ReducedFunctionOnBoundary_Tensor_dx(self):
238 reference="hex_2D_o1_boundary_t.dx"
239 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order1.msh"),optimize=False)
240 x=ReducedFunctionOnBoundary(dom).getX()
241 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order1_ReducedFunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
242 self.check_dx("hex_contact_2D_order1_ReducedFunctionOnBoundary_Tensor.dx",reference)
243 # ======================================================================================================================
244 def test_hex_contact_2D_order2_ContinuousFunction_Scalar_dx(self):
245 reference="hex_2D_o2_node_s.dx"
246 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
247 x=ContinuousFunction(dom).getX()
248 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ContinuousFunction_Scalar.dx"),data=x[0])
249 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Scalar.dx",reference)
250 def test_hex_contact_2D_order2_ContinuousFunction_Vector_dx(self):
251 reference="hex_2D_o2_node_v.dx"
252 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
253 x=ContinuousFunction(dom).getX()
254 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ContinuousFunction_Vector.dx"),data=x[0]*[1.,2.])
255 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Vector.dx",reference)
256 def test_hex_contact_2D_order2_ContinuousFunction_Tensor_dx(self):
257 reference="hex_2D_o2_node_t.dx"
258 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
259 x=ContinuousFunction(dom).getX()
260 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ContinuousFunction_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
261 self.check_dx("hex_contact_2D_order2_ContinuousFunction_Tensor.dx",reference)
262 def test_hex_contact_2D_order2_Solution_Scalar_dx(self):
263 reference="hex_2D_o2_node_s.dx"
264 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
265 x=Solution(dom).getX()
266 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Solution_Scalar.dx"),data=x[0])
267 self.check_dx("hex_contact_2D_order2_Solution_Scalar.dx",reference)
268 def test_hex_contact_2D_order2_Solution_Vector_dx(self):
269 reference="hex_2D_o2_node_v.dx"
270 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
271 x=Solution(dom).getX()
272 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Solution_Vector.dx"),data=x[0]*[1.,2.])
273 self.check_dx("hex_contact_2D_order2_Solution_Vector.dx",reference)
274 def test_hex_contact_2D_order2_Solution_Tensor_dx(self):
275 reference="hex_2D_o2_node_t.dx"
276 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
277 x=Solution(dom).getX()
278 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Solution_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
279 self.check_dx("hex_contact_2D_order2_Solution_Tensor.dx",reference)
280 def test_hex_contact_2D_order2_ReducedSolution_Scalar_dx(self):
281 reference="hex_2D_o1_node_s.dx"
282 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
283 x=ReducedSolution(dom).getX()
284 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedSolution_Scalar.dx"),data=x[0])
285 self.check_dx("hex_contact_2D_order2_ReducedSolution_Scalar.dx",reference)
286 def test_hex_contact_2D_order2_ReducedSolution_Vector_dx(self):
287 reference="hex_2D_o1_node_v.dx"
288 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
289 x=ReducedSolution(dom).getX()
290 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedSolution_Vector.dx"),data=x[0]*[1.,2.])
291 self.check_dx("hex_contact_2D_order2_ReducedSolution_Vector.dx",reference)
292 def test_hex_contact_2D_order2_ReducedSolution_Tensor_dx(self):
293 reference="hex_2D_o1_node_t.dx"
294 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
295 x=ReducedSolution(dom).getX()
296 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedSolution_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
297 self.check_dx("hex_contact_2D_order2_ReducedSolution_Tensor.dx",reference)
298 def test_hex_contact_2D_order2_Function_Scalar_dx(self):
299 reference="hex_2D_o2_cell_s.dx"
300 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
301 x=Function(dom).getX()
302 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Function_Scalar.dx"),data=x[0])
303 self.check_dx("hex_contact_2D_order2_Function_Scalar.dx",reference)
304 def test_hex_contact_2D_order2_Function_Vector_dx(self):
305 reference="hex_2D_o2_cell_v.dx"
306 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
307 x=Function(dom).getX()
308 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Function_Vector.dx"),data=x[0]*[1.,2.])
309 self.check_dx("hex_contact_2D_order2_Function_Vector.dx",reference)
310 def test_hex_contact_2D_order2_Function_Tensor_dx(self):
311 reference="hex_2D_o2_cell_t.dx"
312 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
313 x=Function(dom).getX()
314 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_Function_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
315 self.check_dx("hex_contact_2D_order2_Function_Tensor.dx",reference)
316 def test_hex_contact_2D_order2_ReducedFunction_Scalar_dx(self):
317 reference="hex_2D_o2_cell_s.dx"
318 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
319 x=ReducedFunction(dom).getX()
320 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunction_Scalar.dx"),data=x[0])
321 self.check_dx("hex_contact_2D_order2_ReducedFunction_Scalar.dx",reference)
322 def test_hex_contact_2D_order2_ReducedFunction_Vector_dx(self):
323 reference="hex_2D_o2_cell_v.dx"
324 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
325 x=ReducedFunction(dom).getX()
326 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunction_Vector.dx"),data=x[0]*[1.,2.])
327 self.check_dx("hex_contact_2D_order2_ReducedFunction_Vector.dx",reference)
328 def test_hex_contact_2D_order2_ReducedFunction_Tensor_dx(self):
329 reference="hex_2D_o2_cell_t.dx"
330 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
331 x=ReducedFunction(dom).getX()
332 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunction_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
333 self.check_dx("hex_contact_2D_order2_ReducedFunction_Tensor.dx",reference)
334 def test_hex_contact_2D_order2_FunctionOnBoundary_Scalar_dx(self):
335 reference="hex_2D_o2_boundary_s.dx"
336 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
337 x=FunctionOnBoundary(dom).getX()
338 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_FunctionOnBoundary_Scalar.dx"),data=x[0])
339 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Scalar.dx",reference)
340 def test_hex_contact_2D_order2_FunctionOnBoundary_Vector_dx(self):
341 reference="hex_2D_o2_boundary_v.dx"
342 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
343 x=FunctionOnBoundary(dom).getX()
344 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_FunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.])
345 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Vector.dx",reference)
346 def test_hex_contact_2D_order2_FunctionOnBoundary_Tensor_dx(self):
347 reference="hex_2D_o2_boundary_t.dx"
348 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
349 x=FunctionOnBoundary(dom).getX()
350 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_FunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
351 self.check_dx("hex_contact_2D_order2_FunctionOnBoundary_Tensor.dx",reference)
352 def test_hex_contact_2D_order2_ReducedFunctionOnBoundary_Scalar_dx(self):
353 reference="hex_2D_o2_boundary_s.dx"
354 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
355 x=ReducedFunctionOnBoundary(dom).getX()
356 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunctionOnBoundary_Scalar.dx"),data=x[0])
357 self.check_dx("hex_contact_2D_order2_ReducedFunctionOnBoundary_Scalar.dx",reference)
358 def test_hex_contact_2D_order2_ReducedFunctionOnBoundary_Vector_dx(self):
359 reference="hex_2D_o2_boundary_v.dx"
360 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
361 x=ReducedFunctionOnBoundary(dom).getX()
362 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.])
363 self.check_dx("hex_contact_2D_order2_ReducedFunctionOnBoundary_Vector.dx",reference)
364 def test_hex_contact_2D_order2_ReducedFunctionOnBoundary_Tensor_dx(self):
365 reference="hex_2D_o2_boundary_t.dx"
366 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_2D_order2.msh"),optimize=False)
367 x=ReducedFunctionOnBoundary(dom).getX()
368 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_2D_order2_ReducedFunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.],[21.,22.]])
369 self.check_dx("hex_contact_2D_order2_ReducedFunctionOnBoundary_Tensor.dx",reference)
370 # ======================================================================================================================
371 def test_hex_contact_3D_order1_ContinuousFunction_Scalar_dx(self):
372 reference="hex_3D_o1_node_s.dx"
373 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
374 x=ContinuousFunction(dom).getX()
375 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ContinuousFunction_Scalar.dx"),data=x[0])
376 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Scalar.dx",reference)
377 def test_hex_contact_3D_order1_ContinuousFunction_Vector_dx(self):
378 reference="hex_3D_o1_node_v.dx"
379 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
380 x=ContinuousFunction(dom).getX()
381 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ContinuousFunction_Vector.dx"),data=x[0]*[1.,2.,3.])
382 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Vector.dx",reference)
383 def test_hex_contact_3D_order1_ContinuousFunction_Tensor_dx(self):
384 reference="hex_3D_o1_node_t.dx"
385 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
386 x=ContinuousFunction(dom).getX()
387 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ContinuousFunction_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
388 self.check_dx("hex_contact_3D_order1_ContinuousFunction_Tensor.dx",reference)
389 def test_hex_contact_3D_order1_Solution_Scalar_dx(self):
390 reference="hex_3D_o1_node_s.dx"
391 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
392 x=Solution(dom).getX()
393 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Solution_Scalar.dx"),data=x[0])
394 self.check_dx("hex_contact_3D_order1_Solution_Scalar.dx",reference)
395 def test_hex_contact_3D_order1_Solution_Vector_dx(self):
396 reference="hex_3D_o1_node_v.dx"
397 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
398 x=Solution(dom).getX()
399 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Solution_Vector.dx"),data=x[0]*[1.,2.,3.])
400 self.check_dx("hex_contact_3D_order1_Solution_Vector.dx",reference)
401 def test_hex_contact_3D_order1_Solution_Tensor_dx(self):
402 reference="hex_3D_o1_node_t.dx"
403 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
404 x=Solution(dom).getX()
405 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Solution_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
406 self.check_dx("hex_contact_3D_order1_Solution_Tensor.dx",reference)
407 def test_hex_contact_3D_order1_ReducedSolution_Scalar_dx(self):
408 reference="hex_3D_o1_node_s.dx"
409 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
410 x=ReducedSolution(dom).getX()
411 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedSolution_Scalar.dx"),data=x[0])
412 self.check_dx("hex_contact_3D_order1_ReducedSolution_Scalar.dx",reference)
413 def test_hex_contact_3D_order1_ReducedSolution_Vector_dx(self):
414 reference="hex_3D_o1_node_v.dx"
415 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
416 x=ReducedSolution(dom).getX()
417 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedSolution_Vector.dx"),data=x[0]*[1.,2.,3.])
418 self.check_dx("hex_contact_3D_order1_ReducedSolution_Vector.dx",reference)
419 def test_hex_contact_3D_order1_ReducedSolution_Tensor_dx(self):
420 reference="hex_3D_o1_node_t.dx"
421 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
422 x=ReducedSolution(dom).getX()
423 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedSolution_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
424 self.check_dx("hex_contact_3D_order1_ReducedSolution_Tensor.dx",reference)
425 def test_hex_contact_3D_order1_Function_Scalar_dx(self):
426 reference="hex_3D_o1_cell_s.dx"
427 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
428 x=Function(dom).getX()
429 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Function_Scalar.dx"),data=x[0])
430 self.check_dx("hex_contact_3D_order1_Function_Scalar.dx",reference)
431 def test_hex_contact_3D_order1_Function_Vector_dx(self):
432 reference="hex_3D_o1_cell_v.dx"
433 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
434 x=Function(dom).getX()
435 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Function_Vector.dx"),data=x[0]*[1.,2.,3.])
436 self.check_dx("hex_contact_3D_order1_Function_Vector.dx",reference)
437 def test_hex_contact_3D_order1_Function_Tensor_dx(self):
438 reference="hex_3D_o1_cell_t.dx"
439 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
440 x=Function(dom).getX()
441 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_Function_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
442 self.check_dx("hex_contact_3D_order1_Function_Tensor.dx",reference)
443 def test_hex_contact_3D_order1_ReducedFunction_Scalar_dx(self):
444 reference="hex_3D_o1_cell_s.dx"
445 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
446 x=ReducedFunction(dom).getX()
447 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunction_Scalar.dx"),data=x[0])
448 self.check_dx("hex_contact_3D_order1_ReducedFunction_Scalar.dx",reference)
449 def test_hex_contact_3D_order1_ReducedFunction_Vector_dx(self):
450 reference="hex_3D_o1_cell_v.dx"
451 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
452 x=ReducedFunction(dom).getX()
453 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunction_Vector.dx"),data=x[0]*[1.,2.,3.])
454 self.check_dx("hex_contact_3D_order1_ReducedFunction_Vector.dx",reference)
455 def test_hex_contact_3D_order1_ReducedFunction_Tensor_dx(self):
456 reference="hex_3D_o1_cell_t.dx"
457 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
458 x=ReducedFunction(dom).getX()
459 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunction_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
460 self.check_dx("hex_contact_3D_order1_ReducedFunction_Tensor.dx",reference)
461 def test_hex_contact_3D_order1_FunctionOnBoundary_Scalar_dx(self):
462 reference="hex_3D_o1_boundary_s.dx"
463 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
464 x=FunctionOnBoundary(dom).getX()
465 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_FunctionOnBoundary_Scalar.dx"),data=x[0])
466 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Scalar.dx",reference)
467 def test_hex_contact_3D_order1_FunctionOnBoundary_Vector_dx(self):
468 reference="hex_3D_o1_boundary_v.dx"
469 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
470 x=FunctionOnBoundary(dom).getX()
471 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_FunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.,3.])
472 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Vector.dx",reference)
473 def test_hex_contact_3D_order1_FunctionOnBoundary_Tensor_dx(self):
474 reference="hex_3D_o1_boundary_t.dx"
475 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
476 x=FunctionOnBoundary(dom).getX()
477 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_FunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
478 self.check_dx("hex_contact_3D_order1_FunctionOnBoundary_Tensor.dx",reference)
479 def test_hex_contact_3D_order1_ReducedFunctionOnBoundary_Scalar_dx(self):
480 reference="hex_3D_o1_boundary_s.dx"
481 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
482 x=ReducedFunctionOnBoundary(dom).getX()
483 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunctionOnBoundary_Scalar.dx"),data=x[0])
484 self.check_dx("hex_contact_3D_order1_ReducedFunctionOnBoundary_Scalar.dx",reference)
485 def test_hex_contact_3D_order1_ReducedFunctionOnBoundary_Vector_dx(self):
486 reference="hex_3D_o1_boundary_v.dx"
487 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
488 x=ReducedFunctionOnBoundary(dom).getX()
489 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.,3.])
490 self.check_dx("hex_contact_3D_order1_ReducedFunctionOnBoundary_Vector.dx",reference)
491 def test_hex_contact_3D_order1_ReducedFunctionOnBoundary_Tensor_dx(self):
492 reference="hex_3D_o1_boundary_t.dx"
493 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order1.msh"),optimize=False)
494 x=ReducedFunctionOnBoundary(dom).getX()
495 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order1_ReducedFunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
496 self.check_dx("hex_contact_3D_order1_ReducedFunctionOnBoundary_Tensor.dx",reference)
497 # ======================================================================================================================
498 def test_hex_contact_3D_order2_ContinuousFunction_Scalar_dx(self):
499 reference="hex_3D_o1_node_s.dx"
500 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
501 x=ContinuousFunction(dom).getX()
502 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ContinuousFunction_Scalar.dx"),data=x[0])
503 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Scalar.dx",reference)
504 def test_hex_contact_3D_order2_ContinuousFunction_Vector_dx(self):
505 reference="hex_3D_o1_node_v.dx"
506 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
507 x=ContinuousFunction(dom).getX()
508 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ContinuousFunction_Vector.dx"),data=x[0]*[1.,2.,3.])
509 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Vector.dx",reference)
510 def test_hex_contact_3D_order2_ContinuousFunction_Tensor_dx(self):
511 reference="hex_3D_o1_node_t.dx"
512 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
513 x=ContinuousFunction(dom).getX()
514 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ContinuousFunction_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
515 self.check_dx("hex_contact_3D_order2_ContinuousFunction_Tensor.dx",reference)
516 def test_hex_contact_3D_order2_Solution_Scalar_dx(self):
517 reference="hex_3D_o1_node_s.dx"
518 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
519 x=Solution(dom).getX()
520 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Solution_Scalar.dx"),data=x[0])
521 self.check_dx("hex_contact_3D_order2_Solution_Scalar.dx",reference)
522 def test_hex_contact_3D_order2_Solution_Vector_dx(self):
523 reference="hex_3D_o1_node_v.dx"
524 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
525 x=Solution(dom).getX()
526 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Solution_Vector.dx"),data=x[0]*[1.,2.,3.])
527 self.check_dx("hex_contact_3D_order2_Solution_Vector.dx",reference)
528 def test_hex_contact_3D_order2_Solution_Tensor_dx(self):
529 reference="hex_3D_o1_node_t.dx"
530 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
531 x=Solution(dom).getX()
532 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Solution_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
533 self.check_dx("hex_contact_3D_order2_Solution_Tensor.dx",reference)
534 def test_hex_contact_3D_order2_ReducedSolution_Scalar_dx(self):
535 reference="hex_3D_o1_node_s.dx"
536 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
537 x=ReducedSolution(dom).getX()
538 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedSolution_Scalar.dx"),data=x[0])
539 self.check_dx("hex_contact_3D_order2_ReducedSolution_Scalar.dx",reference)
540 def test_hex_contact_3D_order2_ReducedSolution_Vector_dx(self):
541 reference="hex_3D_o1_node_v.dx"
542 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
543 x=ReducedSolution(dom).getX()
544 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedSolution_Vector.dx"),data=x[0]*[1.,2.,3.])
545 self.check_dx("hex_contact_3D_order2_ReducedSolution_Vector.dx",reference)
546 def test_hex_contact_3D_order2_ReducedSolution_Tensor_dx(self):
547 reference="hex_3D_o1_node_t.dx"
548 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
549 x=ReducedSolution(dom).getX()
550 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedSolution_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
551 self.check_dx("hex_contact_3D_order2_ReducedSolution_Tensor.dx",reference)
552 def test_hex_contact_3D_order2_Function_Scalar_dx(self):
553 reference="hex_3D_o1_cell_s.dx"
554 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
555 x=Function(dom).getX()
556 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Function_Scalar.dx"),data=x[0])
557 self.check_dx("hex_contact_3D_order2_Function_Scalar.dx",reference)
558 def test_hex_contact_3D_order2_Function_Vector_dx(self):
559 reference="hex_3D_o1_cell_v.dx"
560 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
561 x=Function(dom).getX()
562 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Function_Vector.dx"),data=x[0]*[1.,2.,3.])
563 self.check_dx("hex_contact_3D_order2_Function_Vector.dx",reference)
564 def test_hex_contact_3D_order2_Function_Tensor_dx(self):
565 reference="hex_3D_o1_cell_t.dx"
566 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
567 x=Function(dom).getX()
568 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_Function_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
569 self.check_dx("hex_contact_3D_order2_Function_Tensor.dx",reference)
570 def test_hex_contact_3D_order2_ReducedFunction_Scalar_dx(self):
571 reference="hex_3D_o1_cell_s.dx"
572 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
573 x=ReducedFunction(dom).getX()
574 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunction_Scalar.dx"),data=x[0])
575 self.check_dx("hex_contact_3D_order2_ReducedFunction_Scalar.dx",reference)
576 def test_hex_contact_3D_order2_ReducedFunction_Vector_dx(self):
577 reference="hex_3D_o1_cell_v.dx"
578 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
579 x=ReducedFunction(dom).getX()
580 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunction_Vector.dx"),data=x[0]*[1.,2.,3.])
581 self.check_dx("hex_contact_3D_order2_ReducedFunction_Vector.dx",reference)
582 def test_hex_contact_3D_order2_ReducedFunction_Tensor_dx(self):
583 reference="hex_3D_o1_cell_t.dx"
584 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
585 x=ReducedFunction(dom).getX()
586 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunction_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
587 self.check_dx("hex_contact_3D_order2_ReducedFunction_Tensor.dx",reference)
588 def test_hex_contact_3D_order2_FunctionOnBoundary_Scalar_dx(self):
589 reference="hex_3D_o1_boundary_s.dx"
590 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
591 x=FunctionOnBoundary(dom).getX()
592 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_FunctionOnBoundary_Scalar.dx"),data=x[0])
593 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Scalar.dx",reference)
594 def test_hex_contact_3D_order2_FunctionOnBoundary_Vector_dx(self):
595 reference="hex_3D_o1_boundary_v.dx"
596 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
597 x=FunctionOnBoundary(dom).getX()
598 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_FunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.,3.])
599 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Vector.dx",reference)
600 def test_hex_contact_3D_order2_FunctionOnBoundary_Tensor_dx(self):
601 reference="hex_3D_o1_boundary_t.dx"
602 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
603 x=FunctionOnBoundary(dom).getX()
604 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_FunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
605 self.check_dx("hex_contact_3D_order2_FunctionOnBoundary_Tensor.dx",reference)
606 def test_hex_contact_3D_order2_ReducedFunctionOnBoundary_Scalar_dx(self):
607 reference="hex_3D_o1_boundary_s.dx"
608 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
609 x=ReducedFunctionOnBoundary(dom).getX()
610 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunctionOnBoundary_Scalar.dx"),data=x[0])
611 self.check_dx("hex_contact_3D_order2_ReducedFunctionOnBoundary_Scalar.dx",reference)
612 def test_hex_contact_3D_order2_ReducedFunctionOnBoundary_Vector_dx(self):
613 reference="hex_3D_o1_boundary_v.dx"
614 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
615 x=ReducedFunctionOnBoundary(dom).getX()
616 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunctionOnBoundary_Vector.dx"),data=x[0]*[1.,2.,3.])
617 self.check_dx("hex_contact_3D_order2_ReducedFunctionOnBoundary_Vector.dx",reference)
618 def test_hex_contact_3D_order2_ReducedFunctionOnBoundary_Tensor_dx(self):
619 reference="hex_3D_o1_boundary_t.dx"
620 dom=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"hex_contact_3D_order2.msh"),optimize=False)
621 x=ReducedFunctionOnBoundary(dom).getX()
622 saveDX(os.path.join(FINLEY_WORKDIR_PATH,"hex_contact_3D_order2_ReducedFunctionOnBoundary_Tensor.dx"),data=x[0]*[[11.,12.,13.],[21.,22.,23],[31.,32.,33.]])
623 self.check_dx("hex_contact_3D_order2_ReducedFunctionOnBoundary_Tensor.dx",reference)
624
625 if __name__ == '__main__':
626 import sys
627 suite = unittest.TestSuite()
628 # saveDX is not MPI parallel
629 if getMPISizeWorld() == 1:
630 suite.addTest(unittest.makeSuite(Test_DXFiles))
631 pass
632 else:
633 print("Test_DXFiles is dropped as number of processors >1")
634 s=unittest.TextTestRunner(verbosity=2).run(suite)
635 if not s.wasSuccessful(): sys.exit(1)

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26