67 scalar sumBlockFraction = 0;
68 scalar sumNDivFraction = 0;
70 for (
const gradingDescriptor& gd : *
this)
72 sumBlockFraction += gd.blockFraction_;
73 sumNDivFraction += gd.nDivFraction_;
78 gd.blockFraction_ /= sumBlockFraction;
79 gd.nDivFraction_ /= sumNDivFraction;
87 gradingDescriptors ret(*
this);
91 ret[i] = operator[](ret.size() - i - 1).inv();
107 gds = gradingDescriptors(gradingDescriptor(t.number()));
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label n)
Older name for setAddressableSize.
gradingDescriptor & operator[](const label i)
Handles the specification for grading within a section of a block.
void correct()
Adjust expansion ratio.
List of gradingDescriptor for the sections of a block with additional IO functionality.
void correct()
Adjust expansion ratios.
gradingDescriptors()
Default construct with a single default gradingDescriptor.
void normalise()
Normalize blockFractions and nDivFractions for the list of gradingDescriptors, and call correct().
gradingDescriptors inv() const
Return the inverse gradingDescriptors with 1/expansionRatio.
A token holds an item read from Istream.
bool isNumber() const noexcept
Token is (signed/unsigned) integer type, FLOAT or DOUBLE.
scalar number() const
Return label, float or double value.
Istream & operator>>(Istream &, directionInfo &)
#define forAll(list, i)
Loop across all elements in list.