35 const label sizeBeforeMapping,
37 const label addressingOffset
40 sizeBeforeMapping_(sizeBeforeMapping),
41 directAddressing_(addressingSlice)
43 forAll(directAddressing_, i)
48 directAddressing_[i] -= addressingOffset;
56 const label nTotalFaces,
63 sizeBeforeMapping_(nTotalFaces),
64 directAddressing_(addressingSlice.size())
66 forAll(directAddressing_, i)
69 label ai = addressingSlice[i];
72 if (ai < neigh.
size())
81 directAddressing_[i] = owner[ai];
86 directAddressing_[i] = neigh[ai];
97 directAddressing_[i] = owner[ai];
106 label sizeBeforeMapping,
110 sizeBeforeMapping_(sizeBeforeMapping),
111 addressing_(addressingSlice.size()),
112 weights_(addressingSlice.size())
119 addressing_[i][0] =
mag(addressingSlice[i]) - 1;
120 weights_[i][0] =
sign(addressingSlice[i]);
127 Foam::faFieldDecomposer::faFieldDecomposer
130 const faMesh& procMesh,
137 edgeAddressing_(edgeAddressing),
138 faceAddressing_(faceAddressing),
139 boundaryAddressing_(boundaryAddressing),
141 patchFieldDecomposerPtrs_(),
142 processorAreaPatchFieldDecomposerPtrs_(),
143 processorEdgePatchFieldDecomposerPtrs_()
147 Foam::faFieldDecomposer::faFieldDecomposer
149 const faMesh& completeMesh,
169 Foam::faFieldDecomposer::faFieldDecomposer
171 const label nTotalFaces,
191 reset(nTotalFaces, boundaryRanges, edgeOwner, edgeNeigbour);
199 return patchFieldDecomposerPtrs_.empty();
205 patchFieldDecomposerPtrs_.clear();
206 processorAreaPatchFieldDecomposerPtrs_.clear();
207 processorEdgePatchFieldDecomposerPtrs_.clear();
213 const label nTotalFaces,
220 const label nMappers = procMesh_.boundary().size();
221 patchFieldDecomposerPtrs_.resize(nMappers);
222 processorAreaPatchFieldDecomposerPtrs_.resize(nMappers);
223 processorEdgePatchFieldDecomposerPtrs_.resize(nMappers);
225 forAll(boundaryAddressing_, patchi)
227 const label oldPatchi = boundaryAddressing_[patchi];
228 const faPatch& fap = procMesh_.boundary()[patchi];
233 patchFieldDecomposerPtrs_.set
236 new patchFieldDecomposer
238 boundaryRanges[oldPatchi].size(),
240 boundaryRanges[oldPatchi].start()
249 bitSet flipMap(localPatchSlice.size());
252 const label ownFacei = faceAddressing_[fap.
edgeFaces()[i]];
253 flipMap[i] = (edgeOwner[localPatchSlice[i]] != ownFacei);
256 processorAreaPatchFieldDecomposerPtrs_.set
259 new processorAreaPatchFieldDecomposer
269 processorEdgePatchFieldDecomposerPtrs_.set
272 new processorEdgePatchFieldDecomposer
274 procMesh_.boundary()[patchi].size(),
286 const label nMappers = procMesh_.boundary().size();
287 patchFieldDecomposerPtrs_.resize(nMappers);
288 processorAreaPatchFieldDecomposerPtrs_.resize(nMappers);
289 processorEdgePatchFieldDecomposerPtrs_.resize(nMappers);
299 completeMesh.boundary().patchStarts()
302 forAll(boundaryAddressing_, patchi)
304 const label oldPatchi = boundaryAddressing_[patchi];
305 const faPatch& fap = procMesh_.boundary()[patchi];
306 const labelSubList localPatchSlice(fap.patchSlice(edgeAddressing_));
310 patchFieldDecomposerPtrs_.set
313 new patchFieldDecomposer
315 completeMesh.boundary()[oldPatchi].size(),
317 completePatchStarts[oldPatchi]
323 const auto& edgeOwner = completeMesh.edgeOwner();
324 const auto& edgeNeighbour = completeMesh.edgeNeighbour();
329 bitSet flipMap(localPatchSlice.size());
332 const label ownFacei = faceAddressing_[fap.edgeFaces()[i]];
333 flipMap[i] = (edgeOwner[localPatchSlice[i]] != ownFacei);
336 processorAreaPatchFieldDecomposerPtrs_.set
339 new processorAreaPatchFieldDecomposer
341 completeMesh.nFaces(),
349 processorEdgePatchFieldDecomposerPtrs_.set
352 new processorEdgePatchFieldDecomposer
354 procMesh_.boundary()[patchi].size(),
SubList< label > labelSubList
A SubList of labels.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
dimensionedScalar sign(const dimensionedScalar &ds)
const List< T >::subList patchSlice(const List< T > &values) const
This patch slice from the complete list of values, which has size mesh::nEdges(), using the virtual p...
void size(const label n)
Older name for setAddressableSize.
Finite Area area and edge field decomposer.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void resize(const label len)
Adjust allocated size of list.
processorEdgePatchFieldDecomposer(label sizeBeforeMapping, const labelUList &addressingSlice)
Construct given addressing.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
processorAreaPatchFieldDecomposer(const label nTotalFaces, const labelUList &edgeOwner, const labelUList &edgeNeigbour, const labelUList &addressingSlice, const bitSet &flip)
Construct addressing from details.
A List obtained as a section of another List.
void reset(const faMesh &completeMesh)
Reset mappers using information from the complete mesh.
patchFieldDecomposer(const label sizeBeforeMapping, const labelUList &addressingSlice, const label addressingOffset)
Construct given addressing.
const labelUList & edgeFaces() const
Return edge-face addressing.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
void clear()
Remove all mappers.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bool empty() const
True if no mappers have been allocated.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
List< label > labelList
A List of labels.