00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef GaussSeidel_H
00036 #define GaussSeidel_H
00037
00038 #include "lduMatrix.H"
00039
00040
00041
00042 namespace Foam
00043 {
00044
00045
00046
00047
00048
00049 class GaussSeidel
00050 :
00051 public lduMatrix::solver
00052 {
00053 private:
00054
00055
00056
00057
00058 static label maxIter_;
00059
00060
00061
00062
00063
00064 GaussSeidel(const GaussSeidel&);
00065
00066
00067 void operator=(const GaussSeidel&);
00068
00069
00070 protected:
00071
00072
00073
00074 scalar tolerance_;
00075 scalar relTol_;
00076
00077
00078 label nSweeps_;
00079
00080
00081 public:
00082
00083
00084 TypeName("GaussSeidel");
00085
00086
00087
00088
00089
00090 GaussSeidel
00091 (
00092 const word& fieldName,
00093 scalarField& psi,
00094 const lduMatrix& matrix,
00095 const scalarField& source,
00096 const FieldField<Field, scalar>& coupleBouCoeffs,
00097 const FieldField<Field, scalar>& coupleIntCoeffs,
00098 const lduCoupledInterfacePtrsList& interfaces,
00099 const direction cmpt,
00100 const label nSweeps,
00101 const scalar tolerance,
00102 const scalar relTol = 0.0
00103 );
00104
00105
00106 GaussSeidel
00107 (
00108 const word& fieldName,
00109 scalarField& psi,
00110 const lduMatrix& matrix,
00111 const scalarField& source,
00112 const FieldField<Field, scalar>& coupleBouCoeffs,
00113 const FieldField<Field, scalar>& coupleIntCoeffs,
00114 const lduCoupledInterfacePtrsList& interfaces,
00115 const direction cmpt,
00116 Istream& solverData
00117 );
00118
00119
00120
00121
00122
00123 static void smooth
00124 (
00125 const word& fieldName,
00126 scalarField& psi,
00127 const lduMatrix& matrix,
00128 const scalarField& Source,
00129 const FieldField<Field, scalar>& bouCoeffs,
00130 const lduCoupledInterfacePtrsList& interfaces,
00131 const direction cmpt,
00132 const label nSweeps
00133 );
00134
00135
00136
00137 lduMatrix::solverPerformance solve();
00138
00139
00140 static label setMaxIter(const label mIter)
00141 {
00142 label oldMaxIter = maxIter_;
00143 maxIter_ = mIter;
00144
00145 return oldMaxIter;
00146 }
00147 };
00148
00149
00150
00151
00152 }
00153
00154
00155
00156 #endif
00157
00158