# PhasicFlow: src/Integration/integration/integration.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.

integration.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 __integration_hpp__
#define __integration_hpp__
#include "virtualConstructor.hpp"
#include "pointFields.hpp"
namespace pFlow
{
// - Forward
class repository;
class pointStructure;
class integration
{
private:
// - Protected data members
repository& owner_;
const pointStructure& pStruct_;
const word baseName_;
public:
TypeInfo("integration");
// - Constructors
integration(
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
integration(const integration&) = default;
integration(integration&&) = default;
integration& operator = (const integration&) = default;
integration& operator = (integration&&) = default;
virtual ~integration()=default;
create_vCtor
(
integration,
word,
(
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
),
(baseName, pStruct, method, initialValField)
);
// - Methods
inline
const auto& pStruct()const
{
return pStruct_;
}
inline
const word& baseName()const
{
return baseName_;
}
inline
repository& owner()
{
return owner_;
}
virtual
void updateBoundariesSlaveToMasterIfRequested() = 0;
virtual
word method()const = 0 ;
virtual
bool predict(real dt, realx3PointField_D& y, realx3PointField_D& dy) = 0;
virtual
bool predict(real dt, realx3Field_D& y, realx3PointField_D& dy) = 0;
virtual
bool correct(real dt, realx3PointField_D& y, realx3PointField_D& dy) = 0;
virtual
bool correctPStruct(real dt, pointStructure& pStruct, realx3PointField_D& vel) = 0;
virtual
bool setInitialVals(
const int32IndexContainer& newIndices,
const realx3Vector& y) = 0;
virtual
bool needSetInitialVals()const = 0;
static
uniquePtr<integration> create(
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
}; // integration
} // pFlow
#endif //__integration_hpp__
pFlow::integration::owner_
repository & owner_
The owner repository that all fields are storred in.
Definition: integration.hpp:58
pFlow::integration::correct
virtual bool correct(real dt, realx3PointField_D &y, realx3PointField_D &dy)=0
Correction/main integration step.
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::integration::baseName_
const word baseName_
The base name for integration.
Definition: integration.hpp:64
pFlow::integration::operator=
integration & operator=(const integration &)=default
Copy assignment.
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::integration::setInitialVals
virtual bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y)=0
Set the initial values for new indices.
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pointFields.hpp
pFlow::integration::predict
virtual bool predict(real dt, realx3PointField_D &y, realx3PointField_D &dy)=0
Prediction step in integration.
pFlow::Field< realx3 >
pFlow::integration::baseName
const word & baseName() const
Base name.
Definition: integration.hpp:122
pFlow
Definition: demGeometry.hpp:27
pFlow::integration::TypeInfo
TypeInfo("integration")
Type info.
pFlow::pointField
Definition: pointField.hpp:33
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::integration::correctPStruct
virtual bool correctPStruct(real dt, pointStructure &pStruct, realx3PointField_D &vel)=0
virtualConstructor.hpp
pFlow::integration::integration
integration(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Construct from components.
Definition: integration.cpp:26
pFlow::integration::owner
repository & owner()
Ref to the owner repository.
Definition: integration.hpp:129
pFlow::integration::~integration
virtual ~integration()=default
Destructor.
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::integration::updateBoundariesSlaveToMasterIfRequested
virtual void updateBoundariesSlaveToMasterIfRequested()=0
pFlow::integration::pStruct_
const pointStructure & pStruct_
A reference to pointStructure.
Definition: integration.hpp:61
pFlow::integration::needSetInitialVals
virtual bool needSetInitialVals() const =0
Check if the method requires any set initial vals.
pFlow::integration::method
virtual word method() const =0
return integration method
pFlow::repository
Definition: repository.hpp:34
pFlow::Vector< realx3 >
pFlow::integration::create
static uniquePtr< integration > create(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Create the polymorphic object based on inputs.
Definition: integration.cpp:41
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39
pFlow::integration::create_vCtor
create_vCtor(integration, word,(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField),(baseName, pStruct, method, initialValField))
Add a virtual constructor.