Source code for PVGeo.ubc.disc_meshes

__all__ = [
    'DiscretizeMeshReader',
]

__displayname__ = 'Discretize'

# Import Helpers:
from .. import _helpers
from ..base import InterfacedBaseReader
from .. import interface

with _helpers.HiddenPrints():
    import discretize


[docs]class DiscretizeMeshReader(InterfacedBaseReader): """A general reader for all ``discretize`` mesh objects saved to the ``.json`` serialized format""" extensions = 'json' __displayname__ = 'Discretize Mesh Reader' description = 'Serialized Discretize Meshes' def __init__(self, **kwargs): InterfacedBaseReader.__init__(self, **kwargs)
[docs] @staticmethod def _readFile(filename): """Reads a mesh object from the serialized format""" return discretize.MeshIO.load_mesh(filename)
[docs] @staticmethod def _getVTKObject(obj): """Returns the mesh's proper VTK data object""" return obj.toVTK()