34 void Foam::triSurfaceMesh::drawHitProblem
43 const List<labelledTri>& tris = *
this;
46 Info<<
nl <<
"# findLineAll did not hit its own face." 47 <<
nl <<
"# fi " << fi
48 <<
nl <<
"# start " << start
49 <<
nl <<
"# point " << p
50 <<
nl <<
"# end " << end
51 <<
nl <<
"# hitInfo " << hitInfo
68 label hfi = hitInfo[hi].index();
83 void Foam::triSurfaceMesh::processHit
85 scalar& internalCloseness,
86 scalar& externalCloseness,
87 const scalar internalToleranceCosAngle,
88 const scalar externalToleranceCosAngle,
98 if (hitInfo.size() < 1)
100 drawHitProblem(fi, start, p, end, hitInfo);
102 else if (hitInfo.size() == 1)
104 if (!hitInfo[0].hit())
107 else if (hitInfo[0].index() != fi)
109 drawHitProblem(fi, start, p, end, hitInfo);
120 if (hitInfo[hI].index() == fi)
129 drawHitProblem(fi, start, p, end, hitInfo);
131 else if (ownHiti == 0)
138 (normal & normals[hitInfo[ownHiti + 1].index()])
139 < externalToleranceCosAngle
142 externalCloseness =
min 145 mag(p - hitInfo[ownHiti + 1].hitPoint())
149 else if (ownHiti == hitInfo.size() - 1)
156 (normal & normals[hitInfo[ownHiti - 1].index()])
157 < internalToleranceCosAngle
160 internalCloseness =
min 163 mag(p - hitInfo[ownHiti - 1].hitPoint())
171 (normal & normals[hitInfo[ownHiti + 1].index()])
172 < externalToleranceCosAngle
175 externalCloseness =
min 178 mag(p - hitInfo[ownHiti + 1].hitPoint())
184 (normal & normals[hitInfo[ownHiti - 1].index()])
185 < internalToleranceCosAngle
188 internalCloseness =
min 191 mag(p - hitInfo[ownHiti - 1].hitPoint())
202 const scalar internalAngleTolerance,
203 const scalar externalAngleTolerance
206 const scalar internalToleranceCosAngle
211 const scalar externalToleranceCosAngle
242 internalCloseness[fi],
243 externalCloseness[fi],
244 internalToleranceCosAngle,
245 externalToleranceCosAngle,
298 const scalar internalAngleTolerance,
299 const scalar externalAngleTolerance
302 const scalar internalToleranceCosAngle
307 const scalar externalToleranceCosAngle
324 label nPointFaces = 0;
327 nPointFaces += pointFaces[pfi].
size();
339 const label fi = pointFaces[
pi][pfi];
341 facePoints[i] = (0.9*points[meshPoints[
pi]] + 0.1*faceCentres[fi]);
344 start[i] = facePoints[i] - span*
n;
345 end[i] = facePoints[i] + span*
n;
364 const label fi = pointFaces[
pi][pfi];
369 internalCloseness[pi],
370 externalCloseness[pi],
371 internalToleranceCosAngle,
372 externalToleranceCosAngle,
#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
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.
const Field< point > & faceCentres() const
Return face centres for patch.
const Field< point > & faceNormals() const
Return face normals for patch.
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.
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)
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 labelListList & pointFaces() const
Return point-face addressing.
Pair< tmp< triSurfacePointScalarField > > extractPointCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=10) const
Return a pair of triSurfaceScalarPointFields representing the.
const Time & time() const
Return time.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
vector point
Point is a vector.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Pair< tmp< triSurfaceScalarField > > extractCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=10) const
Return a pair of triSurfaceScalarFields representing the.
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