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

insertion.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 __insertion_hpp__
#define __insertion_hpp__
#include "fileDictionary.hpp"
namespace pFlow
{
// forward
class particles;
class pointStructure;
class insertion
:
public fileDictionary
{
private:
Logical active_ = "No";
Logical checkForCollision_ = "No";
Logical increaseVelocity_ = "No";
word diameterName_ = "diameter";
word velocityName_ = "velocity";
particles& particles_;
bool readFromFile_ = false;
bool readInsertionDict();
protected:
virtual bool writeInsertionDict(dictionary& dict)const;
public:
TypeInfo("insertion");
explicit insertion(particles& prtcl);
~insertion() override = default;
inline bool isActive() const
{
return readFromFile_ && active_();
}
inline bool checkForCollision() const
{
return checkForCollision_();
}
inline particles& Particles()
{
return particles_;
}
inline const particles& Particles() const
{
return particles_;
}
const pointStructure& pStruct()const;
inline bool readFromFile() const
{
return readFromFile_;
}
const word& diameterName()const
{
return diameterName_;
}
const word& velocityName()const
{
return velocityName_;
}
//bool read(iIstream& is, const IOPattern& iop) override;
/*/// read from iIstream
virtual bool read(iIstream& is) = 0;*/
using fileDictionary::write;
bool write(iOstream& os, const IOPattern& iop)const override ;
};
}
#endif
pFlow::insertion::pStruct
const pointStructure & pStruct() const
Definition: insertion.cpp:72
pFlow::insertion::readFromFile
bool readFromFile() const
Definition: insertion.hpp:102
pFlow::insertion::velocityName_
word velocityName_
Definition: insertion.hpp:53
pFlow::insertion::increaseVelocity_
Logical increaseVelocity_
if increase velocity in case particles are failed to be inserted due to collision
Definition: insertion.hpp:49
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::insertion::isActive
bool isActive() const
is Insertion active
Definition: insertion.hpp:80
pFlow::insertion::Particles
particles & Particles()
Definition: insertion.hpp:90
pFlow::insertion::particles_
particles & particles_
Ref to particles.
Definition: insertion.hpp:56
pFlow::insertion::Particles
const particles & Particles() const
Definition: insertion.hpp:95
pFlow::insertion::checkForCollision
bool checkForCollision() const
Definition: insertion.hpp:85
pFlow
Definition: demGeometry.hpp:27
pFlow::insertion::checkForCollision_
Logical checkForCollision_
Check for collision? It is not active now.
Definition: insertion.hpp:45
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::particles
Definition: particles.hpp:33
pFlow::insertion::readFromFile_
bool readFromFile_
Definition: insertion.hpp:58
pFlow::dictionary::dict
virtual dictionary & dict()
ref to this dictionary, if it is a dictionary
Definition: dictionary.cpp:369
pFlow::insertion::insertion
insertion(particles &prtcl)
Construct from component.
Definition: insertion.cpp:27
pFlow::insertion::writeInsertionDict
virtual bool writeInsertionDict(dictionary &dict) const
Write to dictionary.
Definition: insertion.cpp:99
pFlow::insertion::diameterName_
word diameterName_
Definition: insertion.hpp:51
pFlow::IOPattern
Definition: IOPattern.hpp:32
pFlow::insertion::active_
Logical active_
Is insertion active.
Definition: insertion.hpp:42
pFlow::insertion::diameterName
const word & diameterName() const
Definition: insertion.hpp:107
pFlow::Logical
Holds a bool value and converts strings to bool.
Definition: Logical.hpp:39
fileDictionary.hpp
pFlow::fileDictionary
Definition: fileDictionary.hpp:29
pFlow::fileDictionary::write
bool write(iOstream &os, const IOPattern &iop) const override
write to stream
Definition: fileDictionary.cpp:75
pFlow::insertion::velocityName
const word & velocityName() const
Definition: insertion.hpp:112
pFlow::insertion::~insertion
~insertion() override=default
Destructor.
pFlow::insertion::TypeInfo
TypeInfo("insertion")
Type info.
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
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::insertion
Base class for particle insertion.
Definition: insertion.hpp:35
pFlow::insertion::write
bool write(iOstream &os, const IOPattern &iop) const override
write to iOstream
Definition: insertion.cpp:120
pFlow::insertion::readInsertionDict
bool readInsertionDict()
Read from dictionary.
Definition: insertion.cpp:78