def testBoundaryRead(self): blk=ParsedBlockMeshDict(SolutionDirectory(self.dest).blockMesh()) self.assertEqual(blk.convertToMeters(),1.) self.assertEqual(len(blk.vertices()),22) self.assertEqual(len(blk.blocks()),5) self.assertEqual(len(blk.patches()),6) self.assertEqual(len(blk.arcs()),8) self.assertEqual(blk.typicalLength(),1.25) self.assertEqual(str(blk.getBounds()),"([0.0, 0.0, 0.0], [2.0, 2.0, 0.5])")
def testBoundaryRead(self): blk = ParsedBlockMeshDict(SolutionDirectory(self.dest).blockMesh()) self.assertEqual(blk.convertToMeters(), 1.) self.assertEqual(len(blk.vertices()), 22) self.assertEqual(len(blk.blocks()), 5) self.assertEqual(len(blk.patches()), 6) self.assertEqual(len(blk.arcs()), 8) self.assertEqual(blk.typicalLength(), 1.25) self.assertEqual(str(blk.getBounds()), "([0.0, 0.0, 0.0], [2.0, 2.0, 0.5])")
import sys from PyFoam.RunDictionary.ParsedBlockMeshDict import ParsedBlockMeshDict bm=ParsedBlockMeshDict(sys.argv[1]) print "Vertices: " print bm.vertices() print "Blocks: " print bm.blocks() print "Patches:" print bm.patches() print "Arcs:" print bm.arcs() print "Min/Max",bm.getBounds() print "Typical Length: ",bm.typicalLength() print bm["edges"]