dummyAgglomeration.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "dummyAgglomeration.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
34 
36  (
39  lduMesh
40  );
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const lduMesh& mesh,
49  const dictionary& controlDict
50 )
51 :
53  nLevels_(controlDict.lookup<label>("nLevels"))
54 {
55  const label nCoarseCells = mesh.lduAddr().size();
56 
57  for
58  (
59  label nCreatedLevels = 0;
60  nCreatedLevels < nLevels_;
61  nCreatedLevels++
62  )
63  {
64  nCells_[nCreatedLevels] = nCoarseCells;
66  (
67  nCreatedLevels,
68  new labelField(identityMap(nCoarseCells))
69  );
70 
71  agglomerateLduAddressing(nCreatedLevels);
72  }
73 
74  // Shrink the storage of the levels to those created
75  compactLevels(nLevels_);
76 }
77 
78 
79 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Geometric agglomerated algebraic multigrid agglomeration class.
void agglomerateLduAddressing(const label fineLevelIndex)
Assemble coarse mesh addressing.
void compactLevels(const label nCreatedLevels)
Shrink the number of levels to that specified.
labelList nCells_
The number of cells in each level.
PtrList< labelField > restrictAddressing_
Cell restriction addressing array.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Agglomerate without combining cells. Used for testing.
dummyAgglomeration(const lduMesh &mesh, const dictionary &controlDict)
Construct given mesh and controls.
label size() const
Return number of equations.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:60
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
defineTypeNameAndDebug(combustionModel, 0)
Field< label > labelField
Specialisation of Field<T> for label.
Definition: labelField.H:49
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep