Loading...
Searching...
No Matches
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;
57/*---------------------------------------------------------------------------*\
58 Class MGridGenGAMGAgglomeration Declaration
59\*---------------------------------------------------------------------------*/
60
61class MGridGenGAMGAgglomeration
62:
64{
65 // Private data
66
67 const fvMesh& fvMesh_;
68
69 // Min, max size of agglomerated cells
70 const label minSize_;
71 const label maxSize_;
72
73 // Number of iterations applied to improve agglomeration consistency
74 // across processor boundaries
75 label nProcConsistencyIter_;
76
77
78 // Private Member Functions
79
80 void swap
81 (
82 const lduInterfacePtrsList& interfaces,
83 const labelUList& cellValues,
84 PtrList<labelList>& nbrValues
85 ) const;
86
87 void getNbrAgglom
88 (
89 const lduAddressing& addr,
90 const lduInterfacePtrsList& interfaces,
91 const PtrList<labelList>& nbrGlobalAgglom,
92 labelList& cellToNbrAgglom
93 ) const;
94
95 void detectSharedFaces
96 (
97 const lduMesh& mesh,
98 const labelList& value,
99 labelHashSet& sharedFaces
100 ) const;
101
102
103 //- Construct the CSR format addressing
104 void makeCompactCellFaceAddressingAndFaceWeights
105 (
106 const lduAddressing& fineAddressing,
107 List<idxtype>& cellCells,
108 List<idxtype>& cellCellOffsets,
109 const scalarField& magSi,
110 List<scalar>& faceWeights
111 );
112
113 //- Calculate and return agglomeration
114 tmp<labelField> agglomerate
115 (
116 label& nCoarseCells,
117 const label minSize,
118 const label maxSize,
119 const lduAddressing& fineAddressing,
120 const scalarField& V,
121 const scalarField& magSf,
122 const scalarField& magSb
123 );
124
125
126 //- No copy construct
127 MGridGenGAMGAgglomeration(const MGridGenGAMGAgglomeration&) = delete;
128
129 //- No copy assignment
130 void operator=(const MGridGenGAMGAgglomeration&) = delete;
131
132
133public:
134
135 //- Runtime type information
136 TypeName("MGridGen");
137
138
139 // Constructors
140
141 //- Construct given mesh and controls
142 MGridGenGAMGAgglomeration
143 (
144 const lduMesh& mesh,
146 );
147
148 //- Agglomerate from a starting level. Starting level is usually 0
149 //- (initial mesh) but sometimes >0 (restarting after processor
150 //- agglomeration)
151 virtual void agglomerate
152 (
153 const label nCellsInCoarsestLevel,
154 const label startLevel,
155 const scalarField& startFaceWeights,
156 const bool doProcessorAgglomerate = true
157 );
158};
159
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163} // End namespace Foam
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#endif
168
169// ************************************************************************* //
GAMGAgglomeration(const GAMGAgglomeration &)=delete
No copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
TypeName("MGridGen")
Runtime type information.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
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:54
A class for managing temporary objects.
Definition tmp.H:75
runTime controlDict().readEntry("adjustTimeStep"
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68