35 void Foam::MGridGenGAMGAgglomeration::
36 makeCompactCellFaceAddressingAndFaceWeights
38 const lduAddressing& fineAddressing,
39 List<idxtype>& cellCells,
40 List<idxtype>& cellCellOffsets,
42 List<scalar>& faceWeights
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);
67 faceWeights.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]++;
90 faceWeights[l1] = magSi[facei];
91 faceWeights[l2] = magSi[facei];
101 const lduAddressing& fineAddressing,
107 const label nFineCells = fineAddressing.size();
110 List<idxtype> cellCells;
111 List<idxtype> cellCellOffsets;
114 List<scalar> faceWeights;
117 makeCompactCellFaceAddressingAndFaceWeights
127 List<int> options(4, 0);
135 List<int> finalAgglom(nFineCells);
141 cellCellOffsets.begin(),
142 const_cast<scalar*
>(V.begin()),
143 const_cast<scalar*>(magSb.begin()),
155 label nNewCoarseCells = 0;
168 nCoarseCells = nNewCoarseCells;
169 finalAgglom.transfer(newRestrictAddr);
173 return tmp<labelField>(
new labelField(finalAgglom));
Field< label > labelField
Specialisation of Field<T> for label.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void MGridGen(int, int *, Foam::scalar *, Foam::scalar *, int *, Foam::scalar *, int, int, int *, int *, int *, int *)
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
static bool checkRestriction(labelList &newRestrict, label &nNewCoarse, const lduAddressing &fineAddressing, const labelUList &restrict, const label nCoarse)
Given restriction determines if coarse cells are connected.
UList< label > labelUList
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
volScalarField scalarField(fieldObject, mesh)
A class for managing temporary objects.