53 wordConstructorTable::iterator cstrIter =
54 wordConstructorTablePtr_->find(setType);
56 if (cstrIter == wordConstructorTablePtr_->end())
59 <<
"Unknown set type " << setType
61 <<
"Valid set types : " <<
endl
62 << wordConstructorTablePtr_->sortedToc()
79 sizeConstructorTable::iterator cstrIter =
80 sizeConstructorTablePtr_->find(setType);
82 if (cstrIter == sizeConstructorTablePtr_->end())
85 <<
"Unknown set type " << setType
87 <<
"Valid set types : " <<
endl
88 << sizeConstructorTablePtr_->sortedToc()
105 setConstructorTable::iterator cstrIter =
106 setConstructorTablePtr_->find(setType);
108 if (cstrIter == setConstructorTablePtr_->end())
111 <<
"Unknown set type " << setType
113 <<
"Valid set types : " <<
endl
114 << setConstructorTablePtr_->sortedToc()
137 bool changed =
false;
141 if ((iter.key() < 0) || (iter.key() > map.
size()))
144 <<
"Illegal content " << iter.key() <<
" of set:" <<
name()
146 <<
"Value should be between 0 and " << map.
size()-1
150 const label newCelli = map[iter.key()];
152 if (newCelli != iter.key())
167 const label newCelli = map[iter.key()];
184 if ((iter.key() < 0) || (iter.key() > maxLabel))
187 <<
"Illegal content " << iter.key() <<
" of set:" <<
name()
189 <<
"Value should be between 0 and " << maxLabel
196 void Foam::topoSet::writeDebug
206 for (; (iter != end()) && (
n < maxElem); ++iter)
208 if ((
n != 0) && ((
n % 10) == 0))
212 os << iter.
key() <<
' ';
220 void Foam::topoSet::writeDebug
231 for (; (iter != end()) && (
n < maxElem); ++iter)
233 if ((
n != 0) && ((
n % 3) == 0))
237 os << iter.key() << coords[iter.key()] <<
' ';
245 void Foam::topoSet::writeDebug
255 os <<
"Set bounding box: min = "
256 << bb.
min() <<
" max = " << bb.
max() <<
" meters. " <<
endl <<
endl;
262 if (size() <= maxLen)
264 writeDebug(os, coords, maxLen, iter,
n);
268 label halfLen = maxLen/2;
270 os <<
"Size larger than " << maxLen <<
". Printing first and last "
271 << halfLen <<
" elements:" <<
endl <<
endl;
273 writeDebug(os, coords, halfLen, iter,
n);
277 for (;
n < size() - halfLen; ++
n)
282 writeDebug(os, coords, halfLen, iter,
n);
316 const word& wantedType,
327 mesh.time().findInstance
374 mesh.time().findInstance
404 mesh.time().findInstance
452 for (
label celli = 0; celli < maxLen; celli++)
454 if (!currentSet.
found(celli))
472 if (set.
found(iter.key()))
511 if (size() <= maxLen)
513 writeDebug(os, maxLen, iter,
n);
517 label halfLen = maxLen/2;
519 os <<
"Size larger than " << maxLen <<
". Printing first and last "
520 << halfLen <<
" elements:" <<
endl <<
endl;
522 writeDebug(os, halfLen, iter,
n);
526 for (;
n < size() - halfLen; ++
n)
531 writeDebug(os, halfLen, iter,
n);
538 return (os << *
this).good();
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void operator=(const HashSet< label, Hash< label > > &)
Assignment operator.
bool insert(const Key &key)
Insert a new entry.
HashTable< nil, label, Hash< label > >::const_iterator const_iterator
An STL-conforming const_iterator.
const Key & key() const
Return the Key corresponding to the iterator.
label size() const
Return number of elements in table.
bool found(const Key &) const
Return true if hashedEntry is found in table.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
readOption
Enumeration defining the read options.
readOption readOpt() const
const word & name() const
Return name.
writeOption
Enumeration defining the write options.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A bounding box defined in terms of the points at its extremities.
const point & min() const
Minimum point defining the bounding box.
const point & max() const
Maximum point defining the bounding box.
A class for handling file names.
const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
Mesh consisting of general polyhedral cells.
const fileName & facesInstance() const
Return the current instance directory for faces.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void close()
Close Istream.
bool headerOk()
Read and check header info.
Istream & readStream(const word &, const bool read=true)
Return Istream and check object type against that given.
General set of labels of mesh quantity (points, cells, faces).
virtual bool writeData(Ostream &) const
Write contents.
virtual void invert(const label maxLen)
Invert contents.
static fileName localPath(const polyMesh &mesh, const word &name)
Name of file set will use.
void operator=(const topoSet &)
Copy labelHashSet part only.
virtual ~topoSet()
Destructor.
void check(const label maxLabel)
Check validity of contents.
void updateLabels(const labelList &map)
Update map from map. Used to update cell/face labels.
topoSet(const IOobject &, const word &wantedType)
Construct from IOobject as explicitly passed type.
virtual void deleteSet(const topoSet &set)
Delete elements present in set.
virtual void sync(const polyMesh &mesh)
Sync set across coupled patches.
virtual void addSet(const topoSet &set)
Add elements present in set.
static autoPtr< topoSet > New(const word &setType, const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Return a pointer to a toposet read from file.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
virtual void topoChange(const polyTopoChangeMap &map)
Update any stored data for new labels. Not implemented.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
errorManipArg< error, int > exit(error &err, const int errNo=1)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
vectorField pointField
pointField is a vectorField.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
triSurfaceToAgglom resize(surfacesMesh.size())