procFacesGAMGProcAgglomeration.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) 2013 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::procFacesGAMGProcAgglomeration
28 
29 Description
30  Processor agglomeration of GAMGAgglomerations. Needs nAgglomeratingCells
31  which is when to start agglomerating processors. Processors get agglomerated
32  by constructing a single cell mesh for each processor with each
33  processor interface a face. This then gets agglomerated using
34  the pairGAMGAgglomeration algorithm with the number of faces
35  on the original processor interface as face weight.
36 
37 SourceFiles
38  procFacesGAMGProcAgglomeration.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef procFacesGAMGProcAgglomeration_H
43 #define procFacesGAMGProcAgglomeration_H
44 
45 #include "GAMGProcAgglomeration.H"
46 #include "DynamicList.H"
47 #include "labelField.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 class GAMGAgglomeration;
55 class lduMesh;
56 class lduPrimitiveMesh;
57 
58 /*---------------------------------------------------------------------------*\
59  Class procFacesGAMGProcAgglomeration Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
65 {
66  // Private data
67 
68  //- When to processor agglomerate
69  const label nAgglomeratingCells_;
70 
71  //- Allocated communicators
72  DynamicList<label> comms_;
73 
74  // Private Member Functions
75 
76  //- Return (on master) all single-cell meshes collected. single-cell
77  // meshes are just one cell with all proc faces intact.
78  autoPtr<lduPrimitiveMesh> singleCellMesh
79  (
80  const label singleCellMeshComm,
81  const lduMesh& mesh,
82  scalarField& faceWeights
83  ) const;
84 
85  //- Construct processor agglomeration: for every processor the
86  // coarse processor-cluster it agglomerates onto
87  tmp<labelField> processorAgglomeration(const lduMesh&) const;
88 
89  //- Do we need to agglomerate across processors?
90  bool doProcessorAgglomeration(const lduMesh&) const;
91 
92  //- No copy construct
94  (
96  ) = delete;
97 
98  //- No copy assignment
99  void operator=(const procFacesGAMGProcAgglomeration&) = delete;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("procFaces");
106 
107 
108  // Constructors
109 
110  //- Construct given agglomerator and controls
112  (
113  GAMGAgglomeration& agglom,
114  const dictionary& controlDict
115  );
116 
117 
118  //- Destructor
120 
121 
122  // Member Functions
123 
124  //- Modify agglomeration. Return true if modified
125  virtual bool agglomerate();
126 
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
GAMGProcAgglomeration.H
Foam::procFacesGAMGProcAgglomeration::TypeName
TypeName("procFaces")
Runtime type information.
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::DynamicList< label >
Foam::procFacesGAMGProcAgglomeration
Processor agglomeration of GAMGAgglomerations. Needs nAgglomeratingCells which is when to start agglo...
Definition: procFacesGAMGProcAgglomeration.H:61
Foam::Field< scalar >
controlDict
runTime controlDict().readEntry("adjustTimeStep"
Definition: debug.C:143
Foam::procFacesGAMGProcAgglomeration::agglomerate
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
Definition: procFacesGAMGProcAgglomeration.C:248
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::procFacesGAMGProcAgglomeration::~procFacesGAMGProcAgglomeration
virtual ~procFacesGAMGProcAgglomeration()
Destructor.
Definition: procFacesGAMGProcAgglomeration.C:234
DynamicList.H
Foam::GAMGProcAgglomeration
Processor agglomeration of GAMGAgglomerations.
Definition: GAMGProcAgglomeration.H:54
labelField.H
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62