Files
ResInsight/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/CaseInfoStreamingExample.py

23 lines
590 B
Python
Raw Normal View History

import rips
resInsight = rips.Instance.find()
case = resInsight.project.case(id = 0)
cellCounts = case.cellCount()
2019-05-22 16:03:03 +02:00
print("Number of active cells: " + str(cellCounts.active_cell_count))
activeCellInfoChunks = case.cellInfoForActiveCells()
#print("Number of grids: " + str(gridCount))
#print(gridDimensions)
receivedActiveCells = []
for activeCellChunk in activeCellInfoChunks:
for activeCell in activeCellChunk.data:
receivedActiveCells.append(activeCell)
2019-05-22 16:03:03 +02:00
assert(cellCounts.active_cell_count == len(receivedActiveCells))
print("First active cell: ")
print(receivedActiveCells[0])