/[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 5698 - (show annotations)
Fri Jun 26 04:40:42 2015 UTC (3 years, 11 months ago) by sshaw
File MIME type: text/x-python
File size: 78846 byte(s)
adding a test for silo being available but broken (as it currently is in debian/jessie
1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2015 by The 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-2015 by The 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 from esys.escriptcore.testing import *
27 from esys.escript import ContinuousFunction, Function, ReducedFunction,\
28 FunctionOnBoundary, ReducedFunctionOnBoundary,\
29 FunctionOnContactZero, ReducedFunctionOnContactZero,\
30 FunctionOnContactOne, ReducedFunctionOnContactOne,\
31 Solution, ReducedSolution, getMPISizeWorld
32 from esys.weipa import saveSilo
33
34 try:
35 import Silo
36 HAVE_SILO=True
37 except ImportError:
38 HAVE_SILO=False
39 try:
40 from esys import dudley
41 HAVE_DUDLEY=True
42 except ImportError:
43 HAVE_DUDLEY=False
44 try:
45 from esys import finley
46 HAVE_FINLEY=True
47 except ImportError:
48 HAVE_FINLEY=False
49 try:
50 from esys import ripley
51 HAVE_RIPLEY=True
52 except ImportError:
53 HAVE_RIPLEY=False
54
55 try:
56 WEIPA_TEST_MESHES=os.environ['WEIPA_TEST_MESHES']
57 except KeyError:
58 WEIPA_TEST_MESHES='meshes'
59
60 try:
61 WEIPA_WORKDIR=os.environ['WEIPA_WORKDIR']
62 except KeyError:
63 WEIPA_WORKDIR='.'
64
65 class SiloReader():
66 """
67 Silo file reader that uses the Python interface to the Silo library.
68 """
69 def __init__(self):
70 self.f=None
71
72 def open(self, filename):
73 try:
74 self.f=Silo.Open(filename)
75 self.filename=filename
76 return True
77 except:
78 return False
79
80 def close(self):
81 if self.f:
82 self.f.Close()
83
84 def getDirNames(self):
85 return self.f.GetToc().dir_names
86
87 def setDir(self, dirname):
88 self.f.SetDir(dirname)
89
90 def getTimeAndCycle(self):
91 return self.f.GetVar('dtime'), self.f.GetVar('cycle')
92
93 def getElementNames(self):
94 names=[]
95 for v in self.f.GetToc().var_names:
96 if v.endswith('_coord0'):
97 names.append(v[:-7])
98 return names
99
100 def getCellCoords(self, elementName):
101 ret=()
102 for i in range(3):
103 try:
104 data=self.f.GetVar("%s_coord%d"%(elementName,i))
105 ret+=data,
106 except:
107 ret+=None,
108 return ret
109
110 def getCellExtents(self, elementName):
111 ret=()
112 for i in ('min','max'):
113 try:
114 data=self.f.GetVar("%s_%s_extents"%(elementName,i))
115 ret+=data,
116 except:
117 ret+=None,
118 return ret
119
120 def getCellNodeList(self, elementName):
121 try:
122 return self.f.GetVar("%s_zones_nodelist"%elementName)
123 except:
124 return None
125
126 def getCellShapeInfo(self, elementName):
127 infoNames=('zones_shapecnt', 'zones_shapesize', 'zones_shapetype')
128 ret=()
129 for n in infoNames:
130 try:
131 data=self.f.GetVar("%s_%s"%(elementName,n))
132 ret+=data,
133 except:
134 ret+=None,
135 return ret
136
137 def getData(self):
138 data={}
139 names=self.f.GetToc().var_names
140 for v in names:
141 if v[-5:]=='_data':
142 data[v[:-5]] = self.f.GetVar(v)
143 return data
144
145 class SiloSaver(unittest.TestCase): #requires subclassing
146 def numericCompareL2(self, vector1, vector2):
147 """
148 Compares two lists of numbers using the L2 norm, returns true if they
149 match up to a tolerance TOL, false otherwise
150 """
151 if vector2 == None: return False
152 TOL = 2.0e-5
153 try:
154 l1=len(vector1)
155 except TypeError:
156 vector1=[vector1]
157 try:
158 l2=len(vector2)
159 except TypeError:
160 vector2=[vector2]
161 if len(vector1) != len(vector2): return False
162 diff = 0.0
163 for i in range(0, len(vector1)):
164 tmp = vector1[i] - vector2[i]
165 diff += tmp * tmp
166 if math.sqrt(diff) > TOL: return False
167 return True
168
169 def compareSiloFiles(self, file1, file2):
170 """
171 Compares two Silo files, asserts if any element is not equal.
172 file2 is the reference file to compare against
173 """
174 p1=SiloReader()
175 p2=SiloReader()
176 self.assertTrue(p1.open(file1), "Invalid Silo file '%s'"%file1)
177 p2.open(file2)
178 self.assertEqual(p1.getTimeAndCycle(), p2.getTimeAndCycle())
179
180 dirNames1=p1.getDirNames()
181 dirNames2=p2.getDirNames()
182 for dirName in dirNames2:
183 self.assertTrue(dirName in dirNames1, "Silo file is missing directories")
184 p1.setDir('/block0000')
185 p2.setDir('/block0000')
186
187 elementNames1=p1.getElementNames()
188 elementNames2=p2.getElementNames()
189
190 for elementName in elementNames2:
191 self.assertTrue(elementName in elementNames1, "Mesh '%s' missing in Silo file"%elementName)
192
193 cx1,cy1,cz1=p1.getCellCoords(elementName)
194 cx2,cy2,cz2=p2.getCellCoords(elementName)
195 self.assertEqual(len(cx1), len(cx2))
196 self.assertEqual(len(cy1), len(cy2))
197 if cz2 is not None:
198 self.assertEqual(len(cz1), len(cz2))
199 coords1=zip(cx1,cy1,cz1)
200 coords2=zip(cx2,cy2,cz2)
201 else:
202 coords1=zip(cx1,cy1)
203 coords2=zip(cx2,cy2)
204
205 # Find mapping of nodes in file 1 to file 2 (they may be
206 # permuted)
207 #nodeMap1to2 = {}
208 for i1 in range(len(coords1)):
209 indexList=[]
210 for i2 in range(len(coords2)):
211 if self.numericCompareL2(coords1[i1], coords2[i2]):
212 indexList.append(i2)
213 self.assertNotEquals(len(indexList), 0,
214 "Node with coordinates %s missing in '%s'"%(str(coords1[i1]),elementName))
215 #nodeMap1to2[i1]=indexList
216
217 extents1=p1.getCellExtents(elementName)
218 extents2=p2.getCellExtents(elementName)
219 self.assertEqual(extents1, extents2)
220
221 nodelist1=p1.getCellNodeList(elementName)
222 nodelist2=p2.getCellNodeList(elementName)
223
224 ccount1,csize1,ctype1=p1.getCellShapeInfo(elementName)
225 ccount2,csize2,ctype2=p2.getCellShapeInfo(elementName)
226
227 # data
228 data1=p1.getData()
229 data2=p2.getData()
230 p1.close()
231 p2.close()
232
233 # TODO: The Silo module does not allow checking for the mesh of
234 # a variable yet so we cannot compare permuted entries using the
235 # node mappings from above (see vtk tests)
236 self.assertEqual(len(data1), len(data2))
237 for name in data2:
238 self.assertTrue(name in data1, "Variable '%s' missing"%name)
239 if name.startswith('data'):
240 self.assertTrue(self.numericCompareL2(
241 data1[name], data2[name]),
242 "Values in '%s' do not match" % name)
243
244 def check_silo(self, reference, **data):
245 outFileBase="out_"+reference
246 saveSilo(os.path.join(WEIPA_WORKDIR, outFileBase), write_meshdata=True, **data)
247 ref=os.path.join(WEIPA_TEST_MESHES, reference+".silo")
248 out=os.path.join(WEIPA_WORKDIR, outFileBase+".silo")
249 self.compareSiloFiles(out, ref)
250
251 class Test_Silo_import(unittest.TestCase):
252 def test_import(self):
253 if not HAVE_SILO:
254 try:
255 import Silo
256 except ImportError as e:
257 if "No module named Silo" not in str(e): raise e
258
259 @unittest.skipIf(getMPISizeWorld()>1, "MPI size > 1")
260 @unittest.skipIf(not HAVE_FINLEY, "finley module not available")
261 @unittest.skipIf(not HAVE_SILO, "Silo module not available")
262 class Test_Finley_SaveSilo(SiloSaver):
263
264 # === Finley hex 2D order 1 with contacts ===================================
265
266 def test_hex_contact_2D_order1_ContinuousFunction(self):
267 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
268 x=ContinuousFunction(dom).getX()
269 self.check_silo("hex_2D_o1_node", 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_Solution(self):
273 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
274 x=Solution(dom).getX()
275 self.check_silo("hex_2D_o1_node", 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_ReducedSolution(self):
279 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
280 x=ReducedSolution(dom).getX()
281 self.check_silo("hex_2D_o1_node", 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_Function(self):
285 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
286 x=Function(dom).getX()
287 self.check_silo("hex_2D_o1_cell", 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_ReducedFunction(self):
291 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
292 x=ReducedFunction(dom).getX()
293 self.check_silo("hex_2D_o1_cell", 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_FunctionOnBoundary(self):
297 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
298 x=FunctionOnBoundary(dom).getX()
299 self.check_silo("hex_2D_o1_boundary", 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_ReducedFunctionOnBoundary(self):
303 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
304 x=ReducedFunctionOnBoundary(dom).getX()
305 self.check_silo("hex_2D_o1_boundary", 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_FunctionOnBoundary(self):
309 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
310 x=FunctionOnBoundary(dom).getX()
311 self.check_silo("hex_2D_o1_f_boundary", 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_ReducedFunctionOnBoundary(self):
315 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
316 x=ReducedFunctionOnBoundary(dom).getX()
317 self.check_silo("hex_2D_o1_f_boundary", 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_FunctionOnContactZero(self):
321 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
322 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
327 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
328 x=ReducedFunctionOnContactZero(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_FunctionOnContactZero(self):
333 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
334 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
339 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
340 x=ReducedFunctionOnContactZero(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 def test_hex_contact_2D_order1_FunctionOnContactOne(self):
345 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
346 x=FunctionOnContactOne(dom).getX()
347 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
348 data_t=x[0]*[[11.,12.],[21.,22.]])
349
350 def test_hex_contact_2D_order1_ReducedFunctionOnContactOne(self):
351 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1.msh"),optimize=False)
352 x=ReducedFunctionOnContactOne(dom).getX()
353 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
354 data_t=x[0]*[[11.,12.],[21.,22.]])
355
356 def test_hex_contact_2D_order1_onFace_FunctionOnContactOne(self):
357 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
358 x=FunctionOnContactOne(dom).getX()
359 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
360 data_t=x[0]*[[11.,12.],[21.,22.]])
361
362 def test_hex_contact_2D_order1_onFace_ReducedFunctionOnContactOne(self):
363 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order1_onFace.msh"),optimize=False)
364 x=ReducedFunctionOnContactOne(dom).getX()
365 self.check_silo("hex_2D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.],
366 data_t=x[0]*[[11.,12.],[21.,22.]])
367
368 # === Finley hex 2D order 2 with contacts ===================================
369
370 def test_hex_contact_2D_order2_ContinuousFunction(self):
371 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
372 x=ContinuousFunction(dom).getX()
373 self.check_silo("hex_2D_o2_node", 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_Solution(self):
377 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
378 x=Solution(dom).getX()
379 self.check_silo("hex_2D_o2_node", 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_ReducedSolution(self):
383 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
384 x=ReducedSolution(dom).getX()
385 self.check_silo("hex_2D_o2_rnode", 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_Function(self):
389 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
390 x=Function(dom).getX()
391 self.check_silo("hex_2D_o2_cell", 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_ReducedFunction(self):
395 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
396 x=ReducedFunction(dom).getX()
397 self.check_silo("hex_2D_o2_cell", 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_FunctionOnBoundary(self):
401 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
402 x=FunctionOnBoundary(dom).getX()
403 self.check_silo("hex_2D_o2_boundary", 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_ReducedFunctionOnBoundary(self):
407 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
408 x=ReducedFunctionOnBoundary(dom).getX()
409 self.check_silo("hex_2D_o2_boundary", 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_FunctionOnBoundary(self):
413 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
414 x=FunctionOnBoundary(dom).getX()
415 self.check_silo("hex_2D_o2_f_boundary", 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_ReducedFunctionOnBoundary(self):
419 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
420 x=ReducedFunctionOnBoundary(dom).getX()
421 self.check_silo("hex_2D_o2_f_boundary", 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_FunctionOnContactZero(self):
425 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
426 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
431 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
432 x=ReducedFunctionOnContactZero(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_FunctionOnContactZero(self):
437 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
438 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
443 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
444 x=ReducedFunctionOnContactZero(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 def test_hex_contact_2D_order2_FunctionOnContactOne(self):
449 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
450 x=FunctionOnContactOne(dom).getX()
451 self.check_silo("hex_2D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.],
452 data_t=x[0]*[[11.,12.],[21.,22.]])
453
454 def test_hex_contact_2D_order2_ReducedFunctionOnContactOne(self):
455 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2.msh"),optimize=False)
456 x=ReducedFunctionOnContactOne(dom).getX()
457 self.check_silo("hex_2D_o2_rcontact", data_s=x[0], data_v=x[0]*[1.,2.],
458 data_t=x[0]*[[11.,12.],[21.,22.]])
459
460 def test_hex_contact_2D_order2_onFace_FunctionOnContactOne(self):
461 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
462 x=FunctionOnContactOne(dom).getX()
463 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
464 data_t=x[0]*[[11.,12.],[21.,22.]])
465
466 def test_hex_contact_2D_order2_onFace_ReducedFunctionOnContactOne(self):
467 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_2D_order2_onFace.msh"),optimize=False)
468 x=ReducedFunctionOnContactOne(dom).getX()
469 self.check_silo("hex_2D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.],
470 data_t=x[0]*[[11.,12.],[21.,22.]])
471
472 # === Finley hex 2D order 2 =================================================
473
474 def test_hex_2D_order2_empty(self):
475 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
476 self.check_silo("hex_2D_o2", domain=dom)
477
478 def test_hex_2D_order2_AllPoints_Scalar(self):
479 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
480 x=Solution(dom).getX()
481 x_r=ReducedSolution(dom).getX()
482 x_n=ContinuousFunction(dom).getX()
483 self.check_silo("hex_2D_o2_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
484
485 def test_hex_2D_order2_2Cells_Scalar(self):
486 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
487 x=Function(dom).getX()
488 x_b=FunctionOnBoundary(dom).getX()
489 self.check_silo("hex_2D_o2_cell_2xs", data_b=x_b[0], data=x[0])
490
491 def test_hex_2D_order2_BoundaryPoint_Scalar(self):
492 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
493 x=ContinuousFunction(dom).getX()
494 x_b=FunctionOnBoundary(dom).getX()
495 self.check_silo("hex_2D_o2_boundary_2xs", data=x[0],data_b=x_b[0])
496
497 def test_hex_2D_order2_Cells_AllData(self):
498 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
499 x=Function(dom).getX()
500 self.check_silo("hex_2D_o2_cell_all",
501 data_s=x[0],
502 data_v=x[0]*[1.,2.],
503 data_t=x[0]*[[11.,12.],[21.,22.]])
504
505 def test_hex_2D_order2_CellsPoints_AllData(self):
506 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2.msh"),optimize=False)
507 x_c=Function(dom).getX()
508 x_p=ContinuousFunction(dom).getX()
509 self.check_silo("hex_2D_o2_cellnode_all",
510 data_sp=x_p[0],
511 data_vp=x_p[0]*[1.,2.],
512 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
513 data_sc=x_c[0],
514 data_vc=x_c[0]*[1.,2.],
515 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
516
517 # === Finley hex 2D order 2 (full) ==========================================
518
519 def test_hex_2D_order2p_empty(self):
520 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
521 self.check_silo("hex_2D_o2p", domain=dom)
522
523 def test_hex_2D_order2p_AllPoints_Scalar(self):
524 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
525 x=Solution(dom).getX()
526 x_r=ReducedSolution(dom).getX()
527 x_n=ContinuousFunction(dom).getX()
528 self.check_silo("hex_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
529
530 def test_hex_2D_order2p_2Cells_Scalar(self):
531 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
532 x=Function(dom).getX()
533 x_b=FunctionOnBoundary(dom).getX()
534 self.check_silo("hex_2D_o2p_cell_2xs", data_b=x_b[0], data=x[0])
535
536 def test_hex_2D_order2p_BoundaryPoint_Scalar(self):
537 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
538 x=ContinuousFunction(dom).getX()
539 x_b=FunctionOnBoundary(dom).getX()
540 self.check_silo("hex_2D_o2p_boundary_2xs", data=x[0],data_b=x_b[0])
541
542 def test_hex_2D_order2p_CellsPoints_AllData(self):
543 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
544 x_c=Function(dom).getX()
545 x_p=ContinuousFunction(dom).getX()
546 self.check_silo("hex_2D_o2p_cellnode_all",
547 data_sp=x_p[0],
548 data_vp=x_p[0]*[1.,2.],
549 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
550 data_sc=x_c[0],
551 data_vc=x_c[0]*[1.,2.],
552 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
553
554 def test_hex_2D_order2p_ContinuousFunction(self):
555 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
556 x=ContinuousFunction(dom).getX()
557 self.check_silo("hex_2D_o2p_node", 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_Solution(self):
561 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
562 x=Solution(dom).getX()
563 self.check_silo("hex_2D_o2p_node", 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_ReducedSolution(self):
567 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
568 x=ReducedSolution(dom).getX()
569 self.check_silo("hex_2D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
570 data_t=x[0]*[[11.,12.],[21.,22.]])
571
572 def test_hex_2D_order2p_Function(self):
573 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
574 x=Function(dom).getX()
575 self.check_silo("hex_2D_o2p_cell", data_s=x[0], data_v=x[0]*[1.,2.],
576 data_t=x[0]*[[11.,12.],[21.,22.]])
577
578 def test_hex_2D_order2p_ReducedFunction(self):
579 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
580 x=ReducedFunction(dom).getX()
581 self.check_silo("hex_2D_o2p_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
582 data_t=x[0]*[[11.,12.],[21.,22.]])
583
584 def test_hex_2D_order2p_FunctionOnBoundary(self):
585 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
586 x=FunctionOnBoundary(dom).getX()
587 self.check_silo("hex_2D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
588 data_t=x[0]*[[11.,12.],[21.,22.]])
589
590 def test_hex_2D_order2p_ReducedFunctionOnBoundary(self):
591 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_order2p.msh"),optimize=False)
592 x=ReducedFunctionOnBoundary(dom).getX()
593 self.check_silo("hex_2D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
594 data_t=x[0]*[[11.,12.],[21.,22.]])
595
596 # === Finley hex 2D macro ===================================================
597
598 def test_hex_2D_macro_empty(self):
599 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
600 self.check_silo("hex_2D_o2p", domain=dom)
601
602 def test_hex_2D_macro_AllPoints_Scalar(self):
603 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
604 x=Solution(dom).getX()
605 x_r=ReducedSolution(dom).getX()
606 x_n=ContinuousFunction(dom).getX()
607 self.check_silo("hex_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
608
609 def test_hex_2D_macro_CellsPoints(self):
610 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
611 x_c=Function(dom).getX()
612 x_p=ContinuousFunction(dom).getX()
613 self.check_silo("hex_2D_macro_cellnode_all",
614 data_sp=x_p[0],
615 data_vp=x_p[0]*[1.,2.],
616 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
617 data_sc=x_c[0],
618 data_vc=x_c[0]*[1.,2.],
619 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
620
621 def test_hex_2D_macro_2Cells_Scalar(self):
622 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
623 x=Function(dom).getX()
624 x_b=FunctionOnBoundary(dom).getX()
625 self.check_silo("hex_2D_cell_2xs", data_b=x_b[0], data=x[0])
626
627 def test_hex_2D_macro_BoundaryPoint_Scalar(self):
628 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
629 x=ContinuousFunction(dom).getX()
630 x_b=FunctionOnBoundary(dom).getX()
631 self.check_silo("hex_2D_boundary_2xs", data_b=x_b[0], data=x[0])
632
633 def test_hex_2D_macro_ContinuousFunction(self):
634 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
635 x=ContinuousFunction(dom).getX()
636 self.check_silo("hex_2D_o2p_node", 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_Solution(self):
640 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
641 x=Solution(dom).getX()
642 self.check_silo("hex_2D_o2p_node", 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_ReducedSolution(self):
646 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
647 x=ReducedSolution(dom).getX()
648 self.check_silo("hex_2D_o2p_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
649 data_t=x[0]*[[11.,12.],[21.,22.]])
650
651 def test_hex_2D_macro_Function(self):
652 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
653 x=Function(dom).getX()
654 self.check_silo("hex_2D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.],
655 data_t=x[0]*[[11.,12.],[21.,22.]])
656
657 def test_hex_2D_macro_ReducedFunction(self):
658 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
659 x=ReducedFunction(dom).getX()
660 self.check_silo("hex_2D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
661 data_t=x[0]*[[11.,12.],[21.,22.]])
662
663 def test_hex_2D_macro_FunctionOnBoundary(self):
664 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
665 x=FunctionOnBoundary(dom).getX()
666 self.check_silo("hex_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
667 data_t=x[0]*[[11.,12.],[21.,22.]])
668
669 def test_hex_2D_macro_ReducedFunctionOnBoundary(self):
670 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_2D_macro.msh"),optimize=False)
671 x=ReducedFunctionOnBoundary(dom).getX()
672 self.check_silo("hex_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
673 data_t=x[0]*[[11.,12.],[21.,22.]])
674
675 # === Finley hex 3D order 1 with contacts ===================================
676
677 def test_hex_contact_3D_order1_ContinuousFunction(self):
678 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
679 x=ContinuousFunction(dom).getX()
680 self.check_silo("hex_3D_o1_node", 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_Solution(self):
684 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
685 x=Solution(dom).getX()
686 self.check_silo("hex_3D_o1_node", 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_ReducedSolution(self):
690 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
691 x=ReducedSolution(dom).getX()
692 self.check_silo("hex_3D_o1_node", 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_Function(self):
696 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
697 x=Function(dom).getX()
698 self.check_silo("hex_3D_o1_cell", 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_ReducedFunction(self):
702 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
703 x=ReducedFunction(dom).getX()
704 self.check_silo("hex_3D_o1_cell", 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_FunctionOnBoundary(self):
708 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
709 x=FunctionOnBoundary(dom).getX()
710 self.check_silo("hex_3D_o1_boundary", 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_ReducedFunctionOnBoundary(self):
714 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
715 x=ReducedFunctionOnBoundary(dom).getX()
716 self.check_silo("hex_3D_o1_boundary", 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_FunctionOnBoundary(self):
720 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
721 x=FunctionOnBoundary(dom).getX()
722 self.check_silo("hex_3D_o1_f_boundary", 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_ReducedFunctionOnBoundary(self):
726 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
727 x=ReducedFunctionOnBoundary(dom).getX()
728 self.check_silo("hex_3D_o1_f_boundary", 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_FunctionOnContactZero(self):
732 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
733 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
738 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
739 x=ReducedFunctionOnContactZero(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_FunctionOnContactZero(self):
744 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
745 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
750 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
751 x=ReducedFunctionOnContactZero(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 def test_hex_contact_3D_order1_FunctionOnContactOne(self):
756 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
757 x=FunctionOnContactOne(dom).getX()
758 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
759 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
760
761 def test_hex_contact_3D_order1_ReducedFunctionOnContactOne(self):
762 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1.msh"),optimize=False)
763 x=ReducedFunctionOnContactOne(dom).getX()
764 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
765 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
766
767 def test_hex_contact_3D_order1_onFace_FunctionOnContactOne(self):
768 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
769 x=FunctionOnContactOne(dom).getX()
770 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
771 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
772
773 def test_hex_contact_3D_order1_onFace_ReducedFunctionOnContactOne(self):
774 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order1_onFace.msh"),optimize=False)
775 x=ReducedFunctionOnContactOne(dom).getX()
776 self.check_silo("hex_3D_o1_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
777 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
778
779 # === Finley hex 3D order 2 with contacts ===================================
780
781 def test_hex_contact_3D_order2_ContinuousFunction(self):
782 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
783 x=ContinuousFunction(dom).getX()
784 self.check_silo("hex_3D_o2_node", 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_Solution(self):
788 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
789 x=Solution(dom).getX()
790 self.check_silo("hex_3D_o2_node", 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_ReducedSolution(self):
794 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
795 x=ReducedSolution(dom).getX()
796 self.check_silo("hex_3D_o2_rnode", 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_Function(self):
800 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
801 x=Function(dom).getX()
802 self.check_silo("hex_3D_o2_cell", 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_ReducedFunction(self):
806 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
807 x=ReducedFunction(dom).getX()
808 self.check_silo("hex_3D_o2_cell", 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_FunctionOnBoundary(self):
812 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
813 x=FunctionOnBoundary(dom).getX()
814 self.check_silo("hex_3D_o2_boundary", 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_ReducedFunctionOnBoundary(self):
818 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
819 x=ReducedFunctionOnBoundary(dom).getX()
820 self.check_silo("hex_3D_o2_boundary", 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_FunctionOnBoundary(self):
824 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
825 x=FunctionOnBoundary(dom).getX()
826 self.check_silo("hex_3D_o2_f_boundary", 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_ReducedFunctionOnBoundary(self):
830 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
831 x=ReducedFunctionOnBoundary(dom).getX()
832 self.check_silo("hex_3D_o2_f_boundary", 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_FunctionOnContactZero(self):
836 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
837 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
842 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
843 x=ReducedFunctionOnContactZero(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_FunctionOnContactZero(self):
848 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
849 x=FunctionOnContactZero(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_ReducedFunctionOnContactZero(self):
854 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
855 x=ReducedFunctionOnContactZero(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 def test_hex_contact_3D_order2_FunctionOnContactOne(self):
860 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
861 x=FunctionOnContactOne(dom).getX()
862 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
863 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
864
865 def test_hex_contact_3D_order2_ReducedFunctionOnContactOne(self):
866 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2.msh"),optimize=False)
867 x=ReducedFunctionOnContactOne(dom).getX()
868 self.check_silo("hex_3D_o2_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
869 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
870
871 def test_hex_contact_3D_order2_onFace_FunctionOnContactOne(self):
872 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
873 x=FunctionOnContactOne(dom).getX()
874 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
875 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
876
877 def test_hex_contact_3D_order2_onFace_ReducedFunctionOnContactOne(self):
878 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_contact_3D_order2_onFace.msh"),optimize=False)
879 x=ReducedFunctionOnContactOne(dom).getX()
880 self.check_silo("hex_3D_o2_f_contact", data_s=x[0], data_v=x[0]*[1.,2.,3.],
881 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
882
883 # === Finley hex 3D order 2 (full) ==========================================
884
885 def test_hex_3D_order2p_ContinuousFunction(self):
886 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
887 x=ContinuousFunction(dom).getX()
888 self.check_silo("hex_3D_o2p_node", 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_Solution(self):
892 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
893 x=Solution(dom).getX()
894 self.check_silo("hex_3D_o2p_node", 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_ReducedSolution(self):
898 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
899 x=ReducedSolution(dom).getX()
900 self.check_silo("hex_3D_o2p_rnode", 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 def test_hex_3D_order2p_Function(self):
904 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
905 x=Function(dom).getX()
906 self.check_silo("hex_3D_o2p_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
907 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
908
909 def test_hex_3D_order2p_ReducedFunction(self):
910 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
911 x=ReducedFunction(dom).getX()
912 self.check_silo("hex_3D_o2p_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
913 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
914
915 def test_hex_3D_order2p_FunctionOnBoundary(self):
916 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
917 x=FunctionOnBoundary(dom).getX()
918 self.check_silo("hex_3D_o2p_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
919 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
920
921 def test_hex_3D_order2p_ReducedFunctionOnBoundary(self):
922 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_order2p.msh"),optimize=False)
923 x=ReducedFunctionOnBoundary(dom).getX()
924 self.check_silo("hex_3D_o2p_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
925 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
926
927 # === Finley hex 3D macro ===================================================
928
929 def test_hex_3D_macro_ContinuousFunction(self):
930 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
931 x=ContinuousFunction(dom).getX()
932 self.check_silo("hex_3D_o2p_node", 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_Solution(self):
936 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
937 x=Solution(dom).getX()
938 self.check_silo("hex_3D_o2p_node", 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_ReducedSolution(self):
942 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
943 x=ReducedSolution(dom).getX()
944 self.check_silo("hex_3D_o2p_rnode", 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 def test_hex_3D_macro_Function(self):
948 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
949 x=Function(dom).getX()
950 self.check_silo("hex_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
951 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
952
953 def test_hex_3D_macro_ReducedFunction(self):
954 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
955 x=ReducedFunction(dom).getX()
956 self.check_silo("hex_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
957 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
958
959 def test_hex_3D_macro_FunctionOnBoundary(self):
960 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
961 x=FunctionOnBoundary(dom).getX()
962 self.check_silo("hex_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
963 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
964
965 def test_hex_3D_macro_ReducedFunctionOnBoundary(self):
966 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"hex_3D_macro.msh"),optimize=False)
967 x=ReducedFunctionOnBoundary(dom).getX()
968 self.check_silo("hex_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
969 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
970
971 # === Finley tet 2D order 1 =================================================
972
973 def test_tet_2D_order1_ContinuousFunction(self):
974 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
975 x=ContinuousFunction(dom).getX()
976 self.check_silo("tet_2D_o1_node", 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_Solution(self):
980 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
981 x=Solution(dom).getX()
982 self.check_silo("tet_2D_o1_node", 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_ReducedSolution(self):
986 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
987 x=ReducedSolution(dom).getX()
988 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
989 data_t=x[0]*[[11.,12.],[21.,22.]])
990
991 def test_tet_2D_order1_Function(self):
992 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
993 x=Function(dom).getX()
994 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
995 data_t=x[0]*[[11.,12.],[21.,22.]])
996
997 def test_tet_2D_order1_ReducedFunction(self):
998 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
999 x=ReducedFunction(dom).getX()
1000 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1001 data_t=x[0]*[[11.,12.],[21.,22.]])
1002
1003 def test_tet_2D_order1_FunctionOnBoundary(self):
1004 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
1005 x=FunctionOnBoundary(dom).getX()
1006 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1007 data_t=x[0]*[[11.,12.],[21.,22.]])
1008
1009 def test_tet_2D_order1_ReducedFunctionOnBoundary(self):
1010 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order1.fly"),optimize=False)
1011 x=ReducedFunctionOnBoundary(dom).getX()
1012 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1013 data_t=x[0]*[[11.,12.],[21.,22.]])
1014
1015 # === Finley tet 2D order 2 =================================================
1016
1017 def test_tet_2D_order2(self):
1018 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1019 self.check_silo("tet_2D_o2", domain=dom)
1020
1021 def test_tet_2D_order2_AllPoints_Scalar(self):
1022 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1023 x=Solution(dom).getX()
1024 x_r=ReducedSolution(dom).getX()
1025 x_n=ContinuousFunction(dom).getX()
1026 self.check_silo("tet_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
1027
1028 def test_tet_2D_order2_02Points_Scalar(self):
1029 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1030 x=Solution(dom).getX()
1031 x_n=ContinuousFunction(dom).getX()
1032 self.check_silo("tet_2D_o2_node_2xs", data_n=x_n[0], data=x[0])
1033
1034 def test_tet_2D_order2_2Cells_Scalar(self):
1035 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1036 x=Function(dom).getX()
1037 x_b=FunctionOnBoundary(dom).getX()
1038 self.check_silo("tet_2D_o2_cell_2xs", data_b=x_b[0], data=x[0])
1039
1040 def test_tet_2D_order2_BoundaryPoint_Scalar(self):
1041 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1042 x=ContinuousFunction(dom).getX()
1043 x_b=FunctionOnBoundary(dom).getX()
1044 self.check_silo("tet_2D_o2_boundary_2xs", data=x[0],data_b=x_b[0])
1045
1046 def test_tet_2D_order2_Cells_AllData(self):
1047 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1048 x=Function(dom).getX()
1049 self.check_silo("tet_2D_o2_cell_all",
1050 data_s=x[0],
1051 data_v=x[0]*[1.,2.],
1052 data_t=x[0]*[[11.,12.],[21.,22.]],
1053 data_t2=x[0]*[[-11.,-12.],[-21.,-22.]])
1054
1055 def test_tet_2D_order2_CellsPoints_AllData(self):
1056 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1057 x_c=Function(dom).getX()
1058 x_p=ContinuousFunction(dom).getX()
1059 self.check_silo("tet_2D_o2_cellnode_all",
1060 data_sp=x_p[0],
1061 data_vp=x_p[0]*[1.,2.],
1062 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
1063 data_sc=x_c[0],
1064 data_vc=x_c[0]*[1.,2.],
1065 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
1066
1067 def test_tet_2D_order2_ContinuousFunction(self):
1068 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1069 x=ContinuousFunction(dom).getX()
1070 self.check_silo("tet_2D_o2_node", 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_Solution(self):
1074 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1075 x=Solution(dom).getX()
1076 self.check_silo("tet_2D_o2_node", 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_ReducedSolution(self):
1080 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1081 x=ReducedSolution(dom).getX()
1082 self.check_silo("tet_2D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
1083 data_t=x[0]*[[11.,12.],[21.,22.]])
1084
1085 def test_tet_2D_order2_Function(self):
1086 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1087 x=Function(dom).getX()
1088 self.check_silo("tet_2D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1089 data_t=x[0]*[[11.,12.],[21.,22.]])
1090
1091 def test_tet_2D_order2_ReducedFunction(self):
1092 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1093 x=ReducedFunction(dom).getX()
1094 self.check_silo("tet_2D_o2_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
1095 data_t=x[0]*[[11.,12.],[21.,22.]])
1096
1097 def test_tet_2D_order2_FunctionOnBoundary(self):
1098 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1099 x=FunctionOnBoundary(dom).getX()
1100 self.check_silo("tet_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1101 data_t=x[0]*[[11.,12.],[21.,22.]])
1102
1103 def test_tet_2D_order2_ReducedFunctionOnBoundary(self):
1104 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_order2.fly"),optimize=False)
1105 x=ReducedFunctionOnBoundary(dom).getX()
1106 self.check_silo("tet_2D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1107 data_t=x[0]*[[11.,12.],[21.,22.]])
1108
1109 # === Finley tet 2D macro ===================================================
1110
1111 def test_tet_2D_macro(self):
1112 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1113 self.check_silo("tet_2D_o2", domain=dom)
1114
1115 def test_tet_2D_macro_AllPoints_Scalar(self):
1116 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1117 x=Solution(dom).getX()
1118 x_r=ReducedSolution(dom).getX()
1119 x_n=ContinuousFunction(dom).getX()
1120 self.check_silo("tet_2D_o1_node_3xs", data_r=x_r[0], data_n=x_n[0], data=x[0])
1121
1122 def test_tet_2D_macro_02Points_Scalar(self):
1123 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1124 x=Solution(dom).getX()
1125 x_n=ContinuousFunction(dom).getX()
1126 self.check_silo("tet_2D_o2_node_2xs", data_n=x_n[0], data=x[0])
1127
1128 def test_tet_2D_macro_2Cells_Scalar(self):
1129 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1130 x=Function(dom).getX()
1131 x_b=FunctionOnBoundary(dom).getX()
1132 self.check_silo("tet_2D_cell_2xs", data_b=x_b[0], data=x[0])
1133
1134 def test_tet_2D_macro_BoundaryPoint_Scalar(self):
1135 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1136 x=ContinuousFunction(dom).getX()
1137 x_b=FunctionOnBoundary(dom).getX()
1138 self.check_silo("tet_2D_boundary_2xs", data_b=x_b[0], data=x[0])
1139
1140 def test_tet_2D_macro_CellsPoints_AllData(self):
1141 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1142 x_c=Function(dom).getX()
1143 x_p=ContinuousFunction(dom).getX()
1144 self.check_silo("tet_2D_macro_cellnode_all",
1145 data_sp=x_p[0],
1146 data_vp=x_p[0]*[1.,2.],
1147 data_tp=x_p[0]*[[11.,12.],[21.,22.]],
1148 data_sc=x_c[0],
1149 data_vc=x_c[0]*[1.,2.],
1150 data_tc=x_c[0]*[[11.,12.],[21.,22.]])
1151
1152 def test_tet_2D_macro_ContinuousFunction(self):
1153 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1154 x=ContinuousFunction(dom).getX()
1155 self.check_silo("tet_2D_o2_node", 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_Solution(self):
1159 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1160 x=Solution(dom).getX()
1161 self.check_silo("tet_2D_o2_node", 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_ReducedSolution(self):
1165 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1166 x=ReducedSolution(dom).getX()
1167 self.check_silo("tet_2D_o2_rnode", data_s=x[0], data_v=x[0]*[1.,2.],
1168 data_t=x[0]*[[11.,12.],[21.,22.]])
1169
1170 def test_tet_2D_macro_Function(self):
1171 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1172 x=Function(dom).getX()
1173 self.check_silo("tet_2D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1174 data_t=x[0]*[[11.,12.],[21.,22.]])
1175
1176 def test_tet_2D_macro_ReducedFunction(self):
1177 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1178 x=ReducedFunction(dom).getX()
1179 self.check_silo("tet_2D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.],
1180 data_t=x[0]*[[11.,12.],[21.,22.]])
1181
1182 def test_tet_2D_macro_FunctionOnBoundary(self):
1183 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1184 x=FunctionOnBoundary(dom).getX()
1185 self.check_silo("tet_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1186 data_t=x[0]*[[11.,12.],[21.,22.]])
1187
1188 def test_tet_2D_macro_ReducedFunctionOnBoundary(self):
1189 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_macro.fly"),optimize=False)
1190 x=ReducedFunctionOnBoundary(dom).getX()
1191 self.check_silo("tet_2D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1192 data_t=x[0]*[[11.,12.],[21.,22.]])
1193
1194 # === Finley tet 3D order 1 =================================================
1195
1196 def test_tet_3D_order1_ContinuousFunction(self):
1197 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1198 x=ContinuousFunction(dom).getX()
1199 self.check_silo("tet_3D_o1_node", 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_Solution(self):
1203 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1204 x=Solution(dom).getX()
1205 self.check_silo("tet_3D_o1_node", 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_ReducedSolution(self):
1209 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1210 x=ReducedSolution(dom).getX()
1211 self.check_silo("tet_3D_o1_node", 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 def test_tet_3D_order1_Function(self):
1215 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1216 x=Function(dom).getX()
1217 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1218 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1219
1220 def test_tet_3D_order1_ReducedFunction(self):
1221 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1222 x=ReducedFunction(dom).getX()
1223 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1224 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1225
1226 def test_tet_3D_order1_FunctionOnBoundary(self):
1227 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1228 x=FunctionOnBoundary(dom).getX()
1229 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1230 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1231
1232 def test_tet_3D_order1_ReducedFunctionOnBoundary(self):
1233 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order1.fly"),optimize=False)
1234 x=ReducedFunctionOnBoundary(dom).getX()
1235 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1236 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1237
1238 # === Finley tet 3D order 2 =================================================
1239
1240 def test_tet_3D_order2_ContinuousFunction(self):
1241 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1242 x=ContinuousFunction(dom).getX()
1243 self.check_silo("tet_3D_o2_node", 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_Solution(self):
1247 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1248 x=Solution(dom).getX()
1249 self.check_silo("tet_3D_o2_node", 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_ReducedSolution(self):
1253 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1254 x=ReducedSolution(dom).getX()
1255 self.check_silo("tet_3D_o2_rnode", 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 def test_tet_3D_order2_Function(self):
1259 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1260 x=Function(dom).getX()
1261 self.check_silo("tet_3D_o2_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1262 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1263
1264 def test_tet_3D_order2_ReducedFunction(self):
1265 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1266 x=ReducedFunction(dom).getX()
1267 self.check_silo("tet_3D_o2_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1268 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1269
1270 def test_tet_3D_order2_FunctionOnBoundary(self):
1271 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1272 x=FunctionOnBoundary(dom).getX()
1273 self.check_silo("tet_3D_o2_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1274 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1275
1276 def test_tet_3D_order2_ReducedFunctionOnBoundary(self):
1277 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_order2.fly"),optimize=False)
1278 x=ReducedFunctionOnBoundary(dom).getX()
1279 self.check_silo("tet_3D_o2_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1280 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1281
1282 # === Finley tet 3D macro ===================================================
1283
1284 def test_tet_3D_macro_ContinuousFunction(self):
1285 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1286 x=ContinuousFunction(dom).getX()
1287 self.check_silo("tet_3D_o2_node", 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_Solution(self):
1291 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1292 x=Solution(dom).getX()
1293 self.check_silo("tet_3D_o2_node", 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_ReducedSolution(self):
1297 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1298 x=ReducedSolution(dom).getX()
1299 self.check_silo("tet_3D_o2_rnode", 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 def test_tet_3D_macro_Function(self):
1303 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1304 x=Function(dom).getX()
1305 self.check_silo("tet_3D_macro_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1306 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1307
1308 def test_tet_3D_macro_ReducedFunction(self):
1309 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1310 x=ReducedFunction(dom).getX()
1311 self.check_silo("tet_3D_macro_rcell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1312 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1313
1314 def test_tet_3D_macro_FunctionOnBoundary(self):
1315 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1316 x=FunctionOnBoundary(dom).getX()
1317 self.check_silo("tet_3D_macro_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1318 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1319
1320 def test_tet_3D_macro_ReducedFunctionOnBoundary(self):
1321 dom=finley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_macro.fly"),optimize=False)
1322 x=ReducedFunctionOnBoundary(dom).getX()
1323 self.check_silo("tet_3D_macro_rboundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1324 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1325
1326 @unittest.skipIf(getMPISizeWorld()>1, "MPI size > 1")
1327 @unittest.skipIf(not HAVE_DUDLEY, "dudley module not available")
1328 @unittest.skipIf(not HAVE_SILO, "Silo module not available")
1329 class Test_Dudley_SaveSilo(SiloSaver):
1330
1331 # === Dudley 2D =============================================================
1332
1333 def test_tet_2D_dudley_ContinuousFunction(self):
1334 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1335 x=ContinuousFunction(dom).getX()
1336 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1337 data_t=x[0]*[[11.,12.],[21.,22.]])
1338
1339 def test_tet_2D_dudley_Solution(self):
1340 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1341 x=Solution(dom).getX()
1342 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1343 data_t=x[0]*[[11.,12.],[21.,22.]])
1344
1345 def test_tet_2D_dudley_ReducedSolution(self):
1346 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1347 x=ReducedSolution(dom).getX()
1348 self.check_silo("tet_2D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.],
1349 data_t=x[0]*[[11.,12.],[21.,22.]])
1350
1351 def test_tet_2D_dudley_Function(self):
1352 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1353 x=Function(dom).getX()
1354 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1355 data_t=x[0]*[[11.,12.],[21.,22.]])
1356
1357 def test_tet_2D_dudley_ReducedFunction(self):
1358 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1359 x=ReducedFunction(dom).getX()
1360 self.check_silo("tet_2D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1361 data_t=x[0]*[[11.,12.],[21.,22.]])
1362
1363 def test_tet_2D_dudley_FunctionOnBoundary(self):
1364 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1365 x=FunctionOnBoundary(dom).getX()
1366 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1367 data_t=x[0]*[[11.,12.],[21.,22.]])
1368
1369 def test_tet_2D_dudley_ReducedFunctionOnBoundary(self):
1370 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_2D_dudley.fly"),optimize=False)
1371 x=ReducedFunctionOnBoundary(dom).getX()
1372 self.check_silo("tet_2D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1373 data_t=x[0]*[[11.,12.],[21.,22.]])
1374
1375 # === Dudley 3D =============================================================
1376
1377 def test_tet_3D_dudley_ContinuousFunction(self):
1378 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1379 x=ContinuousFunction(dom).getX()
1380 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1381 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1382
1383 def test_tet_3D_dudley_Solution(self):
1384 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1385 x=Solution(dom).getX()
1386 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1387 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1388
1389 def test_tet_3D_dudley_ReducedSolution(self):
1390 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1391 x=ReducedSolution(dom).getX()
1392 self.check_silo("tet_3D_o1_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1393 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1394
1395 def test_tet_3D_dudley_Function(self):
1396 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1397 x=Function(dom).getX()
1398 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1399 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1400
1401 def test_tet_3D_dudley_ReducedFunction(self):
1402 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1403 x=ReducedFunction(dom).getX()
1404 self.check_silo("tet_3D_o1_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1405 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1406
1407 def test_tet_3D_dudley_FunctionOnBoundary(self):
1408 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1409 x=FunctionOnBoundary(dom).getX()
1410 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1411 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1412
1413 def test_tet_3D_dudley_ReducedFunctionOnBoundary(self):
1414 dom=dudley.ReadMesh(os.path.join(WEIPA_TEST_MESHES,"tet_3D_dudley.fly"),optimize=False)
1415 x=ReducedFunctionOnBoundary(dom).getX()
1416 self.check_silo("tet_3D_o1_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1417 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1418
1419 @unittest.skipIf(getMPISizeWorld()>1, "MPI size > 1")
1420 @unittest.skipIf(not HAVE_RIPLEY, "ripley module not available")
1421 @unittest.skipIf(not HAVE_SILO, "Silo module not available")
1422 class Test_Ripley_SaveSilo(SiloSaver):
1423
1424 # === Ripley 2D =============================================================
1425
1426 def test_ripley_2D_ContinuousFunction(self):
1427 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1428 x=ContinuousFunction(dom).getX()
1429 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1430 data_t=x[0]*[[11.,12.],[21.,22.]])
1431
1432 def test_ripley_2D_Solution(self):
1433 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1434 x=Solution(dom).getX()
1435 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1436 data_t=x[0]*[[11.,12.],[21.,22.]])
1437
1438 def test_ripley_2D_ReducedSolution(self):
1439 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1440 x=ReducedSolution(dom).getX()
1441 self.check_silo("ripley_2D_node", data_s=x[0], data_v=x[0]*[1.,2.],
1442 data_t=x[0]*[[11.,12.],[21.,22.]])
1443
1444 def test_ripley_2D_Function(self):
1445 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1446 x=Function(dom).getX()
1447 self.check_silo("ripley_2D_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1448 data_t=x[0]*[[11.,12.],[21.,22.]])
1449
1450 def test_ripley_2D_ReducedFunction(self):
1451 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1452 x=ReducedFunction(dom).getX()
1453 self.check_silo("ripley_2D_cell", data_s=x[0], data_v=x[0]*[1.,2.],
1454 data_t=x[0]*[[11.,12.],[21.,22.]])
1455
1456 def test_ripley_2D_FunctionOnBoundary(self):
1457 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1458 x=FunctionOnBoundary(dom).getX()
1459 self.check_silo("ripley_2D_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1460 data_t=x[0]*[[11.,12.],[21.,22.]])
1461
1462 def test_ripley_2D_ReducedFunctionOnBoundary(self):
1463 dom=ripley.Rectangle(n0=11, n1=3, l0=(-2.5,8.0), l1=(1.2,3.8), d0=getMPISizeWorld())
1464 x=ReducedFunctionOnBoundary(dom).getX()
1465 self.check_silo("ripley_2D_boundary", data_s=x[0], data_v=x[0]*[1.,2.],
1466 data_t=x[0]*[[11.,12.],[21.,22.]])
1467
1468 # === Ripley 3D =============================================================
1469
1470 def test_ripley_3D_ContinuousFunction(self):
1471 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)
1472 x=ContinuousFunction(dom).getX()
1473 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1474 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1475
1476 def test_ripley_3D_Solution(self):
1477 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)
1478 x=Solution(dom).getX()
1479 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1480 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1481
1482 def test_ripley_3D_ReducedSolution(self):
1483 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)
1484 x=ReducedSolution(dom).getX()
1485 self.check_silo("ripley_3D_node", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1486 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1487
1488 def test_ripley_3D_Function(self):
1489 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)
1490 x=Function(dom).getX()
1491 self.check_silo("ripley_3D_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1492 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1493
1494 def test_ripley_3D_ReducedFunction(self):
1495 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)
1496 x=ReducedFunction(dom).getX()
1497 self.check_silo("ripley_3D_cell", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1498 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1499
1500 def test_ripley_3D_FunctionOnBoundary(self):
1501 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)
1502 x=FunctionOnBoundary(dom).getX()
1503 self.check_silo("ripley_3D_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1504 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1505
1506 def test_ripley_3D_ReducedFunctionOnBoundary(self):
1507 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)
1508 x=ReducedFunctionOnBoundary(dom).getX()
1509 self.check_silo("ripley_3D_boundary", data_s=x[0], data_v=x[0]*[1.,2.,3.],
1510 data_t=x[0]*[[11.,12.,13.],[21.,22.,23.],[31.,32.,33.]])
1511
1512
1513 if __name__ == '__main__':
1514 run_tests(__name__, exit_on_failure=True)
1515

  ViewVC Help
Powered by ViewVC 1.1.26