34 void Foam::triSurfaceMesh::drawHitProblem
45 const List<labelledTri>& tris = *
this;
46 tmp<pointField> tpoints =
points();
49 Info<<
nl <<
"# findLineAll did not hit its own face."
50 <<
nl <<
"# fi " << fi
51 <<
nl <<
"# start " << start
52 <<
nl <<
"# point " <<
p
53 <<
nl <<
"# end " <<
end
54 <<
nl <<
"# hitInfo " << hitInfo
71 label hfi = hitInfo[hi].index();
87 void Foam::triSurfaceMesh::processHit
89 scalar& internalCloseness,
90 scalar& externalCloseness,
91 const scalar internalToleranceCosAngle,
92 const scalar externalToleranceCosAngle,
102 if (hitInfo.size() < 1)
104 drawHitProblem(fi, start,
p, end, hitInfo);
106 else if (hitInfo.size() == 1)
108 if (!hitInfo[0].hit())
111 else if (hitInfo[0].index() != fi)
113 drawHitProblem(fi, start,
p, end, hitInfo);
124 if (hitInfo[hI].index() == fi)
133 drawHitProblem(fi, start,
p, end, hitInfo);
135 else if (ownHiti == 0)
142 (normal & normals[hitInfo[ownHiti + 1].index()])
143 < externalToleranceCosAngle
146 externalCloseness =
min
149 mag(
p - hitInfo[ownHiti + 1].hitPoint())
153 else if (ownHiti == hitInfo.size() - 1)
160 (normal & normals[hitInfo[ownHiti - 1].index()])
161 < internalToleranceCosAngle
164 internalCloseness =
min
167 mag(
p - hitInfo[ownHiti - 1].hitPoint())
175 (normal & normals[hitInfo[ownHiti + 1].index()])
176 < externalToleranceCosAngle
179 externalCloseness =
min
182 mag(
p - hitInfo[ownHiti + 1].hitPoint())
188 (normal & normals[hitInfo[ownHiti - 1].index()])
189 < internalToleranceCosAngle
192 internalCloseness =
min
195 mag(
p - hitInfo[ownHiti - 1].hitPoint())
206 const scalar internalAngleTolerance,
207 const scalar externalAngleTolerance
210 const scalar internalToleranceCosAngle
215 const scalar externalToleranceCosAngle
226 const scalar span = bounds().mag();
228 const pointField start(faceCentres() - span*normals);
229 const pointField end(faceCentres() + span*normals);
230 const pointField& faceCentres = this->faceCentres();
235 findLineAll(start, end, allHitinfo);
246 internalCloseness[fi],
247 externalCloseness[fi],
248 internalToleranceCosAngle,
249 externalToleranceCosAngle,
302 const scalar internalAngleTolerance,
303 const scalar externalAngleTolerance
306 const scalar internalToleranceCosAngle
311 const scalar externalToleranceCosAngle
322 const labelList& meshPoints = this->meshPoints();
323 const pointField& faceCentres = this->faceCentres();
327 const scalar span = bounds().mag();
329 label nPointFaces = 0;
332 nPointFaces += pointFaces[pfi].
size();
344 const label fi = pointFaces[
pi][pfi];
346 facePoints[i] = (0.9*
points[meshPoints[
pi]] + 0.1*faceCentres[fi]);
349 start[i] = facePoints[i] - span*
n;
350 end[i] = facePoints[i] + span*
n;
359 findLineAll(start, end, allHitinfo);
369 const label fi = pointFaces[
pi][pfi];
374 internalCloseness[
pi],
375 externalCloseness[
pi],
376 internalToleranceCosAngle,
377 externalToleranceCosAngle,
#define forAll(list, i)
Loop across all elements in list.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
An ordered pair of two objects of type <T> with first() and second() elements.
static const word & constant()
Return constant name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const Time & time() const
Return time.
static const word & geometryDir()
Return the geometry directory name.
A class for managing temporary objects.
Pair< tmp< triSurfacePointScalarField > > extractPointCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=80) const
Return a pair of triSurfaceScalarPointFields representing the.
Pair< tmp< triSurfaceScalarField > > extractCloseness(const scalar internalAngleTolerance=80, const scalar externalAngleTolerance=80) const
Return a pair of triSurfaceScalarFields representing the.
virtual tmp< pointField > points() const
Get the points that define the surface.
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.
const dimensionSet dimLength
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< pointIndexHit > pointIndexHitList
List of pointIndexHits and associated functions.
dimensionedScalar cos(const dimensionedScalar &ds)
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
Unit conversion functions.