40 const label oldLen = list.
size();
43 for (label i = oldLen; i > 0; --i)
45 list[i] = std::move(list[i-1]);
65 point(
x.first(),
y.first(), z.first()),
66 point(
x.last(),
y.last(), z.last())
74 return Vector<gradingDescriptors>
99 for (
const label nDiv : divisions_)
120 knots[i+1] - knots[i],
141 divisions_.resize(len,
Zero);
160 <<
"Cannot append point " <<
p 161 <<
" which is <= last value " << knots.
last() <<
endl;
168 <<
"Negative or zero divisions " << nDiv <<
endl;
175 expRatio = 1.0/(-expRatio);
177 else if (
equal(expRatio, 0))
184 divisions_.append(nDiv);
185 expansion_.append(expRatio);
203 <<
"Cannot prepend point " <<
p 204 <<
" which is >= first value " << knots.
first() <<
endl;
211 <<
"Negative or zero divisions " << nDiv <<
endl;
218 expRatio = 1.0/(-expRatio);
220 else if (
equal(expRatio, 0))
238 if (cmpt < vector::nComponents)
255 if (cmpt < vector::nComponents)
277 const scalar span = (upp - low);
279 for (label pointi = 1; pointi < nCells; ++pointi)
281 grid[pointi] = low + (pointi*span)/nCells;
290 for (label edgei = 0; edgei < this->nCells(); ++edgei)
292 limits.
add(width(edgei));
305 else if (
equal(
p, first()))
309 else if (
equal(
p, last()))
313 else if (
p < first() ||
p > last())
343 else if (
p < first() ||
p > last())
351 scalar
delta = GREAT;
353 for (
const scalar& val : *
this)
List< scalar > scalarList
List of scalar.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
void size(const label n)
Older name for setAddressableSize.
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
Binary search to find the index of the last element in a sorted list that is less than value...
Ostream & indent(Ostream &os)
Indent stream.
label findIndex(const scalar p, const scalar tol) const
Find the grid index, within the given tolerance.
void resize(label len)
Resize lists.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void resize(const label len)
Adjust allocated size of list.
bool equal(const T &a, const T &b)
Compare two values for equality.
void prepend(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to front of list (push_front)
void append(const T &val)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
T & front()
Access first element of the list, position [0].
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
A bounding box defined in terms of min/max extrema points.
#define forAll(list, i)
Loop across all elements in list.
virtual Ostream & endBlock()
Write end block group.
const labelVector & sizes() const
The (i,j,k) addressing dimensions.
Handles the specification for grading within a section of a block.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross-product operators.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label size() const noexcept
The number of elements in the List.
Vector< gradingDescriptors > grading() const
Equivalent edge grading descriptors in (x,y,z) directions.
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
void append(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to end of list (push_back)
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
T & last()
Access last element of the list, position [size()-1].
scalarMinMax edgeLimits() const
Return min/max edge lengths.
label findCell(const scalar p) const
Find the cell index enclosing this location.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
static void prependList(List< T > &list, const T &val)
label nCells() const
Total number of cells in this direction.
void writeDict(Ostream &os, const direction cmpt) const
Write as dictionary contents for specified vector direction.
T & back()
Access last element of the list, position [size()-1].
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
Vector< label > labelVector
Vector of labels.
gradingDescriptors grading() const
Return edge grading descriptors for the locations.
List of gradingDescriptor for the sections of a block with additional IO functionality.
const boundBox & bounds() const noexcept
The mesh bounding box.
void reset(const scalar low, const scalar upp, const label nCells)
Reset with min/max range and number of divisions.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)