2019-08-19 06:46:14 -05:00
|
|
|
########################################################################################
|
|
|
|
# This example generates a derived property in an synchronous manner
|
|
|
|
# Meaning it completes reading each result before calculating the derived result
|
|
|
|
# See InputPropTestAsync for how to do this asynchronously instead.
|
|
|
|
########################################################################################
|
2019-06-03 14:11:27 -05:00
|
|
|
import rips
|
2019-06-04 03:34:31 -05:00
|
|
|
import time
|
2019-08-14 02:14:12 -05:00
|
|
|
import grpc
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-09-19 06:25:04 -05:00
|
|
|
resinsight = rips.Instance.find()
|
2019-06-04 03:34:31 -05:00
|
|
|
start = time.time()
|
2019-11-21 01:13:15 -06:00
|
|
|
case = resinsight.project.cases()[0]
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-08-19 06:46:14 -05:00
|
|
|
# Read poro result into list
|
2019-09-23 04:50:33 -05:00
|
|
|
poro_results = case.active_cell_property('STATIC_NATIVE', 'PORO', 0)
|
2019-08-19 06:46:14 -05:00
|
|
|
# Read permx result into list
|
2019-09-23 04:50:33 -05:00
|
|
|
permx_results = case.active_cell_property('STATIC_NATIVE', 'PERMX', 0)
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-08-19 06:46:14 -05:00
|
|
|
# Generate output result
|
2019-06-03 07:33:16 -05:00
|
|
|
results = []
|
2019-09-19 08:14:01 -05:00
|
|
|
for (poro, permx) in zip(poro_results, permx_results):
|
2019-06-03 07:33:16 -05:00
|
|
|
results.append(poro * permx)
|
|
|
|
|
2019-08-19 06:46:14 -05:00
|
|
|
try:
|
|
|
|
# Send back output result
|
2019-09-23 04:50:33 -05:00
|
|
|
case.set_active_cell_property(results, 'GENERATED', 'POROPERMXSY', 0)
|
2019-08-14 02:14:12 -05:00
|
|
|
except grpc.RpcError as e:
|
|
|
|
print("Exception Received: ", e)
|
|
|
|
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-06-04 03:34:31 -05:00
|
|
|
end = time.time()
|
|
|
|
print("Time elapsed: ", end - start)
|
2019-08-19 06:46:14 -05:00
|
|
|
print("Transferred all results back")
|
|
|
|
|
2019-09-19 07:47:48 -05:00
|
|
|
view = case.views()[0].apply_cell_result('GENERATED', 'POROPERMXSY')
|