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] =
244 faceCentres[fI].dist(hitInfo[ownHitI + 1].
point());
247 else if (ownHitI == hitInfo.
size() - 1)
256 & normals[hitInfo[ownHitI - 1].index()]
258 < internalToleranceCosAngle
261 internalCloseness[fI] =
262 faceCentres[fI].dist(hitInfo[ownHitI - 1].
point());
271 & normals[hitInfo[ownHitI + 1].index()]
273 < externalToleranceCosAngle
276 externalCloseness[fI] =
277 faceCentres[fI].dist(hitInfo[ownHitI + 1].
point());
284 & normals[hitInfo[ownHitI - 1].index()]
286 < internalToleranceCosAngle
289 internalCloseness[fI] =
290 faceCentres[fI].dist(hitInfo[ownHitI - 1].
point());
302 basename +
".internalCloseness",
314 outputField.swap(internalCloseness);
316 outputField.swap(internalCloseness);
325 basename +
".externalCloseness",
337 outputField.swap(externalCloseness);
339 outputField.swap(externalCloseness);
void swap(List< T > &other)
Swap with plain List content. Implies shrink_to_fit().
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
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.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
scalar mag() const
The magnitude/length of the bounding box diagonal.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual const boundBox & bounds() const
Return const reference to boundBox.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
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.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
dimensionedScalar cos(const dimensionedScalar &ds)
DimensionedField< scalar, triSurfaceGeoMesh > triSurfaceScalarField
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.