当前位置: 首页>>代码示例>>Python>>正文


Python PerceptMesh.element_rank方法代码示例

本文整理汇总了Python中PerceptMesh.element_rank方法的典型用法代码示例。如果您正苦于以下问题:Python PerceptMesh.element_rank方法的具体用法?Python PerceptMesh.element_rank怎么用?Python PerceptMesh.element_rank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PerceptMesh的用法示例。


在下文中一共展示了PerceptMesh.element_rank方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_hex27_hex27_0

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:29,代码来源:UniformRefinerUnitTests.py

示例2: test_hex27_hex27_1

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:27,代码来源:UniformRefinerUnitTests.py

示例3: test_break_quad4_to_quad9_to_quad9

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:30,代码来源:UniformRefinerUnitTests.py

示例4: test_break_tri3_to_tri6_sierra

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:30,代码来源:UniformRefinerUnitTests.py

示例5: test_break_quad_to_quad_sierra_2

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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
开发者ID:00liujj,项目名称:trilinos,代码行数:32,代码来源:UniformRefinerUnitTests.py

示例6: test_hex8_hex8_8_1

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [as 别名]
 def test_hex8_hex8_8_1(self):
   fixture_setup()
   eMesh = PerceptMesh()
   p_size = eMesh.get_parallel_size()
   gmesh_spec = "4x4x"+str(4*p_size)+"|bbox:0,0,0,1,1,1"
   eMesh.new_mesh(GMeshSpec(gmesh_spec))
   scalarDimension = 0
   proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
   breaker = Refiner(eMesh, HEX8_HEX8_8, proc_rank_field)
   eMesh.commit()
   breaker.doBreak
开发者ID:00liujj,项目名称:trilinos,代码行数:13,代码来源:UniformRefinerUnitTests.py

示例7: test_wedge6_wedge18_enrich

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [as 别名]
 def test_wedge6_wedge18_enrich(self):
   pm = MPI.COMM_WORLD
   p_size = parallel_machine_size(pm)
   if p_size == 1:
     wedgeFixture = WedgeFixture()
     bulk = wedgeFixture.createMesh(MPI.COMM_WORLD, 4,3,2,0,1,0,1,0,1,"")
     eMesh = PerceptMesh(wedgeFixture.getMetaData(), bulk, False)
     scalarDimension = 0
     proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
     breaker = Refiner(eMesh, WEDGE6_WEDGE18_1, proc_rank_field)
     eMesh.commit()
     wedgeFixture.createBulkAfterMetaCommit(MPI.COMM_WORLD)
     breaker.doBreak()
开发者ID:00liujj,项目名称:trilinos,代码行数:15,代码来源:UniformRefinerUnitTests.py

示例8: test_hex20_hex20_1

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:15,代码来源:UniformRefinerUnitTests.py

示例9: test_hex8_tet4_6_12_2

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:15,代码来源:UniformRefinerUnitTests.py

示例10: test_hex20_hex20_1_2

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:16,代码来源:UniformRefinerUnitTests.py

示例11: test_quad8_to_quad8

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:16,代码来源:UniformRefinerUnitTests.py

示例12: test_wedge6_2

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:16,代码来源:UniformRefinerUnitTests.py

示例13: test_hex8_tet4_6_12_1

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:16,代码来源:UniformRefinerUnitTests.py

示例14: test_break_quad_to_quad_sierra_sidesets

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [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")
开发者ID:00liujj,项目名称:trilinos,代码行数:16,代码来源:UniformRefinerUnitTests.py

示例15: test_wedge6_wedge18_enrich

# 需要导入模块: import PerceptMesh [as 别名]
# 或者: from PerceptMesh import element_rank [as 别名]
 def test_wedge6_wedge18_enrich(self):
     pm = MPI.COMM_WORLD
     p_size = parallel_machine_size(pm)
     if p_size == 1:
         wedgeFixture = WedgeFixture()
         bulk = wedgeFixture.createMesh(MPI.COMM_WORLD, 4,3,2,0,1,0,1,0,1,"")   # create stk::mesh::BulkData from wedge fixture
         eMesh = PerceptMesh(wedgeFixture.getMetaData(), bulk, False)           # adopt bulk data
         scalarDimension = 0
         proc_rank_field = eMesh.add_field("proc_rank", eMesh.element_rank(), scalarDimension)
         breaker = Refiner(eMesh, WEDGE6_WEDGE15_1, proc_rank_field)
         eMesh.commit()
         wedgeFixture.createBulkAfterMetaCommit(MPI.COMM_WORLD)         # generate the mesh
         breaker.doBreak()                                              # refine
         eMesh.save_as("./wedge6-15.e")                                  # save
开发者ID:gitter-badger,项目名称:quinoa,代码行数:16,代码来源:Example2.py


注:本文中的PerceptMesh.element_rank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。