MGridGenGAMGAgglomeration.H
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) 2011-2016 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 Class
25  Foam::MGridGenGAMGAgglomeration
26 
27 Description
28  Agglomerate using the MGridGen algorithm.
29 
30 SourceFiles
31  MGridGenGAMGAgglomeration.C
32  MGridGenGAMGAgglomerate.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef MGridGenGAMGAgglomeration_H
37 #define MGridGenGAMGAgglomeration_H
38 
39 #include "fvMesh.H"
40 #include "GAMGAgglomeration.H"
41 
42 extern "C"
43 {
44  #include "mgridgen.h"
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class fvMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class MGridGenGAMGAgglomeration Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
61  public GAMGAgglomeration
62 {
63  // Private data
64 
65  const fvMesh& fvMesh_;
66 
67 
68  // Private Member Functions
69 
70  void swap
71  (
72  const lduInterfacePtrsList& interfaces,
73  const labelUList& cellValues,
74  PtrList<labelList>& nbrValues
75  ) const;
76 
77  void getNbrAgglom
78  (
79  const lduAddressing& addr,
80  const lduInterfacePtrsList& interfaces,
81  const PtrList<labelList>& nbrGlobalAgglom,
82  labelList& cellToNbrAgglom
83  ) const;
84 
85  void detectSharedFaces
86  (
87  const lduMesh& mesh,
88  const labelList& value,
89  labelHashSet& sharedFaces
90  ) const;
91 
92 
93  //- Construct the CSR format addressing
94  void makeCompactCellFaceAddressingAndFaceWeights
95  (
96  const lduAddressing& fineAddressing,
97  List<idxtype>& cellCells,
98  List<idxtype>& cellCellOffsets,
99  const scalarField& magSi,
100  List<scalar>& faceWeights
101  );
102 
103  //- Calculate and return agglomeration
104  tmp<labelField> agglomerate
105  (
106  label& nCoarseCells,
107  const label minSize,
108  const label maxSize,
109  const lduAddressing& fineAddressing,
110  const scalarField& V,
111  const scalarField& magSf,
112  const scalarField& magSb
113  );
114 
115 
116  //- Disallow default bitwise copy construct
118 
119  //- Disallow default bitwise assignment
120  void operator=(const MGridGenGAMGAgglomeration&);
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("MGridGen");
127 
128 
129  // Constructors
130 
131  //- Construct given mesh and controls
133  (
134  const lduMesh& mesh,
135  const dictionary& controlDict
136  );
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
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
Agglomerate using the MGridGen algorithm.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:61
TypeName("MGridGen")
Runtime type information.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A class for managing temporary objects.
Definition: PtrList.H:53
Geometric agglomerated algebraic multigrid agglomeration class.
Namespace for OpenFOAM.