Go to the documentation of this file.
21 #ifndef __AdamsBashforth2_hpp__
22 #define __AdamsBashforth2_hpp__
49 Kokkos::Schedule<Kokkos::Static>,
50 Kokkos::IndexType<int32>
69 return makeUnique<AdamsBashforth2>(*
this);
111 template<
typename activeFunctor>
116 activeFunctor activeP );
120 template<
typename activeFunctor>
125 activeFunctor activeP )
130 auto d_dy1= dy1_.deviceVectorAll();
133 Kokkos::parallel_for(
134 "AdamsBashforth2::correct",
139 d_y[i] += dt*(
static_cast<real>(3.0 / 2.0) * d_dy[i] -
static_cast<real>(1.0 / 2.0) * d_dy1[i]);
151 #endif //__integration_hpp__
bool needSetInitialVals() const override
Check if the method requires any set initial vals.
realx3PointField_D & dy1_
dy at t-dt
bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
Correction/main integration step.
uniquePtr< integration > clone() const override
Polymorphic copy/cloning.
bool intRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Integrate on active points in the active range.
virtual ~AdamsBashforth2()=default
Destructor.
Base class for integrating the first order ODE (IVP)
const auto & pStruct() const
Const ref to pointStructure.
Kokkos::DefaultExecutionSpace DefaultExecutionSpace
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) override
Set the initial values for new indices.
const word & baseName() const
Base name.
range activeRange() const
repository & owner()
Ref to the owner repository.
Second order Adams-Bashforth integration method for solving ODE.
bool intAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Integrate on all points in the active range.
AdamsBashforth2(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
TypeInfo("AdamsBashforth2")
Type info.
INLINE_FUNCTION_H viewType & deviceVectorAll()
Kokkos::RangePolicy< DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< int32 > > rpIntegration
Range policy for integration kernel (alias)
add_vCtor(integration, AdamsBashforth2, word)
Add this to the virtual constructor table.
bool predict(real UNUSED(dt), realx3Vector_D &UNUSED(y), realx3Vector_D &UNUSED(dy)) override