1#ifndef included_AMP_TimeIntegrator
2 #define included_AMP_TimeIntegrator
4 #include "AMP/operators/Operator.h"
5 #include "AMP/time_integrators/TimeIntegratorParameters.h"
6 #include "AMP/utils/Database.h"
7 #include "AMP/vectors/Vector.h"
37 typedef std::shared_ptr<AMP::TimeIntegrator::TimeIntegrator>
shared_ptr;
49 explicit TimeIntegrator( std::shared_ptr<TimeIntegratorParameters> parameters );
58 virtual std::string
type()
const;
68 virtual void initialize( std::shared_ptr<TimeIntegratorParameters> parameters );
76 virtual void reset( std::shared_ptr<const TimeIntegratorParameters> parameters ) = 0;
107 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
108 std::shared_ptr<AMP::LinearAlgebra::Vector> out ) = 0;
137 virtual std::shared_ptr<AMP::LinearAlgebra::Vector>
getSolution(
void )
278 return std::vector<double>( 1, 1.0 );
315 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_ic_vector =
nullptr;
351 double d_old_dt = std::numeric_limits<double>::signaling_NaN();
352 double d_min_dt = std::numeric_limits<double>::signaling_NaN();
355 double d_max_dt = std::numeric_limits<double>::max();
405#include "AMP/time_integrators/TimeIntegrator.I"
Class to manage reading/writing restart data.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Abstract base class for time integration.
virtual void writeRestart(int64_t fid) const
Write restart data to file.
double d_max_dt
maximum allowable timestep (user defined)
virtual void printStatistics(std::ostream &os=AMP::pout)
virtual double getCurrentTime() const
Return final integration time.
virtual void registerOperator(std::shared_ptr< AMP::Operator::Operator > op)
virtual ~TimeIntegrator()
virtual double getInitialTime() const
Return initial integration time.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_ic_vector
virtual void setInitialDt(const double dt)
virtual double getGamma(void)
std::shared_ptr< AMP::TimeIntegrator::TimeIntegrator > shared_ptr
Convience typedef.
virtual int getTotalRejectedSteps() const
virtual void setCurrentDt(const double dt)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_solution_vector
virtual std::shared_ptr< AMP::LinearAlgebra::Vector > getSolution(void)
TimeIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
virtual void updateSolution(void)=0
Update solution after time advance.
void getFromInput(std::shared_ptr< const AMP::Database > db)
virtual AMP::LinearAlgebra::Vector::shared_ptr getSourceTerm(void)
virtual double getFinalTime() const
Return final integration time.
int d_iDebugPrintInfoLevel
virtual double getInitialDt()
virtual std::string type() const
Return the name of the TimeIntegrator.
virtual void setSourceTerm(AMP::LinearAlgebra::Vector::shared_ptr src)
std::shared_ptr< AMP::Operator::Operator > d_operator
TimeIntegrator(std::shared_ptr< TimeIntegratorParameters > parameters)
virtual double getCurrentDt() const
Return current timestep.
int d_max_integrator_steps
virtual void initialize(std::shared_ptr< TimeIntegratorParameters > parameters)
Initialize state of time integrator.
void operator=(const TimeIntegrator &)=delete
virtual void appendRhsVector(AMP::LinearAlgebra::Vector::shared_ptr vec)
Append the vectors of interest to the rhs vector.
std::string d_object_name
virtual bool checkNewSolution(void)=0
virtual void setCurrentTime(const double t)
std::shared_ptr< AMP::IO::Writer > d_writer
keeps track of total number of step rejections
double d_initial_dt
initial time increment
virtual std::vector< double > getTimeHistoryScalings(void)
Scaling factors for previous time history vectors.
virtual void registerChildObjects(AMP::IO::RestartManager *manager) const
Register any child objects.
virtual void appendSolutionVector(AMP::LinearAlgebra::Vector::shared_ptr vec)
Append the vectors of interest to the solution vector.
std::shared_ptr< TimeIntegratorParameters > d_pParameters
virtual void reset(std::shared_ptr< const TimeIntegratorParameters > parameters)=0
Resets the internal state of the time integrator.
void printClassData(std::ostream &os) const
std::shared_ptr< AMP::LinearAlgebra::Vector > d_pSourceTerm
virtual int advanceSolution(const double dt, const bool first_step, std::shared_ptr< AMP::LinearAlgebra::Vector > in, std::shared_ptr< AMP::LinearAlgebra::Vector > out)=0
Integrate through the specified time increment.
virtual void setFinalTime(const double t)
virtual double getNextDt(const bool good_solution)
Return time increment for next solution advance.
virtual void setInitialTime(const double t)
uint64_t getID() const
Get a unique id hash for the vector.
TimeIntegrator(const TimeIntegrator &)=delete
virtual size_t sizeOfTimeHistory() const
void putToDatabase(std::shared_ptr< AMP::Database > db)
virtual void registerWriter(std::shared_ptr< AMP::IO::Writer > writer)
Registers a writer with the solver.
std::shared_ptr< AMP::Operator::Operator > d_pMassOperator
virtual bool stepsRemaining() const
Have the number of integration steps reached the maximum.
virtual int getMaxIntegratorSteps() const
Return maximum number of integration steps.
virtual int getIntegratorStep() const
Return current integration step number.
std::shared_ptr< AMP::Operator::Operator > getOperator(void)