lduMesh.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) 2011-2018 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::lduMesh
26 
27 Description
28  Abstract base class for meshes which provide LDU addressing for the
29  construction of lduMatrix and LDU-solvers.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef lduMesh_H
34 #define lduMesh_H
35 
36 #include "lduAddressing.H"
37 #include "lduInterfacePtrsList.H"
38 #include "typeInfo.H"
39 #include "InfoProxy.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class objectRegistry;
47 
48 
49 // Forward declaration of friend functions and operators
50 
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 
63 public:
64 
65  //- Runtime type information
66  TypeName("lduMesh");
67 
68 
69  // Constructors
70 
71  //- Destructor
72  virtual ~lduMesh()
73  {}
74 
75 
76  // Member Functions
77 
78  // Access
79 
80  //- Return the object registry
81  virtual const objectRegistry& thisDb() const;
82 
83  //- Return ldu addressing
84  virtual const lduAddressing& lduAddr() const = 0;
85 
86  //- Return a list of pointers for each patch
87  // with only those pointing to interfaces being set
88  virtual lduInterfacePtrsList interfaces() const = 0;
89 
90  //- Return communicator used for parallel communication
91  virtual label comm() const = 0;
92 
93  //- Helper: reduce with current communicator
94  template<class T, class BinaryOp>
95  void reduce
96  (
97  T& Value,
98  const BinaryOp& bop
99  ) const;
100 
101 
102  // Info
103 
104  //- Return info proxy.
105  // Used to print mesh information to a stream
106  InfoProxy<lduMesh> info() const
107  {
108  return *this;
109  }
110 
111 
112  // Ostream operator
113 
114  friend Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #ifdef NoRepository
125  #include "lduMeshTemplates.C"
126 #endif
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch.
InfoProxy< lduMesh > info() const
Return info proxy.
Definition: lduMesh.H:105
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
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
virtual label comm() const =0
Return communicator used for parallel communication.
TypeName("lduMesh")
Runtime type information.
virtual ~lduMesh()
Destructor.
Definition: lduMesh.H:71
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:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:45
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:40
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.