33 void Foam::triSurfaceMesh::drawHitProblem
44 const List<labelledTri>& tris = *
this;
45 tmp<pointField> tpoints =
points();
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
225 const scalar span = bounds().mag();
227 const pointField start(faceCentres() - span*normals);
228 const pointField end(faceCentres() + span*normals);
229 const pointField& faceCentres = this->faceCentres();
234 findLineAll(start, end, allHitinfo);
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
321 const labelList& meshPoints = this->meshPoints();
322 const pointField& faceCentres = this->faceCentres();
326 const scalar span = bounds().mag();
328 label nPointFaces = 0;
331 nPointFaces += pointFaces[pfi].
size();
343 const label fi = pointFaces[
pi][pfi];
345 facePoints[i] = (0.9*
points[meshPoints[
pi]] + 0.1*faceCentres[fi]);
348 start[i] = facePoints[i] - span*
n;
349 end[i] = facePoints[i] + span*
n;
358 findLineAll(start, end, allHitinfo);
368 const label fi = pointFaces[
pi][pfi];
373 internalCloseness[
pi],
374 externalCloseness[
pi],
375 internalToleranceCosAngle,
376 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< triSurfaceScalarField > > extractCloseness(const scalar internalAngleTolerance=degToRad(80), const scalar externalAngleTolerance=degToRad(80)) const
Return a pair of triSurfaceScalarFields representing the.
Pair< tmp< triSurfacePointScalarField > > extractPointCloseness(const scalar internalAngleTolerance=degToRad(80), const scalar externalAngleTolerance=degToRad(80)) const
Return a pair of triSurfaceScalarPointFields representing the.
virtual tmp< pointField > points() const
Get the points that define the surface.
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.
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)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable