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 addressing_(addressingSlice.size()),
65 weights_(addressingSlice.size())
70 label ai = addressingSlice[i];
73 if (ai < neigh.
size())
81 addressing_[i][0] = owner[ai];
82 addressing_[i][1] = neigh[ai];
88 weights_[i][1] = 1.0 -
weights[ai];
108 addressing_[i][0] = owner[ai];
110 weights_[i][0] = 1.0;
123 processorAreaPatchFieldDecomposer
127 mesh.edgeNeighbour(),
131 ?
mesh.weights().primitiveField()
141 label sizeBeforeMapping,
145 sizeBeforeMapping_(sizeBeforeMapping),
146 addressing_(addressingSlice.size()),
147 weights_(addressingSlice.size())
154 addressing_[i][0] =
mag(addressingSlice[i]) - 1;
155 weights_[i][0] =
sign(addressingSlice[i]);
162 Foam::faFieldDecomposer::faFieldDecomposer
165 const faMesh& procMesh,
172 edgeAddressing_(edgeAddressing),
173 faceAddressing_(faceAddressing),
174 boundaryAddressing_(boundaryAddressing),
176 patchFieldDecomposerPtrs_(),
177 processorAreaPatchFieldDecomposerPtrs_(),
178 processorEdgePatchFieldDecomposerPtrs_()
182 Foam::faFieldDecomposer::faFieldDecomposer
184 const faMesh& completeMesh,
204 Foam::faFieldDecomposer::faFieldDecomposer
206 const label nTotalFaces,
226 reset(nTotalFaces, boundaryRanges, edgeOwner, edgeNeigbour);
234 return patchFieldDecomposerPtrs_.empty();
240 patchFieldDecomposerPtrs_.clear();
241 processorAreaPatchFieldDecomposerPtrs_.clear();
242 processorEdgePatchFieldDecomposerPtrs_.clear();
248 const label nTotalFaces,
255 const label nMappers = procMesh_.boundary().size();
257 patchFieldDecomposerPtrs_.resize(nMappers);
258 processorAreaPatchFieldDecomposerPtrs_.resize(nMappers);
259 processorEdgePatchFieldDecomposerPtrs_.resize(nMappers);
261 forAll(boundaryAddressing_, patchi)
263 const label oldPatchi = boundaryAddressing_[patchi];
264 const faPatch& fap = procMesh_.boundary()[patchi];
269 patchFieldDecomposerPtrs_.set
272 new patchFieldDecomposer
274 boundaryRanges[oldPatchi].size(),
276 boundaryRanges[oldPatchi].start()
282 processorAreaPatchFieldDecomposerPtrs_.set
285 new processorAreaPatchFieldDecomposer
294 processorEdgePatchFieldDecomposerPtrs_.set
297 new processorEdgePatchFieldDecomposer
299 procMesh_.boundary()[patchi].size(),
311 const label nMappers = procMesh_.boundary().size();
312 patchFieldDecomposerPtrs_.resize(nMappers);
313 processorAreaPatchFieldDecomposerPtrs_.resize(nMappers);
314 processorEdgePatchFieldDecomposerPtrs_.resize(nMappers);
324 completeMesh.boundary().patchStarts()
327 forAll(boundaryAddressing_, patchi)
329 const label oldPatchi = boundaryAddressing_[patchi];
330 const faPatch& fap = procMesh_.boundary()[patchi];
331 const labelSubList localPatchSlice(fap.patchSlice(edgeAddressing_));
335 patchFieldDecomposerPtrs_.set
338 new patchFieldDecomposer
340 completeMesh.boundary()[oldPatchi].size(),
342 completePatchStarts[oldPatchi]
348 processorAreaPatchFieldDecomposerPtrs_.set
351 new processorAreaPatchFieldDecomposer
358 processorEdgePatchFieldDecomposerPtrs_.set
361 new processorEdgePatchFieldDecomposer
363 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.
A List obtained as a section of another List.
void reset(const faMesh &completeMesh)
Reset mappers using information from the complete mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
patchFieldDecomposer(const label sizeBeforeMapping, const labelUList &addressingSlice, const label addressingOffset)
Construct given addressing.
const scalarListList & weights() const
Return the interpolation weights.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
void clear()
Remove all mappers.
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.
processorAreaPatchFieldDecomposer(const label nTotalFaces, const labelUList &edgeOwner, const labelUList &edgeNeigbour, const labelUList &addressingSlice, const scalarField &edgeWeights=scalarField::null())
Construct addressing from details.