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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::lduMesh
29
30Description
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"
41#include "typeInfo.H"
42#include "InfoProxy.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49class objectRegistry;
50
51
52// Forward declaration of friend functions and operators
53
54class lduMesh;
55
56Ostream& operator<<(Ostream&, const InfoProxy<lduMesh>&);
57
58
59/*---------------------------------------------------------------------------*\
60 Class lduMesh Declaration
61\*---------------------------------------------------------------------------*/
63class lduMesh
64{
65
66public:
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
112 {
113 return *this;
114 }
115
116
117 // Ostream operator
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// ************************************************************************* //
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:52
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:63
virtual label comm() const =0
Return communicator used for parallel communication.
InfoProxy< lduMesh > info() const
Return info proxy.
Definition: lduMesh.H:110
friend Ostream & operator<<(Ostream &, const InfoProxy< lduMesh > &)
TypeName("lduMesh")
Runtime type information.
void reduce(T &Value, const BinaryOp &bop) const
Helper: reduce with current communicator.
virtual bool hasDb() const =0
Return true if thisDb() is a valid DB.
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:42
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
virtual ~lduMesh()=default
Destructor.
virtual lduInterfacePtrsList interfaces() const =0
Registry of regIOobjects.
const volScalarField & T
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73