예제 #1
0
파일: mesh.py 프로젝트: hrittich/firedrake
def _from_exodus(filename):
    """Read an Exodus .e or .exo file from `filename`"""
    plex = PETSc.DMPlex().createExodusFromFile(filename)

    boundary_ids = dmplex.getLabelIdIS("Face Sets").getIndices()
    plex.createLabel("boundary_ids")
    for bid in boundary_ids:
        faces = plex.getStratumIS("Face Sets", bid).getIndices()
        for f in faces:
            plex.setLabelValue("boundary_ids", f, bid)

    return plex
예제 #2
0
    def _from_exodus(self, filename, dim=0, reorder=None):
        self.name = filename
        plex = PETSc.DMPlex().createExodusFromFile(filename)

        boundary_ids = dmplex.getLabelIdIS("Face Sets").getIndices()
        plex.createLabel("boundary_ids")
        for bid in boundary_ids:
            faces = plex.getStratumIS("Face Sets", bid).getIndices()
            for f in faces:
                plex.setLabelValue("boundary_ids", f, bid)

        self._from_dmplex(plex, reorder=reorder)