Go to the documentation of this file.
34 for (
const auto& rN :
names_)
37 for (
const auto& vN : validNames)
49 <<
"Shape name " << rN <<
" provided in mixture dictionary "
50 << dict.
globalName() <<
" is invalid. \n Valid names are "
51 << validNames <<
endl;
61 if (current_[i] < number_[i])
70 return getNextShapeName();
78 for (
size_t i = 0u; i <
n; ++i)
80 names.push_back(getNextShapeName());
87 bool containNumberIneserted =
false;
91 for (
auto nm = shNames.begin(); nm != shNames.end();)
93 if (*nm ==
"numberInserted")
95 nm = shNames.erase(nm);
96 containNumberIneserted =
true;
102 for (
const auto& nm : shNames)
104 names_.push_back(nm);
109 <<
" is invalid: " << num <<
endl
114 number_.push_back(num);
117 if (containNumberIneserted)
127 if (numberInserted_.size() != names_.size())
130 <<
" number of elements in numberInserted ("
131 << numberInserted_.size()
132 <<
") is not equal to the number of shape names: " << names_ <<
endl;
137 ForAll(i, numberInserted_)
139 current_.push_back(numberInserted_[i] % number_[i]);
150 if (!dict.
add(names_[i], number_[i]))
159 if (!dict.
add(
"numberInserted", numberInserted_))
162 <<
" error in writing numberInserted to dictionary "
wordVector names_
List of shape names.
void fill(Vector< T, Allocator > &vec, const T &val)
#define fatalExit
Fatal exit.
virtual word globalName() const
global name of entry, separated with dots
bool add(const word &keyword, const float &v)
add a float dataEntry
iOstream & endl(iOstream &os)
Add newline and flush stream.
bool write(dictionary &dict) const
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
#define ForAll(i, container)
T getVal(const word &keyword) const
get the value of data entry
void getNextShapeNameN(size_t n, wordVector &names)
The name of the n next shapes that should be inserted.
bool read(const dictionary &dict)
word getNextShapeName()
The name of the next shape that should be inserted.
shapeMixture(const dictionary &dict, const wordList &validNames)
Construct from dictionary.
Vector< uint32 > uint32Vector
wordList dataEntryKeywords() const
return a list of all dataEntries (non-nullptr) keywords
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...