本文整理汇总了Python中PerceptMesh.open方法的典型用法代码示例。如果您正苦于以下问题:Python PerceptMesh.open方法的具体用法?Python PerceptMesh.open怎么用?Python PerceptMesh.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PerceptMesh
的用法示例。
在下文中一共展示了PerceptMesh.open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hex27_hex27_0
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")
示例2: test_break_quad4_to_quad9_to_quad9
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_break_quad4_to_quad9_to_quad9(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
doGenSideSets = True
if p_size <= 3:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(pm, nx, ny, doGenSideSets)
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)
breaker = Refiner(eMesh, QUAD4_QUAD9_1, proc_rank_field)
eMesh.commit()
fixture.generate_mesh()
breaker.doBreak()
eMesh.save_as("quad_fixture_quad9_quad9_0.e")
em1 = PerceptMesh(2)
em1.open("quad_fixture_quad9_quad9_0.e")
scalarDimension = 0
proc_rank_field = em1.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(em1, QUAD9_QUAD9_4, proc_rank_field)
em1.commit()
breaker.doBreak()
em1.save_as("quad_fixture_quad9_quad9_1.e")
示例3: test_hex27_hex27_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")
示例4: test_use_case_3
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_use_case_3(self):
try:
subprocess.call("sierra aria -i tet_mesh.e -o result_0.e")
pMesh = PerceptMesh()
pMesh.open("tet-mesh.e")
uniform_refiner = Refiner(pMesh, TET4_TET4_8)
pMesh.commit()
uniform_refiner.doBreak()
pMesh.save_as("tet-mesh_refined.e")
subprocess.call("sierra aria -i tet_mesh_refined.e -o result_1.e")
pMesh_0 = PerceptMesh()
pMesh_1 = PerceptMesh()
pMesh_0.open_read_only("result_0.e")
pMesh_1.open_read_only("result_1.e")
ff_0 = Field_Function(pMesh_0)
ff_1 = Field_Function(pMesh_1)
diff = StringFunction("ff_0 - ff_1")
#diffnorm = eval_norm(pMesh.get_bulk_data, diff, 2)
#print "diffnorm = ", diffnorm
except:
print "Sierra not found."
示例5: test_break_quad_to_quad_sierra_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_break_quad_to_quad_sierra_2(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
doGenSideSets = True
if p_size <= 3:
n = 12
nx = n
ny = n
fixture = QuadFixture_4(pm,nx,ny,doGenSideSets)
isCommited = False
eMesh = PerceptMesh(fixture.meta_data, fixture.bulk_data, isCommited)
eMesh.commit()
fixture.generate_mesh()
eMesh.save_as("quad_fixture_mbreak_0.e")
eMesh.close()
eMesh1 = PerceptMesh(2)
eMesh1.open("quad_fixture_mbreak_0.e")
scalarDimension = 0
proc_rank_field = eMesh1.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh1, QUAD4_QUAD4_4_SIERRA, proc_rank_field)
eMesh1.commit()
i = 0
while i < 2:
print "\n\n\n ================ tmp Refine Pass = ", i
breaker.doBreak()
eMesh1.save_as("quad_fixture_mbreak_" + str(i) + ".e")
i = i + 1
示例6: test_hex20_hex20_1
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_hex20_hex20_1(self):
fixture_setup()
eMesh = PerceptMesh(3)
p_size = eMesh.get_parallel_size()
if p_size <= 3:
eMesh.open("hex20_hex20_cube1x1x"+str(p_size) + "_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX20_HEX20_8, proc_rank_field)
eMesh.commit()
breaker.setRemoveOldElements(True)
breaker.doBreak()
eMesh.save_as("hex20_hex20_cube1x1x" + str(p_size) + "_1.e")
示例7: test_hex8_tet4_6_12_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")
示例8: test_use_case_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_use_case_2(self):
pMesh = PerceptMesh() # create an empty PerceptMesh
pMesh.open("exodus_files/tet-mesh.e") # open the mesh, but don't commit its meta data
uniform_refiner = Refiner(pMesh, TET4_TET4_8) # define a Refiner on the mesh
pMesh.commit() # commit the mesh
i = 0
while i < 3:
uniform_refiner.doBreak() # refine the mesh 3 times
i = i + 1
pMesh.save_as("tet-mesh-refined-3-times.e") # save in exodus format
示例9: test_wedge6_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_wedge6_2(self):
fixture_setup()
eMesh = PerceptMesh(3)
p_size = eMesh.get_parallel_size()
if p_size == 1:
wedgeFixture = WedgeFixture()
wedgeFixture.createMesh(MPI.COMM_WORLD, 4,3,2,0,1,0,1,0,1, "swept_wedge_0.e")
eMesh.open("swept_wedge_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, WEDGE6_WEDGE6_8, proc_rank_field)
eMesh.commit()
breaker.doBreak()
eMesh.save_as("swept-wedge_1.e")
示例10: test_quad8_to_quad8
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_quad8_to_quad8(self):
fixture_setup()
pm = MPI.COMM_WORLD
p_size = parallel_machine_size(pm)
if p_size <= 3:
eMesh = PerceptMesh(2)
eMesh.open("quad_fixture_quad8_quad8_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, QUAD8_QUAD8_4, proc_rank_field)
eMesh.commit()
breaker.setIgnoreSideSets(False)
breaker.doBreak()
eMesh.save_as("quad_fixture_quad8_quad8_1.e")
示例11: test_hex20_hex20_1_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_hex20_hex20_1_2(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("hex20_hex20_0.e")
scalarDimension = 0
proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
breaker = Refiner(eMesh, HEX20_HEX20_8, proc_rank_field)
eMesh.commit()
eMesh.save_as("hex20_hex20_0.e")
breaker.doBreak()
eMesh.save_as("hex20_hex20_1.e")
示例12: test_use_case_2
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [as 别名]
def test_use_case_2(self):
pMesh = PerceptMesh()
pMesh.open("exodus_files/tet-mesh.e")
uniform_refiner = Refiner(pMesh, TET4_TET4_8)
pMesh.commit()
i = 0
while i < 3:
uniform_refiner.doBreak()
i = i + 1
pMesh.save_as("tet-mesh-refined-3-times.e")
示例13: test_break_quad_to_quad_sierra_sidesets
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")
示例14: test_break_quad_to_quad
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")
示例15: test_break_tri3_to_tri6_to_tri6_sierra
# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import open [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")