|
|
|
LUscalarMatrix.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 LUscalarMatrix 00027 00028 Description 00029 00030 SourceFiles 00031 LUscalarMatrix.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef LUscalarMatrix_H 00036 #define LUscalarMatrix_H 00037 00038 #include "scalarMatrix.H" 00039 #include "labelList.H" 00040 #include "FieldField.H" 00041 #include "lduInterfaceFieldPtrsList.H" 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 class lduMatrix; 00049 class procLduMatrix; 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class LUscalarMatrix Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class LUscalarMatrix 00056 : 00057 public scalarMatrix 00058 { 00059 // Private data 00060 00061 //- Processor matrix offsets 00062 labelList procOffsets_; 00063 00064 //- The pivot indices used in the LU decomposition 00065 labelList pivotIndices_; 00066 00067 //- Convert the given lduMatrix into this LUscalarMatrix 00068 void convert 00069 ( 00070 const lduMatrix& ldum, 00071 const FieldField<Field, scalar>& interfaceCoeffs, 00072 const lduInterfaceFieldPtrsList& interfaces 00073 ); 00074 00075 //- Convert the given list of procLduMatrix into this LUscalarMatrix 00076 // on the master processor 00077 void convert(const PtrList<procLduMatrix>& lduMatrices); 00078 00079 00080 //- Print the ratio of the mag-sum of the off-diagonal coefficients 00081 // to the mag-diagonal 00082 void printDiagonalDominance() const; 00083 00084 00085 public: 00086 00087 // Constructors 00088 00089 //- Construct from Matrix<scalar> and perform LU decomposition 00090 LUscalarMatrix(const Matrix<scalar>&); 00091 00092 //- Construct from lduMatrix and perform LU decomposition 00093 LUscalarMatrix 00094 ( 00095 const lduMatrix&, 00096 const FieldField<Field, scalar>& interfaceCoeffs, 00097 const lduInterfaceFieldPtrsList& interfaces 00098 ); 00099 00100 00101 // Member Functions 00102 00103 //- Solve the matrix using the LU decomposition with pivoting 00104 // returning the solution in the source 00105 template<class T> 00106 void solve(Field<T>& source) const; 00107 }; 00108 00109 00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00111 00112 } // End namespace Foam 00113 00114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00115 00116 #ifdef NoRepository 00117 # include "LUscalarMatrixTemplates.C" 00118 #endif 00119 00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00121 00122 #endif 00123 00124 // ************************************************************************* // |