Go to the documentation of this file.
21 #ifndef __AdamsMoulton3_hpp__
22 #define __AdamsMoulton3_hpp__
54 Kokkos::Schedule<Kokkos::Static>,
55 Kokkos::IndexType<int32>
73 return makeUnique<AdamsMoulton3>(*
this);
115 template<
typename activeFunctor>
120 activeFunctor activeP);
130 template<
typename activeFunctor>
135 activeFunctor activeP);
140 template<
typename activeFunctor>
145 activeFunctor activeP)
153 auto activeRng = activeP.activeRange();
155 Kokkos::parallel_for(
156 "AdamsMoulton3::predictRange",
165 static_cast<real>(3.0 / 2.0) * d_dy[i]
166 -
static_cast<real>(1.0 / 2.0) * d_dy1[i]
177 template<
typename activeFunctor>
182 activeFunctor activeP)
188 auto d_dy0 = dy0_.deviceViewAll();
189 auto d_y0 = y0_.deviceViewAll();
190 auto d_dy1 = dy1_.deviceViewAll();
192 auto activeRng = activeP.activeRange();
194 Kokkos::parallel_for(
195 "AdamsMoulton3::correct",
200 auto corrct_y = d_y0[i] + dt*(
201 static_cast<real>(5.0/12.0)*d_dy[i]
202 +
static_cast<real>(8.0/12.0)*d_dy0[i]
203 -
static_cast<real>(1.0/12.0)*d_dy1[i]);
TypeInfo("AdamsMoulton3")
Type info.
add_vCtor(integration, AdamsMoulton3, word)
Add this to the virtual constructor table.
Base class for integrating the first order ODE (IVP)
const auto & deviceViewAll() const
const auto & pStruct() const
Const ref to pointStructure.
AdamsMoulton3(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
bool intAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Integrate on all points in the active range.
Kokkos::DefaultExecutionSpace DefaultExecutionSpace
Default execution space, it can be device exe.
Kokkos::RangePolicy< DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< int32 > > rpIntegration
Range policy for integration kernel.
const word & baseName() const
Base name.
bool predictRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Prediction step on active points in the active range.
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) override
Set the initial values for new indices.
realx3PointField_D & dy0_
dy at time t
uniquePtr< integration > clone() const override
repository & owner()
Ref to the owner repository.
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
bool intRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Integrate on active points in the active range.
bool predictAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Prediction step on all points in the active range.
realx3PointField_D & dy1_
dy at time t-dt
bool predict(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
realx3PointField_D & y0_
y at time t
bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
virtual ~AdamsMoulton3()=default
Destructor.
virtual word method() const =0
return integration method
Third order Adams-Moulton integration method for solving ODE.
bool needSetInitialVals() const override
Check if the method requires any set initial vals.
It holds two vectors of indecis on Host and Device.