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


Python PerceptMesh.open_read_only方法代码示例

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


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

示例1: test_use_case_3

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

示例2: test_break_tet4_tet10_1

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

示例3: test_mesh_diff

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


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