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(),
154 selected_.
resize(size, val);
192 return selected_.test(
id);
198 return selected_.set(
id);
204 return selected_.unset(
id);
210 for (
const label
id : labels)
212 selected_[id] =
true;
219 for (
const label
id : labels)
228 selected_.resize(maxLen);
229 for (
bool&
b : selected_)
247 selected_[i] = (selected_[i] &&
set.found(i));
256 for (
const label
id :
set)
258 selected_[id] =
true;
266 for (
const label
id :
set)
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.
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.
label size() const noexcept
The number of elements in table.
UList< label > labelUList
A UList of labels.
void resize(const label sz)
Resize the hash table for efficiency.
#define forAll(list, i)
Loop across all elements in list.
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 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.
errorManip< error > abort(error &err)
virtual bool found(const label id) const
Has the given index?
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
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 subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
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 with empty selection.
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.
virtual void addSet(const topoSet &set)
Add elements present in set.