OcTree Mesh

UBC OcTree Mesh Appender

class PVGeo.ubc.octree.OcTreeAppender(**kwargs)[source]

Bases: PVGeo.ubc.two_file_base.ModelAppenderBase

This filter reads a timeseries of models and appends it to an input vtkUnstructuredGrid

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

UBC OcTree Mesh Reader

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

Bases: PVGeo.ubc.two_file_base.ubcMeshReaderBase

This class reads a UBC OcTree Mesh file and builds a vtkUnstructuredGrid of the data in the file. Model File is optional. Reader will still construct vtkUnstructuredGrid safely.

ClearMesh()[source]

Use to clean/rebuild the mesh.

ClearModels()[source]

Use to clean the models and reread the data

static PlaceModelOnOcTreeMesh(mesh, model, dataNm='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 (vtkUnstructuredGrid) – The vtkUnstructuredGrid that is the mesh to place the model data upon. Needs to have been read in by ubcOcTree
  • model (np.ndarray) – A NumPy float array that holds all of the data to place inside of the mesh’s cells.
  • dataNm (str) – The name of the model data array once placed on the vtkUnstructuredGrid.
Returns:

The input vtkUnstructuredGrid with model data appended.

Return type:

vtkUnstructuredGrid

RequestData(request, inInfo, outInfo)[source]

Overwritten by subclass to execute the algorithm.

RequestInformation(request, inInfo, outInfo)[source]

Pipeline method for handling requests about the grid extents and time step values

_OcTreeReader__ubcOcTree(FileName_Mesh, FileName_Models, output)

Wrapper to Read UBC GIF OcTree mesh and model file pairs. UBC OcTree 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. This only handles OcTree formats

Parameters:FileName_Mesh (str) – The OcTree Mesh filename as an absolute path for the input mesh file in UBC OcTree Mesh Format
FileName_Models (list(str)): The model filenames as absolute paths for
the input model timesteps in UBC OcTree Model Format. output (vtkUnstructuredGrid): The output data object
Returns:A vtkUnstructuredGrid 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:vtkUnstructuredGrid
description = 'PVGeo: UBC OcTree Mesh'
static ubcOcTreeMesh(FileName, pdo=None)[source]

This method reads a UBC OcTree Mesh file and builds a vtkUnstructuredGrid of the data in the file. This method generates the vtkUnstructuredGrid without any data attributes.

Parameters:
  • FileName (str) – The mesh filename as an absolute path for the input mesh file in UBC OcTree format.
  • pdo (vtkUnstructuredGrid) – A pointer to the output data object.
Returns:

a vtkUnstructuredGrid generated from the UBCMesh grid. Mesh is defined by the input mesh file. No data attributes here, simply an empty mesh. Use the PlaceModelOnOcTreeMesh() method to associate with model data.

Return type:

vtkUnstructuredGrid