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())
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
#define forAll(list, i)
Loop across all elements in list.
Extract command arguments and options from the supplied argc and argv parameters. ...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
T get(const label index) const
Get a value from the argument at index.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::argList args(argc, argv)