def dimensions(self): """The dimensions in i, j, k direction Returns: Vec3i: class with integer attributes i, j, k giving extent in all three dimensions. """ case_request = Case_pb2.CaseRequest(id=self.case.id) return self.__stub.GetDimensions( Grid_pb2.GridRequest(case_request=case_request, grid_index=self.index)).dimensions
def cell_centers_async(self): """The cells center for all cells in given grid async. Returns: Iterator to a list of Vec3d: class with double attributes x, y, x giving cell centers """ case_request = Case_pb2.CaseRequest(id=self.case.id) chunks = self.__stub.GetCellCenters( Grid_pb2.GridRequest(case_request=case_request, grid_index=self.index)) for chunk in chunks: yield chunk
def cell_corners_async(self): """The cell corners for all cells in given grid, async. Returns: iterator to a list of CellCorners: a class with Vec3d for each corner (c0, c1.., c7) """ case_request = Case_pb2.CaseRequest(id=self.case.id) chunks = self.__stub.GetCellCorners( Grid_pb2.GridRequest(case_request=case_request, grid_index=self.index)) for chunk in chunks: yield chunk
def active_cell_corners_async(self, porosity_model="MATRIX_MODEL"): """Get a cell corners for all active cells. Async, so returns an iterator Arguments: porosity_model(str): string enum. See available() Returns: An iterator to a chunk object containing an array of CellCorners (which is eight Vec3d values). Loop through the chunks and then the values within the chunk to get all values. """ porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model) request = Case_pb2.CellInfoRequest(case_request=self.__request(), porosity_model=porosity_model_enum) return self.__case_stub.GetCellCornersForActiveCells(request)
def cell_info_for_active_cells_async(self, porosity_model="MATRIX_MODEL"): """Get Stream of cell info objects for current case Arguments: porosity_model(str): String representing an enum. must be 'MATRIX_MODEL' or 'FRACTURE_MODEL'. Returns: Stream of **CellInfo** objects See cell_info_for_active_cells() for detalis on the **CellInfo** class. """ porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model) request = Case_pb2.CellInfoRequest(case_request=self.__request(), porosity_model=porosity_model_enum) return self.__case_stub.GetCellInfoForActiveCells(request)
def cell_count(self, porosity_model="MATRIX_MODEL"): """Get a cell count object containing number of active cells and total number of cells Arguments: porosity_model (str): String representing an enum. must be 'MATRIX_MODEL' or 'FRACTURE_MODEL'. Returns: Cell Count object with the following integer attributes: active_cell_count: number of active cells reservoir_cell_count: total number of reservoir cells """ porosity_model_enum = Case_pb2.PorosityModelType.Value(porosity_model) request = Case_pb2.CellInfoRequest(case_request=self.__request(), porosity_model=porosity_model_enum) return self.__case_stub.GetCellCount(request)
def __init__(self, channel, case_id): # Private properties self.__channel = channel self.__case_stub = Case_pb2_grpc.CaseStub(channel) self.__request = Case_pb2.CaseRequest(id=case_id) info = self.__case_stub.GetCaseInfo(self.__request) self.__properties_stub = Properties_pb2_grpc.PropertiesStub( self.__channel) PdmObject.__init__(self, self.__case_stub.GetPdmObject(self.__request), self.__channel) # Public properties self.case_id = case_id self.name = info.name self.chunk_size = 8160
def __request(self): return Case_pb2.CaseRequest(id=self.id)