コード例 #1
0
def get_highest_dimension_mesh(fieldmodule: Fieldmodule) -> Mesh:
    '''
    Get highest dimension non-empty mesh.
    :return: Zinc Mesh or None if all are empty.
    '''
    for dimension in range(3, 0, -1):
        mesh = fieldmodule.findMeshByDimension(dimension)
        if mesh.getSize() > 0:
            return mesh
    return None
コード例 #2
0
def createFaceMeshGroupExteriorOnFace(fieldmodule : Fieldmodule, elementFaceType) -> MeshGroup:
    """
    Returns mesh group for the exterior surface on the face described
    by elementFaceType.
    """
    with ChangeManager(fieldmodule):
        isExterior = fieldmodule.createFieldIsExterior()
        isOnFace = fieldmodule.createFieldIsOnFace(elementFaceType)
        mesh2d = fieldmodule.findMeshByDimension(2)
        faceElementGroup = fieldmodule.createFieldElementGroup(mesh2d)
        faceMeshGroup = faceElementGroup.getMeshGroup()
        faceMeshGroup.addElementsConditional(fieldmodule.createFieldAnd(isExterior, isOnFace))
        del isExterior
        del isOnFace
    return faceMeshGroup