2019-08-19 06:46:14 -05:00
|
|
|
###################################################################################
|
|
|
|
# This example will connect to ResInsight, retrieve a list of cases and print info
|
2020-02-20 14:40:43 -06:00
|
|
|
#
|
2019-08-19 06:46:14 -05:00
|
|
|
###################################################################################
|
|
|
|
|
|
|
|
# Import the ResInsight Processing Server Module
|
2019-06-03 07:33:16 -05:00
|
|
|
import rips
|
2019-05-20 06:21:02 -05:00
|
|
|
|
2019-08-19 06:46:14 -05:00
|
|
|
# Connect to ResInsight
|
2019-09-19 06:25:04 -05:00
|
|
|
resinsight = rips.Instance.find()
|
|
|
|
if resinsight is not None:
|
2019-08-19 06:46:14 -05:00
|
|
|
# Get a list of all cases
|
2019-09-19 06:25:04 -05:00
|
|
|
cases = resinsight.project.cases()
|
2019-06-03 07:33:16 -05:00
|
|
|
|
|
|
|
print ("Got " + str(len(cases)) + " cases: ")
|
|
|
|
for case in cases:
|
2020-02-21 05:10:02 -06:00
|
|
|
print("Case id: " + str(case.id))
|
2019-08-19 06:46:14 -05:00
|
|
|
print("Case name: " + case.name)
|
2020-02-25 04:59:06 -06:00
|
|
|
print("Case type: " + case.class_keyword)
|
2020-02-21 05:10:02 -06:00
|
|
|
print("Case file name: " + case.file_path)
|
2020-01-23 07:43:51 -06:00
|
|
|
print("Case reservoir bounding box:", case.reservoir_boundingbox())
|
2020-02-20 14:40:43 -06:00
|
|
|
|
2019-09-19 04:14:40 -05:00
|
|
|
timesteps = case.time_steps()
|
2019-09-02 04:44:17 -05:00
|
|
|
for t in timesteps:
|
|
|
|
print("Year: " + str(t.year))
|
|
|
|
print("Month: " + str(t.month))
|
2019-08-19 06:46:14 -05:00
|
|
|
|
2020-02-25 04:59:06 -06: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 14:40:43 -06:00
|
|
|
|
2020-02-25 04:59:06 -06: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))
|