Base Classes

Model Appender Base

class PVGeo.ubc.two_file_base.ModelAppenderBase(inputType='vtkRectilinearGrid', outputType='vtkRectilinearGrid', **kwargs)[source]

Bases: PVGeo.base.AlgorithmBase

A base class for create mesh-model appenders on the UBC Mesh formats

AddModelFileName(fname)[source]

Use to set the file names for the reader. Handles singlt string or list of strings.

ClearModels()[source]

Use to clear data file names.

GetModelFileNames(idx=None)[source]

Returns the list of file names or given and index returns a specified timestep’s filename.

GetTimestepValues()[source]

Use this in ParaView decorator to register timesteps.

HasModels()[source]
Modified(readAgain=True)[source]

Call modified if the files needs to be read again again.

NeedToRead(flag=None)[source]

Ask self if the reader needs to read the files again

Parameters:flag (bool) – if the flag is set then this method will set the read status
Returns:The status of the reader aspect of the filter.
Return type:bool
RequestData(request, inInfo, outInfo)[source]

DO NOT OVERRIDE

RequestInformation(request, inInfo, outInfo)[source]

DO NOT OVERRIDE

SetDataName(name)[source]
_ModelAppenderBase__SetInputTimesteps()
_ModelAppenderBase__UpdateTimeSteps()

For internal use only: appropriately sets the timesteps.

_PlaceOnMesh(output, idx=0)[source]
_ReadUpFront()[source]

UBC Mesh Reader Base

class PVGeo.ubc.two_file_base.ubcMeshReaderBase(nOutputPorts=1, outputType='vtkUnstructuredGrid', **kwargs)[source]

Bases: PVGeo.base.TwoFileReaderBase

A base class for the UBC mesh readers

GetDataName()[source]
Is2D()[source]
Is3D()[source]
SetDataName(name)[source]

Set te data array name for the model data on the output grid.

_ReadExtent()[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
static _ubcMesh2D_part(FileName)[source]
static ubcModel3D(FileName)[source]

Reads the 3D model file and returns a 1D NumPy float array. Use the PlaceModelOnMesh() 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 PlaceModelOnMesh() 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