# PhasicFlow: src/Particles/Insertion/insertionRegion/timeFlowControl.cpp Source File

timeFlowControl.cpp
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.
-----------------------------------------------------------------------------*/
#include "timeFlowControl.hpp"
#include "dictionary.hpp"
bool pFlow::timeFlowControl::readTimeFlowControl
(
const dictionary& dict
)
{
rate_ = dict.getVal<real>("rate");
startTime_ = dict.getVal<real>("startTime");
endTime_ = dict.getVal<real>("endTime");
interval_ = dict.getVal<real>("interval");
numInserted_=0;
return true;
}
bool pFlow::timeFlowControl::writeTimeFlowControl
(
dictionary& dict
) const
{
if(!dict.add("rate", rate_)) return false;
if(!dict.add("startTime", startTime_)) return false;
if(!dict.add("endTime", endTime_)) return false;
if(!dict.add("interval", interval_)) return false;
return true;
}
pFlow::timeFlowControl::timeFlowControl
(
const dictionary& dict
)
{
if(!readTimeFlowControl(dict))
{
fatalExit;
}
}
pFlow::timeFlowControl::timeFlowControl
timeFlowControl(const dictionary &dict)
Definition: timeFlowControl.cpp:52
pFlow::real
float real
Definition: builtinTypes.hpp:46
fatalExit
#define fatalExit
Definition: error.hpp:57
timeFlowControl.hpp
pFlow::dictionary::add
bool add(const word &keyword, const float &v)
Definition: dictionary.cpp:422
dictionary.hpp
pFlow::timeFlowControl::writeTimeFlowControl
bool writeTimeFlowControl(dictionary &dict) const
Definition: timeFlowControl.cpp:38
pFlow::dictionary::getVal
T getVal(const word &keyword) const
Definition: dictionary.hpp:309
pFlow::timeFlowControl::readTimeFlowControl
bool readTimeFlowControl(const dictionary &dict)
Definition: timeFlowControl.cpp:25
pFlow::dictionary
Definition: dictionary.hpp:38