Commit eeef5144 authored by allens's avatar allens

added GetDistance and minor code relocation

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@21733 18c085ea-50e0-402c-830e-de6fd14e8384
parent e05682ba
......@@ -190,40 +190,15 @@ avtFTLEIC::MergeIntegralCurveSequence(std::vector<avtIntegralCurve *> &v)
void avtFTLEIC::AnalyzeStep( avtIVPStep &step,
avtIVPField *field)
{
/* Check for termination:
Code used from avtStreamline.C
*/
// bool shouldTerminate = false;
// if( (direction == DIRECTION_FORWARD && step.GetT1() >= maxTime) ||
// (direction == DIRECTION_BACKWARD && step.GetT1() <= maxTime) )
// {
// shouldTerminate = true;
// }
// /** if the integration is taking too long */
// if( !shouldTerminate && numSteps >= maxSteps )
// {
// shouldTerminate = true;
// }
p_end = step.GetP1();
p_end = CurrentLocation();
// /** update other termination criteria */
// numSteps += 1;
// if (field->VelocityIsInstantaneous() &&
// (step.GetLength() / std::abs(step.t1 - step.t0) < 1e-8) &&
// numSteps > 5)
// shouldTerminate = true;
// /* if Code has to be terminated */
// if( shouldTerminate )
// status.SetTerminationMet();
if (CheckForTermination(step, field))
status.SetTerminationMet();
if (CheckForTermination(step, field))
status.SetTerminationMet();
// These must be called after CheckForTermination, because
// CheckForTermination will modify the step if it goes beyond the
// termination criteria. (Example: streamlines will split a step if it
// is terminating by distance.)
distance += step.GetLength();
p_end = step.GetP1();
}
// ****************************************************************************
......@@ -290,9 +265,6 @@ avtFTLEIC::CheckForTermination(avtIVPStep& step, avtIVPField *field)
// Update other termination criteria.
numSteps += 1;
// Done by state recorder, which may need to record state
distance += step.GetLength();
return shouldTerminate;
}
......
......@@ -75,8 +75,8 @@ public:
virtual void Serialize(MemStream::Mode mode, MemStream &buff,
avtIVPSolver *solver, SerializeFlags serializeFlags);
virtual bool UseFixedTerminationTime(void) { return doTime; };
virtual double FixedTerminationTime(void) { return maxTime; };
// virtual bool UseFixedTerminationTime(void) { return doTime; };
// virtual double FixedTerminationTime(void) { return maxTime; };
bool TerminatedBecauseOfMaxSteps(void)
{ return terminatedBecauseOfMaxSteps; };
......@@ -88,6 +88,8 @@ public:
public:
virtual bool CheckForTermination(avtIVPStep& step, avtIVPField *);
virtual double getDistance() { return distance; }
virtual void AnalyzeStep( avtIVPStep &step, avtIVPField *field);
bool LessThan(const avtIntegralCurve *ic) const;
......
......@@ -223,14 +223,12 @@ avtStateRecorderIntegralCurve::AnalyzeStep( avtIVPStep& step,
if (CheckForTermination(step, field))
status.SetTerminationMet();
// Possibly need this for state we record. Must come after the
// check for termination as the curve may get truncated.
distance += step.GetLength();
// This must be called after CheckForTermination, because
// These must be called after CheckForTermination, because
// CheckForTermination will modify the step if it goes beyond the
// termination criteria. (Example: streamlines will split a step if it
// is terminating by distance.)
distance += step.GetLength();
RecordStep( field, step, step.GetT1() );
}
......
......@@ -155,6 +155,8 @@ public:
virtual bool CheckForTermination(avtIVPStep &step, avtIVPField *) = 0;
virtual double getDistance() { return distance; }
protected:
avtStateRecorderIntegralCurve( const avtStateRecorderIntegralCurve& );
avtStateRecorderIntegralCurve& operator=( const avtStateRecorderIntegralCurve& );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment