45 const scalar defaultCellSize
48 scalar minDist = defaultCellSize;
53 hI1 < hitList.
size() - 1;
74 minDist =
min(minDist, curDist);
88 const scalar defaultCellSize
91 scalar minDist = defaultCellSize;
96 hI1 < hitList.size() - 1;
104 const edge& e1 = emesh.edges()[pHit1.index()];
109 hI2 < hitList.size();
117 const edge& e2 = emesh.edges()[pHit2.index()];
120 if (!e1.connected(e2))
122 scalar curDist = pHit1.point().dist(pHit2.point());
124 minDist =
min(minDist, curDist);
141 const extendedEdgeMesh& emesh,
142 const triSurface& surf,
143 const scalar searchDistance
146 auto tfld = tmp<scalarField>::New(surf.size(), searchDistance);
147 auto& featureProximity = tfld.ref();
149 Info<<
"Extracting proximity of close feature points and "
150 <<
"edges to the surface" << endl;
154 const triPointRef& tri = surf[fI].tri(surf.points());
155 const point& triCentre = tri.circumCentre();
157 const scalar radiusSqr = min
159 sqr(4*tri.circumRadius()),
163 List<pointIndexHit> hitList;
165 emesh.allNearestFeatureEdges(triCentre, radiusSqr, hitList);
167 featureProximity[fI] =
168 calcProximityOfFeatureEdges
175 emesh.allNearestFeaturePoints(triCentre, radiusSqr, hitList);
177 featureProximity[fI] =
178 calcProximityOfFeaturePoints
192 const word& basename,
193 const extendedEdgeMesh& emesh,
194 const triSurface& surf,
195 const scalar searchDistance
198 Info<< nl <<
"Extracting curvature of surface at the points."
202 tmp<scalarField> tfld =
203 edgeMeshTools::featureProximity(emesh, surf, searchDistance);
204 scalarField& featureProximity = tfld.ref();
206 triSurfaceScalarField outputField
210 basename +
".featureProximity",
222 outputField.swap(featureProximity);
224 outputField.swap(featureProximity);
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...
label index() const noexcept
Return the hit index.
bool hit() const noexcept
Is there a hit?
const point_type & point() const noexcept
Return point, no checks.
const Field< point_type > & points() const noexcept
Return reference to global points.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
scalar dist(const Vector< Cmpt > &v2) const
The L2-norm distance from another vector. The mag() of the difference.
Mesh data needed to do the Finite Area discretisation.
const edgeList & edges() const noexcept
Return edges.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
Description of feature edges and points.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
Triangulated surface description with patch information.
Point circumCentre() const
Return circum-centre.
scalar circumRadius() const
Return circum-radius.
A class for handling words, derived from Foam::string.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static scalar calcProximityOfFeaturePoints(const List< pointIndexHit > &hitList, const scalar defaultCellSize)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
vector point
Point is a vector.
triangle< point, const point & > triPointRef
A triangle using referred points.
scalar calcProximityOfFeatureEdges(const edgeMesh &emesh, const List< pointIndexHit > &hitList, const scalar defaultCellSize)
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
DimensionedField< scalar, triSurfaceGeoMesh > triSurfaceScalarField
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.