Go to the documentation of this file.
21 #ifndef __AdamsMoulton4_hpp__
22 #define __AdamsMoulton4_hpp__
57 Kokkos::Schedule<Kokkos::Static>,
58 Kokkos::IndexType<int32>
76 return makeUnique<AdamsMoulton4>(*
this);
118 template<
typename activeFunctor>
123 activeFunctor activeP);
133 template<
typename activeFunctor>
138 activeFunctor activeP );
143 template<
typename activeFunctor>
148 activeFunctor activeP )
158 auto activeRng = activeP.activeRange();
160 Kokkos::parallel_for(
161 "AdamsMoulton4::predictRange",
167 d_y[i] = d_y0[i] + dt*(
168 static_cast<real>(23.0 /12.0 ) * d_dy[i]
169 -
static_cast<real>(16.0 / 12.0) * d_dy1[i]
170 +
static_cast<real>( 5.0 / 12.0) * d_dy2[i]);
180 template<
typename activeFunctor>
185 activeFunctor activeP )
191 auto d_dy0 = dy0_.deviceViewAll();
192 auto d_y0 = y0_.deviceViewAll();
193 auto d_dy1 = dy1_.deviceViewAll();
194 auto d_dy2 = dy2_.deviceViewAll();
196 auto activeRng = activeP.activeRange();
198 Kokkos::parallel_for(
199 "AdamsMoulton4::correct",
204 auto corrct_y = d_y0[i] + dt*(
205 static_cast<real>(9.0/24.0)*d_dy[i]
206 +
static_cast<real>(19.0/24.0)*d_dy0[i]
207 -
static_cast<real>( 5.0/24.0)*d_dy1[i]
208 +
static_cast<real>( 1.0/24.0)*d_dy2[i]);
AdamsMoulton4(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
virtual ~AdamsMoulton4()=default
Destructor.
bool needSetInitialVals() const override
Check if the method requires any set initial vals.
realx3PointField_D & dy0_
dy at time t
Fourth order Adams-Moulton integration method for solving ODE.
realx3PointField_D & dy1_
dy at time t-dt
realx3PointField_D & dy2_
dy at time t-2*dt
Base class for integrating the first order ODE (IVP)
const auto & deviceViewAll() const
realx3PointField_D & y0_
y at time t
const auto & pStruct() const
Const ref to pointStructure.
bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
bool predict(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
Kokkos::DefaultExecutionSpace DefaultExecutionSpace
Default execution space, it can be device exe.
bool intRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Integrate on active points in the active range.
const word & baseName() const
Base name.
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.
add_vCtor(integration, AdamsMoulton4, word)
bool predictRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Prediction step on active points in the active range.
repository & owner()
Ref to the owner repository.
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
bool predictAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Prediction step on all points in the active range.
TypeInfo("AdamsMoulton4")
Type info.
bool intAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Integrate on all points in the active range.
virtual word method() const =0
return integration method
It holds two vectors of indecis on Host and Device.
uniquePtr< integration > clone() const override