Advanced Multi-Physics (AMP)
On-Line Documentation
RK2TimeIntegrator.h
Go to the documentation of this file.
1//
2// $Id: RK2TimeIntegrator.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: RK2TimeIntegrator.h
7// Copyright: (c) 2005 The Regents of the University of California
8// Description: Concrete time integrator using backward Euler method
9//
10
11#ifndef included_RK2TimeIntegrator
12#define included_RK2TimeIntegrator
13
14#include <string>
15
16#include "AMP/time_integrators/TimeIntegrator.h"
17
18namespace AMP::TimeIntegrator {
19
20class TimeIntegratorParameters;
21
29{
30public:
34 explicit RK2TimeIntegrator( std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> );
35
40
41 static std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator> createTimeIntegrator(
42 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters )
43 {
44 return std::unique_ptr<AMP::TimeIntegrator::TimeIntegrator>(
45 new RK2TimeIntegrator( parameters ) );
46 }
47
52 std::shared_ptr<AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
53
59 void reset(
60 std::shared_ptr<const AMP::TimeIntegrator::TimeIntegratorParameters> parameters ) override;
61
65 bool checkNewSolution( void ) override;
66
70 void updateSolution( void ) override;
71
72 int advanceSolution( const double dt,
73 const bool first_step,
74 std::shared_ptr<AMP::LinearAlgebra::Vector> in,
75 std::shared_ptr<AMP::LinearAlgebra::Vector> out ) override;
76
77 std::string type() const override { return "RK2"; }
78
79public: // Write/read restart data
86
92 void writeRestart( int64_t fid ) const override;
93
101
102private:
107
111 void setupVectors( void );
112
113 std::shared_ptr<AMP::LinearAlgebra::Vector> d_new_solution;
114 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k1_vec;
115 std::shared_ptr<AMP::LinearAlgebra::Vector> d_k2_vec;
116};
117} // namespace AMP::TimeIntegrator
118
119#endif
Class to manage reading/writing restart data.
void initialize(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
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.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k1_vec
std::shared_ptr< AMP::LinearAlgebra::Vector > d_new_solution
std::string type() const override
Return the name of the TimeIntegrator.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_k2_vec
void writeRestart(int64_t fid) const override
Write restart data to file.
RK2TimeIntegrator(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data to file.
void reset(std::shared_ptr< const AMP::TimeIntegrator::TimeIntegratorParameters > parameters) override
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
RK2TimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters >)
static std::unique_ptr< AMP::TimeIntegrator::TimeIntegrator > createTimeIntegrator(std::shared_ptr< AMP::TimeIntegrator::TimeIntegratorParameters > parameters)
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