Advanced Multi-Physics (AMP)
On-Line Documentation
RK12TimeIntegrator.h
Go to the documentation of this file.
1//
2// $Id: RK12TimeIntegrator.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: RK12TimeIntegrator.h
7// Copyright: (c) 2005 The Regents of the University of California
8// Description: Concrete time integrator using Runge-Kutta RK12 method
9//
10
11#ifndef included_RK12TimeIntegrator
12#define included_RK12TimeIntegrator
13
14#include <string>
15
16#include "AMP/time_integrators/TimeIntegrator.h"
17
18namespace AMP::TimeIntegrator {
19
35{
36public:
41 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters );
42
47
48 static std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator> createTimeIntegrator(
49 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters )
50 {
51 return std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator>(
52 new RK12TimeIntegrator( parameters ) );
53 }
54
59 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
60
66 void reset(
67 std::shared_ptr<const AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
68
72 double getNextDt( const bool good_solution ) override;
73
77 bool checkNewSolution( void ) override;
78
82 void updateSolution( void ) override;
83
84 int advanceSolution( const double dt,
85 const bool first_step,
86 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
87 std::shared_ptr<AMP::LinearAlgebra::Vector> out ) override;
88
89 std::string type() const override { return "RK12"; }
90
91public: // Write/read restart data
98
104 void writeRestart( int64_t fid ) const override;
105
113
114private:
119
123 void getFromInput( std::shared_ptr<AMP::Database> input_db );
124
128 void setupVectors( void );
129
131
132 double d_safety_factor = 0.0;
133 double d_atol = 0.0;
134
135 bool d_use_fixed_dt = false;
136
137 std::shared_ptr<AMP::LinearAlgebra::Vector> d_new_solution;
138 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k1_vec;
139 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k2_vec;
140 std::shared_ptr<AMP::LinearAlgebra::Vector> d_z_vec;
141};
142} // namespace AMP::TimeIntegrator
143
144#endif
Class to manage reading/writing restart data.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_z_vec
double getNextDt(const bool good_solution) override
RK12TimeIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k1_vec
RK12TimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
std::string type() const override
Return the name of the TimeIntegrator.
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.
void initialize(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
static std::unique_ptr< AMP::TimeIntegrator::TimeIntegrator > createTimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
void reset(std::shared_ptr< const AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
void writeRestart(int64_t fid) const override
Write restart data to file.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k2_vec
void getFromInput(std::shared_ptr< AMP::Database > input_db)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_new_solution
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
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