discretize.base.mesh_io.TensorMeshIO

class discretize.base.mesh_io.TensorMeshIO[source]

Bases: discretize.mixins.vtk_mod.InterfaceTensorread_vtk

Methods

readModelUBC(*args, **kwargs)

readModelUBC has been deprecated.

readUBC(file_name[, directory])

readVTK(file_name[, directory])

Read VTK Rectilinear (vtr xml file) and return Tensor mesh and model

read_UBC(file_name[, directory])

Wrapper to Read UBC GIF 2D and 3D tensor mesh and generate same dimension TensorMesh.

read_model_UBC(file_name[, directory])

Read UBC 2D or 3D Tensor mesh model

read_vtk(file_name[, directory])

Read VTK Rectilinear (vtr xml file) and return Tensor mesh and model

vtk_to_tensor_mesh(vtrGrid)

Converts a vtkRectilinearGrid or pyvista.RectilinearGrid to a discretize.TensorMesh object.

writeModelUBC(*args, **kwargs)

writeModelUBC has been deprecated.

writeUBC(*args, **kwargs)

writeUBC has been deprecated.

write_UBC(file_name[, models, directory, …])

Writes a TensorMesh to a UBC-GIF format mesh file.

write_model_UBC(file_name, model[, directory])

Writes a model associated with a TensorMesh to a UBC-GIF format model file.

Attributes

Methods

TensorMeshIO.readModelUBC(*args, **kwargs)

readModelUBC has been deprecated. See read_model_UBC for documentation

classmethod TensorMeshIO.readUBC(file_name, directory='')[source]
classmethod TensorMeshIO.readVTK(file_name, directory='')

Read VTK Rectilinear (vtr xml file) and return Tensor mesh and model

Parameters
file_namestr

path to the vtr model file to read or just its name if directory is specified

directorystr

directory where the UBC GIF file lives

Returns
tuple

(TensorMesh, modelDictionary)

classmethod TensorMeshIO.read_UBC(file_name, directory='')[source]

Wrapper to Read UBC GIF 2D and 3D tensor mesh and generate same dimension TensorMesh.

Input: :param str file_name: path to the UBC GIF mesh file or just its name if directory is specified :param str directory: directory where the UBC GIF file lives

Output: :rtype: TensorMesh :return: The tensor mesh for the file_name.

TensorMeshIO.read_model_UBC(file_name, directory='')[source]
Read UBC 2D or 3D Tensor mesh model

and generate Tensor mesh model

Input: :param str file_name: path to the UBC GIF mesh file to read or just its name if directory is specified :param str directory: directory where the UBC GIF file lives

Output: :rtype: numpy.ndarray :return: model with TensorMesh ordered

classmethod TensorMeshIO.read_vtk(file_name, directory='')

Read VTK Rectilinear (vtr xml file) and return Tensor mesh and model

Parameters
file_namestr

path to the vtr model file to read or just its name if directory is specified

directorystr

directory where the UBC GIF file lives

Returns
tuple

(TensorMesh, modelDictionary)

classmethod TensorMeshIO.vtk_to_tensor_mesh(vtrGrid)

Converts a vtkRectilinearGrid or pyvista.RectilinearGrid to a discretize.TensorMesh object.

TensorMeshIO.writeModelUBC(*args, **kwargs)

writeModelUBC has been deprecated. See write_model_UBC for documentation

TensorMeshIO.writeUBC(*args, **kwargs)

writeUBC has been deprecated. See write_UBC for documentation

TensorMeshIO.write_UBC(file_name, models=None, directory='', comment_lines='')[source]

Writes a TensorMesh to a UBC-GIF format mesh file.

Input: :param str file_name: File to write to :param str directory: directory where to save model :param dict models: A dictionary of the models :param str comment_lines: comment lines preceded with ‘!’ to add

TensorMeshIO.write_model_UBC(file_name, model, directory='')[source]

Writes a model associated with a TensorMesh to a UBC-GIF format model file.

Input: :param str file_name: File to write to or just its name if directory is specified :param str directory: directory where the UBC GIF file lives :param numpy.ndarray model: The model