Go to the documentation of this file.
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;
97 const vector& subCellCentre,
104 label nEdgePoints{0};
107 for (
const point&
p : edgePoints)
115 fCentre /= nEdgePoints;
126 const label
nPoints = edgePoints.size();
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)
172 if (
mag(faceArea) < VSMALL)
178 vector xhat = faceEdges[0][0] - faceCentre;
179 xhat = (xhat - (xhat & zhat)*zhat);
199 for (
const point&
p : edgePoints)
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]]);
static constexpr const zero Zero
Global zero (0)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
static void calcCellData(const DynamicList< point > &cutFaceCentres, const DynamicList< vector > &cutFaceAreas, vector &subCellCentre, scalar &subCellVolume)
Calculates volume and centre of the cutted cell.
Vector< Cmpt > & normalise()
Normalise the vector by its magnitude.
dimensionedScalar sign(const dimensionedScalar &ds)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static void calcIsoFacePointsFromEdges(const vector &faceArea, const vector &faceCentre, const DynamicList< DynamicList< point >> &faceEdges, DynamicList< point > &facePoints)
Calculates the point of the cutting face.
Mesh data needed to do the Finite Volume discretisation.
cutCell(const fvMesh &mesh)
Construct from fvMesh.
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
static void calcGeomDataCutFace(const DynamicList< DynamicList< point >> &faceEdges, const vector &subCellCentre, vector &faceArea, vector &faceCentre)
Calculates area and centre of the cutting face.
constexpr scalar pi(M_PI)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
const dimensionedScalar c
Speed of light in a vacuum.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.