16#ifndef vtkParticleTracerBase_h
17#define vtkParticleTracerBase_h
20#include "vtkFiltersFlowPathsModule.h"
29#include <unordered_map>
33#define vtkPolyDataAlgorithm vtkTemporalAlgorithm<vtkPolyDataAlgorithm>
36VTK_ABI_NAMESPACE_BEGIN
57VTK_ABI_NAMESPACE_BEGIN
97struct ParticleTracerFunctor;
101VTK_ABI_NAMESPACE_BEGIN
105 friend struct vtkParticleTracerBaseNamespace::ParticleTracerFunctor;
119#undef vtkPolyDataAlgorithm
125#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML)
144 vtkGetMacro(ComputeVorticity,
bool);
152 vtkGetMacro(TerminalSpeed,
double);
161 vtkGetMacro(RotationScale,
double);
185 vtkGetMacro(ForceReinjectionEveryNSteps,
int);
197 "Please edit the TIME_STEPS information key in vtkAlgorithm::RequestInformation() instead")
198 virtual
void SetTerminationTime(
double) {}
200 "Please edit the TIME_STEPS information key in vtkAlgorithm::RequestInformation() instead")
201 virtual
double GetTerminationTime() {
return std::numeric_limits<double>::quiet_NaN(); }
203 "Please edit the TIME_STEPS information key in vtkAlgorithm::RequestInformation() instead")
204 virtual
void SetStartTime(
double) {}
206 "Please edit the TIME_STEPS information key in vtkAlgorithm::RequestInformation() instead")
207 virtual
double GetStartTime() {
return std::numeric_limits<double>::quiet_NaN(); }
215 virtual
void SetDisableResetCache(
bool) {}
217 virtual
bool GetDisableResetCache() {
return false; }
219 virtual
void DisableResetCacheOn() {}
221 virtual
void DisableResetCacheOff() {}
251 LINEAR_TRANSFORMATION = 2,
271 vtkGetMacro(MeshOverTime,
int);
277 INTERPOLATOR_WITH_CELL_LOCATOR
353 vtkGetMacro(ForceSerialExecution,
bool);
354 vtkSetMacro(ForceSerialExecution,
bool);
355 vtkBooleanMacro(ForceSerialExecution,
bool);
462 std::atomic<vtkIdType>& particleCount, std::mutex& eraseMutex,
bool sequential);
471 double pos[4],
double p2[4],
double intersection[4],
vtkGenericCell* cell);
512 vtkGetMacro(ReinjectionCounter,
int);
601 std::unordered_map<vtkIdType, vtkParticleTracerBaseNamespace::ParticleInformation>
MPIRecvList;
609 std::vector<bounds> CachedBounds[2];
638 friend class ParticlePathFilterInternal;
639 friend class StreaklineFilterInternal;
abstract class to write particle data to file
Proxy object to connect input/output ports.
abstract superclass for composite (multi-block or AMR) datasets
abstract superclass for arrays of numeric data
general representation of visualization data
abstract class to specify dataset behavior
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
provides thread-safe access to cells
a simple class to control print indentation
Integrate a set of ordinary differential equations (initial value problem) in time.
dynamic, self-adjusting array of int
Composite dataset that organizes datasets into blocks.
Multiprocessing communication superclass.
Allocate and hold a VTK object.
A particle tracer for vector fields.
vtkFloatArray * GetParticleVorticity(vtkPointData *)
vtkInitialValueProblemSolver * Integrator
vtkSmartPointer< vtkPointData > ProtoPD
ProtoPD is used just to keep track of the input array names and number of components for copy allocat...
int ForceReinjectionEveryNSteps
vtkNew< vtkPoints > OutputCoordinates
vtkNew< vtkPointData > OutputPointData
void SetComputeVorticity(bool)
Turn on/off vorticity computation at streamline points (necessary for generating proper stream-ribbon...
vtkIntArray * GetInjectedPointIds(vtkPointData *)
vtkFloatArray * GetParticleAge(vtkPointData *)
void TestParticles(vtkParticleTracerBaseNamespace::ParticleVector &candidates, std::vector< int > &passed)
virtual void AddRestartSeeds(vtkInformationVector **)
For restarts of particle paths, we add in the ability to add in particles from a previous computation...
virtual int GetMeshOverTimeMinValue()
bool IsPointDataValid(vtkCompositeDataSet *input, std::vector< std::string > &arrayNames)
Methods that check that the input arrays are ordered the same on all data sets.
void SetInterpolatorTypeToCellLocator()
Set the velocity field interpolator type to one that uses a cell locator to perform spatial searching...
@ INTERPOLATOR_WITH_DATASET_POINT_LOCATOR
vtkNew< vtkFloatArray > ParticleRotation
vtkNew< vtkDoubleArray > CellVectors
vtkTimeStamp ParticleInjectionTime
vtkNew< vtkIdTypeArray > ParticleCellsConnectivity
vtkIntArray * GetInjectedStepIds(vtkPointData *)
virtual bool UpdateParticleListFromOtherProcesses()
this is used during classification of seed points and also between iterations of the main loop as par...
vtkIntArray * GetErrorCodeArr(vtkPointData *)
bool RetryWithPush(vtkParticleTracerBaseNamespace::ParticleInformation &info, double *point1, double delT, int subSteps, vtkTemporalInterpolatedVelocityField *interpolator)
When particles leave the domain, they must be collected and sent to the other processes for possible ...
vtkSmartPointer< vtkTemporalInterpolatedVelocityField > Interpolator
int Initialize(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Resets internal cache for a clean start.
vtkNew< vtkIdTypeArray > InjectedPointIds
void operator=(const vtkParticleTracerBase &)=delete
void UpdateParticleList(vtkParticleTracerBaseNamespace::ParticleVector &candidates)
and sending between processors, into a list, which is used as the master list on this processor
vtkGetFilePathMacro(ParticleFileName)
Set/Get the filename to be used with the particle writer when dumping particles to disk.
virtual void SetToExtraPointDataArrays(vtkIdType, vtkParticleTracerBaseNamespace::ParticleInformation &)
vtkFloatArray * GetParticleAngularVel(vtkPointData *)
vtkTypeBool AllFixedGeometry
bool SendReceiveParticles(std::vector< vtkIdType > &)
this is used during classification of seed points and also between iterations of the main loop as par...
std::unordered_map< vtkIdType, int > InjectedPointIdToProcessId
void AddSourceConnection(vtkAlgorithmOutput *input)
Provide support for multiple seed sources.
vtkNew< vtkIntArray > ErrorCodeArray
void RemoveAllSources()
Provide support for multiple seed sources.
void CalculateVorticity(vtkGenericCell *cell, double pcoords[3], vtkDoubleArray *cellVectors, double vorticity[3])
void CreateProtoPD(vtkDataObject *input)
std::unordered_map< vtkIdType, vtkParticleTracerBaseNamespace::ParticleInformation > MPIRecvList
Storage of the particles we received.
virtual void SetController(vtkMultiProcessController *)
Get/Set the controller to use.
vtkIntArray * GetParticleIds(vtkPointData *)
vtkNew< vtkIntArray > InjectedStepIds
MeshOverTimeTypes
Types of Variance of Mesh over time.
void SetForceReinjectionEveryNSteps(int)
When animating particles, it is nice to inject new ones every Nth step to produce a continuous flow.
void SetMeshOverTimeToDifferent()
void SetTerminalSpeed(double)
Specify the terminal speed value, below which integration is terminated.
virtual void SetParticleWriter(vtkAbstractParticleWriter *pw)
Set/Get the Writer associated with this Particle Tracer Ideally a parallel IO capable vtkH5PartWriter...
virtual std::vector< vtkDataSet * > GetSeedSources(vtkInformationVector *inputVector)
Method to get the data set seed sources.
virtual int GetMeshOverTimeMaxValue()
void SetRotationScale(double)
This can be used to scale the rate with which the streamribbons twist.
vtkParticleTracerBaseNamespace::ParticleVector MPISendList
Storage of the particles we want to send to another rank.
vtkParticleTracerBaseNamespace::ParticleDataList ParticleHistories
ProtoPD is used just to keep track of the input array names and number of components for copy allocat...
vtkParticleTracerBase(const vtkParticleTracerBase &)=delete
vtkFloatArray * GetParticleRotation(vtkPointData *)
void IntegrateParticle(vtkParticleTracerBaseNamespace::ParticleListIterator &it, double currentTime, double targetTime, vtkInitialValueProblemSolver *integrator, vtkTemporalInterpolatedVelocityField *interpolator, vtkDoubleArray *cellVectors, std::atomic< vtkIdType > &particleCount, std::mutex &eraseMutex, bool sequential)
particle between the two times supplied.
void GetPointDataArrayNames(vtkDataSet *input, std::vector< std::string > &names)
Methods that check that the input arrays are ordered the same on all data sets.
vtkNew< vtkFloatArray > ParticleVorticity
void SetInterpolatorType(int interpolatorType)
Set the type of the velocity field interpolator to determine whether INTERPOLATOR_WITH_DATASET_POINT_...
vtkTypeBool EnableParticleWriting
virtual void SetMeshOverTime(int meshOverTime)
bool SetTerminationTimeNoModify(double t)
int Finalize(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Generates an output using the data provided after Execute was ran.
bool ForceSerialExecution
vtkTypeBool IgnorePipelineTime
ProtoPD is used just to keep track of the input array names and number of components for copy allocat...
bool InsideBounds(double point[])
void TestParticles(vtkParticleTracerBaseNamespace::ParticleVector &candidates, vtkParticleTracerBaseNamespace::ParticleVector &passed)
inside our data.
virtual bool IsPointDataValid(vtkDataObject *input)
Methods that check that the input arrays are ordered the same on all data sets.
vtkTemporalInterpolatedVelocityField * GetInterpolator()
void SetMeshOverTimeToLinearTransformation()
void SetIntegratorType(int type)
vtkNew< vtkIntArray > ParticleIds
vtkParticleTracerBaseNamespace::ParticleVector LocalSeeds
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
unsigned int NumberOfParticles()
void PrintParticleHistories()
void SetMeshOverTimeToStatic()
vtkNew< vtkSignedCharArray > ParticleSourceIds
virtual void InitializeExtraPointDataArrays(vtkPointData *vtkNotUsed(outputPD))
Methods to append values to existing point data arrays that may only be desired on specific concrete ...
void SetParticle(vtkParticleTracerBaseNamespace::ParticleInformation &info, vtkTemporalInterpolatedVelocityField *interpolator, vtkDoubleArray *cellVectors)
void EnqueueParticleToAnotherProcess(vtkParticleTracerBaseNamespace::ParticleInformation &)
vtkNew< vtkFloatArray > ParticleAngularVel
~vtkParticleTracerBase() override
static const double Epsilon
virtual void AssignSeedsToProcessors(double time, vtkDataSet *source, vtkParticleTracerBaseNamespace::ParticleVector &localSeedPoints)
all the injection/seed points according to which processor they belong to.
void SetIntegrator(vtkInitialValueProblemSolver *)
bool ComputeDomainExitLocation(double pos[4], double p2[4], double intersection[4], vtkGenericCell *cell)
This is an old routine kept for possible future use.
void ResizeArrays(vtkIdType numTuples)
vtkNew< vtkFloatArray > ParticleAge
void SetInterpolatorTypeToDataSetPointLocator()
Set the velocity field interpolator type to one that uses a point locator to perform local spatial se...
vtkSmartPointer< vtkMultiProcessController > Controller
vtkSignedCharArray * GetParticleSourceIds(vtkPointData *)
void SetMeshOverTimeToSameTopology()
vtkSetFilePathMacro(ParticleFileName)
Set/Get the filename to be used with the particle writer when dumping particles to disk.
virtual vtkMultiProcessController * GetController()
Get/Set the controller to use.
vtkAbstractParticleWriter * ParticleWriter
vtkSmartPointer< vtkDataSet > Seeds
All ranks have the same representation of the seeds.
int InitializeInterpolator()
int Execute(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Moves the particles one time step further.
represent and manipulate point attribute data
represent and manipulate 3D points
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
dynamic, self-adjusting array of signed char
Hold a reference to a vtkObjectBase instance.
A helper class for interpolating between times during particle tracing.
record modification and/or execution time
ParticleVector::iterator ParticleIterator
std::list< ParticleInformation > ParticleDataList
ParticleDataList::iterator ParticleListIterator
std::vector< ParticleInformation > ParticleVector
vtkIdType CachedCellId[2]
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_DEPRECATED_IN_9_4_0(reason)
#define vtkCreateWrappedTemporalAlgorithmInterface()