本文整理汇总了Python中pylith.topology.Mesh.Mesh类的典型用法代码示例。如果您正苦于以下问题:Python Mesh类的具体用法?Python Mesh怎么用?Python Mesh使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mesh类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: read
def read(self, debug, interpolate):
"""
Read finite-element mesh and store in Sieve mesh object.
@returns PETSc mesh object containing finite-element mesh
"""
from pylith.mpi.Communicator import mpi_comm_world
comm = mpi_comm_world()
if 0 == comm.rank:
self._info.log("Reading finite-element mesh")
# Set flags
self.debug(debug)
self.interpolate(interpolate)
# Initialize coordinate system
if self.coordsys is None:
raise ValueError, "Coordinate system for mesh is unknown."
from pylith.mpi.Communicator import petsc_comm_world
from pylith.topology.Mesh import Mesh
mesh = Mesh(dim=self.coordsys.spaceDim(), comm=petsc_comm_world())
mesh.coordsys(self.coordsys)
# Read mesh
ModuleMeshIO.read(self, mesh)
return mesh
开发者ID:geodynamics,项目名称:pylith,代码行数:27,代码来源:MeshIOObj.py
示例2: test_dimension
def test_dimension(self):
"""
Test debug().
"""
mesh = Mesh()
self.assertEqual(0, mesh.dimension())
return
开发者ID:geodynamics,项目名称:pylith,代码行数:7,代码来源:TestMesh.py
示例3: test_coordsys
def test_coordsys(self):
"""
Test coordsys().
"""
mesh = self._getMesh()
submesh = Mesh(mesh=mesh, label="bc")
self.assertEqual(2, submesh.coordsys().spaceDim())
return
开发者ID:youngsolar,项目名称:pylith,代码行数:8,代码来源:TestSubMesh.py
示例4: test_constructorA
def test_constructorA(self):
"""
Test constructor.
"""
mesh = Mesh()
self.assertEqual(0, mesh.dimension())
self.assertEqual(False, mesh.debug())
return
开发者ID:youngsolar,项目名称:pylith,代码行数:8,代码来源:TestSubMesh.py
示例5: test_dimension
def test_dimension(self):
"""
Test debug().
"""
mesh = self._getMesh()
submesh = Mesh(mesh=mesh, label="bc")
self.assertEqual(1, submesh.dimension())
return
开发者ID:youngsolar,项目名称:pylith,代码行数:9,代码来源:TestSubMesh.py
示例6: test_constructorB
def test_constructorB(self):
"""
Test constructor.
"""
mesh = self._getMesh()
submesh = Mesh(mesh=mesh, label="bc")
self.assertEqual(1, submesh.dimension())
self.assertEqual(False, mesh.debug())
return
开发者ID:youngsolar,项目名称:pylith,代码行数:9,代码来源:TestSubMesh.py
示例7: test_constructorB
def test_constructorB(self):
"""
Test constructor.
"""
dim = 2
mesh = Mesh(dim=dim)
self.assertEqual(dim, mesh.dimension())
self.assertEqual(False, mesh.debug())
return
开发者ID:geodynamics,项目名称:pylith,代码行数:9,代码来源:TestMesh.py
示例8: test_constructorC
def test_constructorC(self):
"""
Test constructor.
"""
dim = 2
from pylith.mpi.Communicator import mpi_comm_self
mesh = Mesh(dim=dim, comm=mpi_comm_self())
self.assertEqual(dim, mesh.dimension())
self.assertEqual(False, mesh.debug())
return
开发者ID:geodynamics,项目名称:pylith,代码行数:10,代码来源:TestMesh.py
示例9: test_comm
def test_comm(self):
"""
Test comm().
"""
from pylith.mpi.Communicator import petsc_comm_self
mesh = Mesh(dim=3, comm=petsc_comm_self())
comm = mesh.comm()
self.assertEqual(0, comm.rank)
self.assertEqual(1, comm.size)
return
开发者ID:geodynamics,项目名称:pylith,代码行数:10,代码来源:TestMesh.py
示例10: test_comm
def test_comm(self):
"""
Test comm().
"""
mesh = self._getMesh()
submesh = Mesh(mesh=mesh, label="bc")
comm = submesh.comm()
self.assertEqual(0, comm.rank)
self.assertEqual(1, comm.size)
return
开发者ID:youngsolar,项目名称:pylith,代码行数:11,代码来源:TestSubMesh.py
示例11: test_debug
def test_debug(self):
"""
Test debug().
"""
mesh = Mesh()
self.assertEqual(False, mesh.debug())
mesh.debug(True)
self.assertEqual(True, mesh.debug())
return
开发者ID:geodynamics,项目名称:pylith,代码行数:11,代码来源:TestMesh.py
示例12: test_debug
def test_debug(self):
"""
Test debug().
"""
mesh = self._getMesh()
submesh = Mesh(mesh=mesh, label="bc")
self.assertEqual(False, submesh.debug())
submesh.debug(True)
self.assertEqual(True, submesh.debug())
return
开发者ID:youngsolar,项目名称:pylith,代码行数:12,代码来源:TestSubMesh.py
示例13: test_coordsys
def test_coordsys(self):
"""
Test coordsys().
"""
from spatialdata.geocoords.CSCart import CSCart
cs = CSCart()
cs.inventory.spaceDim = 2
cs._configure()
mesh = Mesh()
mesh.coordsys(cs)
self.assertEqual(cs.spaceDim(), mesh.coordsys().spaceDim())
return
开发者ID:geodynamics,项目名称:pylith,代码行数:13,代码来源:TestMesh.py
注:本文中的pylith.topology.Mesh.Mesh类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论