51 Pout<<
nl <<
"Foam::cellPointWeight::findTetrahedron" <<
nl
53 <<
"celli = " << celli <<
endl;
82 && (u + v + w < 1 +
tol)
96 scalar minNearDist = vGreat;
98 label nearestTetI = -1;
106 if (nearDist < minNearDist)
108 minNearDist = nearDist;
116 Pout<<
"cellPointWeight::findTetrahedron" <<
nl
117 <<
" Tetrahedron search failed; using closest tet to point "
125 const tetIndices& tetIs = cellTets[nearestTetI];
145 Pout<<
"\nbool Foam::cellPointWeight::findTriangle" <<
nl
147 <<
"facei = " << facei <<
endl;
168 if (0.25*
mag(
det)/faceAreaSqr > tol)
170 const scalar& u = triWeights[0];
171 const scalar& v = triWeights[1];
182 weights_[1] = triWeights[0];
183 weights_[2] = triWeights[1];
184 weights_[3] = triWeights[2];
195 scalar minNearDist = vGreat;
197 label nearestTetI = -1;
205 if (nearDist < minNearDist)
207 minNearDist = nearDist;
215 Pout<<
"cellPointWeight::findTriangle" <<
nl
216 <<
" Triangle search failed; using closest tri to point "
223 const tetIndices& tetIs = faceTets[nearestTetI];
234 weights_[1] = triWeights[0];
235 weights_[2] = triWeights[1];
236 weights_[3] = triWeights[2];
#define forAll(list, i)
Loop across all elements in list.
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
scalar distance() const
Return distance to hit.
void findTetrahedron(const polyMesh &mesh, const vector &position, const label celli)
void findTriangle(const polyMesh &mesh, const vector &position, const label facei)
triFace faceVertices_
Face vertex indices.
static scalar tol
Tolerance used in calculating barycentric co-ordinates.
barycentric weights_
Weights applied to tet vertices. Equal to the barycentric coordinates.
cellPointWeight(const polyMesh &mesh, const vector &position, const label celli, const label facei=-1)
Construct from components.
static List< tetIndices > cellTetIndices(const polyMesh &mesh, label cI)
Return the tet decomposition of the given cell, see.
static List< tetIndices > faceTetIndices(const polyMesh &mesh, label fI, label cI)
Return the tet decomposition of the given face, with.
Mesh consisting of general polyhedral cells.
virtual const labelList & faceOwner() const
Return face owner.
const scalarField & cellVolumes() const
const scalarField & magFaceAreas() const
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
triFace faceTriIs(const polyMesh &mesh) const
Return the indices corresponding to the tri on the face for.
tetPointRef tet(const polyMesh &mesh, const pointField &meshPoints, const pointField &cellCentres) const
Return the geometry corresponding to this tet and the given.
triPointRef faceTri(const polyMesh &mesh, const pointField &meshPoints) const
Return the geometry corresponding to the tri on the face for.
barycentric pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
pointHit nearestPoint(const point &p) const
Return nearest point to p on tetrahedron. Is p itself.
barycentric2D pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Macro definitions for debug switches.
scalar cellVolume(const cell &c, const cellEdgeAddressing &cAddr, const point &cPAvg, const vectorField &fAreas, const pointField &fCentres)
Compute the cell-volume.
point position(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the position given the coordinates and tet topology.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void det(LagrangianPatchField< scalar > &f, const LagrangianPatchField< tensor > &f1)
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
defineTypeNameAndDebug(combustionModel, 0)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
prefixOSstream Pout(cout, "Pout")