36 template<
class FaceList,
class Po
intField>
39 const scalar mergeDist,
64 (useLocal ?
pp.localPoints().size() :
pp.points().size())
69 faceAddr.
gather(
pp.localFaces(), mergedFaces);
70 pointAddr.
gather(
pp.localPoints(), mergedPoints);
75 pointAddr.
gather(
pp.points(), mergedPoints);
79 for (
const label proci : faceAddr.
subProcs())
91 label nPointsChanged(0);
100 pp.localPoints().size()
106 pp.boundaryPoints().size()
109 bndPointAddr.
gather(
pp.boundaryPoints(), boundaryPoints);
112 for (
const label proci : localPointAddr.subProcs())
115 localPointAddr.inplaceToGlobal(proci, slot);
136 for (
auto&
f : mergedFaces)
144 pointMergeMap.
transfer(pointToUnique);
149 if (!nPointsChanged &&
notNull(pointMergeMap))
157 template<
class FaceList,
class Po
intField>
160 const scalar mergeDist,
161 const PrimitivePatch<FaceList, PointField>&
pp,
174 globalIndex pointAddr;
175 globalIndex faceAddr;
177 PatchTools::gatherAndMerge<FaceList, PointField>
191 template<
class FaceList>
195 const FaceList& localFaces,
207 typedef typename FaceList::value_type FaceType;
217 uniqueMeshPointLabels
224 for (
auto&
f : myFaces)
232 globalPointsPtr().gather
237 globalFacesPtr().gather(myFaces, mergedFaces);
242 uniqueMeshPointLabels = pointToGlobal;
244 globalPointsPtr.
reset(
new globalIndex(meshPoints.
size()));
245 globalFacesPtr.
reset(
new globalIndex(localFaces.size()));
247 mergedFaces = localFaces;
std::remove_reference< PointField >::type::value_type point_type
The point type.
void reset(const label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun())
Reset from local size, using gather/broadcast with default/specified communicator if parallel...
void size(const label n)
Older name for setAddressableSize.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static bool & parRun() noexcept
Test if this a parallel run.
Dispatch tag. Construct 'one-sided' from local sizes, using gather but no broadcast.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
void inplaceToGlobal(labelUList &labels) const
From local to global index (inplace)
std::remove_reference< FaceList >::type::value_type face_type
The face type.
labelRange range() const
Return start/size range of local processor data.
virtual const pointField & points() const
Return raw points.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
A list of faces which address into the list of points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
vectorField pointField
pointField is a vectorField.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
Generic templated field type.
const globalMeshData & globalData() const
Return parallel info.
label inplaceMergePoints(PointList &points, const scalar mergeTol, const bool verbose, labelList &pointToUnique)
Inplace merge points, preserving the original point order. All points closer/equal mergeTol are to be...
Geometric merging of points. See below.
labelRange subProcs() const noexcept
Range of process indices for addressed sub-offsets (processes)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
static void gather(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
List< label > labelList
A List of labels.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())