00001
00010 #ifndef BS_CSR_ILU_CFL_PREC_H_
00011 #define BS_CSR_ILU_CFL_PREC_H_
00012
00013
00014 #include BS_FORCE_PLUGIN_IMPORT ()
00015 #include "linear_solvers.h"
00016 #include "csr_ilu_prec.h"
00017 #include BS_STOP_PLUGIN_IMPORT ()
00018
00019 #include "calc_model.h"
00020
00021
00022 namespace blue_sky
00023 {
00024
00030 template <class strategy_t>
00031 class BS_API_PLUGIN csr_ilu_cfl_prec: public csr_ilu_prec<strategy_t>
00032 {
00033
00034
00035
00036
00037 public:
00038 typedef typename strategy_t::matrix_t matrix_t;
00039 typedef typename strategy_t::item_array_t item_array_t;
00040 typedef typename strategy_t::rhs_item_array_t rhs_item_array_t;
00041 typedef typename strategy_t::item_t item_t;
00042 typedef typename strategy_t::rhs_item_t rhs_item_t;
00043 typedef typename strategy_t::index_t index_t;
00044 typedef typename strategy_t::index_array_t index_array_t;
00045 typedef calc_model <strategy_t> calc_model_t;
00046 typedef jacobian_matrix <strategy_t> jmatrix_t;
00047 typedef rs_mesh_iface <strategy_t> mesh_iface_t;
00048 typedef typename calc_model_t::data_t data_t;
00049 typedef typename calc_model_t::data_array_t data_array_t;
00050
00051 typedef csr_ilu_prec <strategy_t> csr_ilu_prec_t;
00052
00053 private:
00054 typedef bcsr_matrix<rhs_item_array_t, index_array_t> bcsr_matrix_t;
00055 typedef smart_ptr<bcsr_matrix_t, true> sp_bcsr_matrix_t;
00056
00057
00058
00059
00060 public:
00061
00063 ~csr_ilu_cfl_prec ();
00064
00066 virtual int
00067 solve (matrix_t *matrix, rhs_item_array_t &rhs, item_array_t &sol);
00068
00069 virtual int
00070 solve_prec (matrix_t *matrix, item_array_t &rhs, item_array_t &sol);
00071
00073 virtual int
00074 setup (matrix_t *matrix);
00075
00076 private:
00077
00078 sp_bcsr_matrix_t create_merged_matrix_for_ilu (jmatrix_t *matrix, const rhs_item_array_t &cfl_vector_);
00079
00080 public:
00081 BLUE_SKY_TYPE_DECL (csr_ilu_cfl_prec);
00082
00083
00084
00085
00086
00087 private:
00088 sp_bcsr_matrix_t sp_ilu_cfl_;
00089
00090 };
00091
00092 }
00093
00094
00095 #endif // #ifdef BS_CSR_ILU_CFL_PREC_H_