本文整理匯總了Python中dolfin.UnitSquareMesh.coordinates()[parent_vertex_indices_1[:]]方法的典型用法代碼示例。如果您正苦於以下問題:Python UnitSquareMesh.coordinates()[parent_vertex_indices_1[:]]方法的具體用法?Python UnitSquareMesh.coordinates()[parent_vertex_indices_1[:]]怎麽用?Python UnitSquareMesh.coordinates()[parent_vertex_indices_1[:]]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dolfin.UnitSquareMesh
的用法示例。
在下文中一共展示了UnitSquareMesh.coordinates()[parent_vertex_indices_1[:]]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_ale
# 需要導入模塊: from dolfin import UnitSquareMesh [as 別名]
# 或者: from dolfin.UnitSquareMesh import coordinates()[parent_vertex_indices_1[:]] [as 別名]
def test_ale(self):
print ""
print "Testing ALE::move(Mesh& mesh0, const Mesh& mesh1)"
# Create some mesh
mesh = UnitSquareMesh(4, 5)
# Make some cell function
# FIXME: Initialization by array indexing is probably
# not a good way for parallel test
cellfunc = CellFunction('size_t', mesh)
cellfunc.array()[0:4] = 0
cellfunc.array()[4:] = 1
# Create submeshes - this does not work in parallel
submesh0 = SubMesh(mesh, cellfunc, 0)
submesh1 = SubMesh(mesh, cellfunc, 1)
# Move submesh0
disp = Constant(("0.1", "-0.1"))
submesh0.move(disp)
# Move and smooth submesh1 accordignly
submesh1.move(submesh0)
# Move mesh accordingly
parent_vertex_indices_0 = \
submesh0.data().array('parent_vertex_indices', 0)
parent_vertex_indices_1 = \
submesh1.data().array('parent_vertex_indices', 0)
mesh.coordinates()[parent_vertex_indices_0[:]] = \
submesh0.coordinates()[:]
mesh.coordinates()[parent_vertex_indices_1[:]] = \
submesh1.coordinates()[:]
# If test passes here then it is probably working
# Check for cell quality for sure
magic_number = 0.28
rmin = MeshQuality.radius_ratio_min_max(mesh)[0]
self.assertTrue(rmin > magic_number)