Advanced Multi-Physics (AMP)
On-Line Documentation
RK4TimeIntegrator.h
Go to the documentation of this file.
1//
2// $Id: RK4TimeIntegrator.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: RK4TimeIntegrator.h
7// Copyright: (c) 2005 The Regents of the University of California
8// Description: Concrete time integrator using Runge-Kutta RK4 method
9//
10
11#ifndef included_RK4TimeIntegrator
12#define included_RK4TimeIntegrator
13
14#include <string>
15
16#include "AMP/time_integrators/TimeIntegrator.h"
17
18namespace AMP::TimeIntegrator {
19
26{
27public:
32 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters );
33
38
39 static std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator> createTimeIntegrator(
40 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters )
41 {
42 return std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator>(
43 new RK4TimeIntegrator( parameters ) );
44 }
45
50 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
51
57 void reset(
58 std::shared_ptr<const AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
59
63 bool checkNewSolution( void ) override;
64
68 void updateSolution( void ) override;
69
70 int advanceSolution( const double dt,
71 const bool first_step,
72 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
73 std::shared_ptr<AMP::LinearAlgebra::Vector> out ) override;
74
75 std::string type() const override { return "RK4"; }
76
77public: // Write/read restart data
84
90 void writeRestart( int64_t fid ) const override;
91
99
100private:
105
109 void setupVectors( void );
110
111 std::shared_ptr<AMP::LinearAlgebra::Vector> d_new_solution;
112 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k1_vec;
113 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k2_vec;
114 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k3_vec;
115 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k4_vec;
116};
117} // namespace AMP::TimeIntegrator
118
119#endif
Class to manage reading/writing restart data.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_new_solution
RK4TimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
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.
RK4TimeIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
void reset(std::shared_ptr< const AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
static std::unique_ptr< AMP::TimeIntegrator::TimeIntegrator > createTimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k2_vec
std::string type() const override
Return the name of the TimeIntegrator.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k1_vec
void initialize(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k3_vec
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k4_vec
void writeRestart(int64_t fid) const override
Write restart data to file.
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