# PhasicFlow: src/phasicFlow/demComponent/demComponent.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.

demComponent.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 __demComponent_hpp__
#define __demComponent_hpp__
#include "types.hpp"
#include "typeInfo.hpp"
#include "timeInfo.hpp"
#include "Timers.hpp"
namespace pFlow
{
class systemControl;
class Time;
class demComponent
{
private:
// - Protected data members
systemControl& control_;
Time& time_;
Timers timers_;
word componentName_;
public:
TypeInfo("demComponent");
// - Constructors
demComponent(const word& name, systemControl& control);
demComponent(const demComponent&) = delete;
demComponent(demComponent&&) = delete;
demComponent& operator = (const demComponent&) = delete;
demComponent& operator =(demComponent&&) = delete;
virtual ~demComponent() = default;
// - Member functions
inline
const auto& control()const
{
return control_;
}
inline
auto& control()
{
return control_;
}
real dt()const;
real currentTime()const;
uint32 currentIter()const;
timeInfo TimeInfo()const;
inline
const auto& time()const
{
return time_;
}
inline
auto& time()
{
return time_;
}
inline
const auto& timers() const
{
return timers_;
}
inline
auto& timers()
{
return timers_;
}
virtual
bool beforeTimeLoop()
{
notImplementedFunction;
return false;
}
virtual
bool beforeIteration() = 0;
virtual
bool iterate() = 0;
virtual
bool afterIteration() = 0;
virtual
bool afterTimeLoop()
{
notImplementedFunction;
return false;
}
};
}
#endif
pFlow::demComponent::demComponent
demComponent(const word &name, systemControl &control)
construct from components
Definition: demComponent.cpp:25
notImplementedFunction
#define notImplementedFunction
Report that a function is yet not implemented.
Definition: error.hpp:84
pFlow::real
float real
Definition: builtinTypes.hpp:45
timeInfo.hpp
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::demComponent::TimeInfo
timeInfo TimeInfo() const
return time info of the simulaiton
Definition: demComponent.cpp:48
types.hpp
pFlow::demComponent::afterTimeLoop
virtual bool afterTimeLoop()
This is called after the time loop.
Definition: demComponent.hpp:162
pFlow::demComponent::time
const auto & time() const
Definition: demComponent.hpp:113
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::demComponent::operator=
demComponent & operator=(const demComponent &)=delete
No copy assignment.
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::Timers
Definition: Timers.hpp:32
pFlow::demComponent::afterIteration
virtual bool afterIteration()=0
This is called in time loop, after iterate.
pFlow::demComponent::timers
const auto & timers() const
Const ref to timers.
Definition: demComponent.hpp:127
pFlow::demComponent::control
auto & control()
Ref to systemControl.
Definition: demComponent.hpp:95
pFlow::timeInfo
Definition: timeInfo.hpp:28
pFlow::demComponent::control_
systemControl & control_
Reference to systemControl.
Definition: demComponent.hpp:48
pFlow
Definition: demGeometry.hpp:27
pFlow::demComponent::timers_
Timers timers_
All timers (if any) of this component.
Definition: demComponent.hpp:53
pFlow::demComponent::currentIter
uint32 currentIter() const
return current iteration number
Definition: demComponent.cpp:43
pFlow::demComponent::time_
Time & time_
Definition: demComponent.hpp:50
pFlow::demComponent
A base class for every main component of DEM system.
Definition: demComponent.hpp:42
pFlow::demComponent::beforeTimeLoop
virtual bool beforeTimeLoop()
This is called before the start of time loop.
Definition: demComponent.hpp:141
pFlow::demComponent::beforeIteration
virtual bool beforeIteration()=0
This is called in time loop, before iterate.
pFlow::demComponent::currentTime
real currentTime() const
Current simulation time.
Definition: demComponent.cpp:38
pFlow::demComponent::componentName_
word componentName_
Name of the DEM component.
Definition: demComponent.hpp:56
pFlow::demComponent::time
auto & time()
Definition: demComponent.hpp:119
Timers.hpp
pFlow::demComponent::~demComponent
virtual ~demComponent()=default
destructor
pFlow::demComponent::TypeInfo
TypeInfo("demComponent")
Type info.
typeInfo.hpp
pFlow::demComponent::dt
real dt() const
Time step of integration.
Definition: demComponent.cpp:33
pFlow::demComponent::timers
auto & timers()
Ref to timers.
Definition: demComponent.hpp:134
pFlow::demComponent::iterate
virtual bool iterate()=0
This is called in time loop.
pFlow::Time
Definition: Time.hpp:37