lduMesh.C
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-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "lduMesh.H"
29#include "objectRegistry.H"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
35{
37}
38
39
40// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
41
43{
45 const objectRegistry* orPtr_ = nullptr;
46 return *orPtr_;
47}
48
49
50// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
51
53{
54 const lduMesh& ldum = ip.t_;
55 const lduAddressing& addr = ldum.lduAddr();
56 const lduInterfacePtrsList interfaces = ldum.interfaces();
57
58 os << "lduMesh :"
59 << " size:" << addr.size()
60 << " l:" << addr.lowerAddr().size()
61 << " u:" << addr.upperAddr().size()
62 << " interfaces:" << interfaces.size()
63 << " comm:" << ldum.comm()
64 << endl;
65 label nCouples = 0;
66 forAll(interfaces, i)
67 {
68 if (interfaces.set(i))
69 {
70 const labelUList& faceCells = addr.patchAddr(i);
71 nCouples += faceCells.size();
72
73 if (isA<processorLduInterface>(interfaces[i]))
74 {
76 <
78 >(interfaces[i]);
79
80 os << " patch:" << i
81 << " type:" << interfaces[i].type()
82 << " size:" << faceCells.size()
83 << " myProcNo:" << pi.myProcNo()
84 << " neighbProcNo:" << pi.neighbProcNo()
85 << " comm:" << pi.comm()
86 << endl;
87 }
88 else
89 {
90 os << " patch:" << i
91 << " type:" << interfaces[i].type()
92 << " size:" << faceCells.size()
93 << endl;
94 }
95 }
96 }
97 os << " Interface faces/cells:" << scalar(nCouples)/addr.size()
98 << endl;
99
100
101 // Print actual contents
102 if (lduMesh::debug)
103 {
104 const labelList& l = addr.lowerAddr();
105 const labelList& u = addr.upperAddr();
106 forAll(l, facei)
107 {
108 os << " face:" << facei << " l:" << l[facei]
109 << " u:" << u[facei] << endl;
110 }
111 forAll(interfaces, i)
112 {
113 if (interfaces.set(i))
114 {
115 const labelUList& faceCells = addr.patchAddr(i);
116 if (faceCells.size())
117 {
118 os << " patch:" << i
119 << " type:" << interfaces[i].type() << endl;
120
121 if (isA<processorLduInterface>(interfaces[i]))
122 {
124 <
126 >(interfaces[i]);
127
128 os << " myProcNo:" << pi.myProcNo()
129 << " neighbProcNo:" << pi.neighbProcNo()
130 << " comm:" << pi.comm()
131 << endl;
132 }
133
134 forAll(faceCells, i)
135 {
136 os << " " << i << " own:" << faceCells[i]
137 << endl;
138 }
139 }
140 }
141 }
142 }
143
145
146 return os;
147}
148
149
150// ************************************************************************* //
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:52
const T & t_
Definition: InfoProxy.H:55
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
const T * set(const label i) const
Definition: UPtrList.H:248
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
label size() const
Return number of equations.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
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.
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition: lduMesh.C:42
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
virtual lduInterfacePtrsList interfaces() const =0
Registry of regIOobjects.
An abstract base class for processor coupled interfaces.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Namespace for OpenFOAM.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333