Esempio n. 1
0
def set_grid_property(
    self,
    values,
    property_type,
    property_name,
    time_step,
    grid_index=0,
    porosity_model="MATRIX_MODEL",
):
    """Set a cell property for all grid cells. For argument details, see :ref:`Result Definition <result-definition-label>`

    Arguments:
        values(list): a list of double precision floating point numbers
        property_type(str): string enum
        property_name(str): name of an Eclipse property
        time_step(int): the time step for which to get the property for
        grid_index(int): index to the grid we're setting values for
        porosity_model(str): string enum
    """
    property_type_enum = Properties_pb2.PropertyType.Value(property_type)
    porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
    request = Properties_pb2.PropertyRequest(
        case_request=self.__request(),
        property_type=property_type_enum,
        property_name=property_name,
        time_step=time_step,
        grid_index=grid_index,
        porosity_model=porosity_model_enum,
    )
    request_iterator = self.__generate_property_input_chunks(values, request)
    reply = self.__properties_stub.SetGridProperty(request_iterator)
    if reply.accepted_value_count < len(values):
        raise IndexError
Esempio n. 2
0
def set_active_cell_property_async(
    self,
    values_iterator,
    property_type,
    property_name,
    time_step,
    porosity_model="MATRIX_MODEL",
):
    """Set cell property for all active cells Async. Takes an iterator to the input values. For argument details, see :ref:`Result Definition <result-definition-label>`

    Arguments:
        values_iterator(iterator): an iterator to the properties to be set
        property_type(str): string enum
        property_name(str): name of an Eclipse property
        time_step(int): the time step for which to get the property for
        porosity_model(str): string enum
    """
    property_type_enum = Properties_pb2.PropertyType.Value(property_type)
    porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
    request = Properties_pb2.PropertyRequest(
        case_request=self.__request(),
        property_type=property_type_enum,
        property_name=property_name,
        time_step=time_step,
        porosity_model=porosity_model_enum,
    )

    request_iterator = self.__generate_property_input_iterator(
        values_iterator, request)
    self.__properties_stub.SetActiveCellProperty(request_iterator)
Esempio n. 3
0
def grid_property_async(
    self,
    property_type,
    property_name,
    time_step,
    grid_index=0,
    porosity_model="MATRIX_MODEL",
):
    """Get a cell property for all grid cells. Async, so returns an iterator. For argument details, see :ref:`Result Definition <result-definition-label>`

    Arguments:
        property_type(str): string enum
        property_name(str): name of an Eclipse property
        time_step(int): the time step for which to get the property for
        gridIndex(int): index to the grid we're getting values for
        porosity_model(str): string enum

    Returns:
        An iterator to a chunk object containing an array of double values
        Loop through the chunks and then the values within the chunk to get all values.
    """
    property_type_enum = Properties_pb2.PropertyType.Value(property_type)
    porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model)
    request = Properties_pb2.PropertyRequest(
        case_request=self.__request(),
        property_type=property_type_enum,
        property_name=property_name,
        time_step=time_step,
        grid_index=grid_index,
        porosity_model=porosity_model_enum,
    )
    for chunk in self.__properties_stub.GetGridProperty(request):
        yield chunk
Esempio n. 4
0
    def activeCellPropertyAsync(self,
                                propertyType,
                                propertyName,
                                timeStep,
                                porosityModel='MATRIX_MODEL'):
        """Get a cell property for all active cells. Async, so returns an iterator
            
            Arguments:
                propertyType(str): string enum. See available()
                propertyName(str): name of an Eclipse property
                timeStep(int): the time step for which to get the property for
                porosityModel(str): string enum. See available()

            Returns:
                An iterator to a chunk object containing an array of double values
                You first loop through the chunks and then the values within the chunk to get all values.
        """
        propertyTypeEnum = Properties_pb2.PropertyType.Value(propertyType)
        porosityModelEnum = Case_pb2.PorosityModelType.Value(porosityModel)
        request = Properties_pb2.PropertyRequest(
            case_request=Case_pb2.CaseRequest(id=self.case.id),
            property_type=propertyTypeEnum,
            property_name=propertyName,
            time_step=timeStep,
            porosity_model=porosityModelEnum)
        for chunk in self.propertiesStub.GetActiveCellProperty(request):
            yield chunk
Esempio n. 5
0
 def setGridProperty(self,
                     values,
                     propertyType,
                     propertyName,
                     timeStep,
                     gridIndex=0,
                     porosityModel='MATRIX_MODEL'):
     """Set a cell property for all grid cells.
         
         Arguments:
             values(list): a list of double precision floating point numbers
             propertyType(str): string enum. See available()
             propertyName(str): name of an Eclipse property
             timeStep(int): the time step for which to get the property for
             gridIndex(int): index to the grid we're setting values for
             porosityModel(str): string enum. See available()
     """
     propertyTypeEnum = Properties_pb2.PropertyType.Value(propertyType)
     porosityModelEnum = Case_pb2.PorosityModelType.Value(porosityModel)
     request = Properties_pb2.PropertyRequest(
         case_request=self.case.request,
         property_type=propertyTypeEnum,
         property_name=propertyName,
         time_step=timeStep,
         grid_index=gridIndex,
         porosity_model=porosityModelEnum)
     request_iterator = self.__generatePropertyInputChunks(values, request)
     reply = self.propertiesStub.SetGridProperty(request_iterator)
     if reply.accepted_value_count < len(values):
         raise IndexError
Esempio n. 6
0
    def setActiveCellPropertyAsync(self,
                                   values_iterator,
                                   propertyType,
                                   propertyName,
                                   timeStep,
                                   porosityModel='MATRIX_MODEL'):
        """Set a cell property for all active cells. Async, and so takes an iterator to the input values
            
            Arguments:
                values_iterator(iterator): an iterator to the properties to be set
                propertyType(str): string enum. See available()
                propertyName(str): name of an Eclipse property
                timeStep(int): the time step for which to get the property for
                porosityModel(str): string enum. See available()
        """
        propertyTypeEnum = Properties_pb2.PropertyType.Value(propertyType)
        porosityModelEnum = Case_pb2.PorosityModelType.Value(porosityModel)
        request = Properties_pb2.PropertyRequest(
            case_request=self.case.request,
            property_type=propertyTypeEnum,
            property_name=propertyName,
            time_step=timeStep,
            porosity_model=porosityModelEnum)

        request_iterator = self.__generatePropertyInputIterator(
            values_iterator, request)
        self.propertiesStub.SetActiveCellProperty(request_iterator)