temporal fixes.

This commit is contained in:
Dave Pugmire 2019-10-08 22:31:11 -04:00
parent 40cdc99202
commit fc0e5dfe82
3 changed files with 20 additions and 3 deletions

@ -34,6 +34,7 @@ set(headers
Matrix.h
NewtonsMethod.h
Pair.h
Particle.h
Range.h
RangeId.h
RangeId2.h

@ -195,10 +195,17 @@ protected:
vtkm::FloatDefault& time,
vtkm::Vec3f& outpos) const override
{
std::cout << " **SmallStep: " << inpos << std::endl;
if (!this->Evaluator.IsWithinSpatialBoundary(inpos))
{
outpos = inpos;
return IntegratorStatus(false, true, false);
}
if (!this->Evaluator.IsWithinTemporalBoundary(time))
{
outpos = inpos;
return IntegratorStatus(false, false, true);
}
//Stepping by this->StepLength goes beyond the bounds of the dataset.
//We need to take an Euler step that goes outside of the dataset.
@ -244,6 +251,8 @@ protected:
return IntegratorStatus(evalStatus);
outpos = currPos + stepLong * velocity;
std::cout << " ***SmallStep: " << outpos << " h= [" << stepShort << " " << stepLong << "]"
<< std::endl;
return IntegratorStatus(true, true, !this->Evaluator.IsWithinTemporalBoundary(time));
}

@ -413,6 +413,9 @@ void ValidateIntegratorForBoundary(const vtkm::Bounds& bounds,
VTKM_TEST_ASSERT(status.CheckSpatialBounds(), "Error in evaluator for " + msg);
vtkm::Vec3f result = resultsPortal.Get(index);
if (bounds.Contains(result))
std::cout << index << ": " << bounds << " res= " << result << std::endl;
VTKM_TEST_ASSERT(!bounds.Contains(result), "Tolerance not satisfied.");
}
@ -505,16 +508,20 @@ void TestEvaluators()
// of the velocity field
// All velocities are in the +ve direction.
auto p = RandomPoint(forBoundary);
boundaryPoints.push_back(vtkm::Particle(p, k));
if (k == 9)
{
std::cout << "pt= " << p << std::endl;
boundaryPoints.push_back(vtkm::Particle(p, k));
}
}
for (auto& ds : dataSets)
{
GridEvalType gridEval(ds.GetCoordinateSystem(), ds.GetCellSet(), vecField);
ValidateEvaluator(gridEval, pointIns, vec, "grid evaluator");
//ValidateEvaluator(gridEval, pointIns, vec, "grid evaluator");
RK4Type rk4(gridEval, stepSize);
ValidateIntegrator(rk4, pointIns, stepResult, "constant vector RK4");
//ValidateIntegrator(rk4, pointIns, stepResult, "constant vector RK4");
ValidateIntegratorForBoundary(bound, rk4, boundaryPoints, "constant vector RK4");
}