Loading...
Searching...
No Matches
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 Foam_lduMesh_H
37#define Foam_lduMesh_H
38
39#include "lduAddressing.H"
41#include "typeInfo.H"
42#include "InfoProxy.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49// Forward Declarations
50class objectRegistry;
51class lduMesh;
52
54
55
56/*---------------------------------------------------------------------------*\
57 Class lduMesh Declaration
58\*---------------------------------------------------------------------------*/
59
61{
62public:
63
64 //- Runtime type information
65 TypeName("lduMesh");
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(T& val, BinaryOp bop) const
95 {
96 Foam::reduce(val, bop, UPstream::msgType(), comm());
97 }
98
99
100 // Info
101
102 //- Return info proxy,
103 //- used to print mesh information to a stream
104 InfoProxy<lduMesh> info() const noexcept { return *this; }
105
106
107 // Ostream Operator
108
110};
111
112
113// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114
115} // End namespace Foam
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121#endif
122
123// ************************************************************************* //
A helper class for outputting values to Ostream.
Definition InfoProxy.H:49
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
static int & msgType() noexcept
Message tag of standard messages.
Definition UPstream.H:1926
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:54
virtual label comm() const =0
Return communicator used for parallel communication.
friend Ostream & operator<<(Ostream &, const InfoProxy< lduMesh > &)
TypeName("lduMesh")
Runtime type information.
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:35
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
virtual ~lduMesh()=default
Destructor.
InfoProxy< lduMesh > info() const noexcept
Return info proxy, used to print mesh information to a stream.
Definition lduMesh.H:115
void reduce(T &val, BinaryOp bop) const
Helper: reduce with current communicator.
Definition lduMesh.H:103
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch with only those pointing to interfaces being set.
Registry of regIOobjects.
Namespace for OpenFOAM.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
const direction noexcept
Definition scalarImpl.H:265
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68