1#ifndef included_AMP_ImplicitIntegrator
2#define included_AMP_ImplicitIntegrator
6#include "AMP/time_integrators/TimeIntegrator.h"
7#include "AMP/time_integrators/TimeIntegratorParameters.h"
8#include "AMP/time_integrators/TimeOperator.h"
9#include "AMP/vectors/Scalar.h"
112 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters>
prm );
143 std::shared_ptr<const AMP::TimeIntegrator::TimeIntegratorParameters> parameters )
override;
177 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
178 std::shared_ptr<AMP::LinearAlgebra::Vector> out )
override;
242 std::shared_ptr<AMP::LinearAlgebra::Vector> f );
250 std::function<
void( std::shared_ptr<AMP::LinearAlgebra::Vector>,
251 std::shared_ptr<AMP::LinearAlgebra::Vector> )>
fnPtr )
284 std::shared_ptr<AMP::Solver::SolverStrategy>
d_solver =
nullptr;
309 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
310 std::shared_ptr<AMP::LinearAlgebra::Vector> out );
318 std::function<
void( std::shared_ptr<AMP::LinearAlgebra::Vector>,
319 std::shared_ptr<AMP::LinearAlgebra::Vector> )>
Class to manage reading/writing restart data.
Scalar is a class used to store a scalar variable that may be different types/precision.
Manage implicit time integration.
std::shared_ptr< AMP::Solver::SolverStrategy > d_solver
void reset(std::shared_ptr< const AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
bool stepsRemaining() const override
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
int advanceSolution(const double dt, const bool first_step, std::shared_ptr< AMP::LinearAlgebra::Vector > in, std::shared_ptr< AMP::LinearAlgebra::Vector > out) override
Integrate entire patch hierarchy through the specified time increment.
virtual std::shared_ptr< AMP::LinearAlgebra::Vector > getTimeHistorySourceTerm()
virtual void setTimeHistoryScalings()
virtual void integratorSpecificInitialize(void)
virtual int integratorSpecificAdvanceSolution(const double dt, const bool first_step, std::shared_ptr< AMP::LinearAlgebra::Vector > in, std::shared_ptr< AMP::LinearAlgebra::Vector > out)
std::shared_ptr< AMP::Solver::SolverStrategy > getSolver(void)
virtual double integratorSpecificGetNextDt(const bool good_solution, const int solver_retcode)
allows for specialization of getNextDt for classes of time integrators
void setComponentScalingFunction(std::function< void(std::shared_ptr< AMP::LinearAlgebra::Vector >, std::shared_ptr< AMP::LinearAlgebra::Vector >)> fnPtr)
virtual ~ImplicitIntegrator()
virtual void printClassData(std::ostream &os) const
void setTimeScalingFunction(std::function< void(AMP::Scalar)> fnPtr)
virtual void setInitialGuess(const bool first_step, const double current_time, const double current_dt, const double old_dt)
bool d_user_managed_time_operator
user manages time operator
virtual double getNextDt(const bool good_solution) override
ImplicitIntegrator()=delete
std::shared_ptr< AMP::LinearAlgebra::Vector > d_function_scaling
ImplicitIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > prm)
void resetSolver(std::shared_ptr< AMP::Solver::SolverStrategy > solver=nullptr)
std::function< void(std::shared_ptr< AMP::LinearAlgebra::Vector >, std::shared_ptr< AMP::LinearAlgebra::Vector >)> d_fComponentScalingFnPtr
registered callback function to set multiphysics component scalings
ImplicitIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
void printStatistics(std::ostream &os=AMP::pout) override
print the statistics on the solver
void writeRestart(int64_t fid) const override
Write restart data to file.
bool checkNewSolution(void) override
virtual bool integratorSpecificCheckNewSolution(const int solver_retcode)
void setComponentScalings(std::shared_ptr< AMP::LinearAlgebra::Vector > s, std::shared_ptr< AMP::LinearAlgebra::Vector > f)
for multiphysics problems it may be necessary to scale the solution
ImplicitIntegrator(const ImplicitIntegrator &)=delete
std::shared_ptr< AMP::LinearAlgebra::Vector > d_solution_scaling
virtual void integratorSpecificUpdateSolution(double time)
bool d_time_history_initialized
whether it is the first step
const std::string & getObjectName() const
void operator=(const ImplicitIntegrator &)=delete
void updateSolution(void) override
std::function< void(AMP::Scalar)> d_fTimeScalingFnPtr
registered callback function to set gamma, typically when the user needs to know gamma
void registerOperator(std::shared_ptr< AMP::Operator::Operator > op) override
Abstract base class for time integration.
std::shared_ptr< AMP::TimeIntegrator::TimeIntegrator > shared_ptr
Convience typedef.
int d_max_integrator_steps
virtual void initialize(std::shared_ptr< TimeIntegratorParameters > parameters)
Initialize state of time integrator.
std::string d_object_name