当前位置: 首页>>代码示例>>Python>>正文


Python CWrapper.prototype方法代码示例

本文整理汇总了Python中cwrap.CWrapper.prototype方法的典型用法代码示例。如果您正苦于以下问题:Python CWrapper.prototype方法的具体用法?Python CWrapper.prototype怎么用?Python CWrapper.prototype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cwrap.CWrapper的用法示例。


在下文中一共展示了CWrapper.prototype方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    def __init__(self, ert, function_name, argument_types, argument_count):
        super(FunctionErtScript, self).__init__(ert)

        lib = ert_module.load(None)
        wrapper = CWrapper(lib)

        parsed_argument_types = []

        if ert is not None:
            self.__function = wrapper.prototype("c_void_p %s(c_void_p, stringlist)" % function_name)

        else:
            for arg in argument_types:
                if arg is bool:
                    parsed_argument_types.append("bool")
                elif arg is str:
                    parsed_argument_types.append("char*")
                elif arg is int:
                    parsed_argument_types.append("int")
                elif arg is float:
                    parsed_argument_types.append("float")
                else:
                    raise TypeError("Unknown type: %s" % arg)

            self.__function = wrapper.prototype("c_void_p %s(%s)" % (function_name, ", ".join(parsed_argument_types[:argument_count])))
开发者ID:agchitu,项目名称:ert,代码行数:27,代码来源:function_ert_script.py

示例2: test_method_type

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    def test_method_type(self):
        wrapper =  CWrapper(test_lib)
        def stringObj(c_ptr):
            char_ptr = ctypes.c_char_p( c_ptr )
            python_string = char_ptr.value
            test_lib.free(c_ptr)
            return python_string

        wrapper.registerType("string_obj", stringObj)

        dateStamp  = wrapper.prototype("string_obj util_alloc_date_stamp_utc()")
        date_stamp = dateStamp()
        self.assertIsInstance(date_stamp, str)
开发者ID:agchitu,项目名称:ert,代码行数:15,代码来源:test_cwrap.py

示例3: __len__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    def __len__(self):
        return GenKwConfig.cNamespace().size(self)

    def __getitem__(self, index):
        """ @rtype: str """
        return GenKwConfig.cNamespace().iget_name(self, index)

    def __iter__(self):
        index = 0
        while index < len(self):
            yield self[index]
            index += 1


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("gen_kw_config", GenKwConfig)

GenKwConfig.cNamespace().free = cwrapper.prototype("void gen_kw_config_free( gen_kw_config )")
GenKwConfig.cNamespace().alloc_empty = cwrapper.prototype("c_void_p gen_kw_config_alloc_empty( char*, char* )")
GenKwConfig.cNamespace().get_template_file = cwrapper.prototype("char* gen_kw_config_get_template_file(gen_kw_config)")
GenKwConfig.cNamespace().set_template_file = cwrapper.prototype("void gen_kw_config_set_template_file(gen_kw_config , char*)")
GenKwConfig.cNamespace().get_parameter_file = cwrapper.prototype("char* gen_kw_config_get_parameter_file(gen_kw_config)")
GenKwConfig.cNamespace().set_parameter_file = cwrapper.prototype("void gen_kw_config_set_parameter_file( gen_kw_config, char* )")
GenKwConfig.cNamespace().alloc_name_list = cwrapper.prototype("stringlist_obj gen_kw_config_alloc_name_list(gen_kw_config)")

GenKwConfig.cNamespace().should_use_log_scale = cwrapper.prototype("bool gen_kw_config_should_use_log_scale(gen_kw_config, int)")
GenKwConfig.cNamespace().get_key = cwrapper.prototype("char* gen_kw_config_get_key(gen_kw_config)")
GenKwConfig.cNamespace().size = cwrapper.prototype("int gen_kw_config_get_data_size(gen_kw_config)")
GenKwConfig.cNamespace().iget_name = cwrapper.prototype("char* gen_kw_config_iget_name(gen_kw_config, int)")
开发者ID:agchitu,项目名称:ert,代码行数:31,代码来源:gen_kw_config.py

示例4: get_nz

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    def get_nz(self):
        return FieldConfig.cNamespace().get_nz(self)

    def ijk_active(self, i, j, k):
        return FieldConfig.cNamespace().ijk_active(self, i, j, k)

    def free(self):
        FieldConfig.cNamespace().free(self)

    

        
cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("field_config", FieldConfig)

FieldConfig.cNamespace().alloc = cwrapper.prototype("c_void_p field_config_alloc_empty(char* , ecl_grid , c_void_p , bool)")  
FieldConfig.cNamespace().free = cwrapper.prototype("void field_config_free( field_config )")
FieldConfig.cNamespace().get_type = cwrapper.prototype("int field_config_get_type(field_config)")
FieldConfig.cNamespace().get_truncation_mode = cwrapper.prototype("int field_config_get_truncation_mode(field_config)")
FieldConfig.cNamespace().get_truncation_min = cwrapper.prototype("double field_config_get_truncation_min(field_config)")
FieldConfig.cNamespace().get_truncation_max = cwrapper.prototype("double field_config_get_truncation_max(field_config)")
FieldConfig.cNamespace().get_init_transform_name = cwrapper.prototype("char* field_config_get_init_transform_name(field_config)")
FieldConfig.cNamespace().get_output_transform_name = cwrapper.prototype("char* field_config_get_output_transform_name(field_config)")
FieldConfig.cNamespace().ijk_active = cwrapper.prototype("bool field_config_ijk_active(field_config, int, int, int)")
FieldConfig.cNamespace().get_nx = cwrapper.prototype("int field_config_get_nx(field_config)")
FieldConfig.cNamespace().get_ny = cwrapper.prototype("int field_config_get_ny(field_config)")
FieldConfig.cNamespace().get_nz = cwrapper.prototype("int field_config_get_nz(field_config)")
FieldConfig.cNamespace().get_grid = cwrapper.prototype("c_void_p field_config_get_grid(field_config)")  #todo: fix return type

FieldConfig.cNamespace().export_format = cwrapper.prototype("enkf_field_file_format_enum field_config_default_export_format(char*)")  
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:field_config.py

示例5: getMinValues

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        """ @rtype: DoubleVector """
        return EnsemblePlotGenData.cNamespace().max_values(self).setParent(self)

    def getMinValues(self):
        """ @rtype: DoubleVector """
        return EnsemblePlotGenData.cNamespace().min_values(self).setParent(self)

    def free(self):
        EnsemblePlotGenData.cNamespace().free(self)



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerType("ensemble_plot_gen_data", EnsemblePlotGenData)
cwrapper.registerType("ensemble_plot_gen_data_obj", EnsemblePlotGenData.createPythonObject)
cwrapper.registerType("ensemble_plot_gen_data_ref", EnsemblePlotGenData.createCReference)

EnsemblePlotGenData.cNamespace().free = cwrapper.prototype("void enkf_plot_gendata_free(ensemble_plot_gen_data)")
EnsemblePlotGenData.cNamespace().alloc = cwrapper.prototype("c_void_p enkf_plot_gendata_alloc(enkf_config_node)")

EnsemblePlotGenData.cNamespace().size = cwrapper.prototype("int enkf_plot_gendata_get_size(ensemble_plot_gen_data)")
EnsemblePlotGenData.cNamespace().load = cwrapper.prototype("void enkf_plot_gendata_load(ensemble_plot_gen_data, enkf_fs, int, bool_vector)")
EnsemblePlotGenData.cNamespace().get = cwrapper.prototype("ensemble_plot_gen_data_vector_ref enkf_plot_gendata_iget(ensemble_plot_gen_data, int)")

EnsemblePlotGenData.cNamespace().min_values = cwrapper.prototype("double_vector_ref enkf_plot_gendata_get_min_values(ensemble_plot_gen_data)")
EnsemblePlotGenData.cNamespace().max_values = cwrapper.prototype("double_vector_ref enkf_plot_gendata_get_max_values(ensemble_plot_gen_data)")




开发者ID:agchitu,项目名称:ert,代码行数:28,代码来源:ensemble_plot_gen_data.py

示例6: __iter__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        return PcaPlotData.cNamespace().get(self, index).setParent(self)

    def __iter__(self):
        cur = 0
        while cur < len(self):
            yield self[cur]
            cur += 1

    def getSingularValues(self):
        """ @rtype: DoubleVector """
        return PcaPlotData.cNamespace().get_singular_values(self).setParent(self)

    def free(self):
        PcaPlotData.cNamespace().free(self)



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerType("pca_plot_data", PcaPlotData)
cwrapper.registerType("pca_plot_data_obj", PcaPlotData.createPythonObject)
cwrapper.registerType("pca_plot_data_ref", PcaPlotData.createCReference)

PcaPlotData.cNamespace().alloc             = cwrapper.prototype("c_void_p pca_plot_data_alloc(char*, matrix, matrix , double_vector)")
PcaPlotData.cNamespace().free              = cwrapper.prototype("void pca_plot_data_free(pca_plot_data)")

PcaPlotData.cNamespace().component_count      = cwrapper.prototype("int pca_plot_data_get_size(pca_plot_data)")
PcaPlotData.cNamespace().realization_count    = cwrapper.prototype("int pca_plot_data_get_ens_size(pca_plot_data)")
PcaPlotData.cNamespace().get                  = cwrapper.prototype("pca_plot_vector_ref pca_plot_data_iget_vector(pca_plot_data, int)")
PcaPlotData.cNamespace().get_name             = cwrapper.prototype("char* pca_plot_data_get_name(pca_plot_data)")
PcaPlotData.cNamespace().get_singular_values  = cwrapper.prototype("double_vector_ref pca_plot_data_get_singular_values(pca_plot_data)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:pca_plot_data.py

示例7: __len__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        return SummaryKeyMatcher.cNamespace().add_key(self, key)

    def __len__(self):
        return SummaryKeyMatcher.cNamespace().size(self)

    def __contains__(self, key):
        return SummaryKeyMatcher.cNamespace().match_key(self, key)

    def isRequired(self, key):
        """ @rtype: bool """
        return SummaryKeyMatcher.cNamespace().is_required(self, key)

    def keys(self):
        """ @rtype: StringList """
        return SummaryKeyMatcher.cNamespace().keys(self)

    def free(self):
        SummaryKeyMatcher.cNamespace().free(self)


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("summary_key_matcher", SummaryKeyMatcher)

SummaryKeyMatcher.cNamespace().alloc  = cwrapper.prototype("c_void_p summary_key_matcher_alloc()")
SummaryKeyMatcher.cNamespace().free  = cwrapper.prototype("void summary_key_matcher_free(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().size  = cwrapper.prototype("int summary_key_matcher_get_size(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().add_key  = cwrapper.prototype("void summary_key_matcher_add_summary_key(summary_key_matcher, char*)")
SummaryKeyMatcher.cNamespace().match_key  = cwrapper.prototype("bool summary_key_matcher_match_summary_key(summary_key_matcher, char*)")
SummaryKeyMatcher.cNamespace().keys  = cwrapper.prototype("stringlist_obj summary_key_matcher_get_keys(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().is_required  = cwrapper.prototype("bool summary_key_matcher_summary_key_is_required(summary_key_matcher, char*)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:summary_key_matcher.py

示例8: TypeError

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        else:
            raise TypeError("Index should be integer type")


    def getLayer(self , k):
        """
        @rtype: FaultBlockLayer
        """
        return self[k]

    def free(self):
        self.cNamespace().free(self)


    def scanKeyword(self , fault_block_kw):
        ok = self.cNamespace().scan_keyword( self , fault_block_kw )
        if not ok:
            raise ValueError("The fault block keyword had wrong type/size")

    

cwrapper = CWrapper(ECL_LIB)
CWrapper.registerObjectType("fault_block_collection", FaultBlockCollection)


FaultBlockCollection.cNamespace().alloc      = cwrapper.prototype("c_void_p         fault_block_collection_alloc(ecl_grid )")
FaultBlockCollection.cNamespace().free       = cwrapper.prototype("void             fault_block_collection_free(fault_block_collection)")
FaultBlockCollection.cNamespace().num_layers = cwrapper.prototype("int              fault_block_collection_num_layers(fault_block_collection)")
FaultBlockCollection.cNamespace().get_layer  = cwrapper.prototype("fault_block_layer_ref  fault_block_collection_get_layer(fault_block_collection, int)")
FaultBlockCollection.cNamespace().scan_keyword  = cwrapper.prototype("bool          fault_block_collection_scan_kw(fault_block_collection, ecl_kw)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:fault_block_collection.py

示例9: convertDefinition

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    @classmethod
    def convertDefinition(cls, definition):
        """ @rtype: IntegerHash """
        type_hash = IntegerHash()

        for key, value_type in definition.iteritems():
            if value_type == float:
                value_type = 1
            else:
                value_type = 0 #str
            type_hash[key] = value_type
        return type_hash



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("custom_kw_config", CustomKWConfig)

CustomKWConfig.cNamespace().free = cwrapper.prototype("void custom_kw_config_free(custom_kw_config)")
CustomKWConfig.cNamespace().alloc_empty = cwrapper.prototype("void* custom_kw_config_alloc_empty(char*, char*, char*)")
CustomKWConfig.cNamespace().alloc_with_definition = cwrapper.prototype("void* custom_kw_config_alloc_with_definition(char*, integer_hash)")
CustomKWConfig.cNamespace().get_name = cwrapper.prototype("char* custom_kw_config_get_name(custom_kw_config)")
CustomKWConfig.cNamespace().get_result_file = cwrapper.prototype("char* custom_kw_config_get_result_file(custom_kw_config)")
CustomKWConfig.cNamespace().get_output_file = cwrapper.prototype("char* custom_kw_config_get_output_file(custom_kw_config)")
CustomKWConfig.cNamespace().parse_result_file = cwrapper.prototype("bool custom_kw_config_parse_result_file(custom_kw_config, char*, stringlist)")
CustomKWConfig.cNamespace().has_key = cwrapper.prototype("bool custom_kw_config_has_key(custom_kw_config, char*)")
CustomKWConfig.cNamespace().key_is_double = cwrapper.prototype("bool custom_kw_config_key_is_double(custom_kw_config, char*)")
CustomKWConfig.cNamespace().index_of_key = cwrapper.prototype("int custom_kw_config_index_of_key(custom_kw_config, char*)")
CustomKWConfig.cNamespace().size = cwrapper.prototype("int custom_kw_config_size(custom_kw_config)")
CustomKWConfig.cNamespace().keys = cwrapper.prototype("stringlist_obj custom_kw_config_get_keys(custom_kw_config)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:custom_kw_config.py

示例10: free

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
    def free(self):
        LocalObsdataNode.cNamespace().free(self)

    def tstepActive(self , tstep):
        return LocalObsdataNode.cNamespace().tstep_active( self , tstep)


    def getActiveList(self):
        return LocalObsdataNode.cNamespace().get_active_list( self )

    def allTimeStepActive(self):
        return LocalObsdataNode.cNamespace().all_timestep_active( self )

    def setAllTimeStepActive(self, flag):
        return LocalObsdataNode.cNamespace().set_all_timestep_active( self, flag )

cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("local_obsdata_node", LocalObsdataNode)

LocalObsdataNode.cNamespace().alloc            = cwrapper.prototype("c_void_p local_obsdata_node_alloc(char* , bool)")
LocalObsdataNode.cNamespace().free             = cwrapper.prototype("void local_obsdata_node_free(local_obsdata_node)")
LocalObsdataNode.cNamespace().get_key          = cwrapper.prototype("char* local_obsdata_node_get_key(local_obsdata_node)")
LocalObsdataNode.cNamespace().add_range        = cwrapper.prototype("void local_obsdata_node_add_range(local_obsdata_node, int, int)")
LocalObsdataNode.cNamespace().add_step         = cwrapper.prototype("void local_obsdata_node_add_tstep(local_obsdata_node, int)")
LocalObsdataNode.cNamespace().tstep_active     = cwrapper.prototype("bool local_obsdata_node_tstep_active(local_obsdata_node, int)")
LocalObsdataNode.cNamespace().get_active_list  = cwrapper.prototype("active_list_ref local_obsdata_node_get_active_list(local_obsdata_node)")
LocalObsdataNode.cNamespace().all_timestep_active  = cwrapper.prototype("bool local_obsdata_node_all_timestep_active(local_obsdata_node)")
LocalObsdataNode.cNamespace().set_all_timestep_active  = cwrapper.prototype("void local_obsdata_node_set_all_timestep_active(local_obsdata_node, bool)")


开发者ID:agchitu,项目名称:ert,代码行数:30,代码来源:local_obsdata_node.py

示例11: __exit__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]

    def __exit__(self, exc_type, exc_val, exc_tb):
        del self.__test_context
        return False


    def getErt(self):
        return self.__test_context.getErt()


    def getCwd(self):
        """
        Returns the current working directory of this context.
        @rtype: string
        """
        return self.__test_context.getCwd()




cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("ert_test", ErtTest)

ErtTest.cNamespace().alloc = cwrapper.prototype("c_void_p ert_test_context_alloc_python( char* , char*)")
ErtTest.cNamespace().set_store = cwrapper.prototype("c_void_p ert_test_context_set_store( ert_test , bool)")
ErtTest.cNamespace().free = cwrapper.prototype("void ert_test_context_free( ert_test )")
ErtTest.cNamespace().get_enkf_main = cwrapper.prototype("enkf_main_ref ert_test_context_get_main( ert_test )")
ErtTest.cNamespace().get_cwd = cwrapper.prototype("char* ert_test_context_get_cwd( ert_test )")

开发者ID:agchitu,项目名称:ert,代码行数:30,代码来源:ert_test_context.py

示例12: getReportStep

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        return GenDataConfig.cNamespace().get_num_report_step(self)

    def getReportStep(self, index):
        """ @rtype: int """
        return GenDataConfig.cNamespace().iget_report_step(self, index)

    def getReportSteps(self):
        """ @rtype: list of int """
        return [self.getReportStep(index) for index in range(self.getNumReportStep())]


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("gen_data_config", GenDataConfig)


GenDataConfig.cNamespace().alloc = cwrapper.prototype("c_void_p gen_data_config_alloc_GEN_DATA_result( char* , gen_data_file_format_type)")
GenDataConfig.cNamespace().free  = cwrapper.prototype("void gen_data_config_free( gen_data_config )")
GenDataConfig.cNamespace().get_output_format = cwrapper.prototype("gen_data_file_format_type gen_data_config_get_output_format(gen_data_config)")
GenDataConfig.cNamespace().get_input_format = cwrapper.prototype("gen_data_file_format_type gen_data_config_get_input_format(gen_data_config)")
GenDataConfig.cNamespace().get_template_file = cwrapper.prototype("char* gen_data_config_get_template_file(gen_data_config)")
GenDataConfig.cNamespace().get_template_key = cwrapper.prototype("char* gen_data_config_get_template_key(gen_data_config)")
GenDataConfig.cNamespace().get_initial_size = cwrapper.prototype("int gen_data_config_get_initial_size(gen_data_config)")
GenDataConfig.cNamespace().has_report_step = cwrapper.prototype("bool gen_data_config_has_report_step(gen_data_config, int)")
GenDataConfig.cNamespace().get_data_size    = cwrapper.prototype("int gen_data_config_get_data_size__(gen_data_config , int)")
GenDataConfig.cNamespace().get_key          = cwrapper.prototype("char* gen_data_config_get_key(gen_data_config)")
GenDataConfig.cNamespace().get_active_mask  = cwrapper.prototype("bool_vector_ref gen_data_config_get_active_mask(gen_data_config)")

GenDataConfig.cNamespace().get_num_report_step = cwrapper.prototype("int gen_data_config_num_report_step(gen_data_config)")
GenDataConfig.cNamespace().iget_report_step    = cwrapper.prototype("int gen_data_config_iget_report_step(gen_data_config, int)")

开发者ID:agchitu,项目名称:ert,代码行数:31,代码来源:gen_data_config.py

示例13: isinstance

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        Will add a key -> value pair which can be used for search replace
        operations in the data file. Observe that the key will be
        surrounded by \'<\' and \'>\'.
        """
        doc_string = None
        if isinstance(value , str):
            EnKFState.cNamespace().add_subst_kw( self , key , value , doc_string )
        else:
            raise TypeError("The value argument must be a string")

    def getDataKW(self):
        """
        Will return the substitution map for this realisation.
        """
        return EnKFState.cNamespace().get_subst_list( self )


        

cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerType("enkf_state", EnKFState)
cwrapper.registerType("enkf_state_obj", EnKFState.createPythonObject)
cwrapper.registerType("enkf_state_ref", EnKFState.createCReference)


EnKFState.cNamespace().free     = cwrapper.prototype("void enkf_state_free( enkf_state )")
EnKFState.cNamespace().has_key  = cwrapper.prototype("bool enkf_state_has_node( enkf_state , char* )")
EnKFState.cNamespace().get_node = cwrapper.prototype("enkf_node_ref enkf_state_get_node( enkf_state , char* )")
EnKFState.cNamespace().add_subst_kw = cwrapper.prototype("void enkf_state_add_subst_kw( enkf_state , char* , char* , char*)")
EnKFState.cNamespace().get_subst_list  = cwrapper.prototype("subst_list_ref enkf_state_get_subst_list( enkf_state )")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:enkf_state.py

示例14: __ne__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        return WellConnection.cNamespace().equal(self, other)

    def __ne__(self, other):
        return not self == other

    def free(self):
        pass

    def isMultiSegmentWell(self):
        """ @rtype: bool """
        return WellConnection.cNamespace().is_msw(self)


CWrapper.registerObjectType("well_connection", WellConnection)
cwrapper = CWrapper(ECL_WELL_LIB)


WellConnection.cNamespace().i = cwrapper.prototype("int well_conn_get_i(well_connection)")
WellConnection.cNamespace().j = cwrapper.prototype("int well_conn_get_j(well_connection)")
WellConnection.cNamespace().k = cwrapper.prototype("int well_conn_get_k(well_connection)")
WellConnection.cNamespace().get_dir = cwrapper.prototype("well_connection_dir_enum well_conn_get_dir(well_connection)")

WellConnection.cNamespace().segment_id = cwrapper.prototype("int well_conn_get_segment_id(well_connection)")
WellConnection.cNamespace().is_open = cwrapper.prototype("bool well_conn_open(well_connection)")
WellConnection.cNamespace().is_msw = cwrapper.prototype("bool well_conn_MSW(well_connection)")
WellConnection.cNamespace().fracture_connection = cwrapper.prototype("bool well_conn_fracture_connection(well_connection)")
WellConnection.cNamespace().matrix_connection = cwrapper.prototype("bool well_conn_matrix_connection(well_connection)")
WellConnection.cNamespace().connection_factor = cwrapper.prototype("double well_conn_get_connection_factor(well_connection)")

WellConnection.cNamespace().equal = cwrapper.prototype("bool well_conn_equal(well_connection, well_connection)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:well_connection.py

示例15: writeSummaryFile

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import prototype [as 别名]
        

    def writeSummaryFile(self, filename):                                                                                                                          
        """                                                                                                                                                    
        Writes a summary of the local config object                                                                                                            
        The summary contains the Obsset with their respective                                                                                                  
        number of observations and the Datasets with the number of active indices                                                                              
        """                                                                                                                                                    
        assert isinstance(filename, str)                                                                                                                       
        LocalConfig.cNamespace().write_local_config_summary_file(self, filename)                    
        

cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("local_config", LocalConfig)

LocalConfig.cNamespace().free                            = cwrapper.prototype("void local_config_free( local_config )")
LocalConfig.cNamespace().clear                           = cwrapper.prototype("void local_config_clear( local_config )")
LocalConfig.cNamespace().get_updatestep                  = cwrapper.prototype("local_updatestep_ref local_config_get_updatestep( local_config )")
LocalConfig.cNamespace().get_ministep                    = cwrapper.prototype("local_ministep_ref local_config_get_ministep( local_config, char*)")
LocalConfig.cNamespace().create_ministep                 = cwrapper.prototype("void local_config_alloc_ministep( local_config, char*, analysis_module)")
LocalConfig.cNamespace().attach_ministep                 = cwrapper.prototype("void local_updatestep_add_ministep( local_updatestep, local_ministep)")
LocalConfig.cNamespace().get_obsdata                     = cwrapper.prototype("local_obsdata_ref local_config_get_obsdata( local_config, char*)")
LocalConfig.cNamespace().create_obsdata                  = cwrapper.prototype("void local_config_alloc_obsdata( local_config, char*)")
LocalConfig.cNamespace().copy_obsdata                    = cwrapper.prototype("local_obsdata_ref local_config_alloc_obsdata_copy( local_config, char*, char*)")
LocalConfig.cNamespace().has_obsdata                     = cwrapper.prototype("bool local_config_has_obsdata( local_config, char*)")
LocalConfig.cNamespace().get_dataset                     = cwrapper.prototype("local_dataset_ref local_config_get_dataset( local_config, char*)")
LocalConfig.cNamespace().create_dataset                  = cwrapper.prototype("void local_config_alloc_dataset( local_config, char*)")
LocalConfig.cNamespace().copy_dataset                    = cwrapper.prototype("local_dataset_ref local_config_alloc_dataset_copy( local_config, char*, char*)")
LocalConfig.cNamespace().has_dataset                     = cwrapper.prototype("bool local_config_has_dataset( local_config, char*)")

LocalConfig.cNamespace().write_local_config_summary_file = cwrapper.prototype("void local_config_summary_fprintf( local_config, char*)")
开发者ID:agchitu,项目名称:ert,代码行数:33,代码来源:local_config.py


注:本文中的cwrap.CWrapper.prototype方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。