40 const pointMesh& srcMesh,
41 const bool savePoints,
42 const bool isWriteProc
46 nOldPoints_(srcMesh.size()),
51 isWriteProc_(isWriteProc)
62 const pointMesh& srcMesh,
63 const pointMesh& tgtMesh,
64 const mapDistributePolyMesh& distMap,
65 const bool savePoints,
66 const bool isWriteProc
70 nOldPoints_(srcMesh.size()),
75 isWriteProc_(isWriteProc)
88 return !patchMeshPoints_.empty();
94 return !patchPointMaps_.empty();
100 return (tgtMeshRef_ && distMapRef_);
106 patchMeshPoints_.clear();
111 patchPointMaps_.clear();
117 const pointBoundaryMesh&
patches = srcMesh_.boundary();
119 patchMeshPoints_.
clear();
124 if (!isA<processorPointPatch>(
patches[patchi]))
139 if (!tgtMeshRef_ || !distMapRef_)
142 <<
"Cannot create maps without target mesh and/or distribution!"
146 const auto& tgtMesh = tgtMeshRef_();
147 const auto& distMap = distMapRef_();
149 const auto& newPatches = tgtMesh.boundary();
150 const auto& oldPatches = srcMesh_.boundary();
152 patchPointMaps_.clear();
153 patchPointMaps_.resize(oldPatches.size());
160 forAll(oldPatches, patchi)
162 if (!isA<processorPointPatch>(oldPatches[patchi]))
172 new mapDistributeBase(distMap.pointMap())
177 patchMeshPoints_.test(patchi)
178 ? patchMeshPoints_[patchi]
179 : oldPatches[patchi].meshPoints()
182 patchPointMaps_[patchi].compactData
185 newPatches[patchi].meshPoints(),
198 tgtMeshRef_.reset(
nullptr);
199 distMapRef_.reset(
nullptr);
202 clearPatchPointMaps();
208 const pointMesh& tgtMesh,
209 const mapDistributePolyMesh& distMap
212 tgtMeshRef_.cref(tgtMesh);
213 distMapRef_.cref(distMap);
216 clearPatchPointMaps();
222 const IOobjectList& objects,
223 const wordRes& selected
228 nTotal += distributePointFields<scalar>(objects, selected);
229 nTotal += distributePointFields<vector>(objects, selected);
230 nTotal += distributePointFields<symmTensor>(objects, selected);
231 nTotal += distributePointFields<sphericalTensor>(objects, selected);
232 nTotal += distributePointFields<tensor>(objects, selected);
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
static int & msgType() noexcept
Message tag of standard messages.
label size() const noexcept
The number of elements in the list.
Distributor/redistributor for point fields, uses a two (or three) stage construction.
label distributeAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
bool hasPatchPointMaps() const
True if patch maps (per boundary) exist.
void resetTarget()
Clear target mesh / distribution map.
void clearMeshPoints()
Clear out meshPoints (per boundary) for the source mesh.
void clearPatchPointMaps()
Clear out patch maps (per boundary)
void saveMeshPoints()
Create/recreate meshPoints (per boundary) for the source mesh.
static int verbose_
Output verbosity when writing.
void createPatchPointMaps()
Construct per-patch addressing.
bool hasTarget() const
True if a target mesh/distribution map has been attached.
bool hasMeshPoints() const
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
#define forAll(list, i)
Loop across all elements in list.