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 size(const label n)
Older name for setAddressableSize.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void drawHitProblem(label fI, const triSurface &surf, const pointField &start, const pointField &faceCentres, const pointField &end, const List< pointIndexHit > &hitInfo)
Ignore writing from objectRegistry::writeObject()
virtual const boundBox & bounds() const
Return const reference to boundBox.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
#define forAll(list, i)
Loop across all elements in list.
IOoject and searching on triSurface.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
An ordered pair of two objects of type <T> with first() and second() elements.
dimensionedScalar cos(const dimensionedScalar &ds)
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
scalar mag() const
The magnitude/length of the bounding box diagonal.
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.
const Field< point_type > & points() const noexcept
Return reference to global points.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
vector point
Point is a vector.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
Triangulated surface description with patch information.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Foam::DimensionedField< scalar, triSurfaceGeoMesh > triSurfaceScalarField