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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::MGridGenGAMGAgglomeration
28 
29 Description
30  Agglomerate using the MGridGen algorithm.
31 
32 SourceFiles
33  MGridGenGAMGAgglomeration.C
34  MGridGenGAMGAgglomerate.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef MGridGenGAMGAgglomeration_H
39 #define MGridGenGAMGAgglomeration_H
40 
41 #include "fvMesh.H"
42 #include "GAMGAgglomeration.H"
43 
44 extern "C"
45 {
46  #include "mgridgen.h"
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 class fvMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class MGridGenGAMGAgglomeration Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 :
63  public GAMGAgglomeration
64 {
65  // Private data
66 
67  const fvMesh& fvMesh_;
68 
69 
70  // Private Member Functions
71 
72  void swap
73  (
74  const lduInterfacePtrsList& interfaces,
75  const labelUList& cellValues,
76  PtrList<labelList>& nbrValues
77  ) const;
78 
79  void getNbrAgglom
80  (
81  const lduAddressing& addr,
82  const lduInterfacePtrsList& interfaces,
83  const PtrList<labelList>& nbrGlobalAgglom,
84  labelList& cellToNbrAgglom
85  ) const;
86 
87  void detectSharedFaces
88  (
89  const lduMesh& mesh,
90  const labelList& value,
91  labelHashSet& sharedFaces
92  ) const;
93 
94 
95  //- Construct the CSR format addressing
96  void makeCompactCellFaceAddressingAndFaceWeights
97  (
98  const lduAddressing& fineAddressing,
99  List<idxtype>& cellCells,
100  List<idxtype>& cellCellOffsets,
101  const scalarField& magSi,
102  List<scalar>& faceWeights
103  );
104 
105  //- Calculate and return agglomeration
106  tmp<labelField> agglomerate
107  (
108  label& nCoarseCells,
109  const label minSize,
110  const label maxSize,
111  const lduAddressing& fineAddressing,
112  const scalarField& V,
113  const scalarField& magSf,
114  const scalarField& magSb
115  );
116 
117 
118  //- No copy construct
120 
121  //- No copy assignment
122  void operator=(const MGridGenGAMGAgglomeration&) = delete;
123 
124 
125 public:
126 
127  //- Runtime type information
128  TypeName("MGridGen");
129 
130 
131  // Constructors
132 
133  //- Construct given mesh and controls
135  (
136  const lduMesh& mesh,
137  const dictionary& controlDict
138  );
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::GAMGAgglomeration
Geometric agglomerated algebraic multigrid agglomeration class.
Definition: GAMGAgglomeration.H:64
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::MGridGenGAMGAgglomeration
Agglomerate using the MGridGen algorithm.
Definition: MGridGenGAMGAgglomeration.H:60
GAMGAgglomeration.H
Foam::HashSet< label, Hash< label > >
Foam::Field< scalar >
Foam::MGridGenGAMGAgglomeration::TypeName
TypeName("MGridGen")
Runtime type information.
Foam::MeshObject< lduMesh, GeometricMeshObject, GAMGAgglomeration >::mesh
const lduMesh & mesh() const
Definition: MeshObject.H:122
controlDict
runTime controlDict().readEntry("adjustTimeStep"
Definition: debug.C:143
Foam::UPtrList< const lduInterface >
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::UList< label >
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62