Go to the documentation of this file.
43 if (oldId >= map.
size())
46 <<
"Illegal content " << oldId <<
" of set:" <<
name()
47 <<
" of type " <<
type() <<
nl
48 <<
"Value should be between [0," << map.
size() <<
')'
58 for (
const label oldId : labels)
60 const label newId = map[oldId];
78 const label len = map.
size();
82 for (
const label oldId : labels)
84 const label newId = map[oldId];
88 labels.transfer(newLabels);
94 const bitSet& labels = selected_;
101 <<
"Illegal content " << oldId <<
" of set:" <<
name()
102 <<
" of type " <<
type() <<
nl
103 <<
"Value should be between [0," << maxSize <<
')'
145 selected_.
resize(size, val);
174 selected_ = std::move(bits);
175 selected_.resize(size);
183 return selected_.test(
id);
189 return selected_.set(
id);
195 return selected_.unset(
id);
201 selected_.set(labels);
207 selected_.unset(labels);
213 selected_.resize(maxLen);
221 if (isA<topoBitSet>(set))
223 selected_ &= refCast<const topoBitSet>(set).selected_;
225 else if (set.
empty())
231 for (
const label
id : selected_)
245 if (isA<topoBitSet>(set))
247 selected_ |= refCast<const topoBitSet>(set).selected_;
251 for (
const label
id : set)
262 if (isA<topoBitSet>(set))
264 selected_ -= refCast<const topoBitSet>(set).selected_;
268 for (
const label
id : set)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual bool set(const label id)
Set an index.
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
void set(const bitSet &bitset)
Set specified bits from another bitset.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void addSet(const topoSet &set)
Add elements present in set.
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
Mesh consisting of general polyhedral cells.
topoBitSet(const polyMesh &mesh, const word &setName)
Construct with empty selection.
virtual void check(const label maxSize)
Check limits on addressable range.
virtual bool found(const label id) const
Has the given index?
label find_last() const
Locate the last bit set.
virtual void invert(const label maxLen)
Invert contents.
word name(const complex &c)
Return string representation of complex.
void resize(const label sz)
Resize the hash table for efficiency.
virtual bool unset(const label id)
Unset an index.
General set of labels of mesh quantity (points, cells, faces).
errorManip< error > abort(error &err)
virtual bool found(const label id) const
Has the given index?
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void updateLabels(const labelUList &map)
Update map from map.
Base for a special purpose topoSet using labels stored as a bitSet.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
const Time & time() const
Return the top-level database.
bool empty() const noexcept
True if the hash table is empty.
const word & constant() const
Return constant name.