initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / decompositionAgglomeration / MGridGenGamgAgglomeration / MGridGenGAMGAgglomeration.H
blob2d6548e77a8383756db4d904843aac428dc23389
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::MGridGenGAMGAgglomeration
28 Description
29     Agglomerate using the MGridGen algorithm.
31 SourceFiles
32     MGridGenGAMGAgglomeration.C
33     MGridGenGAMGAgglomerate.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef MGridGenGAMGAgglomeration_H
38 #define MGridGenGAMGAgglomeration_H
40 #include "fvMesh.H"
41 #include "GAMGAgglomeration.H"
43 extern "C"
45 #   include "mgridgen.h"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 class fvMesh;
56 /*---------------------------------------------------------------------------*\
57                            Class MGridGenGAMGAgglomeration Declaration
58 \*---------------------------------------------------------------------------*/
60 class MGridGenGAMGAgglomeration
62     public GAMGAgglomeration
64     // Private data
66         const fvMesh& fvMesh_;
69     // Private Member Functions
71         //- Construct the CSR format addressing
72         void makeCompactCellFaceAddressingAndFaceWeights
73         (
74             const lduAddressing& fineAddressing,
75             List<idxtype>& cellCells,
76             List<idxtype>& cellCellOffsets,
77             const vectorField& Si,
78             List<scalar>& faceWeights
79         );
81         //- Calculate and return agglomeration
82         tmp<labelField> agglomerate
83         (
84             label& nCoarseCells,
85             const label minSize,
86             const label maxSize,
87             const lduAddressing& fineAddressing,
88             const scalarField& V,
89             const vectorField& Sf,
90             const scalarField& Sb
91         );
94         //- Disallow default bitwise copy construct
95         MGridGenGAMGAgglomeration(const MGridGenGAMGAgglomeration&);
97         //- Disallow default bitwise assignment
98         void operator=(const MGridGenGAMGAgglomeration&);
101 public:
103     //- Runtime type information
104     TypeName("MGridGen");
107     // Constructors
109         //- Construct given mesh and controls
110         MGridGenGAMGAgglomeration
111         (
112             const lduMesh& mesh,
113             const dictionary& controlDict
114         );
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 } // End namespace Foam
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 #endif
126 // ************************************************************************* //