How to use the ert.well.WellPrototype function in ert

To help you get started, we’ve selected a few ert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_connection.py View on Github external
_segment_id          = WellPrototype("int    well_conn_get_segment_id(well_connection)")
    _is_open             = WellPrototype("bool   well_conn_open(well_connection)")
    _is_msw              = WellPrototype("bool   well_conn_MSW(well_connection)")
    _fracture_connection = WellPrototype("bool   well_conn_fracture_connection(well_connection)")
    _matrix_connection   = WellPrototype("bool   well_conn_matrix_connection(well_connection)")
    _connection_factor   = WellPrototype("double well_conn_get_connection_factor(well_connection)")
    _equal               = WellPrototype("bool   well_conn_equal(well_connection, well_connection)")
    _get_dir             = WellPrototype("void*  well_conn_get_dir(well_connection)")
    _oil_rate            = WellPrototype("double well_conn_get_oil_rate(well_connection)")
    _gas_rate            = WellPrototype("double well_conn_get_gas_rate(well_connection)")
    _water_rate          = WellPrototype("double well_conn_get_water_rate(well_connection)")
    _volume_rate         = WellPrototype("double well_conn_get_volume_rate(well_connection)")

    _oil_rate_si         = WellPrototype("double well_conn_get_oil_rate_si(well_connection)")
    _gas_rate_si         = WellPrototype("double well_conn_get_gas_rate_si(well_connection)")
    _water_rate_si       = WellPrototype("double well_conn_get_water_rate_si(well_connection)")
    _volume_rate_si      = WellPrototype("double well_conn_get_volume_rate_si(well_connection)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")


    def isOpen(self):
        """ @rtype: bool """
        return self._is_open()


    def ijk(self):
        """ @rtype: tuple of (int, int, int) """
        i = self._i()
        j = self._j()
        k = self._k()
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_segment.py View on Github external
from cwrap import BaseCClass
from ert.well import WellPrototype

class WellSegment(BaseCClass):
    TYPE_NAME = "well_segment"

    _active           = WellPrototype("bool well_segment_active(well_segment)")
    _main_stem        = WellPrototype("bool well_segment_main_stem(well_segment)")
    _nearest_wellhead = WellPrototype("bool well_segment_nearest_wellhead(well_segment)")
    _id               = WellPrototype("int well_segment_get_id(well_segment)")
    _link_count       = WellPrototype("int well_segment_get_link_count(well_segment)")
    _branch_id        = WellPrototype("int well_segment_get_branch_id(well_segment)")
    _outlet_id        = WellPrototype("int well_segment_get_outlet_id(well_segment)")
    _depth            = WellPrototype("double well_segment_get_depth(well_segment)")
    _length           = WellPrototype("double well_segment_get_length(well_segment)")
    _total_length     = WellPrototype("double well_segment_get_total_length(well_segment)")
    _diameter         = WellPrototype("double well_segment_get_diameter(well_segment)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")

    def free(self):
        pass

    def __repr__(self):
        return 'WellSegment(%s) at 0x%x' % (str(self), self._address())

    def __str__(self):
        return "{Segment ID:%d   BranchID:%d  Length:%g}" % (self.id() , self.branchId() , self.length())

    def id(self):
        """ @rtype: int """
github Ensembles / ert / python / python / ert / well / well_info.py View on Github external
from cwrap import BaseCClass
from ert.ecl import EclGrid
from ert.ecl.ecl_file import EclFile
from ert.well import WellTimeLine, WellPrototype


class WellInfo(BaseCClass):
    TYPE_NAME = "well_info"

    _alloc            = WellPrototype("void* well_info_alloc(ecl_grid)", bind = False)
    _free             = WellPrototype("void  well_info_free(well_info)")
    _load_rstfile     = WellPrototype("void  well_info_load_rstfile(well_info, char*, bool)")
    _load_rst_eclfile = WellPrototype("void  well_info_load_rst_eclfile(well_info, ecl_file, bool)")
    _get_well_count   = WellPrototype("int   well_info_get_num_wells(well_info)")
    _iget_well_name   = WellPrototype("char* well_info_iget_well_name(well_info, int)")
    _has_well         = WellPrototype("bool  well_info_has_well(well_info, char*)")
    _get_ts           = WellPrototype("well_time_line_ref well_info_get_ts(well_info, char*)")


    def __init__(self, grid, rst_file=None, load_segment_information=True):
        """
        @type grid: EclGrid
        @type rst_file: str or EclFile or list of str or list of EclFile
        """
        c_ptr = self._alloc(grid)
        super(WellInfo, self).__init__(c_ptr)
        if not c_ptr:
            raise ValueError('Unable to construct WellInfo from grid %s.' % str(grid))
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_connection.py View on Github external
from cwrap import BaseCClass
from ert.well import WellPrototype, WellConnectionDirectionEnum

class WellConnection(BaseCClass):
    TYPE_NAME = "well_connection"

    _i                   = WellPrototype("int    well_conn_get_i(well_connection)")
    _j                   = WellPrototype("int    well_conn_get_j(well_connection)")
    _k                   = WellPrototype("int    well_conn_get_k(well_connection)")
    _segment_id          = WellPrototype("int    well_conn_get_segment_id(well_connection)")
    _is_open             = WellPrototype("bool   well_conn_open(well_connection)")
    _is_msw              = WellPrototype("bool   well_conn_MSW(well_connection)")
    _fracture_connection = WellPrototype("bool   well_conn_fracture_connection(well_connection)")
    _matrix_connection   = WellPrototype("bool   well_conn_matrix_connection(well_connection)")
    _connection_factor   = WellPrototype("double well_conn_get_connection_factor(well_connection)")
    _equal               = WellPrototype("bool   well_conn_equal(well_connection, well_connection)")
    _get_dir             = WellPrototype("void*  well_conn_get_dir(well_connection)")
    _oil_rate            = WellPrototype("double well_conn_get_oil_rate(well_connection)")
    _gas_rate            = WellPrototype("double well_conn_get_gas_rate(well_connection)")
    _water_rate          = WellPrototype("double well_conn_get_water_rate(well_connection)")
    _volume_rate         = WellPrototype("double well_conn_get_volume_rate(well_connection)")

    _oil_rate_si         = WellPrototype("double well_conn_get_oil_rate_si(well_connection)")
    _gas_rate_si         = WellPrototype("double well_conn_get_gas_rate_si(well_connection)")
    _water_rate_si       = WellPrototype("double well_conn_get_water_rate_si(well_connection)")
    _volume_rate_si      = WellPrototype("double well_conn_get_volume_rate_si(well_connection)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_info.py View on Github external
from cwrap import BaseCClass
from ert.ecl import EclGrid
from ert.ecl.ecl_file import EclFile
from ert.well import WellTimeLine, WellPrototype


class WellInfo(BaseCClass):
    TYPE_NAME = "well_info"

    _alloc            = WellPrototype("void* well_info_alloc(ecl_grid)", bind = False)
    _free             = WellPrototype("void  well_info_free(well_info)")
    _load_rstfile     = WellPrototype("void  well_info_load_rstfile(well_info, char*, bool)")
    _load_rst_eclfile = WellPrototype("void  well_info_load_rst_eclfile(well_info, ecl_file, bool)")
    _get_well_count   = WellPrototype("int   well_info_get_num_wells(well_info)")
    _iget_well_name   = WellPrototype("char* well_info_iget_well_name(well_info, int)")
    _has_well         = WellPrototype("bool  well_info_has_well(well_info, char*)")
    _get_ts           = WellPrototype("well_time_line_ref well_info_get_ts(well_info, char*)")


    def __init__(self, grid, rst_file=None, load_segment_information=True):
        """
        @type grid: EclGrid
        @type rst_file: str or EclFile or list of str or list of EclFile
        """
        c_ptr = self._alloc(grid)
        super(WellInfo, self).__init__(c_ptr)
        if not c_ptr:
            raise ValueError('Unable to construct WellInfo from grid %s.' % str(grid))

        if rst_file is not None:
            if isinstance(rst_file, list):
                for item in rst_file:
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_connection.py View on Github external
class WellConnection(BaseCClass):
    TYPE_NAME = "well_connection"

    _i                   = WellPrototype("int    well_conn_get_i(well_connection)")
    _j                   = WellPrototype("int    well_conn_get_j(well_connection)")
    _k                   = WellPrototype("int    well_conn_get_k(well_connection)")
    _segment_id          = WellPrototype("int    well_conn_get_segment_id(well_connection)")
    _is_open             = WellPrototype("bool   well_conn_open(well_connection)")
    _is_msw              = WellPrototype("bool   well_conn_MSW(well_connection)")
    _fracture_connection = WellPrototype("bool   well_conn_fracture_connection(well_connection)")
    _matrix_connection   = WellPrototype("bool   well_conn_matrix_connection(well_connection)")
    _connection_factor   = WellPrototype("double well_conn_get_connection_factor(well_connection)")
    _equal               = WellPrototype("bool   well_conn_equal(well_connection, well_connection)")
    _get_dir             = WellPrototype("void*  well_conn_get_dir(well_connection)")
    _oil_rate            = WellPrototype("double well_conn_get_oil_rate(well_connection)")
    _gas_rate            = WellPrototype("double well_conn_get_gas_rate(well_connection)")
    _water_rate          = WellPrototype("double well_conn_get_water_rate(well_connection)")
    _volume_rate         = WellPrototype("double well_conn_get_volume_rate(well_connection)")

    _oil_rate_si         = WellPrototype("double well_conn_get_oil_rate_si(well_connection)")
    _gas_rate_si         = WellPrototype("double well_conn_get_gas_rate_si(well_connection)")
    _water_rate_si       = WellPrototype("double well_conn_get_water_rate_si(well_connection)")
    _volume_rate_si      = WellPrototype("double well_conn_get_volume_rate_si(well_connection)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")


    def isOpen(self):
        """ @rtype: bool """
        return self._is_open()
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_segment.py View on Github external
from cwrap import BaseCClass
from ert.well import WellPrototype

class WellSegment(BaseCClass):
    TYPE_NAME = "well_segment"

    _active           = WellPrototype("bool well_segment_active(well_segment)")
    _main_stem        = WellPrototype("bool well_segment_main_stem(well_segment)")
    _nearest_wellhead = WellPrototype("bool well_segment_nearest_wellhead(well_segment)")
    _id               = WellPrototype("int well_segment_get_id(well_segment)")
    _link_count       = WellPrototype("int well_segment_get_link_count(well_segment)")
    _branch_id        = WellPrototype("int well_segment_get_branch_id(well_segment)")
    _outlet_id        = WellPrototype("int well_segment_get_outlet_id(well_segment)")
    _depth            = WellPrototype("double well_segment_get_depth(well_segment)")
    _length           = WellPrototype("double well_segment_get_length(well_segment)")
    _total_length     = WellPrototype("double well_segment_get_total_length(well_segment)")
    _diameter         = WellPrototype("double well_segment_get_diameter(well_segment)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")

    def free(self):
        pass

    def __repr__(self):
        return 'WellSegment(%s) at 0x%x' % (str(self), self._address())

    def __str__(self):
        return "{Segment ID:%d   BranchID:%d  Length:%g}" % (self.id() , self.branchId() , self.length())
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_connection.py View on Github external
from cwrap import BaseCClass
from ert.well import WellPrototype, WellConnectionDirectionEnum

class WellConnection(BaseCClass):
    TYPE_NAME = "well_connection"

    _i                   = WellPrototype("int    well_conn_get_i(well_connection)")
    _j                   = WellPrototype("int    well_conn_get_j(well_connection)")
    _k                   = WellPrototype("int    well_conn_get_k(well_connection)")
    _segment_id          = WellPrototype("int    well_conn_get_segment_id(well_connection)")
    _is_open             = WellPrototype("bool   well_conn_open(well_connection)")
    _is_msw              = WellPrototype("bool   well_conn_MSW(well_connection)")
    _fracture_connection = WellPrototype("bool   well_conn_fracture_connection(well_connection)")
    _matrix_connection   = WellPrototype("bool   well_conn_matrix_connection(well_connection)")
    _connection_factor   = WellPrototype("double well_conn_get_connection_factor(well_connection)")
    _equal               = WellPrototype("bool   well_conn_equal(well_connection, well_connection)")
    _get_dir             = WellPrototype("void*  well_conn_get_dir(well_connection)")
    _oil_rate            = WellPrototype("double well_conn_get_oil_rate(well_connection)")
    _gas_rate            = WellPrototype("double well_conn_get_gas_rate(well_connection)")
    _water_rate          = WellPrototype("double well_conn_get_water_rate(well_connection)")
    _volume_rate         = WellPrototype("double well_conn_get_volume_rate(well_connection)")

    _oil_rate_si         = WellPrototype("double well_conn_get_oil_rate_si(well_connection)")
    _gas_rate_si         = WellPrototype("double well_conn_get_gas_rate_si(well_connection)")
    _water_rate_si       = WellPrototype("double well_conn_get_water_rate_si(well_connection)")
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_time_line.py View on Github external
from cwrap import BaseCClass
from ert.well import WellState, WellPrototype

class WellTimeLine(BaseCClass):
    TYPE_NAME = "well_time_line"
    _size = WellPrototype("int well_ts_get_size(well_time_line)")
    _name = WellPrototype("char* well_ts_get_name(well_time_line)")
    _iget = WellPrototype("well_state_ref well_ts_iget_state(well_time_line, int)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly")

    def getName(self):
        return self._name()

    def __len__(self):
        """ @rtype: int """
        return self._size()


    def __getitem__(self, index):
        """
         @type index: int
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / well / well_connection.py View on Github external
from cwrap import BaseCClass
from ert.well import WellPrototype, WellConnectionDirectionEnum

class WellConnection(BaseCClass):
    TYPE_NAME = "well_connection"

    _i                   = WellPrototype("int    well_conn_get_i(well_connection)")
    _j                   = WellPrototype("int    well_conn_get_j(well_connection)")
    _k                   = WellPrototype("int    well_conn_get_k(well_connection)")
    _segment_id          = WellPrototype("int    well_conn_get_segment_id(well_connection)")
    _is_open             = WellPrototype("bool   well_conn_open(well_connection)")
    _is_msw              = WellPrototype("bool   well_conn_MSW(well_connection)")
    _fracture_connection = WellPrototype("bool   well_conn_fracture_connection(well_connection)")
    _matrix_connection   = WellPrototype("bool   well_conn_matrix_connection(well_connection)")
    _connection_factor   = WellPrototype("double well_conn_get_connection_factor(well_connection)")
    _equal               = WellPrototype("bool   well_conn_equal(well_connection, well_connection)")
    _get_dir             = WellPrototype("void*  well_conn_get_dir(well_connection)")
    _oil_rate            = WellPrototype("double well_conn_get_oil_rate(well_connection)")
    _gas_rate            = WellPrototype("double well_conn_get_gas_rate(well_connection)")
    _water_rate          = WellPrototype("double well_conn_get_water_rate(well_connection)")
    _volume_rate         = WellPrototype("double well_conn_get_volume_rate(well_connection)")

    _oil_rate_si         = WellPrototype("double well_conn_get_oil_rate_si(well_connection)")
    _gas_rate_si         = WellPrototype("double well_conn_get_gas_rate_si(well_connection)")
    _water_rate_si       = WellPrototype("double well_conn_get_water_rate_si(well_connection)")
    _volume_rate_si      = WellPrototype("double well_conn_get_volume_rate_si(well_connection)")

    def __init__(self):