34 void Foam::triSurfaceMesh::drawHitProblem
45 const List<labelledTri>& tris = *
this;
48 Info<<
nl <<
"# findLineAll did not hit its own face." 49 <<
nl <<
"# fi " << fi
50 <<
nl <<
"# start " << start
51 <<
nl <<
"# point " << p
52 <<
nl <<
"# end " << end
53 <<
nl <<
"# hitInfo " << hitInfo
70 label hfi = hitInfo[hi].index();
86 void Foam::triSurfaceMesh::processHit
88 scalar& internalCloseness,
89 scalar& externalCloseness,
90 const scalar internalToleranceCosAngle,
91 const scalar externalToleranceCosAngle,
101 if (hitInfo.size() < 1)
103 drawHitProblem(fi, start, p, end, hitInfo);
105 else if (hitInfo.size() == 1)
107 if (!hitInfo[0].hit())
110 else if (hitInfo[0].index() != fi)
112 drawHitProblem(fi, start, p, end, hitInfo);
123 if (hitInfo[hI].index() == fi)
132 drawHitProblem(fi, start, p, end, hitInfo);
134 else if (ownHiti == 0)
141 (normal & normals[hitInfo[ownHiti + 1].index()])
142 < externalToleranceCosAngle
145 externalCloseness =
min 148 mag(p - hitInfo[ownHiti + 1].hitPoint())
152 else if (ownHiti == hitInfo.size() - 1)
159 (normal & normals[hitInfo[ownHiti - 1].index()])
160 < internalToleranceCosAngle
163 internalCloseness =
min 166 mag(p - hitInfo[ownHiti - 1].hitPoint())
174 (normal & normals[hitInfo[ownHiti + 1].index()])
175 < externalToleranceCosAngle
178 externalCloseness =
min 181 mag(p - hitInfo[ownHiti + 1].hitPoint())
187 (normal & normals[hitInfo[ownHiti - 1].index()])
188 < internalToleranceCosAngle
191 internalCloseness =
min 194 mag(p - hitInfo[ownHiti - 1].hitPoint())
205 const scalar internalAngleTolerance,
206 const scalar externalAngleTolerance
209 const scalar internalToleranceCosAngle
214 const scalar externalToleranceCosAngle
245 internalCloseness[fi],
246 externalCloseness[fi],
247 internalToleranceCosAngle,
248 externalToleranceCosAngle,
301 const scalar internalAngleTolerance,
302 const scalar externalAngleTolerance
305 const scalar internalToleranceCosAngle
310 const scalar externalToleranceCosAngle
327 label nPointFaces = 0;
330 nPointFaces += pointFaces[pfi].
size();
342 const label fi = pointFaces[
pi][pfi];
344 facePoints[i] = (0.9*points[meshPoints[
pi]] + 0.1*faceCentres[fi]);
347 start[i] = facePoints[i] - span*
n;
348 end[i] = facePoints[i] + span*
n;
367 const label fi = pointFaces[
pi][pfi];
372 internalCloseness[pi],
373 externalCloseness[pi],
374 internalToleranceCosAngle,
375 externalToleranceCosAngle,
Pair< tmp< triSurfacePointScalarField > > extractPointCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=80) const
Return a pair of triSurfaceScalarPointFields representing the.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
const Field< PointType > & faceCentres() const
Return face centres for patch.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual tmp< pointField > points() const
Get the points that define the surface.
Unit conversion functions.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
List< pointIndexHit > pointIndexHitList
List of pointIndexHits and associated functions.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const dimensionSet dimLength
vectorField pointField
pointField is a vectorField.
An ordered pair of two objects of type <T> with first() and second() elements.
dimensionedScalar cos(const dimensionedScalar &ds)
static const word & geometryDir()
Return the geometry directory name.
scalar mag() const
The magnitude of the bounding box span.
const word & constant() const
Return constant name.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
const Field< PointType > & faceNormals() const
Return face normals for patch.
Pair< tmp< triSurfaceScalarField > > extractCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=80) const
Return a pair of triSurfaceScalarFields representing the.
const labelListList & pointFaces() const
Return point-face addressing.
const Time & time() const
Return time.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
vector point
Point is a vector.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const boundBox & bounds() const
Return const reference to boundBox.
Foam::DimensionedField< scalar, triSurfacePointGeoMesh > triSurfacePointScalarField
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Foam::DimensionedField< scalar, triSurfaceGeoMesh > triSurfaceScalarField