Tensor Meshο
UBC Tensor Mesh Appenderο
- class PVGeo.ubc.tensor.TensorMeshAppender(**kwargs)[source]ο
Bases:
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:
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:
filename_mesh (str) β The mesh filename as an absolute path for the input mesh file in UBC 2D/3D Mesh Format
filename_models (str or list(str)) β The model filename(s) as an absolute path for the input model file in UBC 2D/3D Model Format.
output (vtkRectilinearGrid) β The output data object
- 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 readers 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:
AlgorithmBase
This filter reads a single discrete topography file and appends it as a boolean data array.