42 void Foam::faMeshDistributor::createPatchMaps()
const 44 const faBoundaryMesh& oldPatches = srcMesh_.
boundary();
45 const faBoundaryMesh& newPatches = tgtMesh_.
boundary();
47 patchEdgeMaps_.clear();
48 patchEdgeMaps_.resize(oldPatches.size());
51 const auto& faEdgeMap = distMap_.
faceMap();
54 List<labelRange> ranges = newPatches.patchRanges();
58 if (!isA<processorFaPatch>(oldPatches[patchi]))
66 new mapDistributeBase(faEdgeMap)
70 patchEdgeMaps_[patchi].compactRemoteData
72 bitSet(ranges[patchi]),
81 void Foam::faMeshDistributor::createInternalEdgeMap()
const 84 const auto& faEdgeMap = distMap_.faceMap();
87 internalEdgeMapPtr_ = std::make_unique<mapDistributeBase>(faEdgeMap);
90 internalEdgeMapPtr_->compactRemoteData
92 bitSet(tgtMesh_.nInternalEdges(),
true),
99 void Foam::faMeshDistributor::checkAddressing()
const 103 Pout<<
"Create from nFaces:" << srcMesh_.faceLabels().size()
104 <<
" to:" << tgtMesh_.faceLabels().size() <<
endl;
108 vectorField oldFaceCentres(srcMesh_.areaCentres());
109 vectorField newFaceCentres(tgtMesh_.areaCentres());
112 distMap_.distributeCellData(oldFaceCentres);
116 if (!
diff.empty() && !
diff.uniform())
118 forAll(oldFaceCentres, facei)
120 if (oldFaceCentres[facei] != newFaceCentres[facei])
122 Pout<<
"face: " << facei
123 <<
' ' << oldFaceCentres[facei]
124 <<
" vs " << newFaceCentres[facei]
142 Pout<<
"distributed edges: " << oldEdgeCentres.size() <<
" from " 143 << srcMesh_.nEdges() <<
" to " << tgtMesh_.nEdges() <<
endl;
146 distMap_.distributeFaceData(oldEdgeCentres);
150 if (!
diff.empty() && !
diff.uniform())
152 forAll(oldEdgeCentres, edgei)
154 if (oldEdgeCentres[edgei] != newEdgeCentres[edgei])
156 Pout<<
"edge: " << edgei
157 <<
' ' << oldEdgeCentres[edgei]
158 <<
" vs " << newEdgeCentres[edgei]
165 forAll(patchEdgeMaps_, patchi)
167 if (patchEdgeMaps_.set(patchi))
169 Pout<<
"patch " << patchi <<
" : " 170 << patchEdgeMaps_[patchi].
info() <<
endl;
176 forAll(patchEdgeMaps_, patchi)
178 if (patchEdgeMaps_.set(patchi))
180 Info<<
"patch " << patchi <<
" : " 181 << patchEdgeMaps_[patchi] <<
endl;
197 const bool isWriteProc
204 writeHandler_(dummyHandler_),
205 isWriteProc_(isWriteProc)
222 dummyHandler_(nullptr),
223 writeHandler_(writeHandler),
224 isWriteProc_(
Switch::INVALID)
240 nTotal += distributeAreaFields<scalar>(objects, selected);
241 nTotal += distributeAreaFields<vector>(objects, selected);
242 nTotal += distributeAreaFields<symmTensor>(objects, selected);
243 nTotal += distributeAreaFields<sphericalTensor>(objects, selected);
244 nTotal += distributeAreaFields<tensor>(objects, selected);
246 nTotal += distributeEdgeFields<scalar>(objects, selected);
247 nTotal += distributeEdgeFields<vector>(objects, selected);
248 nTotal += distributeEdgeFields<symmTensor>(objects, selected);
249 nTotal += distributeEdgeFields<sphericalTensor>(objects, selected);
250 nTotal += distributeEdgeFields<tensor>(objects, selected);
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
faMeshDistributor(const faMeshDistributor &)=delete
No copy construct.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
InfoProxy< IOstream > info() const noexcept
Return info proxy, used to print IOstream information to a stream.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
static int & msgType() noexcept
Message tag of standard messages.
A class for managing references or pointers (no reference counting)
An encapsulation of filesystem-related operations.
#define forAll(list, i)
Loop across all elements in list.
static int verbose_
Output verbosity when writing.
A List of wordRe with additional matching capabilities.
label distributeAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, distribute and write all/selected point field types (scalar, vector, ... types) ...
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const mapDistribute & faceMap() const noexcept
Face distribute map.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.