49 Pout<<
nl <<
"Foam::cellPointWeight::findTetrahedron" <<
nl
50 <<
"position = " << position <<
nl
51 <<
"celli = " << celli <<
endl;
80 && (u + v + w < 1 +
tol)
94 scalar minNearDist = VGREAT;
96 label nearestTetI = -1;
104 if (nearDist < minNearDist)
106 minNearDist = nearDist;
114 Pout<<
"cellPointWeight::findTetrahedron" <<
nl
115 <<
" Tetrahedron search failed; using closest tet to point "
123 const tetIndices& tetIs = cellTets[nearestTetI];
143 Pout<<
"\nbool Foam::cellPointWeight::findTriangle" <<
nl
144 <<
"position = " << position <<
nl
145 <<
"facei = " << facei <<
endl;
166 if (0.25*
mag(
det)/faceAreaSqr > tol)
168 const scalar& u = triWeights[0];
169 const scalar& v = triWeights[1];
180 weights_[1] = triWeights[0];
181 weights_[2] = triWeights[1];
182 weights_[3] = triWeights[2];
193 scalar minNearDist = VGREAT;
195 label nearestTetI = -1;
203 if (nearDist < minNearDist)
205 minNearDist = nearDist;
213 Pout<<
"cellPointWeight::findTriangle" <<
nl
214 <<
" Triangle search failed; using closest tri to point "
221 const tetIndices& tetIs = faceTets[nearestTetI];
232 weights_[1] = triWeights[0];
233 weights_[2] = triWeights[1];
234 weights_[3] = triWeights[2];
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 noexcept
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 coordinates.
barycentric weights_
Weights applied to tet vertices.
static int debug
Debug switch.
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 vectorField & faceAreas() 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 bool warn=true) 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
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.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.