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 __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)