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 lduMesh_H
37 #define 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 class objectRegistry;
50 
51 
52 // Forward declaration of friend functions and operators
53 
54 class lduMesh;
55 
56 Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class lduMesh Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class lduMesh
64 {
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("lduMesh");
70 
71 
72  // Constructors
73 
74  //- Destructor
75  virtual ~lduMesh() = default;
76 
77 
78  // Member Functions
79 
80  // Access
81 
82  //- Return true if thisDb() is a valid DB
83  virtual bool hasDb() const = 0;
84 
85  //- Return the object registry
86  virtual const objectRegistry& thisDb() const;
87 
88  //- Return ldu addressing
89  virtual const lduAddressing& lduAddr() const = 0;
90 
91  //- Return a list of pointers for each patch
92  //- with only those pointing to interfaces being set
93  virtual lduInterfacePtrsList interfaces() const = 0;
94 
95  //- Return communicator used for parallel communication
96  virtual label comm() const = 0;
97 
98  //- Helper: reduce with current communicator
99  template<class T, class BinaryOp>
100  void reduce
101  (
102  T& Value,
103  const BinaryOp& bop
104  ) const;
105 
106 
107  // Info
108 
109  //- Return info proxy.
110  // Used to print mesh information to a stream
111  InfoProxy<lduMesh> info() const
112  {
113  return *this;
114  }
115 
116 
117  // Ostream operator
118 
119  friend Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "lduMeshTemplates.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::lduMesh::operator<<
friend Ostream & operator<<(Ostream &, const InfoProxy< lduMesh > &)
Foam::lduMesh::~lduMesh
virtual ~lduMesh()=default
Destructor.
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:47
typeInfo.H
InfoProxy.H
lduInterfacePtrsList.H
Foam::lduMesh::interfaces
virtual lduInterfacePtrsList interfaces() const =0
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::lduMesh::thisDb
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:42
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::UPtrList< const lduInterface >
Foam::lduMesh::hasDb
virtual bool hasDb() const =0
Return true if thisDb() is a valid DB.
lduAddressing.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lduMesh::info
InfoProxy< lduMesh > info() const
Return info proxy.
Definition: lduMesh.H:110
Foam::lduMesh::TypeName
TypeName("lduMesh")
Runtime type information.
Foam::lduMesh::reduce
void reduce(T &Value, const BinaryOp &bop) const
Helper: reduce with current communicator.
Definition: lduMeshTemplates.C:34
Foam::lduMesh::comm
virtual label comm() const =0
Return communicator used for parallel communication.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::lduMesh::lduAddr
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62
lduMeshTemplates.C