Manage implicit time integration. More...
#include <ImplicitIntegrator.h>

Public Types | |
| typedef std::shared_ptr< AMP::TimeIntegrator::TimeIntegrator > | shared_ptr |
| Convience typedef. | |
Protected Member Functions | |
| void | createSolver (void) |
| void | getFromInput (std::shared_ptr< const AMP::Database > db) |
| void | getFromRestart () |
| virtual int | integratorSpecificAdvanceSolution (const double dt, const bool first_step, std::shared_ptr< AMP::LinearAlgebra::Vector > in, std::shared_ptr< AMP::LinearAlgebra::Vector > out) |
| virtual void | setInitialGuess (const bool first_step, const double current_time, const double current_dt, const double old_dt) |
| virtual void | setTimeHistoryScalings () |
Protected Attributes | |
| double | d_current_dt = std::numeric_limits<double>::signaling_NaN() |
| double | d_current_time = std::numeric_limits<double>::signaling_NaN() |
| 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 | |
| double | d_final_time = std::numeric_limits<double>::signaling_NaN() |
| bool | d_first_step = true |
| std::function< void(AMP::Scalar)> | d_fTimeScalingFnPtr |
| registered callback function to set gamma, typically when the user needs to know gamma | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_function_scaling |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_ic_vector = nullptr |
| int | d_iDebugPrintInfoLevel = 0 |
| double | d_initial_dt = std::numeric_limits<double>::signaling_NaN() |
| initial time increment | |
| double | d_initial_time = std::numeric_limits<double>::signaling_NaN() |
| bool | d_initialized = false |
| int | d_integrator_step = 0 |
| double | d_max_dt = std::numeric_limits<double>::max() |
| maximum allowable timestep (user defined) | |
| int | d_max_integrator_steps = 0 |
| double | d_min_dt = std::numeric_limits<double>::signaling_NaN() |
| std::string | d_object_name |
| double | d_old_dt = std::numeric_limits<double>::signaling_NaN() |
| std::shared_ptr< AMP::Operator::Operator > | d_operator |
| std::shared_ptr< AMP::Operator::Operator > | d_pMassOperator |
| std::shared_ptr< TimeIntegratorParameters > | d_pParameters |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_pSourceTerm |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_solution_scaling |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_solution_vector |
| std::shared_ptr< AMP::Solver::SolverStrategy > | d_solver = nullptr |
| int | d_solver_retcode = 0 |
| bool | d_time_history_initialized = false |
| whether it is the first step | |
| int | d_total_steprejects = 0 |
| bool | d_user_managed_time_operator = false |
| user manages time operator | |
| std::shared_ptr< AMP::IO::Writer > | d_writer |
| keeps track of total number of step rejections | |
Private Member Functions | |
| virtual bool | integratorSpecificCheckNewSolution (const int solver_retcode) |
| virtual double | integratorSpecificGetNextDt (const bool good_solution, const int solver_retcode) |
| allows for specialization of getNextDt for classes of time integrators | |
| virtual void | integratorSpecificInitialize (void) |
| virtual void | integratorSpecificUpdateSolution (double time) |
Manage implicit time integration.
Class ImplicitIntegrator manages implicit time integration over a mesh. It maintains references to an Operator and SolverStrategy objects, which provide operations describing the implicit equations and solving the problem at each time step, respectively.
Input Parameters
Definitions:
All input data items described above, except for initial_time, may be overridden by new input values when continuing from restart.
Details:
| parameter | type | default | range | opt/req | behavior on restart |
|---|---|---|---|---|---|
| initial_time | double | none | >=0 | req | May not be modified by input db on restart |
| final_time | double | none | final_time >= initial_time | req | Parameter read from restart db may be overridden by input db |
| max_integrator_steps | int | none | >=0 | req | Parameter read from restart db may be overridden by input db |
A sample input file entry might look like:
Definition at line 91 of file ImplicitIntegrator.h.
|
inherited |
Convience typedef.
Definition at line 37 of file TimeIntegrator.h.
|
explicit |
The constructor for ImplicitIntegrator 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.
|
delete |
|
delete |
|
virtual |
Empty destructor for ImplicitIntegrator
| AMP::TimeIntegrator::ImplicitIntegrator::ImplicitIntegrator | ( | int64_t | fid, |
| AMP::IO::RestartManager * | manager | ||
| ) |
Read restart data to file.
This function will create a variable from the restart file
| fid | File identifier to write |
| manager | Restart manager |
|
overridevirtual |
Integrate entire patch hierarchy through the specified time increment.
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 they are 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.
| dt | Time step size |
| first_step | Whether this is the first step after grid change |
| in | Input vector |
| out | Output vector |
Implements AMP::TimeIntegrator::TimeIntegrator.
|
inlinevirtualinherited |
Append the vectors of interest to the rhs vector.
This function will append the necessary vectors that this solver owns to the global vector provided. Note that each solver may own any number of vectors, but no vector may be owned by multiple solvers.
| vec | The vector to append |
Definition at line 219 of file TimeIntegrator.h.
|
inlinevirtualinherited |
Append the vectors of interest to the solution vector.
This function will append the necessary vectors that this solver owns to the global vector provided. Note that each solver may own any number of vectors, but no vector may be owned by multiple solvers.
| vec | The vector to append |
Definition at line 208 of file TimeIntegrator.h.
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.
Implements AMP::TimeIntegrator::TimeIntegrator.
Return current timestep.
Return current timestep.
Return final integration time.
Return current integration time.
Return final integration time.
Return final integration time.
|
protectedinherited |
|
protectedinherited |
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
Definition at line 268 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_current_dt.
|
inherited |
Get a unique id hash for the vector.
get initial time step.
Definition at line 179 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_initial_dt.
Return initial integration time.
Return initial integration time.
Return current integration step number.
Return current integration step number.
Return maximum number of integration steps.
Return maximum number of integration steps.
|
overridevirtual |
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.
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
|
inline |
Returns the object name.
Definition at line 225 of file ImplicitIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_object_name.
|
inlineinherited |
Definition at line 246 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_operator.
|
inlinevirtualinherited |
Retrieve the current solution.
Definition at line 137 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_solution_vector.
|
inline |
Definition at line 227 of file ImplicitIntegrator.h.
References d_solver.
|
inlinevirtualinherited |
Reimplemented in AMP::TimeIntegrator::IDATimeIntegrator.
Definition at line 266 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_pSourceTerm.
|
inlinevirtualinherited |
Scaling factors for previous time history vectors.
For RK methods the previous time vector is always scaled by 1. For multistep methods this vector can consist of multiple scalings with the first entry being the scaling for $y^{n-1}$, the next being for $y^{n-2}$ etc
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
Definition at line 276 of file TimeIntegrator.h.
|
inlinevirtual |
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
Definition at line 256 of file ImplicitIntegrator.h.
|
inlinevirtualinherited |
Definition at line 248 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_total_steprejects.
|
virtual |
Initialize state of time integrator.
Initialize state of time integrator. This includes creating solution vector and initializing solver components.
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
Initialize state of time integrator. This includes creating solution vector and initializing solver components.
|
protectedvirtual |
allows for specialization of advanceSolution for classes of time integrators
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
privatevirtual |
allows for specialization of the checkNewSolution for classes of time integrators
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
privatevirtual |
allows for specialization of getNextDt for classes of time integrators
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
privatevirtual |
allows for specialization of the initialization routine for classes of time integrators
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
privatevirtual |
allows for specialization of updateSolution for classes of time integrators
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
virtual |
Print out all members of integrator instance to given output stream.
|
overridevirtual |
print the statistics on the solver
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
|
inherited |
Write out state of object to given database.
When assertion checking is active, the database pointer must be non-null.
|
overridevirtual |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
|
overridevirtual |
Registers an operator for the rhs
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
|
inlinevirtualinherited |
Registers a writer with the solver.
This function will register a writer with the solver. The solver may then register any vector components it "owns" with the writer.
| writer | The writer to register |
Definition at line 227 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_writer.
|
override |
Resets the internal state of the time integrator as needed. A parameter argument is passed to allow for general flexibility in determining what needs to be reset Typically used after a regrid.
|
pure virtualinherited |
Resets the internal state of the time integrator.
Resets the internal state of the time integrator as needed. A parameter argument is passed to allow for general flexibility in determining what needs to be reset.
Implemented in AMP::TimeIntegrator::OxideTimeIntegrator, and AMP::TimeIntegrator::IDATimeIntegrator.
reset parameters so that the time integrator is ready to start at the initial time
|
inline |
Definition at line 228 of file ImplicitIntegrator.h.
References d_solver.
|
inline |
Definition at line 249 of file ImplicitIntegrator.h.
References d_fComponentScalingFnPtr.
| void AMP::TimeIntegrator::ImplicitIntegrator::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
|
inlinevirtualinherited |
Definition at line 250 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_current_dt.
|
inlinevirtualinherited |
Definition at line 254 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_current_time.
|
inlinevirtualinherited |
Definition at line 258 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_final_time.
|
inlinevirtualinherited |
Definition at line 252 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_initial_dt.
|
protectedvirtual |
Set the initial guess for the time advanced solution at the start of the nonlinear iteration. The boolean argument first_step indicates whether we are at the first step on the current hierarchy configuration. This is true when the hierarchy is constructed initially and after regridding. In these cases, setting the initial iterate using extrapolation, for example, may not be possible.
Function overloaded from algs::ImplicitEquationStrategy.
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
|
inlinevirtualinherited |
Definition at line 256 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_initial_time.
|
inlinevirtualinherited |
Definition at line 262 of file TimeIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_pSourceTerm.
|
inlineprotectedvirtual |
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
Definition at line 277 of file ImplicitIntegrator.h.
|
inline |
Definition at line 244 of file ImplicitIntegrator.h.
References d_fTimeScalingFnPtr.
|
inlinevirtualinherited |
Reimplemented in AMP::TimeIntegrator::BDFIntegrator.
Definition at line 284 of file TimeIntegrator.h.
|
inlineoverridevirtual |
Return true if the number of integration steps performed by the integrator has not reached the specified maximum; return false otherwise.
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
Definition at line 215 of file ImplicitIntegrator.h.
References AMP::TimeIntegrator::TimeIntegrator::d_integrator_step, and AMP::TimeIntegrator::TimeIntegrator::d_max_integrator_steps.
|
virtualinherited |
Return the name of the TimeIntegrator.
Reimplemented in AMP::TimeIntegrator::BDFIntegrator, AMP::TimeIntegrator::ExplicitEuler, AMP::TimeIntegrator::RK12TimeIntegrator, AMP::TimeIntegrator::RK23TimeIntegrator, AMP::TimeIntegrator::RK2TimeIntegrator, AMP::TimeIntegrator::RK34TimeIntegrator, AMP::TimeIntegrator::RK45TimeIntegrator, AMP::TimeIntegrator::RK4TimeIntegrator, and AMP::TimeIntegrator::IDATimeIntegrator.
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.
Implements AMP::TimeIntegrator::TimeIntegrator.
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented from AMP::TimeIntegrator::TimeIntegrator.
|
protectedinherited |
Definition at line 350 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::getGamma(), and AMP::TimeIntegrator::TimeIntegrator::setCurrentDt().
|
protectedinherited |
Definition at line 346 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::setCurrentTime().
|
protected |
registered callback function to set multiphysics component scalings
Definition at line 320 of file ImplicitIntegrator.h.
Referenced by setComponentScalingFunction().
|
protectedinherited |
Definition at line 345 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::setFinalTime().
the return code from the implicit solver at the current timestep
Definition at line 297 of file ImplicitIntegrator.h.
|
protected |
registered callback function to set gamma, typically when the user needs to know gamma
Definition at line 315 of file ImplicitIntegrator.h.
Referenced by setTimeScalingFunction().
|
protected |
Definition at line 287 of file ImplicitIntegrator.h.
|
protectedinherited |
Definition at line 315 of file TimeIntegrator.h.
|
protectedinherited |
Definition at line 357 of file TimeIntegrator.h.
|
protectedinherited |
initial time increment
Definition at line 349 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::getInitialDt(), and AMP::TimeIntegrator::TimeIntegrator::setInitialDt().
|
protectedinherited |
Definition at line 344 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::setInitialTime().
Set to true after initialization in constructors. Needed in getFromInput to avoid reseting some parameters in subsequent reset operations.
Definition at line 370 of file TimeIntegrator.h.
|
protectedinherited |
Definition at line 358 of file TimeIntegrator.h.
Referenced by stepsRemaining().
|
protectedinherited |
maximum allowable timestep (user defined)
Definition at line 355 of file TimeIntegrator.h.
|
protectedinherited |
Definition at line 359 of file TimeIntegrator.h.
Referenced by stepsRemaining().
|
protectedinherited |
Definition at line 352 of file TimeIntegrator.h.
|
protectedinherited |
Definition at line 305 of file TimeIntegrator.h.
Referenced by getObjectName().
|
protectedinherited |
Definition at line 351 of file TimeIntegrator.h.
|
protectedinherited |
The operator is the right hand side operator for an explicit integrator when the time integration problem is : u_t = f(u) but in the case of implicit time integrators the operator represents u_t-f(u)
Definition at line 328 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::getOperator(), and AMP::TimeIntegrator::TimeIntegrator::registerOperator().
|
protectedinherited |
The operator is the left hand side mass operator (for FEM formulations)
Definition at line 333 of file TimeIntegrator.h.
|
protectedinherited |
pointer to parameters
Definition at line 310 of file TimeIntegrator.h.
|
protectedinherited |
Definition at line 338 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::getSourceTerm(), and AMP::TimeIntegrator::TimeIntegrator::setSourceTerm().
|
protected |
Definition at line 286 of file ImplicitIntegrator.h.
|
protectedinherited |
Definition at line 320 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::getSolution().
|
protected |
Definition at line 284 of file ImplicitIntegrator.h.
Referenced by getSolver(), and resetSolver().
|
protected |
Definition at line 294 of file ImplicitIntegrator.h.
whether it is the first step
Definition at line 299 of file ImplicitIntegrator.h.
|
protectedinherited |
Definition at line 361 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::BDFIntegrator::getNumberOfStepRejections(), and AMP::TimeIntegrator::TimeIntegrator::getTotalRejectedSteps().
user manages time operator
Definition at line 302 of file ImplicitIntegrator.h.
|
protectedinherited |
keeps track of total number of step rejections
Definition at line 364 of file TimeIntegrator.h.
Referenced by AMP::TimeIntegrator::TimeIntegrator::registerWriter().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:45. Comments on this page |