51 Pout<<
nl <<
"Foam::cellPointWeight::findTetrahedron" <<
nl
52 <<
"position = " << position <<
nl
53 <<
"celli = " << celli <<
endl;
62 const scalar cellVolume = mesh.
cellVolumes()[celli];
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
146 <<
"position = " << position <<
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
Return the geometry corresponding to this tet.
triPointRef faceTri(const polyMesh &mesh) 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.
Macro definitions for debug switches.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")