fixed blockCoupledSwirlTest tut (formerly coupledSwirlTest in the wrong place
[openfoam-extend-OpenFOAM-1.6-ext.git] / applications / solvers / coupled / blockCoupledScalarTransportFoam / blockMatrixTools.H
blobcb372a92a143f7b13a337ffb75308af77a029278
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     //- Insert field into block field
56     template<class BlockType>
57     void blockInsert
58     (
59         const direction dir,
60         const scalarField& x,
61         Field<BlockType>& blockX
62     );
64     //- Retrieve field from block field
65     template<class BlockType>
66     void blockRetrieve
67     (
68         const direction dir,
69         scalarField& x,
70         const Field<BlockType>& blockX
71     );
73     //- Insert matrix diagonal and source into the block system
74     template<class BlockType>
75     void insertDiagSource
76     (
77         const direction dir,
78         const fvScalarMatrix& m,
79         BlockLduMatrix<BlockType>& blockM,
80         Field<BlockType>& blockB
81     );
83     // Insert matrix into the block system
84     template<class Type, class BlockType>
85     void insertUpperLower
86     (
87         const direction dir,
88         const fvScalarMatrix& m,
89         BlockLduMatrix<BlockType>& blockM
90     );
92     // Insert matrix into the block system
93     template<class BlockType>
94     void insertEquation
95     (
96         const direction dir,
97         const fvScalarMatrix& m,
98         BlockLduMatrix<BlockType>& blockM,
99         Field<BlockType>& blockX,
100         Field<BlockType>& blockB
101     );
103     // Update coupling of block system
104     // Subtracts the block-coefficient coupling as specified by the user
105     // from the source, leaving the implicit update given by linearisation
106     template<class BlockType>
107     void updateCoupling
108     (
109         BlockLduMatrix<BlockType>& blockM,
110         Field<BlockType>& x,
111         Field<BlockType>& b
112     );
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 } // End namespace Foam
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 #ifdef NoRepository
123 #   include "blockMatrixTools.C"
124 #endif
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #endif
130 // ************************************************************************* //