# PhasicFlow: src/Integration/AdamsBashforth2/AdamsBashforth2.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

AdamsBashforth2.hpp
Go to the documentation of this file.
/*------------------------------- 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 __AdamsBashforth2_hpp__
#define __AdamsBashforth2_hpp__
#include "integration.hpp"
#include "pointFields.hpp"
#include "boundaryIntegrationList.hpp"
namespace pFlow
{
class AdamsBashforth2
:
public integration,
public realx3PointField_D
{
private:
boundaryIntegrationList boundaryList_;
friend class processorAB2BoundaryIntegration;
const auto& dy1()const
{
return static_cast<const realx3PointField_D&>(*this);
}
auto& dy1()
{
return static_cast< realx3PointField_D&>(*this);
}
public:
ClassInfo("AdamsBashforth2");
// - Constructors
AdamsBashforth2(
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
~AdamsBashforth2()final = default;
add_vCtor(
integration,
AdamsBashforth2,
word);
// - Methods
void updateBoundariesSlaveToMasterIfRequested()override;
word method()const override
{
return "AdamsBashforth2";
}
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;
bool correctPStruct(
real dt,
pointStructure& pStruct,
realx3PointField_D& vel) final;
/*bool hearChanges
(
real t,
real dt,
uint32 iter,
const message& msg,
const anyList& varList
) override;*/
bool setInitialVals(
const int32IndexContainer& newIndices,
const realx3Vector& y) final;
bool needSetInitialVals()const final
{
return false;
}
};
} // pFlow
#endif //__integration_hpp__
pFlow::AdamsBashforth2::~AdamsBashforth2
~AdamsBashforth2() final=default
Destructor.
pFlow::AdamsBashforth2::method
word method() const override
return integration method
Definition: AdamsBashforth2.hpp:87
pFlow::AdamsBashforth2::predict
bool predict(real UNUSED(dt), realx3PointField_D &UNUSED(y), realx3PointField_D &UNUSED(dy)) final
Definition: AdamsBashforth2.cpp:123
pFlow::real
float real
Definition: builtinTypes.hpp:45
UNUSED
#define UNUSED(x)
Definition: pFlowMacros.hpp:35
pFlow::integration
Base class for integrating the first order ODE (IVP)
Definition: integration.hpp:51
pFlow::integration::pStruct
const auto & pStruct() const
Const ref to pointStructure.
Definition: integration.hpp:115
pFlow::AdamsBashforth2::AdamsBashforth2
AdamsBashforth2(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Construct from components.
Definition: AdamsBashforth2.cpp:94
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pointFields.hpp
pFlow::AdamsBashforth2::ClassInfo
ClassInfo("AdamsBashforth2")
Class info.
pFlow::AdamsBashforth2::dy1
auto & dy1()
Definition: AdamsBashforth2.hpp:53
pFlow::Field< realx3 >
pFlow::AdamsBashforth2::needSetInitialVals
bool needSetInitialVals() const final
Check if the method requires any set initial vals.
Definition: AdamsBashforth2.hpp:126
pFlow::AdamsBashforth2::boundaryList_
boundaryIntegrationList boundaryList_
Definition: AdamsBashforth2.hpp:44
pFlow::AdamsBashforth2::correct
bool correct(real dt, realx3PointField_D &y, realx3PointField_D &dy) final
Correction/main integration step.
Definition: AdamsBashforth2.cpp:142
pFlow::integration::baseName
const word & baseName() const
Base name.
Definition: integration.hpp:122
pFlow
Definition: demGeometry.hpp:27
pFlow::pointField
Definition: pointField.hpp:33
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::AdamsBashforth2::correctPStruct
bool correctPStruct(real dt, pointStructure &pStruct, realx3PointField_D &vel) final
Definition: AdamsBashforth2.cpp:165
pFlow::AdamsBashforth2::dy1
const auto & dy1() const
Definition: AdamsBashforth2.hpp:48
pFlow::AdamsBashforth2::processorAB2BoundaryIntegration
friend class processorAB2BoundaryIntegration
Definition: AdamsBashforth2.hpp:46
pFlow::boundaryIntegrationList
Definition: boundaryIntegrationList.hpp:16
pFlow::AdamsBashforth2::setInitialVals
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) final
Set the initial values for new indices.
Definition: AdamsBashforth2.cpp:187
pFlow::AdamsBashforth2
Second order Adams-Bashforth integration method for solving ODE.
Definition: AdamsBashforth2.hpp:37
integration.hpp
pFlow::AdamsBashforth2::updateBoundariesSlaveToMasterIfRequested
void updateBoundariesSlaveToMasterIfRequested() override
Definition: AdamsBashforth2.cpp:118
pFlow::Vector< realx3 >
boundaryIntegrationList.hpp
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39
pFlow::AdamsBashforth2::add_vCtor
add_vCtor(integration, AdamsBashforth2, word)
Add this to the virtual constructor table.