Base Classesο
Model Appender Baseο
- class PVGeo.ubc.two_file_base.ModelAppenderBase(inputType='vtkRectilinearGrid', outputType='vtkRectilinearGrid', **kwargs)[source]ο
Bases:
AlgorithmBase
A base class for create mesh-model appenders on the UBC Mesh formats
- RequestInformation(request, inInfo, outInfo)[source]ο
Used by pipeline to handle time variance and update output extents
- add_model_file_name(filename)[source]ο
Use to set the file names for the reader. Handles single string or list of strings.
- get_model_filenames(idx=None)[source]ο
Returns the list of file names or given and index returns a specified timestepβs filename.
UBC Mesh Reader Baseο
- class PVGeo.ubc.two_file_base.ubcMeshReaderBase(nOutputPorts=1, outputType='vtkUnstructuredGrid', **kwargs)[source]ο
Bases:
TwoFileReaderBase
A base class for the UBC mesh readers
- _read_extent()[source]ο
Reads the mesh file for the UBC 2D/3D Mesh or OcTree format to get output extents. Computationally inexpensive method to discover whole output extent.
- Returns:
This returns a tuple of the whole extent for the grid to be made of the input mesh file (0,n1-1, 0,n2-1, 0,n3-1). This output should be directly passed to set the whole output extent.
- Return type:
tuple(int)
- extensions = 'mesh msh dat txt text'ο
- set_use_filename(flag)[source]ο
Set a flag on whether or not to use the filename as the data array name
- static ubc_model_3d(FileName)[source]ο
Reads the 3D model file and returns a 1D NumPy float array. Use the place_model_on_mesh() method to associate with a grid.
- Parameters:
FileName (str) β The model file name(s) as an absolute path for the input model file in UBC 3D Model Model Format. Also accepts a list of string file names.
- Returns:
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