本文整理汇总了Python中PerceptMesh.print_info方法的典型用法代码示例。如果您正苦于以下问题:Python PerceptMesh.print_info方法的具体用法?Python PerceptMesh.print_info怎么用?Python PerceptMesh.print_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PerceptMesh
的用法示例。
在下文中一共展示了PerceptMesh.print_info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mesh_diff
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_mesh_diff(self):
self.fixture_setup()
p_size = parallel_machine_size(self.pm)
if p_size <= 2:
eMesh_0 = PerceptMesh(2)
eMesh_0.open_read_only("./exodus_files/quad_fixture.e")
eMesh_0.save_as("./exodus_files/quad_fixture_readwrite.e")
eMesh_1 = PerceptMesh(2)
eMesh_2 = PerceptMesh(2)
eMesh_1.open_read_only("./exodus_files/quad_fixture_readwrite.e")
eMesh_2.open_read_only("./exodus_files/quad_fixture.e")
if p_size == 1:
add_newlines = False
eMesh_1.print_info("quad fixture", 2, add_newlines)
eMesh_2.print_info("quad fixture", 2, add_newlines)
#Here the unit test compares an expected output string with the output of the print_infos
diff_msg = "diff report: "
diff = PerceptMesh.mesh_difference(eMesh_1, eMesh_2, diff_msg, True )
self.assertFalse(diff)
#metaData_1 = eMesh_1.get_fem_meta_data()
#metaData_2 = eMesh_2.get_fem_meta_data()
bulkData_1 = eMesh_1.get_bulk_data()
#bulkData_2 = eMesh_2.get_bulk_data()
#coordField_1 = eMesh_1.get_coordinates_field()
#coordField_2 = eMesh_2.get_coordinates_field()
#diff = PerceptMesh.mesh_difference(metaData_1, metaData_2, bulkData_1, bulkData_2, diff_msg, True)
#self.assertFalse(diff)
buckets = bulkData_1.buckets(FEMMetaData.NODE_RANK)
示例2: test_break_tri3_to_tri6_sierra
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_tri3_to_tri6_sierra(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
print p_size, "++++++++++++++++++++"
for i in range(100):
print "-------------------"
if p_size <= 3:
n = 12
nx = n
ny = n
createEdgeSets = True
fixture = QuadFixture_3(pm, nx, ny, createEdgeSets)
isCommited = False
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data, isCommited)
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
eMesh.add_field("proc_rank_ede", eMesh.edge_rank(), scalarDimension)
breaker = Refiner(eMesh, TRI3_TRI6_1, proc_rank_field)
eMesh.commit()
fixture.generate_mesh()
eMesh.print_info("tri mesh tri6")
eMesh.save_as("quad_fixture_tri3_tri6_0.e")
breaker.doBreak()
eMesh.print_info("tri mesh enriched")
eMesh.save_as("quad_fixture_tri6_tri6_0.e")
eMesh.save_as("quad_fixture_tri3_tri6_1.e")
示例3: fixture_setup_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def fixture_setup_1(self):
p_size = self.pm.size
if p_size <= 2:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(self.pm, nx, ny, 1)
fixture.meta_data.commit()
fixture.generate_mesh()
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data)
eMesh.print_info("quad fixture", 2)
eMesh.save_as("./exodus_files/quad_fixture.e")
if p_size <= 2:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(self.pm, nx, ny, 0)
fixture.meta_data.commit()
fixture.generate_mesh()
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data)
eMesh.print_info("quad fixture no sidesets", 2)
eMesh.save_as("./exodus_files/quad_fixture_no_sidesets.e")
示例4: test_hex27_hex27_0
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_hex27_hex27_0(self):
fixture_setup()
scalarDimension = 0
eMesh = PerceptMesh()
p_size = eMesh.get_parallel_size()
gmesh_spec = "1x1x" + str(p_size) + "|bbox:0,0,0,1,1," + str(p_size)
eMesh.new_mesh(GMeshSpec(gmesh_spec))
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX8_HEX27_1, proc_rank_field)
eMesh.commit()
eMesh.print_info()
eMesh.save_as("hex27_hex27_cube1x1x" + str(p_size) + "-orig.e")
breaker.setRemoveOldElements(True)
breaker.doBreak()
eMesh.save_as("hex27_hex27_cube1x1x" + str(p_size) + "_0.e")
em1 = PerceptMesh(3)
p_size = em1.get_parallel_size()
em1.open("hex27_hex27_cube1x1x" + str(p_size) + "_0.e")
proc_rank_field = em1.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(em1, HEX27_HEX27_8, proc_rank_field)
em1.commit()
breaker.setIgnoreSideSets(True)
breaker.setRemoveOldElements(True)
breaker.doBreak()
em1.save_as("hex27_hex27_cube1x1x" + str(p_size) + "_1.e")
示例5: test_hex27_hex27_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_hex27_hex27_1(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size == 1 or p_size == 3:
eMesh = PerceptMesh(3)
eMesh.open("hex_fixture.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX8_HEX27_1, proc_rank_field)
eMesh.commit()
eMesh.print_info()
eMesh.save_as("hex8_hex27_0.e")
breaker.doBreak()
eMesh.save_as("hex8_27_1.e")
if p_size == 1 or p_size == 3:
eMesh = PerceptMesh(3)
eMesh.open("hex8_27_1.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX27_HEX27_8, proc_rank_field)
eMesh.commit()
breaker.setRemoveOldElements(True)
breaker.doBreak()
eMesh.save_as("hex8_hex27_hex27_1.e")
示例6: test_hex8_tet4_6_12_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_hex8_tet4_6_12_2(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
eMesh = PerceptMesh(3)
eMesh.open("hex_fixture.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX8_TET4_6_12, proc_rank_field)
eMesh.commit()
eMesh.print_info()
breaker.doBreak()
eMesh.save_as("hex_tet_6_12_1.e")
示例7: test_hex8_tet4_6_12_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_hex8_tet4_6_12_1(self):
fixture_setup()
eMesh = PerceptMesh(3)
p_size = eMesh.get_parallel_size()
gmesh_spec = "1x1x" + str(p_size) + "|bbox:0,0,0,1,1," + str(p_size)
eMesh.new_mesh(GMeshSpec(gmesh_spec))
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX8_TET4_6_12, proc_rank_field)
eMesh.commit()
eMesh.print_info()
breaker.setRemoveOldElements(True)
breaker.doBreak()
eMesh.save_as("hex_tet_6_12_cube1x1x1.e")
示例8: test_break_quad_to_quad_sierra_sidesets
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_quad_to_quad_sierra_sidesets(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size == 1 or p_size == 2:
eMesh = PerceptMesh(2)
eMesh.open("quad_fixture.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, QUAD4_QUAD4_4_SIERRA, proc_rank_field)
eMesh.commit()
eMesh.print_info("after refinement break_quad_to_quad_sierra_sidesets")
breaker.doBreak()
eMesh.save_as("quad_sidesets_sierra_out.e")
示例9: test_break_tri_to_tri_sierra_0
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_tri_to_tri_sierra_0(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size <= 3:
n = 12
nx = n
ny = n
fixture = QuadFixture_3(pm, nx, ny, True)
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data, False)
eMesh.commit()
fixture.generate_mesh()
eMesh.print_info("tri mesh")
eMesh.save_as("quad_fixture_tri3.e")
示例10: test_quad4_quad4_test_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_quad4_quad4_test_1(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size <= 3:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(pm,nx,ny,True)
fixture.meta_data.commit()
fixture.generate_mesh()
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data)
eMesh.print_info("quad fixture")
eMesh.save_as("quad_fixture_test_1.e")
示例11: test_break_quad_to_quad
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_quad_to_quad(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size == 1 or p_size == 3:
eMesh = PerceptMesh(2)
eMesh.open("quad_fixture_no_sidesets.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, QUAD4_QUAD4_4, proc_rank_field)
eMesh.commit()
eMesh.print_info("quad mesh")
breaker.setIgnoreSideSets(True)
breaker.doBreak()
eMesh.save_as("square_quad4_ref_out.e")
示例12: test_fieldFunction_demo_1_0_0
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_fieldFunction_demo_1_0_0(self):
eMesh = PerceptMesh(3)
eMesh.new_mesh(GMeshSpec("3x3x3|bbox:0,0,0,1,1,1"))
eMesh.commit()
eMesh.print_info("fieldFunction_demo_1_0_0", 2)
f_coords = eMesh.get_field("coordinates")
ff_coords = FieldFunction("ff_coords", f_coords, eMesh, 3, 3)
x = 0.123
y = 0.234
z = 0.345
time = 0.0
eval_vec3_print(x, y, z, time, ff_coords)
示例13: test_break_tri3_to_tri6_to_tri6_sierra
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_tri3_to_tri6_to_tri6_sierra(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size <= 3:
eMesh = PerceptMesh(2)
eMesh.open("quad_fixture_tri6_tri6_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
eMesh.add_field("proc_rank_ede", eMesh.edge_rank(), scalarDimension)
breaker = Refiner(eMesh, TRI6_TRI6_4, proc_rank_field)
eMesh.commit()
eMesh.print_info("tri mesh tri6")
eMesh.save_as("quad_fixture_tri6_tri6_0.e")
breaker.doBreak()
eMesh.print_info("tri mesh refined")
eMesh.save_as("quad_fixture_tri6_tri6_1.e")
示例14: test_break_quad_to_quad_sierra
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_quad_to_quad_sierra(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size <= 3:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(pm, nx, ny, True)
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data, False)
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, QUAD4_QUAD4_4_SIERRA, proc_rank_field)
eMesh.commit()
fixture.generate_mesh()
eMesh.print_info("quad mesh")
breaker.doBreak()
示例15: test_break_tet4_tet10_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import print_info [as 别名]
def test_break_tet4_tet10_1(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size == 1 or p_size == 3:
eMesh = PerceptMesh(3)
eMesh.open_read_only("tet_fixture.e")
eMesh.save_as("tet_from_hex_fixture_0.e")
if p_size == 1 or p_size == 3:
eMesh = PerceptMesh(3)
eMesh.open("tet_from_hex_fixture_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, TET4_TET10_1, proc_rank_field)
eMesh.commit()
eMesh.print_info("tet mesh")
breaker.doBreak()
eMesh.save_as("tet10_1.e")