00001
00019 #ifndef MatrixSolver_H
00020 #define MatrixSolver_H
00021
00022 #include "../Grid/Grid.h"
00023 #include "../DiffusionCoefficient/DiffusionCoefficient.h"
00024
00025 #include "../GMRES/itlin.h"
00026
00027
00028
00030 bool MakeMatrix(double *A,
00031 double *B1,
00032 double *C,
00033 double *R,
00034 double *x,
00035 double tau,
00036 double n,
00037 double f_lower,
00038 double f_upper,
00039 int nx,
00040 double dt,
00041 double *Dxx,
00042 double taulc,
00043 double alc,
00044 int g_flag,
00045 string lower_border_condition_type,
00046 string upper_border_condition_type,
00047 string approximationMethod = "AM_Split_C");
00048
00049
00051 bool SolveMatrix(double *f,
00052 double *A,
00053 double *B1,
00054 double *C,
00055 double *R,
00056 double f_lower,
00057 double f_upper,
00058 int nx,
00059 double dt);
00060
00061
00062
00063 void over_relaxation_diag(DiagMatrix &A, Matrix1D<double> &B, Matrix1D<double> &X, int max_steps = 1e5, double EE = 1e-3);
00064 void Lapack(DiagMatrix &A, Matrix1D<double> &B, Matrix1D<double> &X);
00065 void gauss_solve(double *a, double *b, int n);
00066
00079 bool tridag(double a[], double b[], double c[], double r[], double u[], long n);
00080
00081 void gmres_wrapout(CalculationMatrix &A, Matrix1D<double> &B, Matrix1D<double> &X, int maxiter = 100, int i_max = 10, double tol = 1e-10);
00082
00083 bool MakeModelMatrix_3D(
00084 CalculationMatrix &matr_A, CalculationMatrix &matr_B, CalculationMatrix &matr_C,
00085 Matrix3D<double> &L, Matrix3D<double> &pc, Matrix3D<double> &alpha,
00086 int L_size, int pc_size, int alpha_size,
00087 Matrix2D<double> &L_lowerBoundaryCondition,
00088 Matrix2D<double> &L_upperBoundaryCondition,
00089 Matrix2D<double> &pc_lowerBoundaryCondition,
00090 Matrix2D<double> &pc_upperBoundaryCondition,
00091 Matrix2D<double> &alpha_lowerBoundaryCondition,
00092 Matrix2D<double> &alpha_upperBoundaryCondition,
00093 string L_lowerBoundaryCondition_calculationType,
00094 string L_upperBoundaryCondition_calculationType,
00095 string pc_lowerBoundaryCondition_calculationType,
00096 string pc_upperBoundaryCondition_calculationType,
00097 string alpha_lowerBoundaryCondition_calculationType,
00098 string alpha_upperBoundaryCondition_calculationType,
00099 Matrix3D<double> &DLL,
00100 Matrix3D<double> &Dpcpc, Matrix3D<double> &DpcpcLpp,
00101 Matrix3D<double> &Daa, Matrix3D<double> &DaaLpp,
00102 Matrix3D<double> &Dpca, Matrix3D<double> &DpcaLpp,
00103 Matrix3D<double> &Jacobian, double dt, double Lpp,
00104 double tau = 1e99, double tauLpp = 1e99);
00105
00106
00107 void SecondDerivativeApproximation_3D(CalculationMatrix &matr_A,
00108 int il, int im, int ia,
00109 string FirstDerivative, string SecondDerivative,
00110 Matrix3D<double> &L, Matrix3D<double> &pc, Matrix3D<double> &alpha,
00111 Matrix3D<double> &Dxx, Matrix3D<double> &Jacobian,
00112 double multiplicator);
00113
00114
00115 #endif
00116