doc for integration

This commit is contained in:
Hamidreza Norouzi
2023-04-23 12:47:12 -07:00
parent ad1a948f5f
commit 06a431f689
15 changed files with 481 additions and 252 deletions

View File

@ -32,7 +32,7 @@ pFlow::AdamsBashforth5::AdamsBashforth5
:
integration(baseName, owner, pStruct, method),
history_(
owner.emplaceObject<HistoryFieldType>(
owner.emplaceObject<pointField<VectorSingle,AB5History>>(
objectFile(
groupNames(baseName,"AB5History"),
"",

View File

@ -30,12 +30,12 @@ namespace pFlow
struct AB5History
{
TypeInfoNV("AB5History");
realx3 dy1_={0,0,0};
realx3 dy2_={0,0,0};
realx3 dy3_={0,0,0};
realx3 dy4_={0,0,0};
TypeInfoNV("AB5History");
};
@ -71,18 +71,21 @@ iOstream& operator<<(iOstream& str, const AB5History& ab5)
return str;
}
/**
* Fifth order Adams-Bashforth integration method for solving ODE
*
* This is a one-step integration method and does not have prediction step.
*/
class AdamsBashforth5
:
public integration
{
protected:
using HistoryFieldType = pointField<VectorSingle,AB5History>;
// this is a device
HistoryFieldType& history_;
/// Integration history
pointField<VectorSingle,AB5History>& history_;
/// Range policy for integration kernel
using rpIntegration = Kokkos::RangePolicy<
DefaultExecutionSpace,
Kokkos::Schedule<Kokkos::Static>,
@ -91,32 +94,40 @@ protected:
public:
// type info
/// Type info
TypeInfo("AdamsBashforth5");
//// - Constructors
// - Constructors
AdamsBashforth5(
const word& baseName,
repository& owner,
const pointStructure& pStruct,
const word& method);
uniquePtr<integration> clone()const override
{
return makeUnique<AdamsBashforth5>(*this);
}
virtual ~AdamsBashforth5()=default;
// - add a virtual constructor
/// Add this to the virtual constructor table
add_vCtor(
integration,
AdamsBashforth5,
word);
//// - Methods
// - Methods
bool predict(
real UNUSED(dt),
realx3Vector_D & UNUSED(y),
realx3Vector_D& UNUSED(dy)) override;
bool correct(real dt,
bool correct(
real dt,
realx3Vector_D & y,
realx3Vector_D& dy) override;
@ -129,18 +140,17 @@ public:
return false;
}
uniquePtr<integration> clone()const override
{
return makeUnique<AdamsBashforth5>(*this);
}
bool intAll(real dt,
/// Integrate on all points in the active range
bool intAll(
real dt,
realx3Vector_D& y,
realx3Vector_D& dy,
range activeRng);
/// Integrate on active points in the active range
template<typename activeFunctor>
bool intRange(real dt,
bool intRange(
real dt,
realx3Vector_D& y,
realx3Vector_D& dy,
activeFunctor activeP );
@ -184,4 +194,4 @@ bool pFlow::AdamsBashforth5::intRange(
} // pFlow
#endif //__integration_hpp__
#endif //