Go to the documentation of this file.
45 lookup.insert(iter.key(), zoneI++);
60 lst[zoneI++] = iter();
71 if (!iter().
found(
"MaterialType"))
73 iter().add(
"MaterialType", defaultMaterial_);
118 readDict(registry,
name, instance);
135 if (maxId < iter.key())
155 iter().lookupOrDefault<word>
176 word lookupName = iter().lookupOrDefault<
word>
184 lookup.insert(iter.key(), lookupName);
199 iter().readIfPresent(
"Label", theName);
234 iter().lookupOrDefault<word>(
"MaterialType", defaultMaterial_)
251 == iter().lookupOrDefault<word>(
"MaterialType", defaultMaterial_)
257 iter().lookupOrDefault<word>
272 return selectType(
"fluid");
278 return selectType(
"solid");
284 return selectType(
"shell");
291 setEntry(
id,
"MaterialType", matlType);
297 setEntry(
id,
"Label",
name);
305 if (iter == end() || !iter().
found(
"Label"))
342 Info<<
"no constant/cellTable information available" <<
endl;
369 "persistent data for thirdParty mesh <-> OpenFOAM translation";
400 label nZoneCells = 0;
403 label unZonedType = zoneNames.
size() + 1;
409 nZoneCells += cZone.
size();
412 dict.
add(
"Label", zoneNames[zoneI]);
413 zoneDict.insert(zoneI + 1,
dict);
452 if (iter != typeToZone.end())
454 zoneCells[iter()].
append(cellI);
465 zoneCells[zoneI].shrink();
466 if (zoneCells[zoneI].size())
468 zoneUsed[nZone++] = zoneI;
478 Info<<
"cellZones not used" <<
endl;
481 czMesh.setSize(nZone);
485 const label origZoneI = zoneUsed[zoneI];
487 Info<<
"cellZone " << zoneI
488 <<
" (size: " << zoneCells[origZoneI].
size()
489 <<
") name: " << zoneNames[origZoneI] <<
endl;
496 zoneNames[origZoneI],
497 zoneCells[origZoneI],
528 matches.insert(namesIter.key(), namesIter());
536 Info<<
"combine cellTable: " << iter().keyword();
540 targetId =
min(matches.toc());
541 operator[](targetId).set(
"Label", iter().keyword());
552 matches.erase(targetId);
553 origNames.erase(targetId);
556 this->
erase(matches);
557 origNames.erase(matches);
561 mapping[matchIter.key()] = targetId;
562 Info<<
" " << matchIter();
void setName(const label, const word &)
Assign name.
void clear()
Clear the zones.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Map< word > selectType(const word &materialType) const
Return a Map of (id => name) for materialType.
A class for handling file names.
An STL-conforming iterator.
#define forAll(list, i)
Loop across all elements in list.
void writeDict(const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") const
Write constant/cellTable for later reuse.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
void addDefaults()
Add required entries - MaterialType.
void readDict(const objectRegistry &, const word &name="cellTable", const fileName &instance="constant")
Read constant/cellTable.
void operator=(const cellTable &)
Assignment.
An STL-conforming const_iterator.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
A HashTable to objects of type <T> with a label key.
Map< word > names() const
Return a Map of (id => name)
Map< word > materialTypes() const
Return a Map of (id => fluid|solid|shell)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label append(const dictionary &)
Append to the end, return index.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
Registry of regIOobjects.
fileName objectPath() const
Return complete path + object name.
bool headerOk()
Read and check header info.
bool writeHeader(Ostream &) const
Write header.
Map< word > fluids() const
Return a Map of (id => name) for fluids.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void append(const T &)
Append an element at the end of the list.
List< word > namesList() const
A contiguous list of cellTable names.
word name(const label id) const
Return the name corresponding to id.
The cellTable persistent data saved as a Map<dictionary>.
Map< word > solids() const
Return a Map of (id => name) for solids.
const word & name() const
Return name.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
void setMaterial(const label, const word &)
Assign material Type.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Input from memory buffer stream.
label findIndex(const word &name) const
Return index corresponding to name.
wordList names() const
Return a list of zone names.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
void combine(const dictionary &, labelList &tableIds)
Combine tableIds together.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Map< label > zoneMap() const
Map from cellTable ID => zone number.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
cellTable()
Construct null.
static const word null
An empty word.
void setEntry(const label id, const word &keyWord, const word &value)
Map< word > shells() const
Return a Map of (id => name) for shells.
Operations on lists of strings.
void size(const label)
Override size to be inconsistent with allocated storage.
static const char *const defaultMaterial_
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
timeIndices insert(timeIndex, timeDirs[timeI].value())
bool add(entry *, bool mergeEntry=false)
Add a new entry.
string & note()
Return non-constant access to the optional note.
stressControl lookup("compactNormalStress") >> compactNormalStress
void addCellZones(polyMesh &, const labelList &tableIds) const
Classify tableIds into cellZones according to the cellTable.
A Map of objects of type <T> with automated input and output.