73 forAll(cutFaceCentres, facei)
77 mag(cutFaceAreas[facei] & (cutFaceCentres[facei] - cEst)), VSMALL);
80 vector pc = 0.75 * cutFaceCentres[facei] + 0.25 * cEst;
83 subCellCentre += pyr3Vol * pc;
86 subCellVolume += pyr3Vol;
89 subCellCentre /= subCellVolume;
96 const DynamicList<DynamicList<point>>& faceEdges,
97 const vector& subCellCentre,
104 label nEdgePoints{0};
107 for (
const point&
p : edgePoints)
115 fCentre /= nEdgePoints;
129 const point& nextPoint = edgePoints[
pi + 1];
131 vector c = edgePoints[
pi] + nextPoint + fCentre;
133 (nextPoint - edgePoints[
pi]) ^ (fCentre - edgePoints[
pi]);
145 if (sumA < ROOTVSMALL)
147 faceCentre = fCentre;
152 faceCentre = (1.0/3.0)*sumAc/sumA;
157 if ((faceArea & (faceCentre - subCellCentre)) >= 0)
168 const DynamicList<DynamicList<point>>& faceEdges,
169 DynamicList<point>& facePoints
172 if (
mag(faceArea) < VSMALL)
178 vector xhat = faceEdges[0][0] - faceCentre;
179 xhat = (xhat - (xhat & zhat)*zhat);
199 for (
const point&
p : edgePoints)
201 unsortedFacePoints.append(
p);
202 unsortedFacePointAngles.append
206 ((
p - faceCentre) & yhat),
207 ((
p - faceCentre) & xhat)
215 facePoints.append(unsortedFacePoints[order[0]]);
216 for (label
pi = 1;
pi < order.size(); ++
pi)
222 unsortedFacePointAngles[order[
pi]]
223 - unsortedFacePointAngles[order[
pi - 1]]
226 facePoints.append(unsortedFacePoints[order[
pi]]);
constexpr scalar pi(M_PI)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
void size(const label n)
Older name for setAddressableSize.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
static void calcCellData(const DynamicList< point > &cutFaceCentres, const DynamicList< vector > &cutFaceAreas, vector &subCellCentre, scalar &subCellVolume)
Calculates volume and centre of the cutted cell.
cutCell(const fvMesh &mesh)
Construct from fvMesh.
static void calcIsoFacePointsFromEdges(const vector &faceArea, const vector &faceCentre, const DynamicList< DynamicList< point > > &faceEdges, DynamicList< point > &facePoints)
Calculates the point of the cutting face.
static void calcGeomDataCutFace(const DynamicList< DynamicList< point > > &faceEdges, const vector &subCellCentre, vector &faceArea, vector &faceCentre)
Calculates area and centre of the cutting face.
Mesh data needed to do the Finite Volume discretisation.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const dimensionedScalar c
Speed of light in a vacuum.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar sign(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
#define forAll(list, i)
Loop across all elements in list.