00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LOCSTEN_H_
00024 #define LOCSTEN_H_
00025
00027
00028
00029
00030
00031
00032
00033
00035
00036
00037
00038
00039
00040
00041
00042 class Loc_stencil_container {
00043 public:
00044 Loc_stencil_container();
00045 double* Give_Loc_sten(diff_type typ_u, diff_type typ_v) const;
00046 double* Give_Loc_sten_Poisson() const { return sten_Poisson; };
00047 private:
00048 double*** sten;
00049 double* sten_Poisson;
00050 double* sten_sp;
00051 };
00052
00053 void Restrict_local_stiffness_matrix(double* Stencil_coarse,
00054 double** Stencils_fine,
00055 bool* corner_in_domain);
00056 void Restrict_local_stiffness_matrix(double* Stencil_coarse,
00057 double** Stencils_fine,
00058 int* coarse_grid_functions);
00059
00060
00061 class Restriction_stencil_container {
00062 public:
00063 Restriction_stencil_container();
00064 double Calc_trans_weight(dir_sons i, dir_sons j, dir_sons k);
00065 private:
00066 int reg_formula[5][5][5];
00067 };
00068
00069
00070 inline double Restriction_stencil_container::Calc_trans_weight(dir_sons i,
00071 dir_sons j,
00072 dir_sons k) {
00073 return reg_formula[2*(i&1) + (j&1) + (k&1)]
00074 [2*((i>>1)&1) + ((j>>1)&1) + ((k>>1)&1)]
00075 [2*((i>>2)&1) + ((j>>2)&1) + ((k>>2)&1)];
00076 }
00077
00078
00079
00081
00083
00084 inline double Evaluate_lsm(double*const * u_Recell, int num_var,
00085 dir_sons dir_v, double* sten) {
00086 static int i;
00087 static double sum;
00088 sum = 0.0;
00089 for(i=0;i<8;++i) sum = sum + sten[dir_v+8*i] * u_Recell[i][num_var];
00090 return sum;
00091 }
00092
00093
00094
00095
00096
00097 void Set_coarse_function(double U[27], dir_sons v);
00098 void Set_coarse_function(int U[27], dir_sons v);
00099
00100
00101 void Print_27_stencil_of_local_matrix(double* sten);
00102
00103 void Print_u_Recell(double*const * u_Recell, int num);
00104
00105
00106 void Print_Loc_stencil(double* sten);
00107 void Print_part_loc_stencil(double* sten);
00108
00109 void Print_Factor(diff_type typ_u, diff_type typ_v);
00110 void Print_Factor_Poisson();
00111
00112 void Print_27_stencil(double Sten27[27]);
00113 void Print_27_stencil(diff_type typ_u, diff_type typ_v);
00114 void Print_27_stencil_var(diff_type typ_u, diff_type typ_v);
00115 void Print_27_stencil_formula_var(diff_type typ_u, diff_type typ_v);
00116 void Print_27_stencil_Poisson();
00117 void Print_27_stencil_Poisson_var();
00118
00119 void Calc_Loc_stencil(double* sten, diff_type typ_u, diff_type typ_v);
00120 double Test_evaluation_of_lsm(double* sten, dir_sons dir_v,
00121 bool* corner_in_domain);
00122 double Test_evaluation_of_lsm(double* sten, dir_sons dir_v);
00123 double Test_evaluation_of_lsm(double* sten, dir_sons dir_v, double* UU);
00124
00125 void Print_restriction_formula();
00126
00127 #endif
00128