47 if (!labels.
test(oldId))
52 if (oldId >= map.
size())
55 <<
"Illegal content " << oldId <<
" of set:" <<
name()
56 <<
" of type " <<
type() <<
nl 57 <<
"Value should be between [0," << map.
size() <<
')' 62 const label newId = map[oldId];
83 const label len = map.
size();
89 const label newId = map[oldId];
105 const label oldId = labels.
rfind(
true);
107 if (oldId >= maxSize)
110 <<
"Illegal content " << oldId <<
" of set:" <<
name()
111 <<
" of type " <<
type() <<
nl 112 <<
"Value should be between [0," << maxSize <<
')' 123 const polyMesh&
mesh,
132 mesh.time().constant(),
136 IOobject::NO_REGISTER
145 const polyMesh&
mesh,
153 selected_.
resize(size, val);
191 return selected_.test(
id);
197 return selected_.test(
id);
203 return selected_.set(
id);
209 return selected_.unset(
id);
215 for (
const label
id : labels)
217 selected_[id] =
true;
224 for (
const label
id : labels)
233 selected_.resize(maxLen);
234 for (
bool&
b : selected_)
252 selected_[i] = (selected_[i] &&
set.found(i));
267 const boolList oldSelected(selected_);
269 for (
const label
id :
set)
271 selected_[id] = oldSelected[id];
280 for (
const label
id :
set)
282 selected_[id] =
true;
290 for (
const label
id :
set)
292 selected_[id] =
true;
300 for (
const label
id :
set)
310 for (
const label
id :
set)
virtual void subset(const labelUList &elems)
Subset contents. Only elements present in both sets remain.
void size(const label n)
Older name for setAddressableSize.
virtual bool unset(const label id)
Unset an index.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
virtual bool contains(const label id) const
Has the given index?
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
constexpr char nl
The newline '\n' character (0x0a)
virtual void invert(const label maxLen)
Invert contents.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
label size() const noexcept
The number of elements in table.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual bool set(const label id)
Set an index.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Base for a special purpose topoSet using labels stored as a boolList.
A class for handling words, derived from Foam::string.
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
virtual void addSet(const labelUList &elems)
Add given elements to the set.
errorManip< error > abort(error &err)
virtual bool found(const label id) const
Has the given index?
void resize(label newCapacity)
Rehash the hash table with new number of buckets. Currently identical to setCapacity() ...
List< bool > bools(const labelHashSet &locations)
Transform the on locations to a boolList, with true for each non-negative location and false for all ...
virtual void subtractSet(const labelUList &elems)
Subtract given elements from the set.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type test(const label i) const
Test bool value at specified position, always false for out-of-range access.
topoBoolSet(const polyMesh &mesh, const word &setName)
Construct (no-read) with empty selection.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
virtual void updateLabels(const labelUList &map)
Update map from map.
Mesh consisting of general polyhedral cells.
virtual void check(const label maxSize)
Check limits on addressable range.
List< bool > boolList
A List of bools.