www.cemf.ir
setFieldList.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 "setFieldList.hpp"
23 
25 {
26  this->clear();
27  wordList Keys = dict.dataEntryKeywords();
28 
29  for(const auto& key:Keys)
30  {
31  this->emplace_back( dict.dataEntryRef(key));
32  }
33 
34  return true;
35 }
36 
38 (
39  dictionary& dict
40 )const
41 {
42  dict = dict_;
43  return true;
44 }
45 
47 (
48  const dictionary& dict
49 )
50 :
51  dict_(dict)
52 {
53  if(!readSetFieldList(dict_))
54  {
55  fatalExit;
56  }
57 }
58 
59 
61 (
62  const dictionary& dict
63 )
64 {
65  dict_ = dict;
66  return readSetFieldList(dict);
67 }
68 
70 (
71  dictionary& dict
72 )const
73 {
74  return writeSetFieldList(dict);
75 }
pFlow::List< word >
setFieldList.hpp
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::setFieldList::writeSetFieldList
bool writeSetFieldList(dictionary &dict) const
Definition: setFieldList.cpp:38
pFlow::setFieldList::setFieldList
setFieldList(const dictionary &dict)
Definition: setFieldList.cpp:47
pFlow::setFieldList::write
bool write(dictionary &dict) const
Definition: setFieldList.cpp:70
pFlow::setFieldList::read
bool read(const dictionary &dict)
Definition: setFieldList.cpp:61
pFlow::setFieldList::readSetFieldList
bool readSetFieldList(const dictionary &dict)
Definition: setFieldList.cpp:24
pFlow::dictionary::dataEntryRef
dataEntry & dataEntryRef(const word &keyword)
ref to a subdictioanry fatalExit if not found/not a dataEntry
Definition: dictionary.cpp:613
pFlow::dictionary::dataEntryKeywords
wordList dataEntryKeywords() const
return a list of all dataEntries (non-nullptr) keywords
Definition: dictionary.cpp:719
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