procFacesGAMGProcAgglomeration.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::procFacesGAMGProcAgglomeration
26 
27 Description
28  Processor agglomeration of GAMGAgglomerations. Needs nAgglomeratingCells
29  which is when to start agglomerating processors. Processors get agglomerated
30  by constructing a single cell mesh for each processor with each
31  processor interface a face. This then gets agglomerated using
32  the pairGAMGAgglomeration algorithm with the number of faces
33  on the original processor interface as face weight.
34 
35 SourceFiles
36  procFacesGAMGProcAgglomeration.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef procFacesGAMGProcAgglomeration_H
41 #define procFacesGAMGProcAgglomeration_H
42 
43 #include "GAMGProcAgglomeration.H"
44 #include "DynamicList.H"
45 #include "labelField.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class GAMGAgglomeration;
53 class lduMesh;
54 class lduPrimitiveMesh;
55 
56 /*---------------------------------------------------------------------------*\
57  Class procFacesGAMGProcAgglomeration Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
63 {
64  // Private Data
65 
66  //- When to processor agglomerate
67  const label nAgglomeratingCells_;
68 
69  //- Allocated communicators
70  DynamicList<label> comms_;
71 
72  // Private Member Functions
73 
74  //- Return (on master) all single-cell meshes collected. single-cell
75  // meshes are just one cell with all proc faces intact.
76  autoPtr<lduPrimitiveMesh> singleCellMesh
77  (
78  const label singleCellMeshComm,
79  const lduMesh& mesh,
80  scalarField& faceWeights
81  ) const;
82 
83  //- Construct processor agglomeration: for every processor the
84  // coarse processor-cluster it agglomerates onto
85  tmp<labelField> processorAgglomeration(const lduMesh&) const;
86 
87  //- Do we need to agglomerate across processors?
88  bool doProcessorAgglomeration(const lduMesh&) const;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("procFaces");
95 
96 
97  // Constructors
98 
99  //- Construct given agglomerator and controls
101  (
102  GAMGAgglomeration& agglom,
103  const dictionary& controlDict
104  );
105 
106  //- Disallow default bitwise copy construction
108  (
110  );
111 
112 
113  //- Destructor
115 
116 
117  // Member Functions
118 
119  //- Modify agglomeration. Return true if modified
120  virtual bool agglomerate();
121 
122 
123  // Member Operators
124 
125  //- Disallow default bitwise assignment
126  void operator=(const procFacesGAMGProcAgglomeration&) = delete;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void operator=(const procFacesGAMGProcAgglomeration &)=delete
Disallow default bitwise assignment.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
procFacesGAMGProcAgglomeration(GAMGAgglomeration &agglom, const dictionary &controlDict)
Construct given agglomerator and controls.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
Processor agglomeration of GAMGAgglomerations. Needs nAgglomeratingCells which is when to start agglo...
dynamicFvMesh & mesh
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
Processor agglomeration of GAMGAgglomerations.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
TypeName("procFaces")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
Geometric agglomerated algebraic multigrid agglomeration class.
Namespace for OpenFOAM.