Commit 14bce1d7 authored by allens's avatar allens

added the ability to generate pathlines using a period time basis

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23205 18c085ea-50e0-402c-830e-de6fd14e8384
parent 416c8f7c
......@@ -90,7 +90,6 @@ avtICAlgorithm::avtICAlgorithm( avtPICSFilter *f ) :
{
picsFilter = f;
numDomains = picsFilter->numDomains;
numTimeSteps = picsFilter->numTimeSteps;
domainsUsed = 0;
totDomainsLoaded = 0;
......
......@@ -147,7 +147,7 @@ class avtICAlgorithm
avtPICSFilter *picsFilter;
std::list<avtIntegralCurve *> terminatedICs, activeICs, inactiveICs;
int numDomains, numTimeSteps, numSeedPoints;
int numDomains, numSeedPoints;
virtual const char* AlgoName() const = 0;
//Helper accessor funcstions to the filter.
......
This diff is collapsed.
......@@ -97,21 +97,13 @@ class IVP_API avtIVPAdamsBashforth: public avtIVPSolver
// perform a single integration step
// adaptive stepsize control retries until success or underflow
virtual Result Step(avtIVPField* field, double t_max,
avtIVPStep* ivpstep = NULL);
virtual void OnExitDomain();
virtual Result Step(avtIVPField* field, double t_max,
avtIVPStep* ivpstep = NULL);
virtual avtVector GetCurrentY() const;
virtual double GetCurrentT() const;
virtual void OnExitDomain();
virtual void SetCurrentY( const avtVector &newY );
virtual void SetCurrentT( double newT );
virtual void SetTolerances(const double& reltol, const double& abstol);
virtual void SetNextStepSize( const double& h );
virtual double GetNextStepSize() const;
virtual void SetMaximumStepSize( const double& hMax );
virtual void SetTolerances(const double& reltol, const double& abstol);
virtual avtIVPAdamsBashforth* Clone() const
{
return new avtIVPAdamsBashforth( *this );
......@@ -121,24 +113,12 @@ class IVP_API avtIVPAdamsBashforth: public avtIVPSolver
// state serialization
virtual void AcceptStateVisitor(avtIVPStateHelper &aiss);
void UpdateHistory( const avtVector &yNew );
Result RK4Step(const avtIVPField* field,
avtVector &yNew);
Result ABStep(const avtIVPField* field,
avtVector &yNew);
private:
int abStep, abNSteps;
int numStep;
double tol;
double h, h_max;
double t, d;
int degenerate_iterations;
double stiffness_eps;
avtVector history[ADAMS_BASHFORTH_NSTEPS];
avtVector dhistory[ADAMS_BASHFORTH_NSTEPS];
avtVector yCur;
};
#endif
This diff is collapsed.
......@@ -97,16 +97,6 @@ class IVP_API avtIVPDopri5: public avtIVPSolver
virtual Result Step(avtIVPField* field, double t_max,
avtIVPStep* ivpstep = NULL);
virtual avtVector GetCurrentY() const;
virtual double GetCurrentT() const;
virtual void SetCurrentY( const avtVector &newY );
virtual void SetCurrentT( double newT );
virtual void SetNextStepSize( const double& h );
virtual double GetNextStepSize() const;
virtual void SetMaximumStepSize( const double& h );
virtual void SetTolerances(const double& reltol, const double& abstol);
virtual avtIVPDopri5* Clone() const { return new avtIVPDopri5( *this ); }
......@@ -125,13 +115,8 @@ class IVP_API avtIVPDopri5: public avtIVPSolver
double reltol;
double abstol;
double h;
double h_max;
double h_init;
double t;
double d;
unsigned int n_accepted;
unsigned int n_rejected;
unsigned int n_steps;
......@@ -142,7 +127,6 @@ class IVP_API avtIVPDopri5: public avtIVPSolver
int iasti;
int nonsti;
avtVector y;
avtVector k1;
};
......
......@@ -86,7 +86,6 @@ avtIVPEuler::avtIVPEuler() : vCur(0,0,0)
tol = 1e-8;
h = 1e-5;
t = 0.0;
d = 0.0;
numStep = 0;
order = 2; // Highest order ODE that the integrator can support.
......@@ -106,57 +105,6 @@ avtIVPEuler::~avtIVPEuler()
}
// ****************************************************************************
// Method: avtIVPEuler::GetCurrentY
//
// Purpose:
// Gets the current Y.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// Modifications:
// Dave Pugmire, Fri Aug 8 16:05:34 EDT 2008
// Improved version of A-B solver that builds function history from
// initial RK4 steps.
//
// Dave Pugmire, Tue Dec 1 11:50:18 EST 2009
// Switch from avtVec to avtVector.
//
// ****************************************************************************
avtVector
avtIVPEuler::GetCurrentY() const
{
return yCur;
}
// ****************************************************************************
// Method: avtIVPEuler::SetCurrentY
//
// Purpose:
// Sets the current Y.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// Modifications:
// Dave Pugmire, Fri Aug 8 16:05:34 EDT 2008
// Improved version of A-B solver that builds function history from
// initial RK4 steps.
//
// Dave Pugmire, Tue Dec 1 11:50:18 EST 2009
// Switch from avtVec to avtVector.
//
// ****************************************************************************
void
avtIVPEuler::SetCurrentY(const avtVector &newY)
{
yCur = newY;
}
// ****************************************************************************
// Method: avtIVPEuler::GetCurrentV
//
......@@ -192,117 +140,6 @@ avtIVPEuler::SetCurrentV(const avtVector &newV)
}
// ****************************************************************************
// Method: avtIVPEuler::GetCurrentT
//
// Purpose:
// Gets the current T.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// ****************************************************************************
double
avtIVPEuler::GetCurrentT() const
{
return t;
}
// ****************************************************************************
// Method: avtIVPEuler::SetCurrentT
//
// Purpose:
// Sets the current T.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// ****************************************************************************
void
avtIVPEuler::SetCurrentT(double newT)
{
t = newT;
}
// ****************************************************************************
// Method: avtIVPEuler::SetNextStepSize
//
// Purpose:
// Sets the step size for the next step.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// ****************************************************************************
void
avtIVPEuler::SetNextStepSize(const double& _h)
{
h = _h;
}
// ****************************************************************************
// Method: avtIVPEuler::GetNextStepSize
//
// Purpose:
// Gets the step size for the next step.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// ****************************************************************************
double
avtIVPEuler::GetNextStepSize() const
{
return h;
}
// ****************************************************************************
// Method: avtIVPEuler::SetMaximumStepSize
//
// Purpose:
// Sets the maximum step size for the next step.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// ****************************************************************************
void
avtIVPEuler::SetMaximumStepSize(const double& hMax)
{
h_max = hMax;
}
// ****************************************************************************
// Method: avtIVPEuler::SetTolerances
//
// Purpose:
// Sets the tolerance.
//
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// Modifications:
// Dave Pugmire, Wed Aug 20, 12:54:44 EDT 2008
// Add a tolerance and counter for handling stiffness detection.
//
// ****************************************************************************
void
avtIVPEuler::SetTolerances(const double& relt, const double& abst)
{
tol = abst;
}
// ****************************************************************************
// Method: avtIVPEuler::Reset
//
......@@ -345,7 +182,6 @@ avtIVPEuler::Reset(const double& t_start,
const avtVector &v_start)
{
t = t_start;
d = 0.0;
numStep = 0;
yCur = y_start;
......@@ -392,21 +228,23 @@ avtIVPEuler::OnExitDomain()
avtIVPSolver::Result
avtIVPEuler::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
{
const double direction = sign( 1.0, t_max - t );
double t_local = GetLocalTime();
const double direction = sign( 1.0, t_max - t_local );
h = sign( h, direction );
bool last = false;
// do not run past integration end
if( (t + 1.01*h - t_max) * direction > 0.0 )
if( (t_local + 1.01*h - t_max) * direction > 0.0 )
{
last = true;
h = t_max - t;
h = t_max - t_local;
}
// stepsize underflow?
if( 0.1*std::abs(h) <= std::abs(t)*epsilon )
if( 0.1*std::abs(h) <= std::abs(t_local)*epsilon )
return avtIVPSolver::STEPSIZE_UNDERFLOW;
avtIVPField::Result fieldResult;
......@@ -416,7 +254,7 @@ avtIVPEuler::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
{
avtVector aCur;
if ((fieldResult = (*field)(t, yCur, vCur, aCur)) != avtIVPField::OK)
if ((fieldResult = (*field)(t_local, yCur, vCur, aCur)) != avtIVPField::OK)
return ConvertResult(fieldResult);
vNew = vCur + aCur * h; // New velocity
......@@ -424,9 +262,9 @@ avtIVPEuler::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
}
else //if( field->GetOrder() == 1 )
{
if ((fieldResult = (*field)(t, yCur, vCur)) != avtIVPSolver::OK)
if ((fieldResult = (*field)(t_local, yCur, vCur)) != avtIVPField::OK)
return ConvertResult(fieldResult);
yNew = yCur + vCur * h; // New position
yNew = yCur + h * vCur; // New position
}
ivpstep->resize(2);
......@@ -482,7 +320,6 @@ avtIVPEuler::AcceptStateVisitor(avtIVPStateHelper& aiss)
.Accept(h)
.Accept(h_max)
.Accept(t)
.Accept(d)
.Accept(yCur)
.Accept(vCur);
}
......@@ -77,19 +77,9 @@ class IVP_API avtIVPEuler: public avtIVPSolver
virtual void OnExitDomain();
virtual double GetCurrentT() const;
virtual avtVector GetCurrentY() const;
virtual avtVector GetCurrentV() const;
virtual void SetCurrentV( const avtVector &newV );
virtual void SetCurrentT( double newT );
virtual void SetCurrentY( const avtVector &newY );
virtual void SetCurrentV( const avtVector &newV );
virtual void SetNextStepSize( const double& h );
virtual double GetNextStepSize() const;
virtual void SetMaximumStepSize( const double& hMax );
virtual void SetTolerances(const double& reltol, const double& abstol);
virtual avtIVPEuler* Clone() const
{
return new avtIVPEuler( *this );
......@@ -99,14 +89,8 @@ class IVP_API avtIVPEuler: public avtIVPSolver
// state serialization
virtual void AcceptStateVisitor(avtIVPStateHelper &aiss);
void UpdateHistory( const avtVector &yNew );
private:
int numStep;
double tol;
double h, h_max;
double t, d;
avtVector yCur;
avtVector vCur;
};
......
......@@ -75,7 +75,6 @@ avtIVPLeapfrog::avtIVPLeapfrog() : vCur(0,0,0)
tol = 1e-8;
h = 1e-5;
t = 0.0;
d = 0.0;
numStep = 0;
order = 2; // Highest order ODE that the integrator can support.
......@@ -98,59 +97,6 @@ avtIVPLeapfrog::~avtIVPLeapfrog()
}
// ****************************************************************************
// Method: avtIVPLeapfrog::GetCurrentT
//
// Purpose:
// Gets the current T.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
double
avtIVPLeapfrog::GetCurrentT() const
{
return t;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::GetCurrentY
//
// Purpose:
// Gets the current Y.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
avtVector
avtIVPLeapfrog::GetCurrentY() const
{
return yCur;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::SetCurrentY
//
// Purpose:
// Sets the current Y.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
void
avtIVPLeapfrog::SetCurrentY(const avtVector &newY)
{
yCur = newY;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::GetCurrentV
//
......@@ -160,6 +106,8 @@ avtIVPLeapfrog::SetCurrentY(const avtVector &newY)
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// Modifications:
// ****************************************************************************
avtVector
......@@ -177,6 +125,8 @@ avtIVPLeapfrog::GetCurrentV() const
// Programmer: Dave Pugmire
// Creation: August 5, 2008
//
// Modifications:
//
// ****************************************************************************
void
......@@ -186,95 +136,6 @@ avtIVPLeapfrog::SetCurrentV(const avtVector &newV)
}
// ****************************************************************************
// Method: avtIVPLeapfrog::SetCurrentT
//
// Purpose:
// Sets the current T.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
void
avtIVPLeapfrog::SetCurrentT(double newT)
{
t = newT;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::SetNextStepSize
//
// Purpose:
// Sets the step size for the next step.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
void
avtIVPLeapfrog::SetNextStepSize(const double& _h)
{
h = _h;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::GetNextStepSize
//
// Purpose:
// Gets the step size for the next step.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
double
avtIVPLeapfrog::GetNextStepSize() const
{
return h;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::SetMaximumStepSize
//
// Purpose:
// Sets the maximum step size for the next step.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
void
avtIVPLeapfrog::SetMaximumStepSize(const double& hMax)
{
h_max = hMax;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::SetTolerances
//
// Purpose:
// Sets the tolerance.
//
// Creationist: Allen Sanderson
// Creation: 20 June 2011
//
// ****************************************************************************
void
avtIVPLeapfrog::SetTolerances(const double& relt, const double& abst)
{
tol = abst;
}
// ****************************************************************************
// Method: avtIVPLeapfrog::Reset
//
......@@ -292,7 +153,6 @@ avtIVPLeapfrog::Reset(const double& t_start,
const avtVector &v_start)
{
t = t_start;
d = 0.0;
numStep = 0;
yCur = y_start;
......@@ -331,21 +191,23 @@ avtIVPLeapfrog::OnExitDomain()
avtIVPSolver::Result
avtIVPLeapfrog::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
{
const double direction = sign( 1.0, t_max - t );
double t_local = GetLocalTime();
const double direction = sign( 1.0, t_max - t_local );
h = sign( h, direction );
bool last = false;
// do not run past integration end
if( (t + 1.01*h - t_max) * direction > 0.0 )
if( (t_local + 1.01*h - t_max) * direction > 0.0 )
{
last = true;
h = t_max - t;
h = t_max - t_local;
}
// stepsize underflow?
if( 0.1*std::abs(h) <= std::abs(t)*epsilon )
if( 0.1*std::abs(h) <= std::abs(t_local)*epsilon )
return avtIVPSolver::STEPSIZE_UNDERFLOW;
avtIVPField::Result fieldResult;
......@@ -354,7 +216,7 @@ avtIVPLeapfrog::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
if( field->GetOrder() == 2 )
{
avtVector aCur;
if ((fieldResult = (*field)(t, yCur, vCur, aCur)) != avtIVPField::OK)
if ((fieldResult = (*field)(t_local, yCur, vCur, aCur)) != avtIVPField::OK)
return ConvertResult(fieldResult);
if( numStep )
vNew = vCur + aCur * h; // New velocity
......@@ -365,7 +227,7 @@ avtIVPLeapfrog::Step(avtIVPField* field, double t_max, avtIVPStep* ivpstep)
}
else //if( field->GetOrder() == 1 )
{
if ((fieldResult = (*field)(t, yCur, vCur)) != avtIVPField::OK)
if ((fieldResult = (*field)(t_local, yCur, vCur)) != avtIVPField::OK)
return ConvertResult(fieldResult);
yNew = yCur + vCur * h; // New position
}
......@@ -415,7 +277,6 @@ avtIVPLeapfrog::AcceptStateVisitor(avtIVPStateHelper& aiss)
.Accept(h)
.Accept(h_max)
.Accept(t)
.Accept(d)
.Accept(yCur)
.Accept(vCur);
}
......@@ -75,19 +75,9 @@ class IVP_API avtIVPLeapfrog: public avtIVPSolver
avtIVPStep* ivpstep = NULL);
virtual void OnExitDomain();
virtual double GetCurrentT() const;
virtual avtVector GetCurrentY() const;
virtual avtVector GetCurrentV() const;
virtual void SetCurrentV( const avtVector &newV );
virtual void SetCurrentT( double newT );
virtual void SetCurrentY( const avtVector &newY );
virtual void SetCurrentV( const avtVector &newV );
virtual void SetNextStepSize( const double& h );
virtual double GetNextStepSize() const;
virtual void SetMaximumStepSize( const double& hMax );
virtual void SetTolerances(const double& reltol, const double& abstol);
virtual avtIVPLeapfrog* Clone() const
{
return new avtIVPLeapfrog( *this );
......@@ -97,14 +87,8 @@ class IVP_API avtIVPLeapfrog: public avtIVPSolver
// state serialization
virtual void AcceptStateVisitor(avtIVPStateHelper &aiss);
void UpdateHistory( const avtVector &yNew );
private:
int numStep;
double tol;
double h, h_max;
double t, d;
avtVector yCur;
avtVector vCur;
};
......
......@@ -73,7 +73,6 @@ avtIVPM3DC1Integrator::avtIVPM3DC1Integrator()
tol = 1e-8;
h = 1e-5;
t = 0.0;
d = 0.0;
numStep = 0;
degenerate_iterations = 0;
stiffness_eps = tol / 1000.0;
......@@ -93,158 +92,6 @@ avtIVPM3DC1Integrator::~avtIVPM3DC1Integrator()
}
// ****************************************************************************
// Method: avtIVPM3DC1Integrator::SetCurrentT
//
// Purpose:
// Sets the current T.
//
// Programmer: Allen Sanderson
// Creation: October 24, 2009
//
// ****************************************************************************
void
avtIVPM3DC1Integrator::SetCurrentT(double newT)
{
t = newT;
}
// ****************************************************************************
// Method: avtIVPM3DC1Integrator::GetCurrentT
//
// Purpose:
// Gets the current T.
//
// Programmer: Allen Sanderson
// Creation: October 24, 2009
//
// ****************************************************************************
double
avtIVPM3DC1Integrator::GetCurrentT() const
{
return t;
}
// ****************************************************************************
// Method: avtIVPM3DC1Integrator::SetCurrentY
//
// Purpose:
// Sets the current Y.
//
// Programmer: Allen Sanderson
// Creation: October 24, 2009
//
// Modifications:
// Dave Pugmire, Fri Aug 8 16:05:34 EDT 2008
// Improved version of A-B solver that builds function history from
// initial RK4 steps.
//
// ****************************************************************************
void