Loading...
Searching...
No Matches
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"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
37}
38
39
40// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
41
43{
46}
47
48
49// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
50
51Foam::Ostream& Foam::operator<<
52(
53 Ostream& os,
54 const InfoProxy<lduMesh>& iproxy
55)
56{
57 const auto& ldum = *iproxy;
58 const lduAddressing& addr = ldum.lduAddr();
59 const lduInterfacePtrsList interfaces = ldum.interfaces();
60
61 os << "lduMesh :"
62 << " size:" << addr.size()
63 << " l:" << addr.lowerAddr().size()
64 << " u:" << addr.upperAddr().size()
65 << " interfaces:" << interfaces.size()
66 << " comm:" << ldum.comm()
67 << endl;
68
69 label nCouples = 0;
70 forAll(interfaces, i)
71 {
72 if (interfaces.set(i))
73 {
74 const labelUList& faceCells = addr.patchAddr(i);
75 nCouples += faceCells.size();
76
77 if (isA<processorLduInterface>(interfaces[i]))
78 {
79 const processorLduInterface& pi = refCast
80 <
81 const processorLduInterface
82 >(interfaces[i]);
83
84 os << " patch:" << i
85 << " type:" << interfaces[i].type()
86 << " size:" << faceCells.size()
87 << " myProcNo:" << pi.myProcNo()
88 << " neighbProcNo:" << pi.neighbProcNo()
89 << " comm:" << pi.comm()
90 << endl;
91 }
92 else
93 {
94 os << " patch:" << i
95 << " type:" << interfaces[i].type()
96 << " size:" << faceCells.size()
97 << endl;
98 }
99 }
100 }
101 os << " Interface faces/cells:" << scalar(nCouples)/addr.size()
102 << endl;
103
104
105 // Print actual contents
106 if (lduMesh::debug)
107 {
108 const labelUList& l = addr.lowerAddr();
109 const labelUList& u = addr.upperAddr();
110 forAll(l, facei)
111 {
112 os << " face:" << facei << " l:" << l[facei]
113 << " u:" << u[facei] << endl;
114 }
115 forAll(interfaces, i)
116 {
117 if (interfaces.set(i))
118 {
119 const labelUList& faceCells = addr.patchAddr(i);
120 if (faceCells.size())
121 {
122 os << " patch:" << i
123 << " type:" << interfaces[i].type() << endl;
124
125 if (isA<processorLduInterface>(interfaces[i]))
126 {
128 <
130 >(interfaces[i]);
131
132 os << " myProcNo:" << pi.myProcNo()
133 << " neighbProcNo:" << pi.neighbProcNo()
134 << " comm:" << pi.comm()
135 << endl;
136 }
137
138 forAll(faceCells, i)
139 {
140 os << " " << i << " own:" << faceCells[i]
141 << endl;
142 }
143 }
144 }
145 }
146 }
147
149
150 return os;
151}
152
153
154// ************************************************************************* //
constexpr scalar pi(M_PI)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition IOstream.C:45
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
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
Definition UPtrList.H:366
label size() const noexcept
The number of entries in the list.
Definition UPtrListI.H:106
Smooth ATC in cells next to a set of patches supplied by type.
Definition faceCells.H:55
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
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.
label size() const noexcept
Return number of equations.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition lduMesh.H:54
virtual const objectRegistry & thisDb() const
Return the object registry.
Definition lduMesh.C:35
Registry of regIOobjects.
An abstract base class for processor coupled interfaces.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
Definition nullObject.H:228
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299