OcTree Meshο
UBC OcTree Mesh Appenderο
- class PVGeo.ubc.octree.OcTreeAppender(**kwargs)[source]ο
Bases:
ModelAppenderBase
This filter reads a timeseries of models and appends it to an input
vtkUnstructuredGrid
UBC OcTree Mesh Readerο
- class PVGeo.ubc.octree.OcTreeReader(nOutputPorts=1, outputType='vtkUnstructuredGrid', **kwargs)[source]ο
Bases:
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 constructvtkUnstructuredGrid
safely.- RequestInformation(request, inInfo, outInfo)[source]ο
Pipeline method for handling requests about the grid extents and time step values
- __ubc_octree(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 place_model_on_octree_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 (vtkUnstructuredGrid) β The
vtkUnstructuredGrid
that is the mesh to place the model data upon. Needs to have been read in by ubcOcTreemodel (np.ndarray) β 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
vtkUnstructuredGrid
.
- Returns:
The input
vtkUnstructuredGrid
with model data appended.- Return type:
vtkUnstructuredGrid
- ubc_octree_mesh(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 thevtkUnstructuredGrid
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 theplace_model_on_octree_mesh()
method to associate with model data.- Return type:
vtkUnstructuredGrid