Merging Deve's particle status changes

This commit is contained in:
Abhishek Yenpure 2019-08-03 15:28:45 -06:00
parent 7906145345
commit 48cc2471e4
2 changed files with 13 additions and 7 deletions

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