32 void Foam::searchableSurfaces::triSurface::drawHitProblem
44 tmp<pointField> tpoints =
points();
47 Info<<
nl <<
"# findLineAll did not hit its own face."
48 <<
nl <<
"# fi " << fi
49 <<
nl <<
"# start " << start
50 <<
nl <<
"# point " <<
p
51 <<
nl <<
"# end " <<
end
52 <<
nl <<
"# hitInfo " << hitInfo
69 label hfi = hitInfo[hi].index();
85 void Foam::searchableSurfaces::triSurface::processHit
87 scalar& internalCloseness,
88 scalar& externalCloseness,
89 const scalar internalToleranceCosAngle,
90 const scalar externalToleranceCosAngle,
100 if (hitInfo.size() < 1)
102 drawHitProblem(fi, start,
p, end, hitInfo);
104 else if (hitInfo.size() == 1)
106 if (!hitInfo[0].hit())
109 else if (hitInfo[0].index() != fi)
111 drawHitProblem(fi, start,
p, end, hitInfo);
122 if (hitInfo[hI].index() == fi)
131 drawHitProblem(fi, start,
p, end, hitInfo);
133 else if (ownHiti == 0)
140 (normal & normals[hitInfo[ownHiti + 1].index()])
141 < externalToleranceCosAngle
144 externalCloseness =
min
147 mag(
p - hitInfo[ownHiti + 1].hitPoint())
151 else if (ownHiti == hitInfo.size() - 1)
158 (normal & normals[hitInfo[ownHiti - 1].index()])
159 < internalToleranceCosAngle
162 internalCloseness =
min
165 mag(
p - hitInfo[ownHiti - 1].hitPoint())
173 (normal & normals[hitInfo[ownHiti + 1].index()])
174 < externalToleranceCosAngle
177 externalCloseness =
min
180 mag(
p - hitInfo[ownHiti + 1].hitPoint())
186 (normal & normals[hitInfo[ownHiti - 1].index()])
187 < internalToleranceCosAngle
190 internalCloseness =
min
193 mag(
p - hitInfo[ownHiti - 1].hitPoint())
204 const scalar internalAngleTolerance,
205 const scalar externalAngleTolerance
208 const scalar internalToleranceCosAngle
213 const scalar externalToleranceCosAngle
224 const scalar span = bounds().mag();
226 const pointField start(faceCentres() - span*normals);
227 const pointField end(faceCentres() + span*normals);
228 const pointField& faceCentres = this->faceCentres();
233 findLineAll(start, end, allHitinfo);
244 internalCloseness[fi],
245 externalCloseness[fi],
246 internalToleranceCosAngle,
247 externalToleranceCosAngle,
296 const scalar internalAngleTolerance,
297 const scalar externalAngleTolerance
300 const scalar internalToleranceCosAngle
305 const scalar externalToleranceCosAngle
316 const labelList& meshPoints = this->meshPoints();
317 const pointField& faceCentres = this->faceCentres();
321 const scalar span = bounds().mag();
323 label nPointFaces = 0;
326 nPointFaces += pointFaces[pfi].
size();
338 const label fi = pointFaces[
pi][pfi];
340 facePoints[i] = (0.9*
points[meshPoints[
pi]] + 0.1*faceCentres[fi]);
343 start[i] = facePoints[i] - span*
n;
344 end[i] = facePoints[i] + span*
n;
353 findLineAll(start, end, allHitinfo);
363 const label fi = pointFaces[
pi][pfi];
368 internalCloseness[
pi],
369 externalCloseness[
pi],
370 internalToleranceCosAngle,
371 externalToleranceCosAngle,
#define forAll(list, i)
Loop across all elements in list.
A primitive field of type <Type> with automated input and output.
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 <Type> 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.
Motion of the mesh specified as a list of pointMeshMovers.
static const word & geometryDir()
Return the geometry directory name.
Pair< tmp< scalarIOField > > extractCloseness(const scalar internalAngleTolerance=degToRad(80), const scalar externalAngleTolerance=degToRad(80)) const
Return a pair of scalarIOFields representing the.
Pair< tmp< scalarIOField > > extractPointCloseness(const scalar internalAngleTolerance=degToRad(80), const scalar externalAngleTolerance=degToRad(80)) const
Return a pair of scalarIOFields representing the.
virtual tmp< pointField > points() const
Get the points that define the surface.
A class for managing temporary objects.
scalar degToRad(const scalar deg)
Convert degrees to radians.
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.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Field< vector > vectorField
Specialisation of Field<T> for vector.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
List< pointIndexHit > pointIndexHitList
List of pointIndexHits and associated functions.
dimensionedScalar cos(const dimensionedScalar &ds)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable