IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::algs::ImplicitIntegrator< DIM > Class Template Reference

Manage implicit time integration over an AMR patch hierarchy. More...

#include <ImplicitIntegrator.h>

Inheritance diagram for SAMRAI::algs::ImplicitIntegrator< DIM >:
Inheritance graph
[legend]

Public Member Functions

 ImplicitIntegrator (const std::string &object_name, tbox::Pointer< tbox::Database > input_db, ImplicitEquationStrategy< DIM > *implicit_equations, solv::NonlinearSolverStrategy< DIM > *nonlinear_solver, const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy)
 
virtual ~ImplicitIntegrator ()
 
void initialize ()
 
int advanceSolution (const double dt, const bool first_step)
 Integrate entire patch hierarchy through the specified time increment. More...
 
double getNextDt (const bool good_solution, const int solver_retcode)
 
bool checkNewSolution (const int solver_retcode) const
 
double updateSolution ()
 
double getInitialTime () const
 
double getFinalTime () const
 
double getCurrentTime () const
 
double getCurrentDt () const
 
int getIntegratorStep () const
 
int getMaxIntegratorSteps () const
 
bool stepsRemaining () const
 
virtual void printClassData (std::ostream &os) const
 
void putToDatabase (tbox::Pointer< tbox::Database > db)
 

Private Member Functions

void getFromInput (tbox::Pointer< tbox::Database > db)
 
void getFromRestart ()
 
 ImplicitIntegrator (const ImplicitIntegrator< DIM > &)
 
void operator= (const ImplicitIntegrator< DIM > &)
 

Private Attributes

std::string d_object_name
 
ImplicitEquationStrategy< DIM > * d_implicit_equations
 
solv::NonlinearSolverStrategy< DIM > * d_nonlinear_solver
 
tbox::Pointer< hier::PatchHierarchy< DIM > > d_patch_hierarchy
 
int d_finest_level
 
tbox::Pointer< solv::SAMRAIVectorReal< DIM, double > > d_solution_vector
 
double d_initial_time
 
double d_final_time
 
double d_current_time
 
double d_current_dt
 
double d_old_dt
 
int d_integrator_step
 
int d_max_integrator_steps
 

Detailed Description

template<int DIM>
class SAMRAI::algs::ImplicitIntegrator< DIM >

Class ImplicitIntegrator<DIM> manages implicit time integration over an AMR patch hierarchy. It maintains references to ImplicitEquationStrategy<DIM> and solv::NonlinearSolverStrategy<DIM> objects, which provide operations describing the implicit equations and solving the problem at each time step, respectively. When a time step is performed, data on all levels is integrated through the same time increment.

Initialization of an ImplicitIntegrator<DIM> object is performed via a combination of default parameters and values read from input. Data read from input is summarized as follows:

Required input keys and data types:

Parameters
initial_timedouble value for the initial simulation time.
final_timedouble value for the final simulation time.
max_integrator_stepsinteger value for the maximum number of timesteps allowed.

All input data items described above, except for initial_time, may be overwritten by new input values when continuing from restart.

A sample input file entry might look like:

initial_time = 0.0
final_time = 1.0
max_integrator_steps = 100
See also
algs::ImplicitEquationStrategy
solv::NonlinearSolverStrategy

Constructor & Destructor Documentation

◆ ImplicitIntegrator() [1/2]

template<int DIM>
SAMRAI::algs::ImplicitIntegrator< DIM >::ImplicitIntegrator ( const std::string &  object_name,
tbox::Pointer< tbox::Database input_db,
ImplicitEquationStrategy< DIM > *  implicit_equations,
solv::NonlinearSolverStrategy< DIM > *  nonlinear_solver,
const tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy 
)

The constructor for ImplicitIntegrator<DIM> initializes the default state of the integrator. The integrator is configured with the concrete strategy objects in the argument list that provide operations related to the nonlinear solver and implicit equations to solve. Data members are initialized from the input and restart databases.

Note that no vectors are created in the constructor. Vectors are created and the nonlinear solver is initialized in the initialize() member function.

If assertion checking is turned on, an unrecoverable assertion will result if any of the database, strategy, or hierarchy pointers is null. Exceptions may also be thrown if any checks for consistency among input parameters fail.

◆ ~ImplicitIntegrator()

template<int DIM>
virtual SAMRAI::algs::ImplicitIntegrator< DIM >::~ImplicitIntegrator ( )
virtual

Empty destructor for ImplicitIntegrator<DIM>

◆ ImplicitIntegrator() [2/2]

template<int DIM>
SAMRAI::algs::ImplicitIntegrator< DIM >::ImplicitIntegrator ( const ImplicitIntegrator< DIM > &  )
private

Member Function Documentation

◆ initialize()

template<int DIM>
void SAMRAI::algs::ImplicitIntegrator< DIM >::initialize ( )

Initialize state of time integrator. This includes creating solution vector and initializing solver components.

◆ advanceSolution()

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::advanceSolution ( const double  dt,
const bool  first_step 
)

Integrate entire patch hierarchy through the specified time increment. The time advance assumes the use of a nonlinear solver to implicitly integrate the discrete equations. The integer return value is the return code generated by the particular solver package in use. It is the user's responsibility to interpret this code in a manner consistent with the solver she is using.

The boolean first_step argument is true when this is the very first call to the advance function or if the call occurs immediately after the hierarchy has changed due to regridding. Otherwise it is false. Note that, when the argument is true, the use of extrapolation to construct the initial guess for the advanced solution may not be possible.

Parameters
dtTime step size
first_stepWhether this is the first step after grid change
Returns
value is the return code generated by the particular solver package in use

◆ getNextDt()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::getNextDt ( const bool  good_solution,
const int  solver_retcode 
)

Return time increment for next solution advance. Timestep selection is generally based on whether the nonlinear solution iteration converged and, if so, whether the solution meets some user-defined criteria. This routine assumes that, before it is called, the routine checkNewSolution() was called. The boolean argument is the return value from that call. The integer argument is the return code generated by the nonlinear solver package that computed the solution.

◆ checkNewSolution()

template<int DIM>
bool SAMRAI::algs::ImplicitIntegrator< DIM >::checkNewSolution ( const int  solver_retcode) const

Check time advanced solution to determine whether it is acceptable. Return true if the solution is acceptable; return false otherwise. The integer argument is the return code generated by the call to the nonlinear solver "solve" routine. The meaning of this value depends on the particular nonlinear solver in use and must be intepreted properly by the user-supplied solution checking routine.

◆ updateSolution()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::updateSolution ( )

Update solution (e.g., reset pointers for solution data, update dependent variables, etc.) after time advance. It is assumed that when this routine is invoked, an acceptable new solution has been computed. The double return value is the simulation time corresponding to the advanced solution.

◆ getInitialTime()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::getInitialTime ( ) const

Return initial integration time.

◆ getFinalTime()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::getFinalTime ( ) const

Return final integration time.

◆ getCurrentTime()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::getCurrentTime ( ) const

Return current integration time.

◆ getCurrentDt()

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::getCurrentDt ( ) const

Return current timestep.

◆ getIntegratorStep()

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::getIntegratorStep ( ) const

Return current integration step number.

◆ getMaxIntegratorSteps()

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::getMaxIntegratorSteps ( ) const

Return maximum number of integration steps.

◆ stepsRemaining()

template<int DIM>
bool SAMRAI::algs::ImplicitIntegrator< DIM >::stepsRemaining ( ) const

Return true if the number of integration steps performed by the integrator has not reached the specified maximum; return false otherwise.

◆ printClassData()

template<int DIM>
virtual void SAMRAI::algs::ImplicitIntegrator< DIM >::printClassData ( std::ostream &  os) const
virtual

Print out all members of integrator instance to given output stream.

◆ putToDatabase()

template<int DIM>
void SAMRAI::algs::ImplicitIntegrator< DIM >::putToDatabase ( tbox::Pointer< tbox::Database db)
virtual

Write out state of object to given database.

When assertion checking is active, the database pointer must be non-null.

Implements SAMRAI::tbox::Serializable.

◆ getFromInput()

template<int DIM>
void SAMRAI::algs::ImplicitIntegrator< DIM >::getFromInput ( tbox::Pointer< tbox::Database db)
private

◆ getFromRestart()

template<int DIM>
void SAMRAI::algs::ImplicitIntegrator< DIM >::getFromRestart ( )
private

◆ operator=()

template<int DIM>
void SAMRAI::algs::ImplicitIntegrator< DIM >::operator= ( const ImplicitIntegrator< DIM > &  )
private

Member Data Documentation

◆ d_object_name

template<int DIM>
std::string SAMRAI::algs::ImplicitIntegrator< DIM >::d_object_name
private

◆ d_implicit_equations

template<int DIM>
ImplicitEquationStrategy<DIM>* SAMRAI::algs::ImplicitIntegrator< DIM >::d_implicit_equations
private

◆ d_nonlinear_solver

template<int DIM>
solv::NonlinearSolverStrategy<DIM>* SAMRAI::algs::ImplicitIntegrator< DIM >::d_nonlinear_solver
private

◆ d_patch_hierarchy

template<int DIM>
tbox::Pointer< hier::PatchHierarchy<DIM> > SAMRAI::algs::ImplicitIntegrator< DIM >::d_patch_hierarchy
private

◆ d_finest_level

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::d_finest_level
private

◆ d_solution_vector

template<int DIM>
tbox::Pointer< solv::SAMRAIVectorReal<DIM,double> > SAMRAI::algs::ImplicitIntegrator< DIM >::d_solution_vector
private

◆ d_initial_time

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::d_initial_time
private

◆ d_final_time

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::d_final_time
private

◆ d_current_time

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::d_current_time
private

◆ d_current_dt

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::d_current_dt
private

◆ d_old_dt

template<int DIM>
double SAMRAI::algs::ImplicitIntegrator< DIM >::d_old_dt
private

◆ d_integrator_step

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::d_integrator_step
private

◆ d_max_integrator_steps

template<int DIM>
int SAMRAI::algs::ImplicitIntegrator< DIM >::d_max_integrator_steps
private

The documentation for this class was generated from the following file: