GAMGSolver.H
Go to the documentation of this file.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
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef GAMGSolver_H
00055 #define GAMGSolver_H
00056
00057 #include "GAMGAgglomeration.H"
00058 #include "lduMatrix.H"
00059 #include "labelField.H"
00060 #include "primitiveFields.H"
00061 #include "LUscalarMatrix.H"
00062 #include "Switch.H"
00063
00064
00065
00066 namespace Foam
00067 {
00068
00069
00070
00071
00072
00073 class GAMGSolver
00074 :
00075 public lduMatrix::solver
00076 {
00077
00078
00079 Switch cacheAgglomeration_;
00080
00081
00082 label nPreSweeps_;
00083
00084
00085 label nPostSweeps_;
00086
00087
00088 label nFinestSweeps_;
00089
00090
00091
00092
00093 bool scaleCorrection_;
00094
00095
00096 bool directSolveCoarsest_;
00097
00098
00099 const GAMGAgglomeration& agglomeration_;
00100
00101
00102 PtrList<lduMatrix> matrixLevels_;
00103
00104
00105
00106 PtrList<lduInterfaceFieldPtrsList> interfaceLevels_;
00107
00108
00109 PtrList<FieldField<Field, scalar> > interfaceLevelsBouCoeffs_;
00110
00111
00112 PtrList<FieldField<Field, scalar> > interfaceLevelsIntCoeffs_;
00113
00114
00115 autoPtr<LUscalarMatrix> coarsestLUMatrixPtr_;
00116
00117
00118
00119
00120
00121 virtual void readControls();
00122
00123
00124 const lduInterfaceFieldPtrsList& interfaceLevel
00125 (
00126 const label i
00127 ) const;
00128
00129
00130 const lduMatrix& matrixLevel(const label i) const;
00131
00132
00133 const FieldField<Field, scalar>& interfaceBouCoeffsLevel
00134 (
00135 const label i
00136 ) const;
00137
00138
00139 const FieldField<Field, scalar>& interfaceIntCoeffsLevel
00140 (
00141 const label i
00142 ) const;
00143
00144
00145 void agglomerateMatrix(const label fineLevelIndex);
00146
00147
00148
00149
00150
00151
00152 scalar scalingFactor
00153 (
00154 scalarField& field,
00155 const scalarField& source,
00156 const scalarField& Acf,
00157 const scalarField& D
00158 ) const;
00159
00160
00161 scalar scalingFactor
00162 (
00163 scalarField& Acf,
00164 const lduMatrix& A,
00165 scalarField& field,
00166 const FieldField<Field, scalar>& interfaceLevelBouCoeffs,
00167 const lduInterfaceFieldPtrsList& interfaceLevel,
00168 const scalarField& source,
00169 const direction cmpt
00170 ) const;
00171
00172
00173
00174 void initVcycle
00175 (
00176 PtrList<scalarField>& coarseCorrFields,
00177 PtrList<scalarField>& coarseSources,
00178 PtrList<lduMatrix::smoother>& smoothers
00179 ) const;
00180
00181
00182
00183 void Vcycle
00184 (
00185 const PtrList<lduMatrix::smoother>& smoothers,
00186 scalarField& psi,
00187 const scalarField& source,
00188 scalarField& Apsi,
00189 scalarField& finestCorrection,
00190 scalarField& finestResidual,
00191 PtrList<scalarField>& coarseCorrFields,
00192 PtrList<scalarField>& coarseSources,
00193 const direction cmpt=0
00194 ) const;
00195
00196
00197
00198 void solveCoarsestLevel
00199 (
00200 scalarField& coarsestCorrField,
00201 const scalarField& coarsestSource
00202 ) const;
00203
00204
00205 public:
00206
00207 friend class GAMGPreconditioner;
00208
00209
00210 TypeName("GAMG");
00211
00212
00213
00214
00215
00216 GAMGSolver
00217 (
00218 const word& fieldName,
00219 const lduMatrix& matrix,
00220 const FieldField<Field, scalar>& interfaceBouCoeffs,
00221 const FieldField<Field, scalar>& interfaceIntCoeffs,
00222 const lduInterfaceFieldPtrsList& interfaces,
00223 const dictionary& solverControls
00224 );
00225
00226
00227
00228
00229 virtual ~GAMGSolver();
00230
00231
00232
00233
00234
00235 virtual lduMatrix::solverPerformance solve
00236 (
00237 scalarField& psi,
00238 const scalarField& source,
00239 const direction cmpt=0
00240 ) const;
00241 };
00242
00243
00244
00245
00246 }
00247
00248
00249
00250 #endif
00251
00252
Copyright © 2000-2009 OpenCFD Ltd