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
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 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 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 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
-