41 int main(
int argc,
char *argv[])
58 Info<<
"Looking for nearest face/vertex to " << samplePt <<
endl;
68 const pointField& localPoints = surf1.localPoints();
73 forAll(localPoints, pointi)
75 const scalar dist =
mag(localPoints[pointi] - samplePt);
83 Info<<
"Nearest vertex:" <<
nl
84 <<
" index : " << minIndex <<
" (in localPoints)" <<
nl
85 <<
" index : " << surf1.meshPoints()[minIndex]
86 <<
" (in points)" <<
nl
87 <<
" coordinates: " << localPoints[minIndex] <<
nl
102 surf1[facei].nearestPoint(samplePt,
points);
111 const face&
f = surf1[minIndex];
113 Info<<
"Nearest face:" <<
nl
114 <<
" index : " << minIndex <<
nl
115 <<
" centre : " <<
f.centre(
points) <<
nl
116 <<
" face : " <<
f <<
nl
117 <<
" vertex coords:" <<
endl;
127 if (minIndex >= surfZones[zonei].start())
#define forAll(list, i)
Loop across all elements in list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
scalar distance() const
Return distance to hit.
Extract command arguments and options from the supplied argc and argv parameters.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
A face is a list of labels corresponding to mesh vertices.
A surface zone on a MeshedSurface.
int main(int argc, char *argv[])
scalar minDist(const List< pointIndexHit > &hitList)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::argList args(argc, argv)