37void Foam::MGridGenGAMGAgglomeration::
38makeCompactCellFaceAddressingAndFaceWeights
40 const lduAddressing& fineAddressing,
41 List<idxtype>& cellCells,
42 List<idxtype>& cellCellOffsets,
43 const scalarField& magSi,
44 List<scalar>& faceWeights
47 const label nFineCells = fineAddressing.size();
48 const label nFineFaces = fineAddressing.upperAddr().size();
50 const labelUList& upperAddr = fineAddressing.upperAddr();
51 const labelUList& lowerAddr = fineAddressing.lowerAddr();
58 nNbrs[upperAddr[facei]]++;
63 nNbrs[lowerAddr[facei]]++;
67 cellCellOffsets.setSize(nFineCells + 1);
68 cellCells.setSize(2*nFineFaces);
69 faceWeights.setSize(2*nFineFaces);
72 cellCellOffsets[0] = 0;
75 cellCellOffsets[celli+1] = cellCellOffsets[celli] + nNbrs[celli];
83 label own = upperAddr[facei];
84 label nei = lowerAddr[facei];
86 label l1 = cellCellOffsets[own] + nNbrs[own]++;
87 label l2 = cellCellOffsets[nei] + nNbrs[nei]++;
92 faceWeights[l1] = magSi[facei];
93 faceWeights[l2] = magSi[facei];
103 const lduAddressing& fineAddressing,
109 const label nFineCells = fineAddressing.size();
112 List<idxtype> cellCells;
113 List<idxtype> cellCellOffsets;
116 List<scalar> faceWeights;
119 makeCompactCellFaceAddressingAndFaceWeights
129 List<int> options(4,
Zero);
133 options[3] = fvMesh_.nGeometricD();
137 List<int> finalAgglom(nFineCells);
143 cellCellOffsets.begin(),
144 const_cast<scalar*
>(V.begin()),
145 const_cast<scalar*
>(magSb.begin()),
157 label nNewCoarseCells = 0;
159 bool ok = checkRestriction
170 nCoarseCells = nNewCoarseCells;
171 finalAgglom.transfer(newRestrictAddr);
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A class for managing temporary objects.
void MGridGen(int, int *, Foam::scalar *, Foam::scalar *, int *, Foam::scalar *, int, int, int *, int *, int *, int *)
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static constexpr const zero Zero
Global zero (0)
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.