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 | Copyright (C) 2011-2014 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  Class lduMesh Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class lduMesh
53 {
54 
55 public:
56 
57  //- Runtime type information
58  TypeName("lduMesh");
59 
60 
61  // Constructors
62 
63  //- Destructor
64  virtual ~lduMesh()
65  {}
66 
67 
68  // Member Functions
69 
70  // Access
71 
72  //- Return the object registry
73  virtual const objectRegistry& thisDb() const;
74 
75  //- Return ldu addressing
76  virtual const lduAddressing& lduAddr() const = 0;
77 
78  //- Return a list of pointers for each patch
79  // with only those pointing to interfaces being set
80  virtual lduInterfacePtrsList interfaces() const = 0;
81 
82  //- Return communicator used for parallel communication
83  virtual label comm() const = 0;
84 
85  //- Helper: reduce with current communicator
86  template<class T, class BinaryOp>
87  void reduce
88  (
89  T& Value,
90  const BinaryOp& bop
91  ) const;
92 
93  // Info
94 
95  //- Return info proxy.
96  // Used to print mesh information to a stream
97  InfoProxy<lduMesh> info() const
98  {
99  return *this;
100  }
101 
102  // Ostream operator
103 
104  friend Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace Foam
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #ifdef NoRepository
115 # include "lduMeshTemplates.C"
116 #endif
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
void reduce(T &Value, const BinaryOp &bop) const
Helper: reduce with current communicator.
virtual label comm() const =0
Return communicator used for parallel communication.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch.
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:51
InfoProxy< lduMesh > info() const
Return info proxy.
Definition: lduMesh.H:96
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:40
Namespace for OpenFOAM.
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:45
virtual ~lduMesh()
Destructor.
Definition: lduMesh.H:63
TypeName("lduMesh")
Runtime type information.
Registry of regIOobjects.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
The class contains the addressing required by the lduMatrix: upper, lower and losort.