00001
00010 #ifndef BS_FACILITY_BASE_H_
00011 #define BS_FACILITY_BASE_H_
00012
00013 #include "calc_model.h"
00014
00015 namespace blue_sky {
00016
00022 template <typename strategy_t>
00023 class BS_API_PLUGIN facility_base : public objbase
00024 {
00025 public:
00026 typedef typename strategy_t::index_array_t index_array_t;
00027 typedef typename strategy_t::item_array_t item_array_t;
00028 typedef typename strategy_t::rhs_item_array_t rhs_item_array_t;
00029 typedef typename strategy_t::index_t index_t;
00030
00031 typedef calc_model <strategy_t> calc_model_t;
00032 typedef rs_mesh_iface <strategy_t> mesh_iface_t;
00033 typedef jacobian_matrix <strategy_t> jmatrix_t;
00034
00035 typedef smart_ptr <calc_model_t, true> sp_calc_model_t;
00036 typedef smart_ptr <mesh_iface_t, true> sp_mesh_iface_t;
00037 typedef smart_ptr <jmatrix_t, true> sp_jmatrix_t;
00038
00039 public:
00041 virtual ~facility_base () {}
00042
00047 virtual void
00048 fill_rows (index_array_t &rows) const = 0;
00049
00060 virtual void
00061 fill_jacobian (double dt, index_t block_size, const index_array_t &rows, index_array_t &cols, rhs_item_array_t &values, index_array_t &markers) const = 0;
00062
00072 virtual void
00073 fill_rhs (double dt, index_t n_phases, bool is_g, bool is_o, bool is_w, rhs_item_array_t &rhs) const = 0;
00074
00084 virtual void
00085 process (bool is_start, double dt, const sp_calc_model_t &calc_model, const sp_mesh_iface_t &mesh, sp_jmatrix_t &jmatrix) = 0;
00086
00094 virtual void
00095 restore_solution (double dt, const item_array_t &p_sol, const item_array_t &s_sol, index_t block_size) = 0;
00096
00102 virtual void
00103 pre_large_step (const sp_calc_model_t &calc_model, const sp_mesh_iface_t &mesh) = 0;
00104
00108 virtual void
00109 pre_small_step () = 0;
00110
00114 virtual void
00115 pre_newton_step () = 0;
00116
00120 virtual void
00121 restart_small_step () = 0;
00122
00126 virtual void
00127 restart_newton_step () = 0;
00128 };
00129
00130 }
00131
00132
00133 #endif // #ifndef BS_FACILITY_BASE_H_
00134