insertion.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 
22 #include "particles.hpp"
23 #include "dictionary.hpp"
24 #include "insertion.hpp"
25 #include "streams.hpp"
26 
28 (
29  const dictionary& dict
30 )
31 {
32 
33  active_ = dict.getVal<Logical>("active");
34 
35  if(active_)
36  REPORT(1)<< "Particle insertion mechanism is "<<
37  yellowText("active")<<" in the simulation."<<endREPORT;
38  else
39  REPORT(1)<< "Particle insertion mechanism is "<<
40  yellowText("not active")<<" in the simulation."<<endREPORT;
41 
42 
43  return true;
44 }
45 
47 (
48  dictionary& dict
49 )const
50 {
51  if(!dict.add("active", active_) )
52  {
54  " error in writing active to dictionary "<<dict.globalName()<<endl;
55  return false;
56  }
57 
58  if(!dict.add("checkForCollision", checkForCollision_) )
59  {
61  " error in writing checkForCollision to dictionary "<<dict.globalName()<<endl;
62  return false;
63  }
64 
65  return true;
66 }
67 
69 (
70  particles& prtcl
71 )
72 :
73  particles_(prtcl)
74 {}
endREPORT
#define endREPORT
Definition: streams.hpp:41
REPORT
#define REPORT(n)
Definition: streams.hpp:40
insertion.hpp
pFlow::dictionary::globalName
virtual word globalName() const
Definition: dictionary.cpp:349
particles.hpp
pFlow::dictionary::add
bool add(const word &keyword, const float &v)
Definition: dictionary.cpp:422
pFlow::endl
iOstream & endl(iOstream &os)
Definition: iOstream.hpp:312
pFlow::particles
Definition: particles.hpp:33
fatalErrorInFunction
#define fatalErrorInFunction
Definition: error.hpp:42
pFlow::insertion::insertion
insertion(particles &prtcl)
Definition: insertion.cpp:69
pFlow::insertion::writeInsertionDict
bool writeInsertionDict(dictionary &dict) const
Definition: insertion.cpp:47
dictionary.hpp
streams.hpp
pFlow::dictionary::getVal
T getVal(const word &keyword) const
Definition: dictionary.hpp:309
pFlow::Logical
Definition: Logical.hpp:35
pFlow::insertion::readInsertionDict
bool readInsertionDict(const dictionary &dict)
Definition: insertion.cpp:28
yellowText
#define yellowText(text)
Definition: streams.hpp:30
pFlow::dictionary
Definition: dictionary.hpp:38