Base Classes¶
Algorithm Base¶
-
class
PVGeo.base.
AlgorithmBase
(nInputPorts=1, inputType='vtkDataSet', nOutputPorts=1, outputType='vtkTable', **kwargs)[source]¶ Bases:
vtk.util.vtkAlgorithm.VTKPythonAlgorithmBase
This is a base class to add convienace methods to the
VTKPythonAlgorithmBase
for all algorithms implemented inPVGeo
. We implement our algorithms in this manner to harness all of the backend support that theVTKPythonAlgorithmBase
class provides for integrating custom algorithms on a VTK pipeline. All of the pipeline methods for setting inputs, getting outputs, making requests are handled by the super classes. For more information on what functionality is available, check out the VTK Docs for the vtkAlgorithm and then check out the following blog posts:-
GetOutput
(port=0)[source]¶ A conveience method to get the output data object of this
PVGeo
algorithm.
Filter Base¶
-
class
PVGeo.base.
FilterBase
(nInputPorts=1, inputType='vtkDataSet', nOutputPorts=1, outputType='vtkPolyData', **kwargs)[source]¶ Bases:
PVGeo.base.AlgorithmBase
A base class for implementing filters which holds several convienace methods
Filter Preserve Type Base¶
-
class
PVGeo.base.
FilterPreserveTypeBase
(nInputPorts=1, **kwargs)[source]¶ Bases:
PVGeo.base.FilterBase
A Base class for implementing filters that preserve the data type of their arbitrary input.
Interfaced Base Reader¶
-
class
PVGeo.base.
InterfacedBaseReader
(**kwargs)[source]¶ Bases:
PVGeo.base.ReaderBase
A general base reader for all interfacing with librarues that already have file I/O methods and VTK data object interfaces. This provides a routine for using an external library to handle all I/O and produce the VTK data objects.
-
RequestData
(request, inInfo, outInfo)[source]¶ Do not override. Used by pipeline to get data for current timestep and populate the output data object.
-
RequestDataObject
(request, inInfo, outInfo)[source]¶ Do not override. This method lets the us dynamically decide the output data type based in the read meshes. Note: they all have to be the same VTK type.
-
RequestInformation
(request, inInfo, outInfo)[source]¶ Do not override. Used by pipeline to set extents and time info.
-
_get_object_at_index
(idx=None)[source]¶ Internal helper to get the data object at the specified index
-
static
_get_vtk_object
(obj)[source]¶ OVERRIDE: Given an object in the interfaced library’s type, return a converted VTK data object.
-
Reader Base: Time Varying¶
-
class
PVGeo.base.
ReaderBase
(nOutputPorts=1, outputType='vtkTable', **kwargs)[source]¶ Bases:
PVGeo.base.ReaderBaseBase
A base class for inherrited functionality common to all reader algorithms that need to handle a time series.
-
RequestInformation
(request, inInfo, outInfo)[source]¶ This is a conveience method that should be overwritten when needed. This will handle setting the timesteps appropriately based on the number of file names when the pipeline needs to know the time information.
-
Reader Base Base¶
-
class
PVGeo.base.
ReaderBaseBase
(nOutputPorts=1, outputType='vtkTable', **kwargs)[source]¶ Bases:
PVGeo.base.AlgorithmBase
A base class for inherrited functionality common to all reader algorithms
-
AddFileName
(filename)[source]¶ Use to set the file names for the reader. Handles singlt string or list of strings.
- Parameters
filename (str) – The absolute file name with path to read.
-
add_file_name
(filename)[source]¶ Use to set the file names for the reader. Handles singlt string or list of strings.
- Parameters
filename (str) – The absolute file name with path to read.
-
clear_file_names
()[source]¶ Use to clear file names of the reader.
Note
This does not set the reader to need to read again as there are no files to read.
-
Two File Reader Base¶
-
class
PVGeo.base.
TwoFileReaderBase
(nOutputPorts=1, outputType='vtkUnstructuredGrid', **kwargs)[source]¶ Bases:
PVGeo.base.AlgorithmBase
A base clase for readers that need to handle two input files. One meta-data file and a series of data files.
-
Modified
(read_again_mesh=True, read_again_models=True)[source]¶ Call modified if the files needs to be read again again
-
RequestInformation
(request, inInfo, outInfo)[source]¶ Used by pipeline to handle setting up time variance
-
__update_time_steps
()¶ For internal use only
-
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.
-
static
has_models
(model_files)[source]¶ A convienance method to see if a list contatins models filenames.
-
need_to_readMesh
(flag=None)[source]¶ Ask self if the reader needs to read the mesh file again.
- Parameters
flag (bool) – set the status of the reader for mesh files.
-
Writer Base¶
-
class
PVGeo.base.
WriterBase
(nInputPorts=1, inputType='vtkPolyData', **kwargs)[source]¶ Bases:
PVGeo.base.AlgorithmBase
-
FillInputPortInformation
(port, info)[source]¶ Allows us to save composite datasets as well.
Note
I only care about
vtkMultiBlockDataSet
-
RequestData
(request, inInfo, outInfo)[source]¶ Subclasses must implement a
perform_write_out
method that takes an input data object and a filename. This method will automatically handle composite data sets.
-
SetFileName
(filename)[source]¶ Specify the filename for the output. Writer can only handle a single output data object/time step.
-
perform_write_out
(input_data_object, filename, object_name)[source]¶ This method must be implemented. This is automatically called by
RequestData
for single inputs or composite inputs.
-
set_block_filenames
(n)[source]¶ Gets a list of filenames based on user input filename and creates a numbered list of filenames for the reader to save out. Assumes the filename has an extension set already.
-