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 with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An ordered pair of two objects of type <T> with first() and second() elements.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
const Field< point_type > & points() const noexcept
Return reference to global points.
const Field< point_type > & faceCentres() const
Return face centres for patch.
const word & constant() const
Return constant name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void swap(UList< T > &list)
Swap content with another UList of the same type in constant time.
void size(const label n)
Older name for setAddressableSize.
scalar mag() const
The magnitude of the bounding box span.
virtual bool write(const bool valid=true) const
Write using setting from DB.
virtual const boundBox & bounds() const
Return const reference to boundBox.
A class for managing temporary objects.
IOoject and searching on triSurface.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
Triangulated surface description with patch information.
A class for handling words, derived from Foam::string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static void drawHitProblem(label fI, const triSurface &surf, const pointField &start, const pointField &faceCentres, const pointField &end, const List< pointIndexHit > &hitInfo)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.