2019-08-19 13:46:14 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# This example will get the cell info for the active cells for the first case
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
# Import the ResInsight Processing Server Module
|
2019-06-03 21:11:27 +02:00
|
|
|
import rips
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Connect to ResInsight
|
2019-06-03 21:11:27 +02:00
|
|
|
resInsight = rips.Instance.find()
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get the case with id == 0. This will fail if your project doesn't have a case with id == 0
|
2019-06-03 14:33:16 +02:00
|
|
|
case = resInsight.project.case(id = 0)
|
|
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get the cell count object
|
2019-06-03 14:33:16 +02:00
|
|
|
cellCounts = case.cellCount()
|
2019-05-22 16:03:03 +02:00
|
|
|
print("Number of active cells: " + str(cellCounts.active_cell_count))
|
2019-08-19 13:46:14 +02:00
|
|
|
print("Total number of reservoir cells: " + str(cellCounts.reservoir_cell_count))
|
2019-05-22 16:03:03 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get information for all active cells
|
|
|
|
|
activeCellInfos = case.cellInfoForActiveCells()
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# A simple check on the size of the cell info
|
|
|
|
|
assert(cellCounts.active_cell_count == len(activeCellInfos))
|
2019-05-22 16:03:03 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Print information for the first active cell
|
2019-05-20 13:21:02 +02:00
|
|
|
print("First active cell: ")
|
2019-08-19 13:46:14 +02:00
|
|
|
print(activeCellInfos[0])
|