62 nearestToCell::typeName,
63 "\n Usage: nearestToCell (pt0 .. ptn)\n\n"
64 " Select the nearest cell for each of the points pt0 ..ptn\n\n"
73 List<mappedPatchBase::nearInfo> nearest(points_.
size());
81 nearest[pointi].second() = Tuple2<scalar, label>
83 magSqr(cc-points_[pointi]),
90 for (
const auto& near : nearest)
120 points_(std::move(
points))
161 Info<<
" Adding cells nearest to " << points_ <<
endl;
170 Info<<
" Removing cells nearest to " << points_ <<
endl;
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A topoSetCellSource to select cells whose cell centre nearest to given points.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Mesh consisting of general polyhedral cells.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
const vectorField & cellCentres() const
int myProcNo() const noexcept
Return processor number.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
const polyMesh & mesh_
Reference to the mesh.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector point
Point is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dict add("bounds", meshBb)
#define forAll(list, i)
Loop across all elements in list.