lduMesh.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::lduMesh
29 
30 Description
31  Abstract base class for meshes which provide LDU addressing for the
32  construction of lduMatrix and LDU-solvers.
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef Foam_lduMesh_H
37 #define Foam_lduMesh_H
38 
39 #include "lduAddressing.H"
40 #include "lduInterfacePtrsList.H"
41 #include "typeInfo.H"
42 #include "InfoProxy.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward Declarations
50 class objectRegistry;
51 class lduMesh;
52 
53 Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
54 
55 
56 /*---------------------------------------------------------------------------*\
57  Class lduMesh Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class lduMesh
61 {
62 public:
63 
64  //- Runtime type information
65  TypeName("lduMesh");
66 
67 
68  //- Destructor
69  virtual ~lduMesh() = default;
70 
71 
72  // Member Functions
73 
74  // Access
75 
76  //- Return true if thisDb() is a valid DB
77  virtual bool hasDb() const = 0;
78 
79  //- Return the object registry
80  virtual const objectRegistry& thisDb() const;
81 
82  //- Return ldu addressing
83  virtual const lduAddressing& lduAddr() const = 0;
84 
85  //- Return a list of pointers for each patch
86  //- with only those pointing to interfaces being set
87  virtual lduInterfacePtrsList interfaces() const = 0;
88 
89  //- Return communicator used for parallel communication
90  virtual label comm() const = 0;
91 
92  //- Helper: reduce with current communicator
93  template<class T, class BinaryOp>
94  void reduce
95  (
96  T& Value,
97  const BinaryOp& bop
98  ) const;
99 
100 
101  // Info
102 
103  //- Return info proxy,
104  //- used to print mesh information to a stream
105  InfoProxy<lduMesh> info() const noexcept { return *this; }
106 
107 
108  // Ostream Operator
109 
110  friend Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #ifdef NoRepository
121  #include "lduMeshTemplates.C"
122 #endif
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch with only those pointing to interfaces being set...
virtual ~lduMesh()=default
Destructor.
InfoProxy< lduMesh > info() const noexcept
Return info proxy, used to print mesh information to a stream.
Definition: lduMesh.H:116
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:53
virtual label comm() const =0
Return communicator used for parallel communication.
TypeName("lduMesh")
Runtime type information.
virtual bool hasDb() const =0
Return true if thisDb() is a valid DB.
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const direction noexcept
Definition: Scalar.H:258
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A helper class for outputting values to Ostream.
Definition: ensightCells.H:43
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:35
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Registry of regIOobjects.
void reduce(T &Value, const BinaryOp &bop) const
Helper: reduce with current communicator.
Namespace for OpenFOAM.