46 nearestToPoint::typeName,
47 "\n Usage: nearestToPoint (pt0 .. ptn)\n\n" 48 " Select the nearest point for each of the points pt0 ..ptn\n\n" 54 void Foam::nearestToPoint::combine(topoSet&
set,
const bool add)
const 65 scalar minDistSqr =
magSqr(pts[minPointi] - points_[pointi]);
67 for (
label i = 1; i < pts.size(); i++)
69 scalar distSqr =
magSqr(pts[i] - points_[pointi]);
71 if (distSqr < minDistSqr)
78 addOrDelete(
set, minPointi, add);
106 points_(dict.
lookup(
"points"))
138 Info<<
" Adding points nearest to " << points_ <<
endl;
144 Info<<
" Removing points nearest to " << points_ <<
endl;
#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 list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
nearestToPoint(const polyMesh &mesh, const pointField &points)
Construct from components.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
vectorField pointField
pointField is a vectorField.
setAction
Enumeration defining the valid actions.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
virtual ~nearestToPoint()
Destructor.
Class with constructor to add usage string to table.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.