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_;
96 const label oldId = labels.find_last();
101 <<
"Illegal content " << oldId <<
" of set:" <<
name()
102 <<
" of type " <<
type() <<
nl 103 <<
"Value should be between [0," << maxSize <<
')' 114 const polyMesh&
mesh,
123 mesh.time().constant(),
145 selected_.
resize(size, val);
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)
void size(const label n)
Older name for setAddressableSize.
void set(const bitSet &bitset)
Set specified bits from another bitset.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
virtual void updateLabels(const labelUList &map)
Update map from map.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
label find_last() const
Locate the last bit set.
constexpr char nl
The newline '\n' character (0x0a)
Base for a special purpose topoSet using labels stored as a bitSet.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool found(const label id) const
Has the given index?
label size() const noexcept
The number of elements in table.
virtual void addSet(const topoSet &set)
Add elements present in set.
void resize(const label sz)
Resize the hash table for efficiency.
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void invert(const label maxLen)
Invert contents.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
errorManip< error > abort(error &err)
virtual void check(const label maxSize)
Check limits on addressable range.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
General set of labels of mesh quantity (points, cells, faces).
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
topoBitSet(const polyMesh &mesh, const word &setName)
Construct with empty selection.
Mesh consisting of general polyhedral cells.
virtual bool unset(const label id)
Unset an index.
virtual bool set(const label id)
Set an index.