/[escript]/trunk/weipa/test/python/run_savesilo_tests.py
ViewVC logotype

Contents of /trunk/weipa/test/python/run_savesilo_tests.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4938 - (show annotations)
Wed May 14 01:13:23 2014 UTC (5 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 78269 byte(s)
Modify unit tests to read their classes from
esys.escriptcore.utestselect

Change the line in that file to switch between unittest and unittest2


1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2014 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 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 __copyright__="""Copyright (c) 2003-2014 by University of Queensland
18 http://www.uq.edu.au
19 Primary Business: Queensland, Australia"""
20 __license__="""Licensed under the Open Software License version 3.0
21 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
23
24 import os, math
25 import esys.escriptcore.utestselect as unittest
26 try:
27 import Silo
28 HAVE_SILO=True
29 except ImportError:
30 HAVE_SILO=False
31
32 from esys.escript import ContinuousFunction, Function, ReducedFunction,\
33 FunctionOnBoundary, ReducedFunctionOnBoundary,\
34 FunctionOnContactZero, ReducedFunctionOnContactZero,\
35 FunctionOnContactOne, ReducedFunctionOnContactOne,\
36 Solution, ReducedSolution, getMPISizeWorld
37 from esys import dudley,finley,ripley
38 from esys.weipa import saveSilo
39
40 try:
41 WEIPA_TEST_MESHES=os.environ['WEIPA_TEST_MESHES']
42 except KeyError:
43 WEIPA_TEST_MESHES='meshes'
44
45 try:
46 WEIPA_WORKDIR=os.environ['WEIPA_WORKDIR']
47 except KeyError:
48 WEIPA_WORKDIR='.'
49
50 class SiloReader():
51 """
52 Silo file reader that uses the Python interface to the Silo library.
53 """
54 def __init__(self):
55 self.f=None
56
57 def open(self, filename):
58 try:
59 self.f=Silo.Open(filename)
60 self.filename=filename
61 return True
62 except:
63 return False
64
65 def close(self):
66 if self.f:
67 self.f.Close()
68
69 def getDirNames(self):
70 return self.f.GetToc().dir_names
71
72 def setDir(self, dirname):
73 self.f.SetDir(dirname)
74
75 def getTimeAndCycle(self):
76 return self.f.GetVar('dtime'), self.f.GetVar('cycle')
77
78 def getElementNames(self):
79 names=[]
80 for v in self.f.GetToc().var_names:
81 if v.endswith('_coord0'):
82 names.append(v[:-7])
83 return names
84
85 def getCellCoords(self, elementName):
86 ret=()
87 for i in range(3):
88 try:
89 data=self.f.GetVar("%s_coord%d"%(elementName,i))
90 ret+=data,
91 except:
92 ret+=None,
93 return ret
94
95 def getCellExtents(self, elementName):
96 ret=()
97 for i in ('min','max'):
98 try:
99 data=self.f.GetVar("%s_%s_extents"%(elementName,i))
100 ret+=data,
101 except:
102 ret+=None,
103 return ret
104
105 def getCellNodeList(self, elementName):
106 try:
107 return self.f.GetVar("%s_zones_nodelist"%elementName)
108 except:
109 return None
110
111 def getCellShapeInfo(self, elementName):
112 infoNames=('zones_shapecnt', 'zones_shapesize', 'zones_shapetype')
113 ret=()
114 for n in infoNames:
115 try:
116 data=self.f.GetVar("%s_%s"%(elementName,n))
117 ret+=data,
118 except:
119 ret+=None,
120 return ret
121
122 def getData(self):
123 data={}
124 names=self.f.GetToc().var_names
125 for v in names:
126 if v[-5:]=='_data':
127 data[v[:-5]] = self.f.GetVar(v)
128 return data
129
130
131 class Test_SiloSaver(unittest.TestCase):
132 def numericCompareL2(self, vector1, vector2):
133 """
134 Compares two lists of numbers using the L2 norm, returns true if they
135 match up to a tolerance TOL, false otherwise
136 """
137 if vector2 == None: return False
138 TOL = 2.0e-5
139 try:
140 l1=len(vector1)
141 except TypeError:
142 vector1=[vector1]
143 try:
144 l2=len(vector2)
145 except TypeError:
146 vector2=[vector2]
147 if len(vector1) != len(vector2): return False
148 diff = 0.0
149 for i in range(0, len(vector1)):
150 tmp = vector1[i] - vector2[i]
151 diff += tmp * tmp
152 if math.sqrt(diff) > TOL: return False
153 return True
154
155 def compareSiloFiles(self, file1, file2):
156 """
157 Compares two Silo files, asserts if any element is not equal.
158 file2 is the reference file to compare against
159 """
160 p1=SiloReader()
161 p2=SiloReader()
162 self.assertTrue(p1.open(file1), "Invalid Silo file '%s'"%file1)
163 p2.open(file2)
164 self.assertEqual(p1.getTimeAndCycle(), p2.getTimeAndCycle())
165
166 dirNames1=p1.getDirNames()
167 dirNames2=p2.getDirNames()
168 for dirName in dirNames2:
169 self.assertTrue(dirName in dirNames1, "Silo file is missing directories")
170 p1.setDir('/block0000')
171 p2.setDir('/block0000')
172
173 elementNames1=p1.getElementNames()
174 elementNames2=p2.getElementNames()
175
176 for elementName in elementNames2:
177 self.assertTrue(elementName in elementNames1, "Mesh '%s' missing in Silo file"%elementName)
178
179 cx1,cy1,cz1=p1.getCellCoords(elementName)
180 cx2,cy2,cz2=p2.getCellCoords(elementName)
181 self.assertEqual(len(cx1), len(cx2))
182 self.assertEqual(len(cy1), len(cy2))
183 if cz2 is not None:
184 self.assertEqual(len(cz1), len(cz2))
185 coords1=zip(cx1,cy1,cz1)
186 coords2=zip(cx2,cy2,cz2)
187 else:
188 coords1=zip(cx1,cy1)
189 coords2=zip(cx2,cy2)
190
191 # Find mapping of nodes in file 1 to file 2 (they may be
192 # permuted)
193 #nodeMap1to2 = {}
194 for i1 in range(len(coords1)):
195 indexList=[]
196 for i2 in range(len(coords2)):
197 if self.numericCompareL2(coords1[i1], coords2[i2]):
198 indexList.append(i2)
199 self.assertNotEquals(len(indexList), 0,
200 "Node with coordinates %s missing in '%s'"%(str(coords1[i1]),elementName))
201 #nodeMap1to2[i1]=indexList
202
203 extents1=p1.getCellExtents(elementName)
204 extents2=p2.getCellExtents(elementName)
205 self.assertEqual(extents1, extents2)
206
207 nodelist1=p1.getCellNodeList(elementName)
208 nodelist2=p2.getCellNodeList(elementName)
209
210 ccount1,csize1,ctype1=p1.getCellShapeInfo(elementName)
211 ccount2,csize2,ctype2=p2.getCellShapeInfo(elementName)
212
213 # data
214 data1=p1.getData()
215 data2=p2.getData()
216 p1.close()
217 p2.close()
218
219 # TODO: The Silo module does not allow checking for the mesh of
220 # a variable yet so we cannot compare permuted entries using the
221 # node mappings from above (see vtk tests)
222 self.assertEqual(len(data1), len(data2))
223 for name in data2:
224 self.assertTrue(name in data1, "Variable '%s' missing"%name)
225 if name.startswith('data'):
226 self.assertTrue(self.numericCompareL2(
227 data1[name], data2[name]),
228 "Values in '%s' do not match" % name)
229
230 def check_silo(self, reference, **data):
231 outFileBase="out_"+reference
232 saveSilo(os.path.join(WEIPA_WORKDIR, outFileBase), write_meshdata=True, **data)
233 ref=os.path.join(WEIPA_TEST_MESHES, reference+".silo")
234 out=os.path.join(WEIPA_WORKDIR, outFileBase+".silo")
235 self.compareSiloFiles(out, ref)
236
237
238 class Test_Finley_SaveSilo(Test_SiloSaver):
239
240 # === Finley hex 2D order 1 with contacts ===================================
241
242 def test_hex_contact_2D_order1_ContinuousFunction(self):
243 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
244 x=ContinuousFunction(dom).getX()
245 self.check_silo("hex_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
246 data_t=x[0]*[[11.,12.],[21.,22.]])
247
248 def test_hex_contact_2D_order1_Solution(self):
249 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
250 x=Solution(dom).getX()
251 self.check_silo("hex_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
252 data_t=x[0]*[[11.,12.],[21.,22.]])
253
254 def test_hex_contact_2D_order1_ReducedSolution(self):
255 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
256 x=ReducedSolution(dom).getX()
257 self.check_silo("hex_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
258 data_t=x[0]*[[11.,12.],[21.,22.]])
259
260 def test_hex_contact_2D_order1_Function(self):
261 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
262 x=Function(dom).getX()
263 self.check_silo("hex_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
264 data_t=x[0]*[[11.,12.],[21.,22.]])
265
266 def test_hex_contact_2D_order1_ReducedFunction(self):
267 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
268 x=ReducedFunction(dom).getX()
269 self.check_silo("hex_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
270 data_t=x[0]*[[11.,12.],[21.,22.]])
271
272 def test_hex_contact_2D_order1_FunctionOnBoundary(self):
273 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
274 x=FunctionOnBoundary(dom).getX()
275 self.check_silo("hex_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
276 data_t=x[0]*[[11.,12.],[21.,22.]])
277
278 def test_hex_contact_2D_order1_ReducedFunctionOnBoundary(self):
279 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
280 x=ReducedFunctionOnBoundary(dom).getX()
281 self.check_silo("hex_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
282 data_t=x[0]*[[11.,12.],[21.,22.]])
283
284 def test_hex_contact_2D_order1_onFace_FunctionOnBoundary(self):
285 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
286 x=FunctionOnBoundary(dom).getX()
287 self.check_silo("hex_2D_o1_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
288 data_t=x[0]*[[11.,12.],[21.,22.]])
289
290 def test_hex_contact_2D_order1_onFace_ReducedFunctionOnBoundary(self):
291 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
292 x=ReducedFunctionOnBoundary(dom).getX()
293 self.check_silo("hex_2D_o1_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
294 data_t=x[0]*[[11.,12.],[21.,22.]])
295
296 def test_hex_contact_2D_order1_FunctionOnContactZero(self):
297 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
298 x=FunctionOnContactZero(dom).getX()
299 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
300 data_t=x[0]*[[11.,12.],[21.,22.]])
301
302 def test_hex_contact_2D_order1_ReducedFunctionOnContactZero(self):
303 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
304 x=ReducedFunctionOnContactZero(dom).getX()
305 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
306 data_t=x[0]*[[11.,12.],[21.,22.]])
307
308 def test_hex_contact_2D_order1_onFace_FunctionOnContactZero(self):
309 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
310 x=FunctionOnContactZero(dom).getX()
311 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
312 data_t=x[0]*[[11.,12.],[21.,22.]])
313
314 def test_hex_contact_2D_order1_onFace_ReducedFunctionOnContactZero(self):
315 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
316 x=ReducedFunctionOnContactZero(dom).getX()
317 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
318 data_t=x[0]*[[11.,12.],[21.,22.]])
319
320 def test_hex_contact_2D_order1_FunctionOnContactOne(self):
321 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
322 x=FunctionOnContactOne(dom).getX()
323 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
324 data_t=x[0]*[[11.,12.],[21.,22.]])
325
326 def test_hex_contact_2D_order1_ReducedFunctionOnContactOne(self):
327 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
328 x=ReducedFunctionOnContactOne(dom).getX()
329 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
330 data_t=x[0]*[[11.,12.],[21.,22.]])
331
332 def test_hex_contact_2D_order1_onFace_FunctionOnContactOne(self):
333 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
334 x=FunctionOnContactOne(dom).getX()
335 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
336 data_t=x[0]*[[11.,12.],[21.,22.]])
337
338 def test_hex_contact_2D_order1_onFace_ReducedFunctionOnContactOne(self):
339 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
340 x=ReducedFunctionOnContactOne(dom).getX()
341 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
342 data_t=x[0]*[[11.,12.],[21.,22.]])
343
344 # === Finley hex 2D order 2 with contacts ===================================
345
346 def test_hex_contact_2D_order2_ContinuousFunction(self):
347 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
348 x=ContinuousFunction(dom).getX()
349 self.check_silo("hex_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
350 data_t=x[0]*[[11.,12.],[21.,22.]])
351
352 def test_hex_contact_2D_order2_Solution(self):
353 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
354 x=Solution(dom).getX()
355 self.check_silo("hex_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
356 data_t=x[0]*[[11.,12.],[21.,22.]])
357
358 def test_hex_contact_2D_order2_ReducedSolution(self):
359 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
360 x=ReducedSolution(dom).getX()
361 self.check_silo("hex_2D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
362 data_t=x[0]*[[11.,12.],[21.,22.]])
363
364 def test_hex_contact_2D_order2_Function(self):
365 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
366 x=Function(dom).getX()
367 self.check_silo("hex_2D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.],
368 data_t=x[0]*[[11.,12.],[21.,22.]])
369
370 def test_hex_contact_2D_order2_ReducedFunction(self):
371 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
372 x=ReducedFunction(dom).getX()
373 self.check_silo("hex_2D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.],
374 data_t=x[0]*[[11.,12.],[21.,22.]])
375
376 def test_hex_contact_2D_order2_FunctionOnBoundary(self):
377 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
378 x=FunctionOnBoundary(dom).getX()
379 self.check_silo("hex_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
380 data_t=x[0]*[[11.,12.],[21.,22.]])
381
382 def test_hex_contact_2D_order2_ReducedFunctionOnBoundary(self):
383 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
384 x=ReducedFunctionOnBoundary(dom).getX()
385 self.check_silo("hex_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
386 data_t=x[0]*[[11.,12.],[21.,22.]])
387
388 def test_hex_contact_2D_order2_onFace_FunctionOnBoundary(self):
389 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
390 x=FunctionOnBoundary(dom).getX()
391 self.check_silo("hex_2D_o2_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
392 data_t=x[0]*[[11.,12.],[21.,22.]])
393
394 def test_hex_contact_2D_order2_onFace_ReducedFunctionOnBoundary(self):
395 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
396 x=ReducedFunctionOnBoundary(dom).getX()
397 self.check_silo("hex_2D_o2_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
398 data_t=x[0]*[[11.,12.],[21.,22.]])
399
400 def test_hex_contact_2D_order2_FunctionOnContactZero(self):
401 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
402 x=FunctionOnContactZero(dom).getX()
403 self.check_silo("hex_2D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.],
404 data_t=x[0]*[[11.,12.],[21.,22.]])
405
406 def test_hex_contact_2D_order2_ReducedFunctionOnContactZero(self):
407 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
408 x=ReducedFunctionOnContactZero(dom).getX()
409 self.check_silo("hex_2D_o2_rcontact", data_s=x[0], data_v=x[0]*[1.,2.],
410 data_t=x[0]*[[11.,12.],[21.,22.]])
411
412 def test_hex_contact_2D_order2_onFace_FunctionOnContactZero(self):
413 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
414 x=FunctionOnContactZero(dom).getX()
415 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
416 data_t=x[0]*[[11.,12.],[21.,22.]])
417
418 def test_hex_contact_2D_order2_onFace_ReducedFunctionOnContactZero(self):
419 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
420 x=ReducedFunctionOnContactZero(dom).getX()
421 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
422 data_t=x[0]*[[11.,12.],[21.,22.]])
423
424 def test_hex_contact_2D_order2_FunctionOnContactOne(self):
425 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
426 x=FunctionOnContactOne(dom).getX()
427 self.check_silo("hex_2D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.],
428 data_t=x[0]*[[11.,12.],[21.,22.]])
429
430 def test_hex_contact_2D_order2_ReducedFunctionOnContactOne(self):
431 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
432 x=ReducedFunctionOnContactOne(dom).getX()
433 self.check_silo("hex_2D_o2_rcontact", data_s=x[0], data_v=x[0]*[1.,2.],
434 data_t=x[0]*[[11.,12.],[21.,22.]])
435
436 def test_hex_contact_2D_order2_onFace_FunctionOnContactOne(self):
437 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
438 x=FunctionOnContactOne(dom).getX()
439 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
440 data_t=x[0]*[[11.,12.],[21.,22.]])
441
442 def test_hex_contact_2D_order2_onFace_ReducedFunctionOnContactOne(self):
443 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
444 x=ReducedFunctionOnContactOne(dom).getX()
445 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
446 data_t=x[0]*[[11.,12.],[21.,22.]])
447
448 # === Finley hex 2D order 2 =================================================
449
450 def test_hex_2D_order2_empty(self):
451 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
452 self.check_silo("hex_2D_o2", domain=dom)
453
454 def test_hex_2D_order2_AllPoints_Scalar(self):
455 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
456 x=Solution(dom).getX()
457 x_r=ReducedSolution(dom).getX()
458 x_n=ContinuousFunction(dom).getX()
459 self.check_silo("hex_2D_o2_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
460
461 def test_hex_2D_order2_2Cells_Scalar(self):
462 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
463 x=Function(dom).getX()
464 x_b=FunctionOnBoundary(dom).getX()
465 self.check_silo("hex_2D_o2_cell_2xs", data_b=x_b[0], data=x[0])
466
467 def test_hex_2D_order2_BoundaryPoint_Scalar(self):
468 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
469 x=ContinuousFunction(dom).getX()
470 x_b=FunctionOnBoundary(dom).getX()
471 self.check_silo("hex_2D_o2_boundary_2xs", data=x[0],data_b=x_b[0])
472
473 def test_hex_2D_order2_Cells_AllData(self):
474 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
475 x=Function(dom).getX()
476 self.check_silo("hex_2D_o2_cell_all",
477 data_s=x[0],
478 data_v=x[0]*[1.,2.],
479 data_t=x[0]*[[11.,12.],[21.,22.]])
480
481 def test_hex_2D_order2_CellsPoints_AllData(self):
482 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
483 x_c=Function(dom).getX()
484 x_p=ContinuousFunction(dom).getX()
485 self.check_silo("hex_2D_o2_cellnode_all",
486 data_sp=x_p[0],
487 data_vp=x_p[0]*[1.,2.],
488 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
489 data_sc=x_c[0],
490 data_vc=x_c[0]*[1.,2.],
491 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
492
493 # === Finley hex 2D order 2 (full) ==========================================
494
495 def test_hex_2D_order2p_empty(self):
496 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
497 self.check_silo("hex_2D_o2p", domain=dom)
498
499 def test_hex_2D_order2p_AllPoints_Scalar(self):
500 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
501 x=Solution(dom).getX()
502 x_r=ReducedSolution(dom).getX()
503 x_n=ContinuousFunction(dom).getX()
504 self.check_silo("hex_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
505
506 def test_hex_2D_order2p_2Cells_Scalar(self):
507 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
508 x=Function(dom).getX()
509 x_b=FunctionOnBoundary(dom).getX()
510 self.check_silo("hex_2D_o2p_cell_2xs", data_b=x_b[0], data=x[0])
511
512 def test_hex_2D_order2p_BoundaryPoint_Scalar(self):
513 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
514 x=ContinuousFunction(dom).getX()
515 x_b=FunctionOnBoundary(dom).getX()
516 self.check_silo("hex_2D_o2p_boundary_2xs", data=x[0],data_b=x_b[0])
517
518 def test_hex_2D_order2p_CellsPoints_AllData(self):
519 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
520 x_c=Function(dom).getX()
521 x_p=ContinuousFunction(dom).getX()
522 self.check_silo("hex_2D_o2p_cellnode_all",
523 data_sp=x_p[0],
524 data_vp=x_p[0]*[1.,2.],
525 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
526 data_sc=x_c[0],
527 data_vc=x_c[0]*[1.,2.],
528 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
529
530 def test_hex_2D_order2p_ContinuousFunction(self):
531 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
532 x=ContinuousFunction(dom).getX()
533 self.check_silo("hex_2D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.],
534 data_t=x[0]*[[11.,12.],[21.,22.]])
535
536 def test_hex_2D_order2p_Solution(self):
537 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
538 x=Solution(dom).getX()
539 self.check_silo("hex_2D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.],
540 data_t=x[0]*[[11.,12.],[21.,22.]])
541
542 def test_hex_2D_order2p_ReducedSolution(self):
543 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
544 x=ReducedSolution(dom).getX()
545 self.check_silo("hex_2D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
546 data_t=x[0]*[[11.,12.],[21.,22.]])
547
548 def test_hex_2D_order2p_Function(self):
549 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
550 x=Function(dom).getX()
551 self.check_silo("hex_2D_o2p_cell", data_s=x[0], data_v=x[0]*[1.,2.],
552 data_t=x[0]*[[11.,12.],[21.,22.]])
553
554 def test_hex_2D_order2p_ReducedFunction(self):
555 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
556 x=ReducedFunction(dom).getX()
557 self.check_silo("hex_2D_o2p_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
558 data_t=x[0]*[[11.,12.],[21.,22.]])
559
560 def test_hex_2D_order2p_FunctionOnBoundary(self):
561 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
562 x=FunctionOnBoundary(dom).getX()
563 self.check_silo("hex_2D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
564 data_t=x[0]*[[11.,12.],[21.,22.]])
565
566 def test_hex_2D_order2p_ReducedFunctionOnBoundary(self):
567 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
568 x=ReducedFunctionOnBoundary(dom).getX()
569 self.check_silo("hex_2D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
570 data_t=x[0]*[[11.,12.],[21.,22.]])
571
572 # === Finley hex 2D macro ===================================================
573
574 def test_hex_2D_macro_empty(self):
575 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
576 self.check_silo("hex_2D_o2p", domain=dom)
577
578 def test_hex_2D_macro_AllPoints_Scalar(self):
579 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
580 x=Solution(dom).getX()
581 x_r=ReducedSolution(dom).getX()
582 x_n=ContinuousFunction(dom).getX()
583 self.check_silo("hex_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
584
585 def test_hex_2D_macro_CellsPoints(self):
586 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
587 x_c=Function(dom).getX()
588 x_p=ContinuousFunction(dom).getX()
589 self.check_silo("hex_2D_macro_cellnode_all",
590 data_sp=x_p[0],
591 data_vp=x_p[0]*[1.,2.],
592 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
593 data_sc=x_c[0],
594 data_vc=x_c[0]*[1.,2.],
595 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
596
597 def test_hex_2D_macro_2Cells_Scalar(self):
598 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
599 x=Function(dom).getX()
600 x_b=FunctionOnBoundary(dom).getX()
601 self.check_silo("hex_2D_cell_2xs", data_b=x_b[0], data=x[0])
602
603 def test_hex_2D_macro_BoundaryPoint_Scalar(self):
604 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
605 x=ContinuousFunction(dom).getX()
606 x_b=FunctionOnBoundary(dom).getX()
607 self.check_silo("hex_2D_boundary_2xs", data_b=x_b[0], data=x[0])
608
609 def test_hex_2D_macro_ContinuousFunction(self):
610 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
611 x=ContinuousFunction(dom).getX()
612 self.check_silo("hex_2D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.],
613 data_t=x[0]*[[11.,12.],[21.,22.]])
614
615 def test_hex_2D_macro_Solution(self):
616 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
617 x=Solution(dom).getX()
618 self.check_silo("hex_2D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.],
619 data_t=x[0]*[[11.,12.],[21.,22.]])
620
621 def test_hex_2D_macro_ReducedSolution(self):
622 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
623 x=ReducedSolution(dom).getX()
624 self.check_silo("hex_2D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
625 data_t=x[0]*[[11.,12.],[21.,22.]])
626
627 def test_hex_2D_macro_Function(self):
628 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
629 x=Function(dom).getX()
630 self.check_silo("hex_2D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.],
631 data_t=x[0]*[[11.,12.],[21.,22.]])
632
633 def test_hex_2D_macro_ReducedFunction(self):
634 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
635 x=ReducedFunction(dom).getX()
636 self.check_silo("hex_2D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
637 data_t=x[0]*[[11.,12.],[21.,22.]])
638
639 def test_hex_2D_macro_FunctionOnBoundary(self):
640 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
641 x=FunctionOnBoundary(dom).getX()
642 self.check_silo("hex_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
643 data_t=x[0]*[[11.,12.],[21.,22.]])
644
645 def test_hex_2D_macro_ReducedFunctionOnBoundary(self):
646 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
647 x=ReducedFunctionOnBoundary(dom).getX()
648 self.check_silo("hex_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
649 data_t=x[0]*[[11.,12.],[21.,22.]])
650
651 # === Finley hex 3D order 1 with contacts ===================================
652
653 def test_hex_contact_3D_order1_ContinuousFunction(self):
654 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
655 x=ContinuousFunction(dom).getX()
656 self.check_silo("hex_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
657 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
658
659 def test_hex_contact_3D_order1_Solution(self):
660 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
661 x=Solution(dom).getX()
662 self.check_silo("hex_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
663 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
664
665 def test_hex_contact_3D_order1_ReducedSolution(self):
666 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
667 x=ReducedSolution(dom).getX()
668 self.check_silo("hex_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
669 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
670
671 def test_hex_contact_3D_order1_Function(self):
672 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
673 x=Function(dom).getX()
674 self.check_silo("hex_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
675 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
676
677 def test_hex_contact_3D_order1_ReducedFunction(self):
678 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
679 x=ReducedFunction(dom).getX()
680 self.check_silo("hex_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
681 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
682
683 def test_hex_contact_3D_order1_FunctionOnBoundary(self):
684 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
685 x=FunctionOnBoundary(dom).getX()
686 self.check_silo("hex_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
687 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
688
689 def test_hex_contact_3D_order1_ReducedFunctionOnBoundary(self):
690 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
691 x=ReducedFunctionOnBoundary(dom).getX()
692 self.check_silo("hex_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
693 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
694
695 def test_hex_contact_3D_order1_onFace_FunctionOnBoundary(self):
696 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
697 x=FunctionOnBoundary(dom).getX()
698 self.check_silo("hex_3D_o1_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
699 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
700
701 def test_hex_contact_3D_order1_onFace_ReducedFunctionOnBoundary(self):
702 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
703 x=ReducedFunctionOnBoundary(dom).getX()
704 self.check_silo("hex_3D_o1_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
705 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
706
707 def test_hex_contact_3D_order1_FunctionOnContactZero(self):
708 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
709 x=FunctionOnContactZero(dom).getX()
710 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
711 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
712
713 def test_hex_contact_3D_order1_ReducedFunctionOnContactZero(self):
714 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
715 x=ReducedFunctionOnContactZero(dom).getX()
716 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
717 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
718
719 def test_hex_contact_3D_order1_onFace_FunctionOnContactZero(self):
720 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
721 x=FunctionOnContactZero(dom).getX()
722 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
723 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
724
725 def test_hex_contact_3D_order1_onFace_ReducedFunctionOnContactZero(self):
726 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
727 x=ReducedFunctionOnContactZero(dom).getX()
728 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
729 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
730
731 def test_hex_contact_3D_order1_FunctionOnContactOne(self):
732 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
733 x=FunctionOnContactOne(dom).getX()
734 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
735 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
736
737 def test_hex_contact_3D_order1_ReducedFunctionOnContactOne(self):
738 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
739 x=ReducedFunctionOnContactOne(dom).getX()
740 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
741 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
742
743 def test_hex_contact_3D_order1_onFace_FunctionOnContactOne(self):
744 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
745 x=FunctionOnContactOne(dom).getX()
746 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
747 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
748
749 def test_hex_contact_3D_order1_onFace_ReducedFunctionOnContactOne(self):
750 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
751 x=ReducedFunctionOnContactOne(dom).getX()
752 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
753 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
754
755 # === Finley hex 3D order 2 with contacts ===================================
756
757 def test_hex_contact_3D_order2_ContinuousFunction(self):
758 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
759 x=ContinuousFunction(dom).getX()
760 self.check_silo("hex_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
761 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
762
763 def test_hex_contact_3D_order2_Solution(self):
764 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
765 x=Solution(dom).getX()
766 self.check_silo("hex_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
767 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
768
769 def test_hex_contact_3D_order2_ReducedSolution(self):
770 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
771 x=ReducedSolution(dom).getX()
772 self.check_silo("hex_3D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.,3.],
773 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
774
775 def test_hex_contact_3D_order2_Function(self):
776 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
777 x=Function(dom).getX()
778 self.check_silo("hex_3D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
779 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
780
781 def test_hex_contact_3D_order2_ReducedFunction(self):
782 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
783 x=ReducedFunction(dom).getX()
784 self.check_silo("hex_3D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
785 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
786
787 def test_hex_contact_3D_order2_FunctionOnBoundary(self):
788 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
789 x=FunctionOnBoundary(dom).getX()
790 self.check_silo("hex_3D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
791 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
792
793 def test_hex_contact_3D_order2_ReducedFunctionOnBoundary(self):
794 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
795 x=ReducedFunctionOnBoundary(dom).getX()
796 self.check_silo("hex_3D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
797 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
798
799 def test_hex_contact_3D_order2_onFace_FunctionOnBoundary(self):
800 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
801 x=FunctionOnBoundary(dom).getX()
802 self.check_silo("hex_3D_o2_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
803 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
804
805 def test_hex_contact_3D_order2_onFace_ReducedFunctionOnBoundary(self):
806 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
807 x=ReducedFunctionOnBoundary(dom).getX()
808 self.check_silo("hex_3D_o2_f_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
809 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
810
811 def test_hex_contact_3D_order2_FunctionOnContactZero(self):
812 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
813 x=FunctionOnContactZero(dom).getX()
814 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
815 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
816
817 def test_hex_contact_3D_order2_ReducedFunctionOnContactZero(self):
818 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
819 x=ReducedFunctionOnContactZero(dom).getX()
820 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
821 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
822
823 def test_hex_contact_3D_order2_onFace_FunctionOnContactZero(self):
824 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
825 x=FunctionOnContactZero(dom).getX()
826 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
827 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
828
829 def test_hex_contact_3D_order2_onFace_ReducedFunctionOnContactZero(self):
830 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
831 x=ReducedFunctionOnContactZero(dom).getX()
832 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
833 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
834
835 def test_hex_contact_3D_order2_FunctionOnContactOne(self):
836 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
837 x=FunctionOnContactOne(dom).getX()
838 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
839 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
840
841 def test_hex_contact_3D_order2_ReducedFunctionOnContactOne(self):
842 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
843 x=ReducedFunctionOnContactOne(dom).getX()
844 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
845 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
846
847 def test_hex_contact_3D_order2_onFace_FunctionOnContactOne(self):
848 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
849 x=FunctionOnContactOne(dom).getX()
850 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
851 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
852
853 def test_hex_contact_3D_order2_onFace_ReducedFunctionOnContactOne(self):
854 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
855 x=ReducedFunctionOnContactOne(dom).getX()
856 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
857 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
858
859 # === Finley hex 3D order 2 (full) ==========================================
860
861 def test_hex_3D_order2p_ContinuousFunction(self):
862 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
863 x=ContinuousFunction(dom).getX()
864 self.check_silo("hex_3D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
865 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
866
867 def test_hex_3D_order2p_Solution(self):
868 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
869 x=Solution(dom).getX()
870 self.check_silo("hex_3D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
871 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
872
873 def test_hex_3D_order2p_ReducedSolution(self):
874 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
875 x=ReducedSolution(dom).getX()
876 self.check_silo("hex_3D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.,3.],
877 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
878
879 def test_hex_3D_order2p_Function(self):
880 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
881 x=Function(dom).getX()
882 self.check_silo("hex_3D_o2p_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
883 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
884
885 def test_hex_3D_order2p_ReducedFunction(self):
886 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
887 x=ReducedFunction(dom).getX()
888 self.check_silo("hex_3D_o2p_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
889 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
890
891 def test_hex_3D_order2p_FunctionOnBoundary(self):
892 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
893 x=FunctionOnBoundary(dom).getX()
894 self.check_silo("hex_3D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
895 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
896
897 def test_hex_3D_order2p_ReducedFunctionOnBoundary(self):
898 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
899 x=ReducedFunctionOnBoundary(dom).getX()
900 self.check_silo("hex_3D_o2p_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
901 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
902
903 # === Finley hex 3D macro ===================================================
904
905 def test_hex_3D_macro_ContinuousFunction(self):
906 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
907 x=ContinuousFunction(dom).getX()
908 self.check_silo("hex_3D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
909 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
910
911 def test_hex_3D_macro_Solution(self):
912 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
913 x=Solution(dom).getX()
914 self.check_silo("hex_3D_o2p_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
915 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
916
917 def test_hex_3D_macro_ReducedSolution(self):
918 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
919 x=ReducedSolution(dom).getX()
920 self.check_silo("hex_3D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.,3.],
921 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
922
923 def test_hex_3D_macro_Function(self):
924 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
925 x=Function(dom).getX()
926 self.check_silo("hex_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
927 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
928
929 def test_hex_3D_macro_ReducedFunction(self):
930 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
931 x=ReducedFunction(dom).getX()
932 self.check_silo("hex_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
933 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
934
935 def test_hex_3D_macro_FunctionOnBoundary(self):
936 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
937 x=FunctionOnBoundary(dom).getX()
938 self.check_silo("hex_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
939 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
940
941 def test_hex_3D_macro_ReducedFunctionOnBoundary(self):
942 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
943 x=ReducedFunctionOnBoundary(dom).getX()
944 self.check_silo("hex_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
945 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
946
947 # === Finley tet 2D order 1 =================================================
948
949 def test_tet_2D_order1_ContinuousFunction(self):
950 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
951 x=ContinuousFunction(dom).getX()
952 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
953 data_t=x[0]*[[11.,12.],[21.,22.]])
954
955 def test_tet_2D_order1_Solution(self):
956 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
957 x=Solution(dom).getX()
958 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
959 data_t=x[0]*[[11.,12.],[21.,22.]])
960
961 def test_tet_2D_order1_ReducedSolution(self):
962 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
963 x=ReducedSolution(dom).getX()
964 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
965 data_t=x[0]*[[11.,12.],[21.,22.]])
966
967 def test_tet_2D_order1_Function(self):
968 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
969 x=Function(dom).getX()
970 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
971 data_t=x[0]*[[11.,12.],[21.,22.]])
972
973 def test_tet_2D_order1_ReducedFunction(self):
974 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
975 x=ReducedFunction(dom).getX()
976 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
977 data_t=x[0]*[[11.,12.],[21.,22.]])
978
979 def test_tet_2D_order1_FunctionOnBoundary(self):
980 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
981 x=FunctionOnBoundary(dom).getX()
982 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
983 data_t=x[0]*[[11.,12.],[21.,22.]])
984
985 def test_tet_2D_order1_ReducedFunctionOnBoundary(self):
986 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
987 x=ReducedFunctionOnBoundary(dom).getX()
988 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
989 data_t=x[0]*[[11.,12.],[21.,22.]])
990
991 # === Finley tet 2D order 2 =================================================
992
993 def test_tet_2D_order2(self):
994 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
995 self.check_silo("tet_2D_o2", domain=dom)
996
997 def test_tet_2D_order2_AllPoints_Scalar(self):
998 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
999 x=Solution(dom).getX()
1000 x_r=ReducedSolution(dom).getX()
1001 x_n=ContinuousFunction(dom).getX()
1002 self.check_silo("tet_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
1003
1004 def test_tet_2D_order2_02Points_Scalar(self):
1005 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1006 x=Solution(dom).getX()
1007 x_n=ContinuousFunction(dom).getX()
1008 self.check_silo("tet_2D_o2_node_2xs", data_n=x_n[0], data=x[0])
1009
1010 def test_tet_2D_order2_2Cells_Scalar(self):
1011 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1012 x=Function(dom).getX()
1013 x_b=FunctionOnBoundary(dom).getX()
1014 self.check_silo("tet_2D_o2_cell_2xs", data_b=x_b[0], data=x[0])
1015
1016 def test_tet_2D_order2_BoundaryPoint_Scalar(self):
1017 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1018 x=ContinuousFunction(dom).getX()
1019 x_b=FunctionOnBoundary(dom).getX()
1020 self.check_silo("tet_2D_o2_boundary_2xs", data=x[0],data_b=x_b[0])
1021
1022 def test_tet_2D_order2_Cells_AllData(self):
1023 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1024 x=Function(dom).getX()
1025 self.check_silo("tet_2D_o2_cell_all",
1026 data_s=x[0],
1027 data_v=x[0]*[1.,2.],
1028 data_t=x[0]*[[11.,12.],[21.,22.]],
1029 data_t2=x[0]*[[-11.,-12.],[-21.,-22.]])
1030
1031 def test_tet_2D_order2_CellsPoints_AllData(self):
1032 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1033 x_c=Function(dom).getX()
1034 x_p=ContinuousFunction(dom).getX()
1035 self.check_silo("tet_2D_o2_cellnode_all",
1036 data_sp=x_p[0],
1037 data_vp=x_p[0]*[1.,2.],
1038 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
1039 data_sc=x_c[0],
1040 data_vc=x_c[0]*[1.,2.],
1041 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
1042
1043 def test_tet_2D_order2_ContinuousFunction(self):
1044 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1045 x=ContinuousFunction(dom).getX()
1046 self.check_silo("tet_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
1047 data_t=x[0]*[[11.,12.],[21.,22.]])
1048
1049 def test_tet_2D_order2_Solution(self):
1050 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1051 x=Solution(dom).getX()
1052 self.check_silo("tet_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
1053 data_t=x[0]*[[11.,12.],[21.,22.]])
1054
1055 def test_tet_2D_order2_ReducedSolution(self):
1056 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1057 x=ReducedSolution(dom).getX()
1058 self.check_silo("tet_2D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
1059 data_t=x[0]*[[11.,12.],[21.,22.]])
1060
1061 def test_tet_2D_order2_Function(self):
1062 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1063 x=Function(dom).getX()
1064 self.check_silo("tet_2D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1065 data_t=x[0]*[[11.,12.],[21.,22.]])
1066
1067 def test_tet_2D_order2_ReducedFunction(self):
1068 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1069 x=ReducedFunction(dom).getX()
1070 self.check_silo("tet_2D_o2_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
1071 data_t=x[0]*[[11.,12.],[21.,22.]])
1072
1073 def test_tet_2D_order2_FunctionOnBoundary(self):
1074 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1075 x=FunctionOnBoundary(dom).getX()
1076 self.check_silo("tet_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1077 data_t=x[0]*[[11.,12.],[21.,22.]])
1078
1079 def test_tet_2D_order2_ReducedFunctionOnBoundary(self):
1080 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1081 x=ReducedFunctionOnBoundary(dom).getX()
1082 self.check_silo("tet_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1083 data_t=x[0]*[[11.,12.],[21.,22.]])
1084
1085 # === Finley tet 2D macro ===================================================
1086
1087 def test_tet_2D_macro(self):
1088 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1089 self.check_silo("tet_2D_o2", domain=dom)
1090
1091 def test_tet_2D_macro_AllPoints_Scalar(self):
1092 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1093 x=Solution(dom).getX()
1094 x_r=ReducedSolution(dom).getX()
1095 x_n=ContinuousFunction(dom).getX()
1096 self.check_silo("tet_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
1097
1098 def test_tet_2D_macro_02Points_Scalar(self):
1099 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1100 x=Solution(dom).getX()
1101 x_n=ContinuousFunction(dom).getX()
1102 self.check_silo("tet_2D_o2_node_2xs", data_n=x_n[0], data=x[0])
1103
1104 def test_tet_2D_macro_2Cells_Scalar(self):
1105 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1106 x=Function(dom).getX()
1107 x_b=FunctionOnBoundary(dom).getX()
1108 self.check_silo("tet_2D_cell_2xs", data_b=x_b[0], data=x[0])
1109
1110 def test_tet_2D_macro_BoundaryPoint_Scalar(self):
1111 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1112 x=ContinuousFunction(dom).getX()
1113 x_b=FunctionOnBoundary(dom).getX()
1114 self.check_silo("tet_2D_boundary_2xs", data_b=x_b[0], data=x[0])
1115
1116 def test_tet_2D_macro_CellsPoints_AllData(self):
1117 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1118 x_c=Function(dom).getX()
1119 x_p=ContinuousFunction(dom).getX()
1120 self.check_silo("tet_2D_macro_cellnode_all",
1121 data_sp=x_p[0],
1122 data_vp=x_p[0]*[1.,2.],
1123 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
1124 data_sc=x_c[0],
1125 data_vc=x_c[0]*[1.,2.],
1126 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
1127
1128 def test_tet_2D_macro_ContinuousFunction(self):
1129 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1130 x=ContinuousFunction(dom).getX()
1131 self.check_silo("tet_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
1132 data_t=x[0]*[[11.,12.],[21.,22.]])
1133
1134 def test_tet_2D_macro_Solution(self):
1135 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1136 x=Solution(dom).getX()
1137 self.check_silo("tet_2D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.],
1138 data_t=x[0]*[[11.,12.],[21.,22.]])
1139
1140 def test_tet_2D_macro_ReducedSolution(self):
1141 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1142 x=ReducedSolution(dom).getX()
1143 self.check_silo("tet_2D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
1144 data_t=x[0]*[[11.,12.],[21.,22.]])
1145
1146 def test_tet_2D_macro_Function(self):
1147 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1148 x=Function(dom).getX()
1149 self.check_silo("tet_2D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1150 data_t=x[0]*[[11.,12.],[21.,22.]])
1151
1152 def test_tet_2D_macro_ReducedFunction(self):
1153 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1154 x=ReducedFunction(dom).getX()
1155 self.check_silo("tet_2D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
1156 data_t=x[0]*[[11.,12.],[21.,22.]])
1157
1158 def test_tet_2D_macro_FunctionOnBoundary(self):
1159 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1160 x=FunctionOnBoundary(dom).getX()
1161 self.check_silo("tet_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1162 data_t=x[0]*[[11.,12.],[21.,22.]])
1163
1164 def test_tet_2D_macro_ReducedFunctionOnBoundary(self):
1165 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1166 x=ReducedFunctionOnBoundary(dom).getX()
1167 self.check_silo("tet_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1168 data_t=x[0]*[[11.,12.],[21.,22.]])
1169
1170 # === Finley tet 3D order 1 =================================================
1171
1172 def test_tet_3D_order1_ContinuousFunction(self):
1173 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1174 x=ContinuousFunction(dom).getX()
1175 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1176 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1177
1178 def test_tet_3D_order1_Solution(self):
1179 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1180 x=Solution(dom).getX()
1181 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1182 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1183
1184 def test_tet_3D_order1_ReducedSolution(self):
1185 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1186 x=ReducedSolution(dom).getX()
1187 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1188 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1189
1190 def test_tet_3D_order1_Function(self):
1191 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1192 x=Function(dom).getX()
1193 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1194 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1195
1196 def test_tet_3D_order1_ReducedFunction(self):
1197 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1198 x=ReducedFunction(dom).getX()
1199 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1200 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1201
1202 def test_tet_3D_order1_FunctionOnBoundary(self):
1203 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1204 x=FunctionOnBoundary(dom).getX()
1205 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1206 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1207
1208 def test_tet_3D_order1_ReducedFunctionOnBoundary(self):
1209 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1210 x=ReducedFunctionOnBoundary(dom).getX()
1211 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1212 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1213
1214 # === Finley tet 3D order 2 =================================================
1215
1216 def test_tet_3D_order2_ContinuousFunction(self):
1217 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1218 x=ContinuousFunction(dom).getX()
1219 self.check_silo("tet_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1220 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1221
1222 def test_tet_3D_order2_Solution(self):
1223 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1224 x=Solution(dom).getX()
1225 self.check_silo("tet_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1226 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1227
1228 def test_tet_3D_order2_ReducedSolution(self):
1229 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1230 x=ReducedSolution(dom).getX()
1231 self.check_silo("tet_3D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1232 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1233
1234 def test_tet_3D_order2_Function(self):
1235 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1236 x=Function(dom).getX()
1237 self.check_silo("tet_3D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1238 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1239
1240 def test_tet_3D_order2_ReducedFunction(self):
1241 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1242 x=ReducedFunction(dom).getX()
1243 self.check_silo("tet_3D_o2_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1244 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1245
1246 def test_tet_3D_order2_FunctionOnBoundary(self):
1247 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1248 x=FunctionOnBoundary(dom).getX()
1249 self.check_silo("tet_3D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1250 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1251
1252 def test_tet_3D_order2_ReducedFunctionOnBoundary(self):
1253 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1254 x=ReducedFunctionOnBoundary(dom).getX()
1255 self.check_silo("tet_3D_o2_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1256 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1257
1258 # === Finley tet 3D macro ===================================================
1259
1260 def test_tet_3D_macro_ContinuousFunction(self):
1261 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1262 x=ContinuousFunction(dom).getX()
1263 self.check_silo("tet_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1264 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1265
1266 def test_tet_3D_macro_Solution(self):
1267 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1268 x=Solution(dom).getX()
1269 self.check_silo("tet_3D_o2_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1270 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1271
1272 def test_tet_3D_macro_ReducedSolution(self):
1273 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1274 x=ReducedSolution(dom).getX()
1275 self.check_silo("tet_3D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1276 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1277
1278 def test_tet_3D_macro_Function(self):
1279 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1280 x=Function(dom).getX()
1281 self.check_silo("tet_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1282 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1283
1284 def test_tet_3D_macro_ReducedFunction(self):
1285 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1286 x=ReducedFunction(dom).getX()
1287 self.check_silo("tet_3D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1288 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1289
1290 def test_tet_3D_macro_FunctionOnBoundary(self):
1291 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1292 x=FunctionOnBoundary(dom).getX()
1293 self.check_silo("tet_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1294 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1295
1296 def test_tet_3D_macro_ReducedFunctionOnBoundary(self):
1297 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1298 x=ReducedFunctionOnBoundary(dom).getX()
1299 self.check_silo("tet_3D_macro_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1300 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1301
1302
1303 class Test_Dudley_SaveSilo(Test_SiloSaver):
1304
1305 # === Dudley 2D =============================================================
1306
1307 def test_tet_2D_dudley_ContinuousFunction(self):
1308 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1309 x=ContinuousFunction(dom).getX()
1310 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1311 data_t=x[0]*[[11.,12.],[21.,22.]])
1312
1313 def test_tet_2D_dudley_Solution(self):
1314 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1315 x=Solution(dom).getX()
1316 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1317 data_t=x[0]*[[11.,12.],[21.,22.]])
1318
1319 def test_tet_2D_dudley_ReducedSolution(self):
1320 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1321 x=ReducedSolution(dom).getX()
1322 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1323 data_t=x[0]*[[11.,12.],[21.,22.]])
1324
1325 def test_tet_2D_dudley_Function(self):
1326 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1327 x=Function(dom).getX()
1328 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1329 data_t=x[0]*[[11.,12.],[21.,22.]])
1330
1331 def test_tet_2D_dudley_ReducedFunction(self):
1332 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1333 x=ReducedFunction(dom).getX()
1334 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1335 data_t=x[0]*[[11.,12.],[21.,22.]])
1336
1337 def test_tet_2D_dudley_FunctionOnBoundary(self):
1338 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1339 x=FunctionOnBoundary(dom).getX()
1340 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1341 data_t=x[0]*[[11.,12.],[21.,22.]])
1342
1343 def test_tet_2D_dudley_ReducedFunctionOnBoundary(self):
1344 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1345 x=ReducedFunctionOnBoundary(dom).getX()
1346 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1347 data_t=x[0]*[[11.,12.],[21.,22.]])
1348
1349 # === Dudley 3D =============================================================
1350
1351 def test_tet_3D_dudley_ContinuousFunction(self):
1352 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1353 x=ContinuousFunction(dom).getX()
1354 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1355 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1356
1357 def test_tet_3D_dudley_Solution(self):
1358 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1359 x=Solution(dom).getX()
1360 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1361 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1362
1363 def test_tet_3D_dudley_ReducedSolution(self):
1364 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1365 x=ReducedSolution(dom).getX()
1366 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1367 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1368
1369 def test_tet_3D_dudley_Function(self):
1370 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1371 x=Function(dom).getX()
1372 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1373 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1374
1375 def test_tet_3D_dudley_ReducedFunction(self):
1376 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1377 x=ReducedFunction(dom).getX()
1378 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1379 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1380
1381 def test_tet_3D_dudley_FunctionOnBoundary(self):
1382 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1383 x=FunctionOnBoundary(dom).getX()
1384 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1385 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1386
1387 def test_tet_3D_dudley_ReducedFunctionOnBoundary(self):
1388 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1389 x=ReducedFunctionOnBoundary(dom).getX()
1390 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1391 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1392
1393
1394 class Test_Ripley_SaveSilo(Test_SiloSaver):
1395
1396 # === Ripley 2D =============================================================
1397
1398 def test_ripley_2D_ContinuousFunction(self):
1399 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1400 x=ContinuousFunction(dom).getX()
1401 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1402 data_t=x[0]*[[11.,12.],[21.,22.]])
1403
1404 def test_ripley_2D_Solution(self):
1405 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1406 x=Solution(dom).getX()
1407 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1408 data_t=x[0]*[[11.,12.],[21.,22.]])
1409
1410 def test_ripley_2D_ReducedSolution(self):
1411 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1412 x=ReducedSolution(dom).getX()
1413 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1414 data_t=x[0]*[[11.,12.],[21.,22.]])
1415
1416 def test_ripley_2D_Function(self):
1417 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1418 x=Function(dom).getX()
1419 self.check_silo("ripley_2D_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1420 data_t=x[0]*[[11.,12.],[21.,22.]])
1421
1422 def test_ripley_2D_ReducedFunction(self):
1423 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1424 x=ReducedFunction(dom).getX()
1425 self.check_silo("ripley_2D_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1426 data_t=x[0]*[[11.,12.],[21.,22.]])
1427
1428 def test_ripley_2D_FunctionOnBoundary(self):
1429 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1430 x=FunctionOnBoundary(dom).getX()
1431 self.check_silo("ripley_2D_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1432 data_t=x[0]*[[11.,12.],[21.,22.]])
1433
1434 def test_ripley_2D_ReducedFunctionOnBoundary(self):
1435 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1436 x=ReducedFunctionOnBoundary(dom).getX()
1437 self.check_silo("ripley_2D_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1438 data_t=x[0]*[[11.,12.],[21.,22.]])
1439
1440 # === Ripley 3D =============================================================
1441
1442 def test_ripley_3D_ContinuousFunction(self):
1443 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1444 x=ContinuousFunction(dom).getX()
1445 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1446 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1447
1448 def test_ripley_3D_Solution(self):
1449 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1450 x=Solution(dom).getX()
1451 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1452 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1453
1454 def test_ripley_3D_ReducedSolution(self):
1455 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1456 x=ReducedSolution(dom).getX()
1457 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1458 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1459
1460 def test_ripley_3D_Function(self):
1461 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1462 x=Function(dom).getX()
1463 self.check_silo("ripley_3D_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1464 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1465
1466 def test_ripley_3D_ReducedFunction(self):
1467 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1468 x=ReducedFunction(dom).getX()
1469 self.check_silo("ripley_3D_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1470 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1471
1472 def test_ripley_3D_FunctionOnBoundary(self):
1473 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1474 x=FunctionOnBoundary(dom).getX()
1475 self.check_silo("ripley_3D_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1476 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1477
1478 def test_ripley_3D_ReducedFunctionOnBoundary(self):
1479 dom=ripley.Brick(n0=11, n1=3, n2=2, l0=(-2.5,7.0), l1=(1.2,3.8), l2=4., d0=getMPISizeWorld(), d1=1, d2=1)
1480 x=ReducedFunctionOnBoundary(dom).getX()
1481 self.check_silo("ripley_3D_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1482 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1483
1484
1485
1486 if __name__ == '__main__':
1487 if not HAVE_SILO:
1488 print("Skipping saveSilo tests since Silo module not available")
1489 elif getMPISizeWorld()>1:
1490 print("Skipping saveSilo tests since MPI size > 1")
1491 else:
1492 import sys
1493 suite = unittest.TestSuite()
1494 suite.addTest(unittest.makeSuite(Test_Finley_SaveSilo))
1495 suite.addTest(unittest.makeSuite(Test_Dudley_SaveSilo))
1496 suite.addTest(unittest.makeSuite(Test_Ripley_SaveSilo))
1497 s=unittest.TextTestRunner(verbosity=2).run(suite)
1498 if not s.wasSuccessful(): sys.exit(1)
1499

  ViewVC Help
Powered by ViewVC 1.1.26