00001
00010 #ifndef PY_BS_CALC_WELL_H_
00011 #define PY_BS_CALC_WELL_H_
00012
00013 #ifdef BSPY_EXPORTING_PLUGIN
00014 #include "calc_well.h"
00015 #include "well_connection.h"
00016 #include "calc_model.h"
00017 #include "py_calc_well_detail.h"
00018 #include "facility_manager.h"
00019
00020 #include "export_python_wrapper.h"
00021
00022
00023 namespace blue_sky {
00024 namespace python {
00025
00026 STRATEGY_CLASS_WRAPPER (wells::connection, py_connection)
00027 {
00028 public:
00029
00030 typedef typename strategy_t::item_t item_t;
00031 typedef typename strategy_t::rhs_item_t rhs_item_t;
00032
00033 typedef wells::connection <strategy_t> wrapped_t;
00034
00035 public:
00036
00037 STRATEGY_CLASS_WRAPPER_DECL (py_connection);
00038
00039 WRAPPER_METHOD (clear_data, void, 0, (empty_arg__));
00040 WRAPPER_METHOD_R (get_rw_value, array_ext <item_t>, 0, (empty_arg__));
00041 WRAPPER_METHOD_R (get_wr_value, array_ext <item_t>, 0, (empty_arg__));
00042 WRAPPER_METHOD_R (get_rr_value, array_ext <item_t>, 0, (empty_arg__));
00043 WRAPPER_METHOD_R (get_ps_value, array_ext <item_t>, 0, (empty_arg__));
00044 WRAPPER_METHOD_R (get_rate_value, array_ext <rhs_item_t>, 0, (empty_arg__));
00045 };
00046
00047 STRATEGY_CLASS_WRAPPER (well, py_well)
00048 {
00049 public:
00050
00051 typedef typename strategy_t::index_t index_t;
00052 typedef typename strategy_t::item_t item_t;
00053 typedef typename strategy_t::rhs_item_t rhs_item_t;
00054 typedef typename strategy_t::item_array_t item_array_t;
00055 typedef typename strategy_t::rhs_item_array_t rhs_item_array_t;
00056
00057 typedef smart_ptr <calc_model <strategy_t>, true > sp_calc_model_t;
00058 typedef smart_ptr <rs_mesh_iface <strategy_t>, true > sp_mesh_iface_t;
00059 typedef smart_ptr <jacobian_matrix <strategy_t>, true > sp_jmatrix_t;
00060
00061 typedef well <strategy_t> wrapped_t;
00062
00063 public:
00064
00065 STRATEGY_CLASS_WRAPPER_DECL (py_well);
00066
00067 WRAPPER_METHOD_R (get_ww_value, array_ext <item_t>, 0, (empty_arg__));
00068 WRAPPER_METHOD_R (get_bw_value, array_ext <item_t>, 0, (empty_arg__));
00069 WRAPPER_METHOD (eliminate, void, 5, (rhs_item_t *, index_t, index_t, item_t, index_t));
00070 WRAPPER_METHOD (process, void, 5, (int, double, const sp_calc_model_t &, const sp_mesh_iface_t &, sp_jmatrix_t &));
00071 WRAPPER_METHOD (process_newton, void, 4, (int, const sp_calc_model_t &, const sp_mesh_iface_t &, sp_jmatrix_t &));
00072 WRAPPER_METHOD (restore_solution, void, 4, (double, const item_array_t &, const item_array_t &, index_t));
00073 WRAPPER_METHOD (clear_data, void, 0, (empty_arg__));
00074 };
00075
00076 PY_EXPORTER (connection_exporter, default_exporter)
00077 .def ("clear_data", &T::clear_data)
00078 .add_property ("rw", &T::get_rw_value)
00079 .add_property ("wr", &T::get_wr_value)
00080 .add_property ("rr", &T::get_rr_value)
00081 .add_property ("ps", &T::get_ps_value)
00082 .add_property ("rate", &T::get_rate_value)
00083 .add_property ("head_term", &T::get_head_term, &T::set_head_term)
00084 .add_property ("cur_bhp", &T::get_cur_bhp, &T::set_cur_bhp)
00085 .add_property ("connection_depth", &T::get_connection_depth, &T::set_connection_depth)
00086 .add_property ("density", &T::get_density, make_function (detail::set_connection_density<T>))
00087 .add_property ("bulkp", &T::get_bulkp, &T::set_bulkp)
00088 .add_property ("n_block", &T::n_block)
00089 .add_property ("i", &T::i_coord)
00090 .add_property ("j", &T::j_coord)
00091 .add_property ("k", &T::k_coord)
00092 .add_property ("fact", &T::get_fact)
00093 .add_property ("gw", &T::get_fact)
00094 .add_property ("is_shut", &T::is_shut)
00095 PY_EXPORTER_END;
00096
00097 PY_EXPORTER (well_exporter, default_exporter)
00098
00099 .def ("process", &T::process)
00100 .def ("update", &T::restore_solution)
00101 .def ("clear_data", &T::clear_data)
00102
00103 .add_property ("ww", &T::get_ww_value)
00104 .add_property ("bw", &T::get_bw_value)
00105 .add_property ("name", make_function (&T::get_name, return_value_policy <copy_const_reference> ()), &T::set_name)
00106 .add_property ("i_coord", make_function (detail::get_well_i_coord<T>), make_function (detail::set_well_i_coord<T>))
00107 .add_property ("j_coord", make_function (detail::get_well_j_coord<T>), make_function (detail::set_well_j_coord<T>))
00108 .add_property ("bhp_depth", &T::get_bhp_depth, &T::set_bhp_depth)
00109 .add_property ("exploitation_factor", make_function (detail::get_well_wefac<T>), &T::set_exploitation_factor)
00110 .add_property ("state", make_function (detail::get_well_state<T>))
00111 .add_property ("bhp_rate", &T::bhp)
00112 .add_property ("is_work", make_function (detail::get_well_is_work<T>), make_function (detail::set_well_is_work<T>))
00113 .add_property ("connections", &T::get_connections_count)
00114 .add_property ("is_production", make_function (detail::well_is_production<T>))
00115 PY_EXPORTER_END;
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 void
00173 py_export_calc_well ();
00174
00175 }
00176 }
00177
00178 #endif // BSPY_EXPORTING_PLUGIN
00179 #endif // #ifndef PY_BS_CALC_WELL_H_