# PhasicFlow: src/Particles/Insertion/insertionRegion/insertionRegion.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.

insertionRegion.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 __insertionRegion_hpp__
#define __insertionRegion_hpp__
#include "anyList.hpp"
#include "baseTimeControl.hpp"
#include "peakableRegion.hpp"
#include "shapeMixture.hpp"
namespace pFlow
{
class dictionary;
class insertion;
class pointStructure;
class insertionRegion
{
private:
const word name_;
const dictionary& dict_;
const insertion& insertion_;
baseTimeControl tControl_;
real rate_;
uint32 numInserted_ = 0;
word type_;
uniquePtr<peakableRegion> pRegion_ = nullptr;
uniquePtr<shapeMixture> mixture_ = nullptr;
uniquePtr<dictionary> setFieldDict_ = nullptr;
anyList setFieldList_;
private:
// - private methods
bool readInsertionRegion(const dictionary& dict);
bool writeInsertionRegion(dictionary& dict) const;
bool readSetFieldDict();
public:
TypeInfoNV("insertionRegion");
// - Constructors
insertionRegion(const word& name, const insertion& instn);
~insertionRegion() = default;
// - Methods
const auto& name() const
{
return name_;
}
const auto& type() const
{
return type_;
}
const auto& dict()const
{
return dict_;
}
const auto& Insertion() const
{
return insertion_;
}
const pointStructure& pStruct()const;
inline bool insertionTime(uint32 iter, real t, real dt) const
{
return tControl_.timeEvent(iter, t, dt);
}
uint32 numberToBeInserted(uint32 iter, real t, real dt);
inline uint32 addToNumInserted(uint32 newInserted)
{
return numInserted_ += newInserted;
}
inline uint32 totalInserted() const
{
return numInserted_;
}
auto& mixture()
{
return mixture_();
}
auto& pRegion()
{
return pRegion_();
}
const auto& setFieldList() const
{
return setFieldList_;
}
// - IO operation
/*bool read(const dictionary& dict)
{
if (!timeFlowControl::read(dict))
return false;
return readInsertionRegion(dict);
}*/
bool write(dictionary& dict) const
{
return writeInsertionRegion(dict);
}
};
} // pFlow
#endif //__insertionRegion_hpp__
anyList.hpp
pFlow::insertionRegion::numInserted_
uint32 numInserted_
number of inserted particles
Definition: insertionRegion.hpp:106
pFlow::insertionRegion::TypeInfoNV
TypeInfoNV("insertionRegion")
Type info.
pFlow::insertionRegion::type_
word type_
type of insertion region
Definition: insertionRegion.hpp:109
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::insertionRegion::numberToBeInserted
uint32 numberToBeInserted(uint32 iter, real t, real dt)
Definition: insertionRegion.cpp:174
pFlow::insertionRegion::addToNumInserted
uint32 addToNumInserted(uint32 newInserted)
Definition: insertionRegion.hpp:181
pFlow::insertionRegion::Insertion
const auto & Insertion() const
Definition: insertionRegion.hpp:167
pFlow::insertionRegion::insertionRegion
insertionRegion(const word &name, const insertion &instn)
Construct from a dictionary.
Definition: insertionRegion.cpp:152
pFlow::insertionRegion::pRegion
auto & pRegion()
Definition: insertionRegion.hpp:196
pFlow::insertionRegion::pStruct
const pointStructure & pStruct() const
Definition: insertionRegion.cpp:168
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::baseTimeControl::timeEvent
bool timeEvent(uint32 iter, real t, real dt) const
Definition: baseTimeControl.cpp:78
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::insertionRegion::setFieldList
const auto & setFieldList() const
Definition: insertionRegion.hpp:201
pFlow::insertionRegion
This class defines all the necessary enteties for defining an insertion region.
Definition: insertionRegion.hpp:86
pFlow::insertionRegion::write
bool write(dictionary &dict) const
read from dictionary
Definition: insertionRegion.hpp:217
pFlow::insertionRegion::mixture_
uniquePtr< shapeMixture > mixture_
mixture of shapes
Definition: insertionRegion.hpp:115
pFlow
Definition: demGeometry.hpp:27
pFlow::insertionRegion::setFieldDict_
uniquePtr< dictionary > setFieldDict_
dictionary for set field
Definition: insertionRegion.hpp:118
pFlow::insertionRegion::tControl_
baseTimeControl tControl_
time control for insertion events
Definition: insertionRegion.hpp:100
shapeMixture.hpp
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::anyList
Definition: anyList.hpp:35
pFlow::insertionRegion::name
const auto & name() const
Const ref to name of the region.
Definition: insertionRegion.hpp:151
pFlow::insertionRegion::insertion_
const insertion & insertion_
ref to insertion
Definition: insertionRegion.hpp:97
pFlow::insertionRegion::setFieldList_
anyList setFieldList_
list of (filedName type value) for the fields
Definition: insertionRegion.hpp:121
pFlow::insertionRegion::totalInserted
uint32 totalInserted() const
Definition: insertionRegion.hpp:186
pFlow::baseTimeControl
Definition: baseTimeControl.hpp:29
pFlow::insertionRegion::dict_
const dictionary & dict_
insertion region dictionary
Definition: insertionRegion.hpp:94
peakableRegion.hpp
baseTimeControl.hpp
pFlow::insertionRegion::type
const auto & type() const
return type of insertion region
Definition: insertionRegion.hpp:157
pFlow::insertionRegion::writeInsertionRegion
bool writeInsertionRegion(dictionary &dict) const
write to dictionary
Definition: insertionRegion.cpp:102
pFlow::insertionRegion::mixture
auto & mixture()
Definition: insertionRegion.hpp:191
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::insertionRegion::dict
const auto & dict() const
Definition: insertionRegion.hpp:162
pFlow::insertionRegion::name_
const word name_
name of this region
Definition: insertionRegion.hpp:91
pFlow::insertionRegion::insertionTime
bool insertionTime(uint32 iter, real t, real dt) const
Definition: insertionRegion.hpp:174
pFlow::insertionRegion::pRegion_
uniquePtr< peakableRegion > pRegion_
peakable region of points
Definition: insertionRegion.hpp:112
pFlow::insertionRegion::readSetFieldDict
bool readSetFieldDict()
Definition: insertionRegion.cpp:137
pFlow::insertionRegion::rate_
real rate_
rate of insertion
Definition: insertionRegion.hpp:103
pFlow::insertionRegion::readInsertionRegion
bool readInsertionRegion(const dictionary &dict)
read from dictionary
Definition: insertionRegion.cpp:67
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::insertionRegion::~insertionRegion
~insertionRegion()=default
Destructor.
pFlow::insertion
Base class for particle insertion.
Definition: insertion.hpp:35