36 return nDiv > 1 ?
pow(expRatio, 1.0/(nDiv - 1)) : 0.0;
54 divisions_[nDiv] = 1.0;
56 scalar secStart = divisions_[0];
60 if (nDiv >= gd.
size())
65 label sumSecnDivs = 0;
66 label secnMaxDivs = 0;
70 scalar nDivFrac = gd[sectioni].nDivFraction();
71 secnDivs[sectioni] =
label(nDivFrac*nDiv + 0.5);
72 sumSecnDivs += secnDivs[sectioni];
75 if (nDivFrac > gd[secnMaxDivs].nDivFraction())
77 secnMaxDivs = sectioni;
83 if (sumSecnDivs != nDiv)
85 secnDivs[secnMaxDivs] += (nDiv - sumSecnDivs);
90 scalar blockFrac = gd[sectioni].blockFraction();
91 scalar expRatio = gd[sectioni].expansionRatio();
93 label secnDiv = secnDivs[sectioni];
94 label secnEnd = secnStart + secnDiv;
99 for (
label i = secnStart; i < secnEnd; i++)
103 + blockFrac*scalar(i - secnStart + 1)/secnDiv;
109 const scalar expFact =
calcGexp(expRatio, secnDiv);
111 for (
label i = secnStart; i < secnEnd; i++)
115 + blockFrac*(1.0 -
pow(expFact, i - secnStart + 1))
116 /(1.0 -
pow(expFact, secnDiv));
120 secStart = divisions_[secnEnd - 1];
127 for (
label i=1; i < nDiv; i++)
129 divisions_[i] = scalar(i)/nDiv;
134 points_ = cedge.
position(divisions_);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual point position(const scalar) const =0
Return the point position corresponding to the curve parameter.
const scalarList & lambdaDivisions() const
Return the list of lambda values.
void size(const label)
Override size to be inconsistent with allocated storage.
lineDivide(const blockEdge &, const label ndiv, const gradingDescriptors &gd=gradingDescriptors())
Construct from components.
scalar calcGexp(const scalar expRatio, const label nDiv)
Calculate the geometric expansion factor from the expansion ratio.
const pointField & points() const
Return the points.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Define a curved edge that is parameterized for 0<lambda<1 between the start and end point...
List of gradingDescriptor for the sections of a block with additional IO functionality.