Go to the documentation of this file.
21 #ifndef __AdamsMoulton5_hpp__
22 #define __AdamsMoulton5_hpp__
60 Kokkos::Schedule<Kokkos::Static>,
61 Kokkos::IndexType<int32>
79 return makeUnique<AdamsMoulton5>(*
this);
121 template<
typename activeFunctor>
126 activeFunctor activeP);
136 template<
typename activeFunctor>
141 activeFunctor activeP );
146 template<
typename activeFunctor>
151 activeFunctor activeP )
162 auto activeRng = activeP.activeRange();
164 Kokkos::parallel_for(
165 "AdamsMoulton5::predictRange",
171 d_y[i] = d_y0[i] + dt*(
172 static_cast<real>(55.0/24.0) * d_dy[i]
173 -
static_cast<real>(59.0/24.0) * d_dy1[i]
174 +
static_cast<real>(37.0/24.0) * d_dy2[i]
175 -
static_cast<real>( 9.0/24.0) * d_dy3[i]);
184 template<
typename activeFunctor>
189 activeFunctor activeP )
195 auto d_dy0 = dy0_.deviceViewAll();
196 auto d_y0 = y0_.deviceViewAll();
197 auto d_dy1 = dy1_.deviceViewAll();
198 auto d_dy2 = dy2_.deviceViewAll();
199 auto d_dy3 = dy3_.deviceViewAll();
201 auto activeRng = activeP.activeRange();
203 Kokkos::parallel_for(
204 "AdamsMoulton5::correct",
209 auto corrct_y = d_y0[i] + dt*(
210 static_cast<real>(251.0/720.0)*d_dy[i]
211 +
static_cast<real>(646.0/720.0)*d_dy0[i]
212 -
static_cast<real>(264.0/720.0)*d_dy1[i]
213 +
static_cast<real>(106.0/720.0)*d_dy2[i]
214 -
static_cast<real>( 19.0/720.0)*d_dy3[i]);
231 #endif //__integration_hpp__
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) override
Set the initial values for new indices.
Kokkos::RangePolicy< DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< int32 > > rpIntegration
Range policy for integration kernel.
bool predictRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Prediction step on active points in the active range.
Base class for integrating the first order ODE (IVP)
const auto & deviceViewAll() const
bool intAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Integrate on all points in the active range.
const auto & pStruct() const
Const ref to pointStructure.
add_vCtor(integration, AdamsMoulton5, word)
Fifth order Adams-Moulton integration method for solving ODE.
bool predictAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Prediction step on all points in the active range.
Kokkos::DefaultExecutionSpace DefaultExecutionSpace
Default execution space, it can be device exe.
const word & baseName() const
Base name.
realx3PointField_D & dy0_
dy at time t
realx3PointField_D & dy1_
dy at time t-dt
uniquePtr< integration > clone() const override
realx3PointField_D & y0_
y at time t
bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
AdamsMoulton5(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
bool needSetInitialVals() const override
Check if the method requires any set initial vals.
repository & owner()
Ref to the owner repository.
bool predict(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
realx3PointField_D & dy2_
dy at time t-2*dt
realx3PointField_D & dy3_
dy at time t-3*dt
bool intRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Integrate on active points in the active range.
virtual word method() const =0
return integration method
virtual ~AdamsMoulton5()=default
Destructor.
TypeInfo("AdamsMoulton5")
Type info.
It holds two vectors of indecis on Host and Device.