mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-20 02:55:47 +00:00
Merging Deve's particle status changes
This commit is contained in:
parent
7906145345
commit
48cc2471e4
@ -31,6 +31,12 @@ namespace worklet
|
||||
{
|
||||
namespace particleadvection
|
||||
{
|
||||
enum class EvaluatorStatus
|
||||
{
|
||||
SUCCESS = 0,
|
||||
OUTSIDE_SPATIAL_BOUNDS,
|
||||
OUTSIDE_TEMPORAL_BOUNDS
|
||||
};
|
||||
|
||||
template <typename DeviceAdapter, typename FieldArrayType>
|
||||
class ExecutionGridEvaluator
|
||||
@ -80,15 +86,15 @@ public:
|
||||
}
|
||||
|
||||
template <typename Point>
|
||||
VTKM_EXEC ParticleStatus Evaluate(const Point& pos,
|
||||
vtkm::FloatDefault vtkmNotUsed(time),
|
||||
Point& out) const
|
||||
VTKM_EXEC EvaluatorStatus Evaluate(const Point& pos,
|
||||
vtkm::FloatDefault vtkmNotUsed(time),
|
||||
Point& out) const
|
||||
{
|
||||
return this->Evaluate(pos, out);
|
||||
}
|
||||
|
||||
template <typename Point>
|
||||
VTKM_EXEC ParticleStatus Evaluate(const Point point, Point& out) const
|
||||
VTKM_EXEC EvaluatorStatus Evaluate(const Point point, Point& out) const
|
||||
{
|
||||
vtkm::Id cellId;
|
||||
Point parametric;
|
||||
@ -107,7 +113,7 @@ public:
|
||||
fieldValues.Append(Field.Get(ptIndices[i]));
|
||||
out = vtkm::exec::CellInterpolate(fieldValues, parametric, cellShape, tmp);
|
||||
|
||||
return ParticleStatus::STATUS_OK;
|
||||
return EvaluatorStatus::SUCCESS;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename Point>
|
||||
VTKM_EXEC ParticleStatus Evaluate(const Point& pos, vtkm::FloatDefault time, Point& out) const
|
||||
VTKM_EXEC EvaluatorStatus Evaluate(const Point& pos, vtkm::FloatDefault time, Point& out) const
|
||||
{
|
||||
// Validate time is in bounds for the current two slices.
|
||||
if (!(time >= TimeOne && time <= TimeTwo))
|
||||
@ -84,7 +84,7 @@ public:
|
||||
// LERP between the two values of calculated fields to obtain the new value
|
||||
ScalarType proportion = (time - this->TimeOne) / this->TimeDiff;
|
||||
out = vtkm::Lerp(one, two, proportion);
|
||||
return ParticleStatus::STATUS_OK;
|
||||
return EvaluatorStatus::SUCCESS;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user