|
|
|
scalarMatrix.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 scalarMatrix 00027 00028 Description 00029 00030 SourceFiles 00031 scalarMatrix.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef scalarMatrix_H 00036 #define scalarMatrix_H 00037 00038 #include "Matrix.H" 00039 #include "scalarField.H" 00040 #include "labelList.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class scalarMatrix Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class scalarMatrix 00052 : 00053 public Matrix<scalar> 00054 { 00055 00056 public: 00057 00058 // Constructors 00059 00060 //- Construct null 00061 scalarMatrix(); 00062 00063 //- Construct given size 00064 scalarMatrix(const label); 00065 00066 //- Construct from Matrix<scalar> 00067 scalarMatrix(const Matrix<scalar>&); 00068 00069 //- Construct from Istream 00070 scalarMatrix(Istream&); 00071 00072 00073 // Member Functions 00074 00075 //- Solve the matrix using Gaussian elimination with pivoting, 00076 // returning the solution in the source 00077 template<class T> 00078 static void solve(Matrix<scalar>& matrix, Field<T>& source); 00079 00080 //- Solve the matrix using Gaussian elimination with pivoting 00081 // and return the solution 00082 template<class T> 00083 void solve(Field<T>& psi, const Field<T>& source) const; 00084 00085 00086 //- LU decompose the matrix with pivoting 00087 static void LUDecompose 00088 ( 00089 Matrix<scalar>& matrix, 00090 labelList& pivotIndices 00091 ); 00092 00093 //- LU back-substitution with given source, returning the solution 00094 // in the source 00095 template<class T> 00096 static void LUBacksubstitute 00097 ( 00098 const Matrix<scalar>& luMmatrix, 00099 const labelList& pivotIndices, 00100 Field<T>& source 00101 ); 00102 00103 //- Solve the matrix using LU decomposition with pivoting 00104 // returning the LU form of the matrix and the solution in the source 00105 template<class T> 00106 static void LUsolve(Matrix<scalar>& matrix, Field<T>& source); 00107 }; 00108 00109 00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00111 00112 } // End namespace Foam 00113 00114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00115 00116 #ifdef NoRepository 00117 # include "scalarMatrixTemplates.C" 00118 #endif 00119 00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00121 00122 #endif 00123 00124 // ************************************************************************* // |