Go to the documentation of this file.
53 Info<<
nl <<
"# findLineAll did not hit its own face."
54 <<
nl <<
"# fI " << fI
55 <<
nl <<
"# start " << start[fI]
56 <<
nl <<
"# f centre " << faceCentres[fI]
57 <<
nl <<
"# end " <<
end[fI]
58 <<
nl <<
"# hitInfo " << hitInfo
75 label hFI = hitInfo[hI].index();
100 const scalar internalAngleTolerance,
101 const scalar externalAngleTolerance
110 Info<<
"Extracting internal and external closeness of surface." <<
endl;
116 basename +
".closeness",
129 const scalar span = searchSurf.
bounds().
mag();
131 const scalar externalToleranceCosAngle =
134 degToRad(180 - externalAngleTolerance)
137 const scalar internalToleranceCosAngle =
140 degToRad(180 - internalAngleTolerance)
143 Info<<
"externalToleranceCosAngle: " << externalToleranceCosAngle <<
nl
144 <<
"internalToleranceCosAngle: " << internalToleranceCosAngle <<
endl;
164 if (hitInfo.size() < 1)
172 else if (hitInfo.size() == 1)
174 if (!hitInfo[0].hit())
180 else if (hitInfo[0].index() != fI)
205 if (hitInfo[hI].index() == fI)
229 else if (ownHitI == 0)
238 & normals[hitInfo[ownHitI + 1].index()]
240 < externalToleranceCosAngle
243 externalCloseness[fI] =
247 - hitInfo[ownHitI + 1].hitPoint()
251 else if (ownHitI == hitInfo.size() - 1)
260 & normals[hitInfo[ownHitI - 1].index()]
262 < internalToleranceCosAngle
265 internalCloseness[fI] =
269 - hitInfo[ownHitI - 1].hitPoint()
279 & normals[hitInfo[ownHitI + 1].index()]
281 < externalToleranceCosAngle
284 externalCloseness[fI] =
288 - hitInfo[ownHitI + 1].hitPoint()
296 & normals[hitInfo[ownHitI - 1].index()]
298 < internalToleranceCosAngle
301 internalCloseness[fI] =
305 - hitInfo[ownHitI - 1].hitPoint()
318 basename +
".internalCloseness",
330 outputField.swap(internalCloseness);
332 outputField.swap(internalCloseness);
341 basename +
".externalCloseness",
353 outputField.swap(externalCloseness);
355 outputField.swap(externalCloseness);
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
scalar mag() const
The magnitude of the bounding box span.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
Unit conversion functions.
IOoject and searching on triSurface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
Triangulated surface description with patch information.
messageStream Info
Information stream (uses stdout - output is on the master only)
const Field< point_type > & points() const
Return reference to global points.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
An ordered pair of two objects of type <T> with first() and second() elements.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static void drawHitProblem(label fI, const triSurface &surf, const pointField &start, const pointField &faceCentres, const pointField &end, const List< pointIndexHit > &hitInfo)
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
virtual const boundBox & bounds() const
Return const reference to boundBox.
const Field< point_type > & faceCentres() const
Return face centres for patch.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensionedScalar cos(const dimensionedScalar &ds)