42 int main(
int argc,
char *argv[])
58 Info<<
"Looking for nearest face/vertex to " << samplePt <<
endl;
68 const pointField& localPoints = surf1.localPoints();
71 scalar minDist = GREAT;
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 103 const scalar dist =
mag(centre - samplePt);
111 const face& f = surf1[minIndex];
113 Info<<
"Face with nearest centre:" <<
nl 114 <<
" index :" << minIndex <<
nl 115 <<
" centre :" << f.
centre(points) <<
nl 116 <<
" face :" << f <<
nl 117 <<
" vertex coords:\n";
120 Info<<
" " << points[f[fp]] <<
"\n";
point centre(const pointField &) const
Centre point of face.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt >> &) const
Return *this (used for point which is a typedef to Vector<scalar>.
static void noParallel()
Remove the parallel options.
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.
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.
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::argList args(argc, argv)