1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh 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 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 Implementation of 2 x 2 matrix
32 \*---------------------------------------------------------------------------*/
38 #include "FixedList.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class matrix2D Declaration
47 \*---------------------------------------------------------------------------*/
50 : public FixedList<FixedList<scalar, 2>, 2>
56 // Private member functions
57 //- calculate matrix determinant
58 inline void calculateDeterminant();
64 explicit inline matrix2D();
67 inline matrix2D(const matrix2D&);
73 //- return matrix determinant
74 inline scalar determinant();
76 //- return inverse matrix
77 inline matrix2D inverse();
79 //- find the solution of the system with the given rhs
80 inline FixedList<scalar, 2> solve
82 const FixedList<scalar, 2>& source
85 //- return the first component of the solution vector
86 inline scalar solveFirst(const FixedList<scalar, 2>& source);
88 //- return the second component of the solution vector
89 inline scalar solveSecond(const FixedList<scalar, 2>& source);
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 } // End namespace Foam
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 #include "matrix2DI.H"
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 // ************************************************************************* //