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

@ -31,32 +31,71 @@ Licence:
namespace pFlow
{
/**
* Base class for integrating the first order ODE (IVP)
*
* The ODE should be in the following form:
*\f[
\frac{dy}{dt} = f(y,t)
\f]
* for example the equation of motion is in the following form:
*\f[
m\frac{d\vec{v}}{dt} = m\vec{g} + \sum \vec{f_c}(\vec{v},t)
\f]
*
* The integration method can be either one-step or predictor-corrector type.
*
*/
class integration
{
protected:
repository& owner_;
// - Protected data members
const word baseName_;
/// The owner repository that all fields are storred in
repository& owner_;
const pointStructure& pStruct_;
/// The base name for integration
const word baseName_;
/// A reference to pointStructure
const pointStructure& pStruct_;
public:
// type info
/// Type info
TypeInfo("integration");
//// - Constructors
// - Constructors
/// Construct from components
integration(
const word& baseName,
repository& owner,
const pointStructure& pStruct,
const word& method);
/// Copy constructor
integration(const integration&) = default;
/// Move constructor
integration(integration&&) = default;
/// Copy assignment
integration& operator = (const integration&) = default;
/// Move assignment
integration& operator = (integration&&) = default;
/// Polymorphic copy/cloning
virtual
uniquePtr<integration> clone()const=0;
/// Destructor
virtual ~integration()=default;
// - add a virtual constructor
/// Add a virtual constructor
create_vCtor(
integration,
word,
@ -67,35 +106,49 @@ public:
(baseName, owner, pStruct, method) );
//// - Methods
// - Methods
/// Const ref to pointStructure
inline
const auto& pStruct()const
{
return pStruct_;
}
virtual bool predict(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
virtual bool correct(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
virtual bool setInitialVals(
const int32IndexContainer& newIndices,
const realx3Vector& y) = 0;
virtual bool needSetInitialVals()const = 0;
virtual uniquePtr<integration> clone()const=0;
/// Base name
inline
const word& baseName()const
{
return baseName_;
}
/// Ref to the owner repository
inline
repository& owner()
{
return owner_;
}
/// Prediction step in integration
virtual
bool predict(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
/// Correction/main integration step
virtual
bool correct(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
/// Set the initial values for new indices
virtual
bool setInitialVals(
const int32IndexContainer& newIndices,
const realx3Vector& y) = 0;
/// Check if the method requires any set initial vals
virtual
bool needSetInitialVals()const = 0;
/// Create the polymorphic object based on inputs
static
uniquePtr<integration> create(
const word& baseName,
@ -103,7 +156,7 @@ public:
const pointStructure& pStruct,
const word& method);
};
}; // integration
} // pFlow

View File

@ -1,28 +0,0 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __integrations_hpp__
#define __integrations_hpp__
#include "integration.hpp"
#include "AdamsBashforth2.hpp"
#include "AdamsBashforth3.hpp"
#endif