Go to the documentation of this file.
49 int main(
int argc,
char *argv[])
53 "Find nearest face and vertex."
54 " Uses a zero origin unless otherwise specified"
71 Info<<
"Looking for nearest face/vertex to " << samplePt <<
endl;
81 const pointField& localPoints = surf1.localPoints();
84 scalar minDist = GREAT;
86 forAll(localPoints, pointi)
88 const scalar dist =
mag(localPoints[pointi] - samplePt);
96 Info<<
"Nearest vertex:" <<
nl
97 <<
" index : " << minIndex <<
" (in localPoints)" <<
nl
98 <<
" index : " << surf1.meshPoints()[minIndex]
99 <<
" (in points)" <<
nl
100 <<
" coordinates: " << localPoints[minIndex] <<
nl
116 const scalar dist =
mag(centre - samplePt);
124 const face&
f = surf1[minIndex];
126 Info<<
"Face with nearest centre:" <<
nl
127 <<
" index : " << minIndex <<
nl
128 <<
" centre : " <<
f.centre(
points) <<
nl
129 <<
" face : " <<
f <<
nl
130 <<
" vertex coords:" <<
endl;
141 if (minIndex >= surfZones[zonei].start())
A class for handling file names.
T getOrDefault(const word &optName, const T &deflt) const
static void addNote(const string ¬e)
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
T get(const label index) const
static void addArgument(const string &argName, const string &usage="")
Generic templated field type.
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt >> &) const
A surface zone on a MeshedSurface.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A face is a list of labels corresponding to mesh vertices.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)