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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::MGridGenGAMGAgglomeration
28
29Description
30 Agglomerate using the MGridGen algorithm.
31
32SourceFiles
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
44extern "C"
45{
46 #include "mgridgen.h"
47}
48
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55class fvMesh;
56
57/*---------------------------------------------------------------------------*\
58 Class MGridGenGAMGAgglomeration Declaration
59\*---------------------------------------------------------------------------*/
62:
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
125public:
126
127 //- Runtime type information
128 TypeName("MGridGen");
129
130
131 // Constructors
132
133 //- Construct given mesh and controls
135 (
136 const lduMesh& mesh,
138 );
139};
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace Foam
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#endif
149
150// ************************************************************************* //
Geometric agglomerated algebraic multigrid agglomeration class.
Agglomerate using the MGridGen algorithm.
TypeName("MGridGen")
Runtime type information.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:63
A class for managing temporary objects.
Definition: tmp.H:65
runTime controlDict().readEntry("adjustTimeStep"
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73