timeFlowControl.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #include "timeFlowControl.hpp"
22 #include "dictionary.hpp"
23 
25 (
26  const dictionary& dict
27 )
28 {
29  rate_ = dict.getVal<real>("rate");
30  startTime_ = dict.getVal<real>("startTime");
31  endTime_ = dict.getVal<real>("endTime");
32  interval_ = dict.getVal<real>("interval");
33  numInserted_=0;
34  return true;
35 }
36 
38 (
39  dictionary& dict
40 ) const
41 {
42  if(!dict.add("rate", rate_)) return false;
43  if(!dict.add("startTime", startTime_)) return false;
44  if(!dict.add("endTime", endTime_)) return false;
45  if(!dict.add("interval", interval_)) return false;
46 
47  return true;
48 }
49 
50 
52 (
53  const dictionary& dict
54 )
55 {
56 
57  if(!readTimeFlowControl(dict))
58  {
59  fatalExit;
60  }
61 
62 }
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