Base Classesο
Algorithm Baseο
- class PVGeo.base.AlgorithmBase(nInputPorts=1, inputType='vtkDataSet', nOutputPorts=1, outputType='vtkTable', **kwargs)[source]ο
Bases:
VTKPythonAlgorithmBase
This is a base class to add coconvenience 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 convenience 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:
AlgorithmBase
A base class for implementing filters which holds several conveience methods
Filter Preserve Type Baseο
- class PVGeo.base.FilterPreserveTypeBase(nInputPorts=1, **kwargs)[source]ο
Bases:
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:
ReaderBase
A general base reader for all interfacing with libraries 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 user 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:
ReaderBaseBase
A base class for inherited functionality common to all reader algorithms that need to handle a time series.
- RequestInformation(request, inInfo, outInfo)[source]ο
This is a convenience 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:
AlgorithmBase
A base class for inherited 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:
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
- Parameters:
read_again_mesh (bool) β set the status of the reader for mesh files.
read_again_models (bool) β set the status of the reader for model files.
- 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.
- Parameters:
filename (str or list(str)) β the file name(s) to use for the model data.
- 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 convenience ethod 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:
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.