2019-08-19 13:46:14 +02:00
|
|
|
###################################################################################
|
|
|
|
|
# This example will connect to ResInsight, retrieve a list of cases and print info
|
2020-02-20 21:40:43 +01:00
|
|
|
#
|
2019-08-19 13:46:14 +02:00
|
|
|
###################################################################################
|
|
|
|
|
|
|
|
|
|
# Import the ResInsight Processing Server Module
|
2019-06-03 14:33:16 +02:00
|
|
|
import rips
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Connect to ResInsight
|
2019-09-19 13:25:04 +02:00
|
|
|
resinsight = rips.Instance.find()
|
|
|
|
|
if resinsight is not None:
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get a list of all cases
|
2019-09-19 13:25:04 +02:00
|
|
|
cases = resinsight.project.cases()
|
2019-06-03 14:33:16 +02:00
|
|
|
|
|
|
|
|
print ("Got " + str(len(cases)) + " cases: ")
|
|
|
|
|
for case in cases:
|
2020-02-21 12:10:02 +01:00
|
|
|
print("Case id: " + str(case.id))
|
2019-08-19 13:46:14 +02:00
|
|
|
print("Case name: " + case.name)
|
2020-03-04 14:52:16 +01:00
|
|
|
print("Case type: " + case.__class__.__name__)
|
2020-02-21 12:10:02 +01:00
|
|
|
print("Case file name: " + case.file_path)
|
2020-01-23 14:43:51 +01:00
|
|
|
print("Case reservoir bounding box:", case.reservoir_boundingbox())
|
2020-02-20 21:40:43 +01:00
|
|
|
|
2019-09-19 11:14:40 +02:00
|
|
|
timesteps = case.time_steps()
|
2019-09-02 11:44:17 +02:00
|
|
|
for t in timesteps:
|
|
|
|
|
print("Year: " + str(t.year))
|
|
|
|
|
print("Month: " + str(t.month))
|
2019-08-19 13:46:14 +02:00
|
|
|
|
2020-02-25 11:59:06 +01:00
|
|
|
if isinstance(case, rips.EclipseCase):
|
|
|
|
|
print ("Getting coarsening info for case: ", case.name, case.id)
|
|
|
|
|
coarsening_info = case.coarsening_info()
|
|
|
|
|
if coarsening_info:
|
|
|
|
|
print("Coarsening information:")
|
2020-02-20 21:40:43 +01:00
|
|
|
|
2020-02-25 11:59:06 +01:00
|
|
|
for c in coarsening_info:
|
|
|
|
|
print("[{}, {}, {}] - [{}, {}, {}]".format(c.min.x, c.min.y, c.min.z,
|
|
|
|
|
c.max.x, c.max.y, c.max.z))
|