www.cemf.ir
AdamsBashforth2 Class Reference

Second order Adams-Bashforth integration method for solving ODE. More...

+ Inheritance diagram for AdamsBashforth2:
+ Collaboration diagram for AdamsBashforth2:

Public Member Functions

 ClassInfo ("AdamsBashforth2")
 Class info. More...
 
 AdamsBashforth2 (const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
 Construct from components. More...
 
 ~AdamsBashforth2 () final=default
 Destructor. More...
 
 add_vCtor (integration, AdamsBashforth2, word)
 Add this to the virtual constructor table. More...
 
void updateBoundariesSlaveToMasterIfRequested () override
 
word method () const override
 return integration method More...
 
bool predict (real UNUSED(dt), realx3PointField_D &UNUSED(y), realx3PointField_D &UNUSED(dy)) final
 
bool predict (real dt, realx3Field_D &y, realx3PointField_D &dy) final
 
bool correct (real dt, realx3PointField_D &y, realx3PointField_D &dy) final
 Correction/main integration step. More...
 
bool correctPStruct (real dt, pointStructure &pStruct, realx3PointField_D &vel) final
 
bool setInitialVals (const int32IndexContainer &newIndices, const realx3Vector &y) final
 Set the initial values for new indices. More...
 
bool needSetInitialVals () const final
 Check if the method requires any set initial vals. More...
 
- Public Member Functions inherited from integration
 TypeInfo ("integration")
 Type info. More...
 
 integration (const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
 Construct from components. More...
 
 integration (const integration &)=default
 Copy constructor. More...
 
 integration (integration &&)=default
 Move constructor. More...
 
integrationoperator= (const integration &)=default
 Copy assignment. More...
 
integrationoperator= (integration &&)=default
 Move assignment. More...
 
virtual ~integration ()=default
 Destructor. More...
 
 create_vCtor (integration, word,(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField),(baseName, pStruct, method, initialValField))
 Add a virtual constructor. More...
 
const auto & pStruct () const
 Const ref to pointStructure. More...
 
const wordbaseName () const
 Base name. More...
 
repositoryowner ()
 Ref to the owner repository. More...
 
virtual bool predict (real dt, realx3PointField_D &y, realx3PointField_D &dy)=0
 Prediction step in integration. More...
 
- Public Member Functions inherited from pointField< T, MemorySpace >
 TypeInfoTemplate111 ("pointField", T, VectorType::memoerySpaceName())
 
 pointField (const objectFile &objf, pointStructure &pStruct, const T &defVal)
 
 pointField (const objectFile &objf, repository *owner, pointStructure &pStruct, const T &defVal)
 
 pointField (const objectFile &objf, pointStructure &pStruct, const T &defVal, const T &val)
 
const wordname () const final
 
const auto & internal () const
 
void updateBoundaries (DataDirection direction) const
 
void updateBoundariesSlaveToMasterIfRequested ()
 update boundaries if it is requested previousely (slave to master). More...
 
const auto & boundaryFields () const
 
const auto & BoundaryField (uint32 i) const
 
const pointStructurepStruct () const
 
void fill (const T &val)
 
bool readPointField (iIstream &is, const IOPattern &iop)
 
bool writePointField (iOstream &os, const IOPattern &iop) const
 
bool read (iIstream &is, const IOPattern &iop) override
 
bool write (iOstream &os, const IOPattern &iop) const override
 
 TypeInfoTemplateNV2 ("pointField", T, VectorType::memoerySpaceName())
 
 pointField (const pointStructure &pStruct, const T &defVal, bool subscribe=true)
 
 pointField (const pointStructure &pStruct, const T &val, const T &defVal, bool subscribe=true)
 
 pointField (const pointField &src, bool subscribe)
 
 pointField (const pointField &src)
 
 pointField (pointField &&src)=delete
 
pointFieldoperator= (const pointField &rhs)
 
pointFieldoperator= (pointField &&)=delete
 
uniquePtr< pointFieldTypeclone () const
 
pointFieldTypeclonePtr () const
 
const pointStructurepStruct () const
 
INLINE_FUNCTION_H bool allActive () const
 
INLINE_FUNCTION_H bool isActive (label i) const
 
const auto & pointFlag () const
 
range activeRange () const
 
bool update (const eventMessage &msg)
 
bool readPointField (iIstream &is)
 
bool writePointField (iOstream &os) const
 
bool read (iIstream &is)
 
bool write (iOstream &os) const
 
- Public Member Functions inherited from IOobject
virtual word typeName () const =0
 
 IOobject (const objectFile &objf, const IOPattern &iop, repository *owner)
 
 ~IOobject () override
 
 IOobject (const IOobject &src)=delete
 
 IOobject (IOobject &&src)=delete
 
const IOPatternioPattern () const
 
const repositoryowner () const override
 
repositoryowner ()
 
repositoryreleaseOwner (bool fromOwner=false)
 
bool isIncluded (const word &objName) const override
 
bool isExcluded (const word &objName) const override
 
bool readObject (bool rdHdr=true)
 
bool writeObject () const
 
bool readObject (iIstream &is, bool rdHdr=true)
 
bool writeObject (iOstream &os) const
 
- Public Member Functions inherited from IOfileHeader
 IOfileHeader (const objectFile &objf)
 
const wordobjectName () const
 
const wordobjectType () const
 
fileSystem path () const
 
bool outFileBinary () const
 
bool inFileBinary () const
 
bool headerOk (bool silent=false)
 
bool implyRead () const
 Imply read. More...
 
bool implyWrite () const
 Imply write. More...
 
bool fileExist () const
 Check if file exists. More...
 
bool readIfPresent () const
 Check read if present. More...
 
bool writeHeader () const
 Check if the header should be written to file True: on master + implyWrite + readWriteHeader = true False: otherwise. More...
 
bool writeHeader (iOstream &os, const word &typeName, bool forceWrite=false) const
 Write the header to the file , typeName comes from caller. More...
 
bool writeHeader (iOstream &os, bool forceWrite=false) const
 Write the header to the file, typeName comes from the one read from file. More...
 
bool readHeader () const
 Check if header should be read from file. More...
 
bool readHeader (iIstream &is, bool silent=false)
 Read the header in the file. More...
 
bool writeBanner (iOstream &os) const
 write the banner More...
 
bool writeSeparator (iOstream &os) const
 wirte a separator line More...
 
- Public Member Functions inherited from objectFile
 objectFile (const word &name)
 
 objectFile (const word &name, const fileSystem &localPath, const readFlag &rf=readFlag::READ_NEVER, const writeFlag &wf=writeFlag::WRITE_NEVER, bool rwHeader=true)
 
 objectFile (const objectFile &src)=default
 
 objectFile (objectFile &&src)=default
 
objectFileoperator= (const objectFile &rhs)=default
 
objectFileoperator= (objectFile &&rhs)=default
 
virtual ~objectFile ()=default
 
virtual const fileSystemlocalPath () const
 
readFlag rFlag () const
 
writeFlag wFlag () const
 
bool isReadAlways () const
 
bool isReadNever () const
 
bool isReadIfPresent () const
 
bool isWriteAlways () const
 
bool isWriteNever () const
 
bool readWriteHeader () const
 
- Public Member Functions inherited from internalField< T, void >
 internalField (const word &name, const internalPoints &internal, const T &defVal)
 
 internalField (const word &name, const internalPoints &internal, const T &defVal, const T &val)
 
const auto & deviceViewAll () const
 
auto deviceView () const
 
auto hostView () const
 
const FieldTypefield () const
 
FieldTypefield ()
 
const pFlagTypeDeviceactivePointsMaskDevice () const
 
const pFlagTypeHostactivePointsMaskHost () const
 
FieldTypeHost activeValuesHost () const
 
auto size () const
 
auto capacity () const
 
word name () const
 
word fieldKey () const
 
const T & defaultValue () const
 
rangeU32 activeRange () const
 
auto isAllActive () const
 
void fillInternal (const T &val)
 
bool insertSetElement (uint32IndexContainer indices, const T &val)
 
const Timetime () const
 
bool hearChanges (real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
 
bool write (iOstream &os, const IOPattern &iop) const
 
 TypeInfoTemplateNV2 ("pointField", T, VectorType::memoerySpaceName())
 
 pointField (const objectFile &objf, pointStructure &pStruct, const T &defVal)
 
- Public Member Functions inherited from observer
 observer (message msg)
 
 observer (const subscriber *subscrbr, message msg)
 
virtual ~observer ()
 
void subscribe (const subscriber *subscrbr, message msg)
 
observeraddEvent (message::EVENT event)
 
bool subscribed () const
 
void addToSubscriber (const subscriber *subscrbr, message msg)
 
bool addToSubscriber (const subscriber &subscriber)
 

Private Member Functions

const auto & dy1 () const
 
auto & dy1 ()
 

Private Attributes

boundaryIntegrationList boundaryList_
 

Friends

class processorAB2BoundaryIntegration
 

Additional Inherited Members

- Public Types inherited from pointField< T, MemorySpace >
using PointFieldType = pointField< T, MemorySpace >
 
using InternalFieldType = internalField< T, MemorySpace >
 
using boundaryFieldListType = boundaryFieldList< T, MemorySpace >
 
using FieldType = typename InternalFieldType::FieldType
 
using VectorType = typename InternalFieldType::VectorType
 
using memory_space = typename InternalFieldType::memory_space
 
using execution_space = typename InternalFieldType::execution_space
 
using pointFieldType = pointField< VectorField, T, MemorySpace >
 
using FieldType = Field< VectorField, T, MemorySpace >
 
using VectorType = typename FieldType::VectorType
 
using iterator = typename FieldType::iterator
 
using constIterator = typename FieldType::constIterator
 
using reference = typename FieldType::reference
 
using constReference = typename FieldType::constReference
 
using valueType = typename FieldType::valueType
 
using pointer = typename FieldType::pointer
 
using constPointer = typename FieldType::constPointer
 
- Public Types inherited from objectFile
enum  readFlag { READ_ALWAYS, READ_NEVER, READ_IF_PRESENT }
 
enum  writeFlag { WRITE_ALWAYS, WRITE_NEVER }
 
- Public Types inherited from internalField< T, void >
using InternalFieldType = internalField< T, void >
 
using FieldType = Field< T, void >
 
using FieldType = Field< VectorField, T, void >
 
using FieldTypeHost = Field< T, HostSpace >
 
using VectorType = typename FieldType::VectorType
 
using VectorType = typename FieldType::VectorType
 
using memory_space = typename FieldType::memory_space
 
using execution_space = typename FieldType::execution_space
 
using pointFieldType = pointField< VectorField, T, void >
 
using boundaryFieldListType = boundaryFieldList< VectorField, T, void >
 
using iterator = typename FieldType::iterator
 
using const_iterator = typename FieldType::const_iterator
 
using reference = typename FieldType::reference
 
using const_reference = typename FieldType::const_reference
 
using value_type = typename FieldType::value_type
 
using pointer = typename FieldType::pointer
 
using const_pointer = typename FieldType::const_pointer
 
- Static Public Member Functions inherited from integration
static uniquePtr< integrationcreate (const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
 Create the polymorphic object based on inputs. More...
 
- Static Public Member Functions inherited from observer
static constexpr auto numEvents ()
 
- Protected Member Functions inherited from IOfileHeader
uniquePtr< iFstreaminStream () const
 
uniquePtr< oFstreamoutStream () const
 
uniquePtr< oFstreamdummyOutStream () const
 
- Protected Member Functions inherited from internalField< T, void >
bool insert (const anyList &varList)
 
bool rearrange (const anyList &varList)
 
- Protected Attributes inherited from pointField< T, MemorySpace >
defaultValue_
 
- Protected Attributes inherited from IOfileHeader
word objectName_
 
word objectType_
 
word fileFormat_ = "ASCII"
 file format read from file More...
 
- Protected Attributes inherited from internalField< T, void >
FieldType field_
 Field. More...
 
defaultValue_
 value when a new item is added to field More...
 
const internalPointsinternalPoints_
 const ref to internal points More...
 
boundaryFieldListType boundaryFieldList_
 list of boundaries More...
 
const pointStructurepStruct_
 refrence to point structure More...
 
- Static Protected Attributes inherited from internalField< T, void >
static const message defaultMessage_
 

Detailed Description

Second order Adams-Bashforth integration method for solving ODE.

This is a one-step integration method and does not have prediction step.

Definition at line 37 of file AdamsBashforth2.hpp.

Constructor & Destructor Documentation

◆ AdamsBashforth2()

AdamsBashforth2 ( const word baseName,
pointStructure pStruct,
const word method,
const realx3Field_D initialValField 
)

Construct from components.

Definition at line 94 of file AdamsBashforth2.cpp.

◆ ~AdamsBashforth2()

~AdamsBashforth2 ( )
finaldefault

Destructor.

Member Function Documentation

◆ dy1() [1/2]

const auto& dy1 ( ) const
inlineprivate

Definition at line 48 of file AdamsBashforth2.hpp.

◆ dy1() [2/2]

auto& dy1 ( )
inlineprivate

Definition at line 53 of file AdamsBashforth2.hpp.

◆ ClassInfo()

ClassInfo ( "AdamsBashforth2"  )

Class info.

◆ add_vCtor()

add_vCtor ( integration  ,
AdamsBashforth2  ,
word   
)

Add this to the virtual constructor table.

◆ updateBoundariesSlaveToMasterIfRequested()

void updateBoundariesSlaveToMasterIfRequested ( )
overridevirtual

Implements integration.

Definition at line 118 of file AdamsBashforth2.cpp.

References pointField< T, MemorySpace >::updateBoundariesSlaveToMasterIfRequested().

+ Here is the call graph for this function:

◆ method()

word method ( ) const
inlineoverridevirtual

return integration method

Implements integration.

Definition at line 87 of file AdamsBashforth2.hpp.

◆ predict() [1/2]

bool predict ( real   UNUSEDdt,
realx3PointField_D UNUSEDy,
realx3PointField_D UNUSEDdy 
)
final

Definition at line 123 of file AdamsBashforth2.cpp.

◆ predict() [2/2]

bool predict ( real  dt,
realx3Field_D y,
realx3PointField_D dy 
)
finalvirtual

Implements integration.

Definition at line 132 of file AdamsBashforth2.cpp.

◆ correct()

bool correct ( real  dt,
realx3PointField_D y,
realx3PointField_D dy 
)
finalvirtual

Correction/main integration step.

Implements integration.

Definition at line 142 of file AdamsBashforth2.cpp.

References internalField< T, MemorySpace >::field(), pFlow::intAllActive(), and pFlow::intScattered().

+ Here is the call graph for this function:

◆ correctPStruct()

bool correctPStruct ( real  dt,
pointStructure pStruct,
realx3PointField_D vel 
)
finalvirtual

Implements integration.

Definition at line 165 of file AdamsBashforth2.cpp.

References pFlow::intAllActive(), pFlow::intScattered(), and pStruct.

+ Here is the call graph for this function:

◆ setInitialVals()

bool setInitialVals ( const int32IndexContainer newIndices,
const realx3Vector y 
)
finalvirtual

Set the initial values for new indices.

Implements integration.

Definition at line 187 of file AdamsBashforth2.cpp.

◆ needSetInitialVals()

bool needSetInitialVals ( ) const
inlinefinalvirtual

Check if the method requires any set initial vals.

Implements integration.

Definition at line 126 of file AdamsBashforth2.hpp.

Friends And Related Function Documentation

◆ processorAB2BoundaryIntegration

friend class processorAB2BoundaryIntegration
friend

Definition at line 46 of file AdamsBashforth2.hpp.

Member Data Documentation

◆ boundaryList_

boundaryIntegrationList boundaryList_
private

Definition at line 44 of file AdamsBashforth2.hpp.


The documentation for this class was generated from the following files: