Go to the documentation of this file.
21 #ifndef __AdamsBashforth4_hpp__
22 #define __AdamsBashforth4_hpp__
89 Kokkos::Schedule<Kokkos::Static>,
90 Kokkos::IndexType<int32>
109 return makeUnique<AdamsBashforth4>(*
this);
151 template<
typename activeFunctor>
156 activeFunctor activeP );
161 template<
typename activeFunctor>
166 activeFunctor activeP )
171 auto activeRng = activeP.activeRange();
173 Kokkos::parallel_for(
174 "AdamsBashforth4::correct",
181 static_cast<real>(55.0 / 24.0) * d_dy[i]
182 -
static_cast<real>(59.0 / 24.0) * d_history[i].dy1_
183 +
static_cast<real>(37.0 / 24.0) * d_history[i].dy2_
184 -
static_cast<real>( 9.0 / 24.0) * d_history[i].dy3_
186 d_history[i].dy3_ = d_history[i].dy2_;
187 d_history[i].dy2_ = d_history[i].dy1_;
188 d_history[i].dy1_ = d_dy[i];
198 #endif //__integration_hpp__
bool intRange(real dt, realx3Vector_D &y, realx3Vector_D &dy, activeFunctor activeP)
Integrate on active points in the active range.
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
Base class for integrating the first order ODE (IVP)
uniquePtr< integration > clone() const override
const auto & deviceViewAll() const
const auto & pStruct() const
Const ref to pointStructure.
bool readEnd(const char *funcName)
End read of data chunk, ends with ')' return true or FatalIOError.
Kokkos::DefaultExecutionSpace DefaultExecutionSpace
Default execution space, it can be device exe.
add_vCtor(integration, AdamsBashforth4, word)
Add a this to the virtual constructor table.
TypeInfo("AdamsBashforth4")
Type info.
const word & baseName() const
Base name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
virtual ~AdamsBashforth4()=default
Destructor.
Interface class for any input stream
Kokkos::RangePolicy< DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< int32 > > rpIntegration
Range policy for integration kernel.
bool predict(real UNUSED(dt), realx3Vector_D &UNUSED(y), realx3Vector_D &UNUSED(dy)) override
bool needSetInitialVals() const override
Check if the method requires any set initial vals.
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
@ END_LIST
Begin list [isseparator].
Fourth order Adams-Bashforth integration method for solving ODE.
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
repository & owner()
Ref to the owner repository.
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
AdamsBashforth4(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
@ BEGIN_LIST
End entry [isseparator].
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) override
Set the initial values for new indices.
virtual word method() const =0
return integration method
pointField< VectorSingle, AB4History > & history_
Integration history.
bool intAll(real dt, realx3Vector_D &y, realx3Vector_D &dy, range activeRng)
Integrate on all points in the active range.
Interface class for any output stream.
bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy) override
It holds two vectors of indecis on Host and Device.