Go to the documentation of this file.
34 void Foam::labelRanges::insertBefore
37 const labelRange&
range
41 label nElem = this->size();
45 Info<<
"before insert "
46 << nElem <<
" elements, insert at " <<
insert <<
nl
54 Info<<
"copy between " << nElem <<
" and " <<
insert <<
nl;
57 for (label i = nElem-1; i >=
insert; --i)
61 Info<<
"copy from " << (i) <<
" to " << (i+1) <<
nl;
64 StorageContainer::operator[](i+1) = StorageContainer::operator[](i);
76 void Foam::labelRanges::purgeEmpty()
82 if (!StorageContainer::operator[](elemI).empty())
86 StorageContainer::operator[](nElem) =
87 StorageContainer::operator[](elemI);
101 const labelRange&
range
132 else if (this->empty())
141 labelRange& currRange = StorageContainer::operator[](elemI);
149 for (; elemI < this->size()-1; ++elemI)
151 labelRange& nextRange = StorageContainer::operator[](elemI+1);
152 if (currRange.
overlaps(nextRange,
true))
154 currRange.
join(nextRange);
168 else if (
range < currRange)
170 insertBefore(elemI,
range);
187 if (
range.empty() || this->empty())
194 labelRange& currRange = StorageContainer::operator[](elemI);
204 Info<<
"Fragment removal ";
206 printRange(
Info, currRange) <<
endl;
221 insertBefore(elemI, fragment);
228 printRange(
Info, currRange) <<
endl;
235 else if (
range.first() <= currRange.
last())
241 Info<<
"RHS removal ";
243 printRange(
Info, currRange) <<
endl;
255 printRange(
Info, currRange) <<
endl;
267 Info<<
"LHS removal ";
269 printRange(
Info, currRange) <<
endl;
281 printRange(
Info, currRange) <<
endl;
304 os << static_cast<const labelRanges::StorageContainer&>(ranges);
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
points setSize(newPointi)
labelRange join(const labelRange &range) const
Return a joined range, squashing any gaps in between.
labelRanges()
Construct null.
bool add(const labelRange &range)
Add the range to the list.
Istream & operator>>(Istream &, directionInfo &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
void clear() noexcept
Reset to zero start and zero size.
bool overlaps(const labelRange &range, bool touches=false) const
Return true if the ranges overlap.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
A range or interval of labels defined by a start and a size.
label first() const noexcept
The (inclusive) lower value of the range - same as start()
static int debug
Debugging.
void setSize(const label nElem)
Alter addressable list size.
label last() const noexcept
The (inclusive) upper value of the range - same as max()
labelRange remove()
Remove and return the last element. Fatal on an empty list.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.