Go to the documentation of this file.
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"
70 void Foam::nearestToCell::combine(topoSet&
set,
const bool add)
const
73 List<mappedPatchBase::nearInfo> nearest(points_.size());
81 nearest[pointi].second() = Tuple2<scalar, label>
83 magSqr(cc-points_[pointi]),
91 for (
const auto& near : nearest)
121 points_(std::move(
points))
162 Info<<
" Adding cells nearest to " << points_ <<
endl;
171 Info<<
" Removing cells nearest to " << points_ <<
endl;
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
nearestToCell(const polyMesh &mesh, const pointField &points)
Construct from components, copying points.
Add elements to current set.
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Class with constructor to add usage string to table.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Create a new set and ADD elements to it.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
A topoSetCellSource to select cells whose cell centre nearest to given points.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (stdout output on master, null elsewhere)
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
General set of labels of mesh quantity (points, cells, faces).
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Macros for easy insertion into run-time selection tables.
Subtract elements from current set.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const vectorField & cellCentres() const
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
vector point
Point is a vector.
const polyMesh & mesh_
Reference to the mesh.
defineTypeNameAndDebug(combustionModel, 0)