Tensor Mesh¶
UBC Tensor Mesh Appender¶
-
class
PVGeo.ubc.tensor.
TensorMeshAppender
(**kwargs)[source]¶ Bases:
PVGeo.ubc.two_file_base.ModelAppenderBase
This filter reads a timeseries of models and appends it to an input
vtkRectilinearGrid
UBC Tensor Mesh Reader¶
-
class
PVGeo.ubc.tensor.
TensorMeshReader
(nOutputPorts=1, outputType='vtkRectilinearGrid', **kwargs)[source]¶ Bases:
PVGeo.ubc.two_file_base.ubcMeshReaderBase
UBC Mesh 2D/3D models are defined using a 2-file format. The “mesh” file describes how the data is discretized. The “model” file lists the physical property values for all cells in a mesh. A model file is meaningless without an associated mesh file. The reader will automatically detect if the mesh is 2D or 3D and read the remainder of the data with that dimensionality assumption. If the mesh file is 2D, then then model file must also be in the 2D format (same for 3D).
Note
Model File is optional. Reader will still construct
vtkRectilinearGrid
safely.-
RequestInformation
(request, inInfo, outInfo)[source]¶ Handles info request by pipeline about timesteps and grid extents.
-
__ubc_mesh_data_2d
(filename_mesh, filename_models, output)¶ Helper method to read a 2D mesh
-
__ubc_mesh_data_3d
(filename_mesh, filename_models, output)¶ Helper method to read a 3D mesh
-
__ubc_tensor_mesh
(filename_mesh, filename_models, output)¶ Wrapper to Read UBC GIF 2D and 3D meshes. UBC Mesh 2D/3D models are defined using a 2-file format. The “mesh” file describes how the data is descritized. The “model” file lists the physical property values for all cells in a mesh. A model file is meaningless without an associated mesh file. If the mesh file is 2D, then then model file must also be in the 2D format (same for 3D).
- Parameters
- Returns
a
vtkRectilinearGrid
generated from the UBC 2D/3D Mesh grid. Mesh is defined by the input mesh file. Cell data is defined by the input model file.- Return type
vtkRectilinearGrid
-
description
= 'PVGeo: UBC Mesh 2D/3D Two-File Format'¶
-
static
place_model_on_mesh
(mesh, model, data_name='Data')[source]¶ Places model data onto a mesh. This is for the UBC Grid data reaers to associate model data with the mesh grid.
- Parameters
mesh (vtkRectilinearGrid) – The
vtkRectilinearGrid
that is the mesh to place the model data upon.model (np.array) – A NumPy float array that holds all of the data to place inside of the mesh’s cells.
data_name (str) – The name of the model data array once placed on the
vtkRectilinearGrid
.
- Returns
Returns the input
vtkRectilinearGrid
with model data appended.- Return type
vtkRectilinearGrid
-
static
ubc_mesh_2d
(FileName, output)[source]¶ This method reads a UBC 2D Mesh file and builds an empty
vtkRectilinearGrid
for data to be inserted into. Format Specs.- Parameters
FileName (str) – The mesh filename as an absolute path for the input mesh file in UBC 3D Mesh Format.
output (vtkRectilinearGrid) – The output data object
- Returns
a
vtkRectilinearGrid
generated from the UBC 3D Mesh grid. Mesh is defined by the input mesh file. No data attributes here, simply an empty mesh. Use theplace_model_on_mesh()
method to associate with model data.- Return type
vtkRectilinearGrid
-
static
ubc_mesh_3d
(FileName, output)[source]¶ This method reads a UBC 3D Mesh file and builds an empty
vtkRectilinearGrid
for data to be inserted into.- Parameters
FileName (str) – The mesh filename as an absolute path for the input mesh file in UBC 3D Mesh Format.
output (vtkRectilinearGrid) – The output data object
- Returns
a
vtkRectilinearGrid
generated from the UBC 3D Mesh grid. Mesh is defined by the input mesh file. No data attributes here, simply an empty mesh. Use theplace_model_on_mesh()
method to associate with model data.- Return type
vtkRectilinearGrid
-
static
ubc_model_2d
(FileName)[source]¶ Reads a 2D model file and returns a 1D NumPy float array. Use the
place_model_on_mesh()
method to associate with a grid.Note
Only supports single component data
- Parameters
FileName (str) – The model filename as an absolute path for the input model file in UBCMesh Model Format. Also accepts a list of string file names.
- Returns
a NumPy float array that holds the model data read from the file. Use the
place_model_on_mesh()
method to associate with a grid. If a list of file names is given then it will return a dictionary of NumPy float array with keys as the basenames of the files.- Return type
np.array
-
Append UBC Discrete Topography¶
-
class
PVGeo.ubc.tensor.
TopoMeshAppender
(inputType='vtkRectilinearGrid', outputType='vtkRectilinearGrid', **kwargs)[source]¶ Bases:
PVGeo.base.AlgorithmBase
This filter reads a single discrete topography file and appends it as a boolean data array.