Go to the documentation of this file.
44 <<
"Addressing already calculated."
61 label nInsertedCells = 0;
65 if (directAddr[cellI] < 0)
68 directAddr[cellI] = 0;
69 insertedCells[nInsertedCells] = cellI;
74 insertedCells.
setSize(nInsertedCells);
91 const labelList& mo = cfp[cfpI].masterObjects();
93 label cellI = cfp[cfpI].index();
95 if (addr[cellI].
size())
98 <<
"Master cell " << cellI
99 <<
" mapped from point cells " << mo
113 const labelList& mo = cfe[cfeI].masterObjects();
115 label cellI = cfe[cfeI].index();
117 if (addr[cellI].
size())
120 <<
"Master cell " << cellI
121 <<
" mapped from edge cells " << mo
135 const labelList& mo = cff[cffI].masterObjects();
137 label cellI = cff[cffI].index();
139 if (addr[cellI].
size())
142 <<
"Master cell " << cellI
143 <<
" mapped from face cells " << mo
159 const labelList& mo = cfc[cfcI].masterObjects();
161 label cellI = cfc[cfcI].index();
163 if (addr[cellI].
size())
166 <<
"Master cell " << cellI
167 <<
" mapped from cell cells " << mo
168 <<
" already destination of mapping."
185 <<
"cellVolumes size " << V.size()
187 <<
". Are your cellVolumes already mapped?"
188 <<
" (new number of cells " <<
size() <<
")"
194 const labelList& mo = cfc[cfcI].masterObjects();
196 label cellI = cfc[cfcI].index();
198 w[cellI].setSize(mo.
size());
205 w[cellI][ci] = V[mo[ci]];
212 w[cellI][ci] /= sumV;
229 const labelList& mo = cfc[cfcI].masterObjects();
231 label cellI = cfc[cfcI].index();
245 if (cm[cellI] > -1 && addr[cellI].empty())
258 label nInsertedCells = 0;
262 if (addr[cellI].empty())
268 insertedCells[nInsertedCells] = cellI;
273 insertedCells.
setSize(nInsertedCells);
294 insertedCells_(true),
296 directAddrPtr_(NULL),
297 interpolationAddrPtr_(NULL),
299 insertedCellLabelsPtr_(NULL)
335 cm[cfp[cfpI].index()] = 0;
342 cm[cfe[cfeI].index()] = 0;
349 cm[cff[cffI].index()] = 0;
356 cm[cfc[cfcI].index()] = 0;
379 return mpm_.cellMap().size();
385 return mpm_.nOldCells();
394 <<
"Requested direct addressing for an interpolative mapper."
398 if (!insertedObjects())
401 return mpm_.cellMap();
410 return *directAddrPtr_;
420 <<
"Requested interpolative addressing for a direct mapper."
424 if (!interpolationAddrPtr_)
429 return *interpolationAddrPtr_;
438 <<
"Requested interpolative weights for a direct mapper."
453 if (!insertedCellLabelsPtr_)
455 if (!insertedObjects())
458 insertedCellLabelsPtr_ =
new labelList(0);
466 return *insertedCellLabelsPtr_;
List< scalar > scalarList
A List of scalars.
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
void calcAddressing() const
Calculate addressing for mapping with inserted cells.
labelListList * interpolationAddrPtr_
Interpolated addressing (only one for of addressing is used)
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
const mapPolyMesh & mpm_
Reference to mapPolyMesh.
Template functions to aid in the implementation of demand driven data.
virtual const labelUList & directAddressing() const
Return direct addressing.
bool direct_
Is the mapping direct.
const List< objectMap > & cellsFromPointsMap() const
Cells inflated from points.
virtual ~cellMapper()
Destructor.
virtual bool direct() const
Is the mapping direct.
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual const labelListList & addressing() const
Return interpolated addressing.
Pre-declare SubField and related Field type.
labelList * directAddrPtr_
Direct addressing (only one for of addressing is used)
cellMapper(const cellMapper &)
Disallow default bitwise copy construct.
const List< objectMap > & cellsFromEdgesMap() const
Cells inflated from edges.
virtual label sizeBeforeMapping() const
Return size before mapping.
errorManip< error > abort(error &err)
const scalarField & oldCellVolumes() const
virtual const scalarListList & weights() const
Return interpolaion weights.
void setSize(const label)
Reset size of List.
List< labelList > labelListList
A List of labelList.
virtual label size() const
Return size.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
scalarListList * weightsPtr_
Interpolation weights.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clearOut()
Clear out local storage.
bool hasOldCellVolumes() const
const List< objectMap > & cellsFromFacesMap() const
Cells inflated from faces.
const virtual labelList & insertedObjectLabels() const
Return list of inserted cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void size(const label)
Override size to be inconsistent with allocated storage.
List< scalarList > scalarListList
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
bool insertedCells_
Are there any inserted (unmapped) cells.
const labelList & cellMap() const
Old cell map.
const List< objectMap > & cellsFromCellsMap() const
Cells originating from cells.
labelList * insertedCellLabelsPtr_
Inserted cells.
const polyMesh & mesh_
Reference to polyMesh.