Advanced Multi-Physics (AMP)
On-Line Documentation
RK23TimeIntegrator.h
Go to the documentation of this file.
1//
2// $Id: RK23TimeIntegrator.h,v 1.2 2006/02/07 17:36:01 philipb Exp $
3// $Revision: 1.2 $
4// $Date: 2006/02/07 17:36:01 $
5//
6// File: RK23TimeIntegrator.h
7// Copyright: (c) 2005 The Regents of the University of California
8// Description: Concrete time integrator using Runge-Kutta RK23 method
9//
10
11#ifndef included_RK23TimeIntegrator
12#define included_RK23TimeIntegrator
13
14#include <string>
15
16#include "AMP/time_integrators/TimeIntegrator.h"
17
18namespace AMP::TimeIntegrator {
19
27{
28public:
33 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters );
34
39
40 static std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator> createTimeIntegrator(
41 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters )
42 {
43 return std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator>(
44 new RK23TimeIntegrator( parameters ) );
45 }
46
51 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
52
58 void reset(
59 std::shared_ptr<const AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
60
64 double getNextDt( const bool good_solution ) override;
65
69 bool checkNewSolution( void ) override;
70
74 void updateSolution( void ) override;
75
76 int advanceSolution( const double dt,
77 const bool first_step,
78 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
79 std::shared_ptr<AMP::LinearAlgebra::Vector> out ) override;
80
81 std::string type() const override { return "RK23"; }
82
83public: // Write/read restart data
90
96 void writeRestart( int64_t fid ) const override;
97
105
106private:
111
115 void getFromInput( std::shared_ptr<AMP::Database> input_db );
116
120 void setupVectors( void );
121
123
124 double d_safety_factor = 0.0;
125 double d_atol = 0.0;
126
127 bool d_use_fixed_dt = false;
128
129 std::shared_ptr<AMP::LinearAlgebra::Vector> d_new_solution;
130 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k1_vec;
131 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k2_vec;
132 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k3_vec;
133 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k4_vec;
134 std::shared_ptr<AMP::LinearAlgebra::Vector> d_z_vec;
135};
136} // namespace AMP::TimeIntegrator
137
138#endif
Class to manage reading/writing restart data.
void reset(std::shared_ptr< const AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
std::string type() const override
Return the name of the TimeIntegrator.
static std::unique_ptr< AMP::TimeIntegrator::TimeIntegrator > createTimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
void initialize(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
RK23TimeIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_new_solution
std::shared_ptr< AMP::LinearAlgebra::Vector > d_z_vec
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k4_vec
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
double getNextDt(const bool good_solution) override
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k3_vec
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k2_vec
void writeRestart(int64_t fid) const override
Write restart data to file.
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 through the specified time increment.
RK23TimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
void getFromInput(std::shared_ptr< AMP::Database > input_db)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k1_vec
Abstract base class for time integration.
std::shared_ptr< AMP::TimeIntegrator::TimeIntegrator > shared_ptr
Convience typedef.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page