The open source CFD toolbox
procLduMatrix.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 OpenFOAM Foundation
9-------------------------------------------------------------------------------
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
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 "procLduMatrix.H"
29#include "procLduInterface.H"
30#include "lduMatrix.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
35(
36 const lduMatrix& ldum,
37 const FieldField<Field, scalar>& interfaceCoeffs,
38 const lduInterfaceFieldPtrsList& interfaces
39)
40:
43 diag_(ldum.diag()),
44 upper_(ldum.upper()),
45 lower_(ldum.lower())
46{
47 label nInterfaces = 0;
48
49 forAll(interfaces, i)
50 {
51 if (interfaces.set(i))
52 {
53 nInterfaces++;
54 }
55 }
56
57 interfaces_.setSize(nInterfaces);
58
59 nInterfaces = 0;
60
61 forAll(interfaces, i)
62 {
63 if (interfaces.set(i))
64 {
65 interfaces_.set
66 (
67 nInterfaces++,
69 (
70 interfaces[i],
71 interfaceCoeffs[i]
72 )
73 );
74 }
75 }
76
77}
78
79
81:
84 diag_(is),
85 upper_(is),
86 lower_(is),
87 interfaces_(is)
88{}
89
90
91// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
92
94{
97 << cldum.diag_
98 << cldum.upper_
99 << cldum.lower_
100 << cldum.interfaces_;
101
102 return os;
103}
104
105
106// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
const T * set(const label i) const
Definition: UPtrList.H:248
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:84
IO interface for processorLduInterface.
I/O for lduMatrix and interface values.
Definition: procLduMatrix.H:64
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333