41 { modelType::UNKNOWN,
"unknown" },
42 { modelType::HEX,
"hex" },
43 { modelType::WEDGE,
"wedge" },
44 { modelType::PRISM,
"prism" },
45 { modelType::PYR,
"pyr" },
46 { modelType::TET,
"tet" },
47 { modelType::TETWEDGE,
"tetWedge" },
48 { modelType::SPLITHEX,
"splitHex" },
54void Foam::cellModel::constructModels()
59 <<
"attempt to re-construct cellModeller when it already exists"
65 PtrList<cellModel> newPtrs(is);
66 models_.swap(newPtrs);
80 if (maxIndex < models_[i].
index())
82 maxIndex = models_[i].index();
87 modelPtrs_.setSize(maxIndex+1,
nullptr);
93 const label modelIndex = models_[i].index();
94 const word& modelName = models_[i].name();
99 if (modelPtrs_[modelIndex])
102 <<
"more than one model share the index "
107 modelPtrs_[modelIndex] =
ptr;
112 <<
"more than one model share the name "
122 return ptr(label(model));
133 const label
n = models_.size();
134 for (label i = 0; i <
n; ++i)
136 if (models_[i].
name() == modelName)
138 return &(models_[i]);
153 return (modelIndex < modelPtrs_.size() ? modelPtrs_[modelIndex] :
nullptr);
164 <<
"No such cellModel: " << modelNames[model]
179 <<
"No such cellModel: " << modelName
194 <<
"No such cellModel: " << modelIndex
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Maps a geometry to a set of cell primitives.
cellModel(Istream &is)
Construct from Istream.
modelType
Enumeration of commonly used cellModel types.
label index() const noexcept
Return index of model in the model list.
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
static const Enum< modelType > modelNames
Names of commonly used cellModels corresponding to modelType.
reference ref() const
A reference to the entry (Error if not found)
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Functions to search 'etc' directories for configuration files etc.
labelHashSet used(const bitSet &select)
Convert a bitset to a labelHashSet of the indices used.
fileName findEtcFile(const fileName &name, const bool mandatory=false, unsigned short location=0777)
Search for a single FILE within the etc directories.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.