40 const pointMesh& srcMesh,
41 const bool savePoints,
42 const bool isWriteProc
46 nOldPoints_(srcMesh.size()),
51 dummyHandler_(fileOperation::null()),
52 writeHandler_(dummyHandler_),
53 isWriteProc_(isWriteProc)
64 const pointMesh& srcMesh,
65 const bool savePoints,
66 refPtr<fileOperation>& writeHandler
70 nOldPoints_(srcMesh.size()),
75 dummyHandler_(nullptr),
76 writeHandler_(writeHandler),
88 const pointMesh& srcMesh,
89 const pointMesh& tgtMesh,
90 const mapDistributePolyMesh& distMap,
91 const bool savePoints,
92 const bool isWriteProc
96 nOldPoints_(srcMesh.size()),
101 dummyHandler_(fileOperation::null()),
102 writeHandler_(dummyHandler_),
103 isWriteProc_(isWriteProc)
114 const pointMesh& srcMesh,
115 const pointMesh& tgtMesh,
116 const mapDistributePolyMesh& distMap,
117 const bool savePoints,
118 refPtr<fileOperation>& writeHandler
122 nOldPoints_(srcMesh.size()),
124 tgtMeshRef_(tgtMesh),
125 distMapRef_(distMap),
127 dummyHandler_(nullptr),
128 writeHandler_(writeHandler),
142 return !patchMeshPoints_.empty();
148 return !patchPointMaps_.empty();
154 return (tgtMeshRef_ && distMapRef_);
160 patchMeshPoints_.clear();
165 patchPointMaps_.clear();
171 const pointBoundaryMesh&
patches = srcMesh_.boundary();
173 patchMeshPoints_.
clear();
178 if (!isA<processorPointPatch>(
patches[patchi]))
193 if (!tgtMeshRef_ || !distMapRef_)
196 <<
"Cannot create maps without target mesh and/or distribution!" 200 const auto& tgtMesh = tgtMeshRef_();
201 const auto& distMap = distMapRef_();
203 const auto& newPatches = tgtMesh.boundary();
204 const auto& oldPatches = srcMesh_.boundary();
206 patchPointMaps_.clear();
207 patchPointMaps_.resize(oldPatches.size());
214 forAll(oldPatches, patchi)
216 if (!isA<processorPointPatch>(oldPatches[patchi]))
226 new mapDistributeBase(distMap.pointMap())
231 patchMeshPoints_.test(patchi)
232 ? patchMeshPoints_[patchi]
233 : oldPatches[patchi].meshPoints()
236 patchPointMaps_[patchi].compactData
239 newPatches[patchi].meshPoints(),
252 tgtMeshRef_.reset(
nullptr);
253 distMapRef_.reset(
nullptr);
256 clearPatchPointMaps();
262 const pointMesh& tgtMesh,
263 const mapDistributePolyMesh& distMap
266 tgtMeshRef_.cref(tgtMesh);
267 distMapRef_.cref(distMap);
270 clearPatchPointMaps();
276 const IOobjectList& objects,
277 const wordRes& selected
282 nTotal += distributePointFields<scalar>(objects, selected);
283 nTotal += distributePointFields<vector>(objects, selected);
284 nTotal += distributePointFields<symmTensor>(objects, selected);
285 nTotal += distributePointFields<sphericalTensor>(objects, selected);
286 nTotal += distributePointFields<tensor>(objects, selected);
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.
void createPatchPointMaps()
Construct per-patch addressing.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
label distributeAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, distribute and write all/selected point field types (scalar, vector, ... types) ...
void resetTarget()
Clear target mesh / distribution map.
static int & msgType() noexcept
Message tag of standard messages.
bool hasPatchPointMaps() const
True if patch maps (per boundary) exist.
#define forAll(list, i)
Loop across all elements in list.
Invalid/unknown/error type.
static int verbose_
Output verbosity when writing.
bool hasMeshPoints() const
True if meshPoints (per boundary) for the source mesh have been saved.
bool hasTarget() const
True if a target mesh/distribution map has been attached.
label size() const noexcept
The number of entries in the list.
errorManip< error > abort(error &err)
void clear()
Clear the patch list and all demand-driven data.
const polyBoundaryMesh & patches
List< label > labelList
A List of labels.
parPointFieldDistributor(const parPointFieldDistributor &)=delete
No copy construct.