Go to the documentation of this file.
63 auto* ctorPtr = wordConstructorTable(setType);
71 *wordConstructorTablePtr_
89 auto* ctorPtr = sizeConstructorTable(setType);
97 *sizeConstructorTablePtr_
115 auto* ctorPtr = setConstructorTable(setType);
123 *setConstructorTablePtr_
153 bool changed =
false;
155 for (
const label oldId : labels)
157 if (oldId < 0 || oldId >= map.
size())
160 <<
"Illegal content " << oldId <<
" of set:" <<
name()
161 <<
" of type " <<
type() <<
nl
162 <<
"Value should be between [0," << map.
size() <<
')'
167 const label newId = map[oldId];
189 for (
const label oldId : labels)
191 const label newId = map[oldId];
195 newLabels.set(newId);
199 labels.transfer(newLabels);
207 for (
const label oldId : labels)
209 if (oldId < 0 || oldId >= maxSize)
212 <<
"Illegal content " << oldId <<
" of set:" <<
name()
213 <<
" of type " <<
type() <<
nl
214 <<
"Value should be between [0," << maxSize <<
')'
233 for (; (iter !=
cend()) && (
n < maxElem); ++iter)
235 if (
n && ((
n % 10) == 0))
239 os << iter.key() <<
' ';
259 for (; (iter !=
cend()) && (
n < maxElem); ++iter)
261 if (
n && ((
n % 3) == 0))
265 os << iter.key() << coords[iter.key()] <<
' ';
283 os <<
"Set bounding box: min = "
284 << bb.min() <<
" max = " << bb.max() <<
" metres." <<
nl <<
endl;
290 if (size() <= maxLen)
292 writeDebug(
os, coords, maxLen, iter,
n);
296 label halfLen = maxLen/2;
298 os <<
"Size larger than " << maxLen <<
". Printing first and last "
299 << halfLen <<
" elements:" <<
nl <<
endl;
301 writeDebug(
os, coords, halfLen, iter,
n);
305 for (;
n < size() - halfLen; ++
n)
310 writeDebug(
os, coords, halfLen, iter,
n);
319 const polyMesh&
mesh,
341 if (!io.typeHeaderOk<topoSet>(
false) && disallowGenericSets != 0)
395 if (readStream(wantedType).
good())
397 readStream(wantedType) >>
static_cast<labelHashSet&
>(*this);
407 const polyMesh&
mesh,
408 const word& wantedType,
414 regIOobject(findIOobject(
mesh,
name, r, w))
435 const polyMesh&
mesh,
510 return static_cast<const labelHashSet&
>(*this).found(
id);
547 resize(2*
max(64, (maxLen - original.size())));
549 for (label
id=0;
id < maxLen; ++id)
551 if (!original.found(
id))
582 this->subtractSet(
set);
598 if (size() <= maxLen)
600 writeDebug(
os, maxLen, iter,
n);
604 label halfLen = maxLen/2;
606 os <<
"Size larger than " << maxLen <<
". Printing first and last "
607 << halfLen <<
" elements:" <<
nl <<
endl;
609 writeDebug(
os, halfLen, iter,
n);
613 for (;
n < size() - halfLen; ++
n)
618 writeDebug(
os, halfLen, iter,
n);
625 return (
os << *
this).good();
void writeDebug(Ostream &os, const label maxElem, topoSet::const_iterator &iter, label &elemI) const
static fileName localPath(const polyMesh &mesh, const word &name)
topoSet(const topoSet &)=delete
vectorField pointField
pointField is a vectorField.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void set(List< bool > &bools, const labelRange &range)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
const point & max() const
void operator=(const topoSet &)
void operator=(const this_type &rhs)
int debugSwitch(const char *name, const int deflt=0)
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual const fileName & dbDir() const
const fileName & facesInstance() const
virtual void deleteSet(const topoSet &set)
static int disallowGenericSets
virtual void subset(const topoSet &set)
Ostream & endl(Ostream &os)
static autoPtr< topoSet > New(const word &setType, const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
A HashTable with keys but without contents that is similar to std::unordered_set.
virtual void invert(const label maxLen)
Mesh consisting of general polyhedral cells.
static IOobject findIOobject(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
typename parent_type::const_key_iterator const_iterator
virtual void addSet(const topoSet &set)
virtual bool found(const label id) const
virtual void updateMesh(const mapPolyMesh &morphMap)
patchWriters resize(patchIds.size())
Generic templated field type.
virtual bool set(const label id)
virtual void subtractSet(const topoSet &set)
General set of labels of mesh quantity (points, cells, faces).
const point & min() const
label max(const labelHashSet &set, label maxValue=labelMin)
bool unset(const Key &key)
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
constexpr auto cend(const C &c) -> decltype(c.end())
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
readOption readOpt() const noexcept
const word & name() const noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
constexpr auto cbegin(const C &c) -> decltype(c.begin())
bool rmDir(const fileName &directory, const bool silent=false)
virtual bool writeData(Ostream &) const
fileName::Type type(const fileName &name, const bool followLink=true)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual bool unset(const label id)
virtual void check(const label maxSize)
A bounding box defined in terms of min/max extrema points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool good() const noexcept
word name(const expressions::valueTypeCode typeCode)
const Time & time() const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Istream & readStream(const word &, const bool valid=true)
virtual void sync(const polyMesh &mesh)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
virtual void updateLabels(const labelUList &map)
static void removeFiles(const polyMesh &)
defineTypeNameAndDebug(combustionModel, 0)
bool isDir(const fileName &name, const bool followLink=true)