35 void Foam::MGridGenGAMGAgglomeration::
36 makeCompactCellFaceAddressingAndFaceWeights
38 const lduAddressing& fineAddressing,
39 List<idxtype>& cellCells,
40 List<idxtype>& cellCellOffsets,
45 const label nFineCells = fineAddressing.size();
46 const label nFineFaces = fineAddressing.upperAddr().size();
48 const labelUList& upperAddr = fineAddressing.upperAddr();
49 const labelUList& lowerAddr = fineAddressing.lowerAddr();
56 nNbrs[upperAddr[facei]]++;
61 nNbrs[lowerAddr[facei]]++;
65 cellCellOffsets.setSize(nFineCells + 1);
66 cellCells.setSize(2*nFineFaces);
70 cellCellOffsets[0] = 0;
73 cellCellOffsets[celli+1] = cellCellOffsets[celli] + nNbrs[celli];
81 label own = upperAddr[facei];
82 label nei = lowerAddr[facei];
84 label l1 = cellCellOffsets[own] + nNbrs[own]++;
85 label l2 = cellCellOffsets[nei] + nNbrs[nei]++;
101 const lduAddressing& fineAddressing,
107 const label nFineCells = fineAddressing.size();
110 List<idxtype> cellCells;
111 List<idxtype> cellCellOffsets;
117 makeCompactCellFaceAddressingAndFaceWeights
127 List<int> options(4, 0);
131 options[3] = fvMesh_.nGeometricD();
135 List<int> finalAgglom(nFineCells);
141 cellCellOffsets.begin(),
142 const_cast<scalar*
>(V.begin()),
143 const_cast<scalar*
>(magSb.begin()),
155 label nNewCoarseCells = 0;
157 bool ok = checkRestriction
168 nCoarseCells = nNewCoarseCells;
169 finalAgglom.transfer(newRestrictAddr);
173 return tmp<labelField>(
new labelField(finalAgglom));
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
void MGridGen(int, int *, Foam::scalar *, Foam::scalar *, int *, Foam::scalar *, int, int, int *, int *, int *, int *)
volScalarField scalarField(fieldObject, mesh)
tmp< scalarField > faceWeights(const polyMesh &mesh, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs)
Generate interpolation factors field.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< label > labelField
Specialisation of Field<T> for label.
UList< label > labelUList