dummyAgglomeration.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013 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 {
33  defineTypeNameAndDebug(dummyAgglomeration, 0);
34 
36  (
37  GAMGAgglomeration,
38  dummyAgglomeration,
39  lduMesh
40  );
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
46 Foam::dummyAgglomeration::dummyAgglomeration
47 (
48  const lduMesh& mesh,
49  const dictionary& controlDict
50 )
51 :
52  GAMGAgglomeration(mesh, controlDict),
53  nLevels_(readLabel(controlDict.lookup("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;
65  restrictAddressing_.set
66  (
67  nCreatedLevels,
68  new labelField(identity(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 // ************************************************************************* //
Field< label > labelField
Specialisation of Field<T> for label.
Definition: labelField.H:49
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
Macros for easy insertion into run-time selection tables.
label size() const
Return number of equations.
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
label readLabel(Istream &is)
Definition: label.H:64
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Geometric agglomerated algebraic multigrid agglomeration class.
Namespace for OpenFOAM.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:451