www.cemf.ir
countFields.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 "countFields.hpp"
22 #include "countField.hpp"
23 #include "repository.hpp"
24 #include "includeMask.hpp"
25 
26 
28 :
29  dict_(dict),
30  variableNames_(dict.dictionaryKeywords()),
31  countedValues_(variableNames_.size(), 0u)
32 {
33 
34 }
35 
36 
38 {
39  uint32List counted;
40 
41  for(const auto& name: variableNames_)
42  {
43  const dictionary& varDict = dict_.subDict(name);
44  uint32 count;
45  countField cField(varDict, rep);
46  cField.process(count);
47  counted.push_back(count);
48  }
49 
50  countedValues_ = counted;
51 
52  return true;
53 }
pFlow::List< uint32 >
includeMask.hpp
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::countField::process
bool process(uint32 &countedValue)
Definition: countField.cpp:78
pFlow::countFields::process
bool process(repository &rep)
Definition: countFields.cpp:37
countField.hpp
repository.hpp
pFlow::count
auto count(const Vector< T, Allocator > &vec, const T &val)
Definition: VectorAlgorithm.hpp:26
pFlow::countField
Definition: countField.hpp:36
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
ref to a subdictioanry fatalExit if not found
Definition: dictionary.cpp:560
pFlow::countFields::countFields
countFields(const dictionary &dict)
Definition: countFields.cpp:27
pFlow::repository
Definition: repository.hpp:34
countFields.hpp
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