BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / src / VectorN / finiteVolume / blockMatrixTools / blockMatrixTools.H
blob5377ecc556d25b0e54bb4f90dae2ed2233656c70
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 InNamespace
26     Foam::
28 Description
29     Block matrix insertion and retrieval tools
31 SourceFiles
32     blockMatrixTools.C
34 \*---------------------------------------------------------------------------*/
37 #ifndef blockMatrixTools_H
38 #define blockMatrixTools_H
40 #include "blockLduMatrices.H"
41 #include "fvMatrices.H"
42 #include "surfaceFieldsFwd.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50               Namespace blockMatrixTools functions Declaration
51 \*---------------------------------------------------------------------------*/
53 namespace blockMatrixTools
55     // Field operations
57         //- Insert field into block field
58         template<class BlockType>
59         void blockInsert
60         (
61             const direction dir,
62             const scalarField& x,
63             Field<BlockType>& blockX
64         );
66         //- Add field into block field
67         template<class BlockType>
68         void blockAdd
69         (
70             const direction dir,
71             const scalarField& x,
72             Field<BlockType>& blockX
73         );
75         //- Retrieve field from block field
76         template<class BlockType>
77         void blockRetrieve
78         (
79             const direction dir,
80             scalarField& x,
81             const Field<BlockType>& blockX
82         );
85     // Diagonal block operations
87         //- Insert matrix diagonal and source into the block system
88         template<class BlockType>
89         void insertDiagSource
90         (
91             const direction dir,
92             const fvScalarMatrix& m,
93             BlockLduMatrix<BlockType>& blockM,
94             Field<BlockType>& blockB
95         );
97         // Insert upper and lower coefficients matrix into the block system
98         template<class Type, class BlockType>
99         void insertUpperLower
100         (
101             const direction dir,
102             const fvScalarMatrix& m,
103             BlockLduMatrix<BlockType>& blockM
104         );
106         // Insert matrix into the block system
107         template<class BlockType>
108         void insertEquation
109         (
110             const direction dir,
111             const fvScalarMatrix& m,
112             BlockLduMatrix<BlockType>& blockM,
113             Field<BlockType>& blockX,
114             Field<BlockType>& blockB
115         );
118     // Coupling block operations
120         //- Insert coupling matrix diagonal and source into the block system
121         template<class BlockType>
122         void insertCouplingDiagSource
123         (
124             const direction dirI,
125             const direction dirJ,
126             const fvScalarMatrix& m,
127             BlockLduMatrix<BlockType>& blockM,
128             Field<BlockType>& blockB
129         );
131         // Insert coupling matrix into the block system
132         template<class Type, class BlockType>
133         void insertCouplingUpperLower
134         (
135             const direction dirI,
136             const direction dirJ,
137             const fvScalarMatrix& m,
138             BlockLduMatrix<BlockType>& blockM
139         );
141         // Insert coupling matrix into the block system
142         template<class BlockType>
143         void insertCoupling
144         (
145             const direction dir,
146             const fvScalarMatrix& m,
147             BlockLduMatrix<BlockType>& blockM,
148             Field<BlockType>& blockX,
149             Field<BlockType>& blockB
150         );
152         // Update coupling of block system
153         // Subtracts the block-coefficient coupling as specified by the user
154         // from the source, leaving the implicit update given by linearisation
155         template<class BlockType>
156         void updateSourceCoupling
157         (
158             BlockLduMatrix<BlockType>& blockM,
159             Field<BlockType>& x,
160             Field<BlockType>& b
161         );
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #ifdef NoRepository
172 #   include "blockMatrixTools.C"
173 #endif
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //