2019-06-03 14:11:27 -05:00
|
|
|
import rips
|
2019-05-31 03:17:44 -05:00
|
|
|
|
|
|
|
def createResult(soilChunks, porvChunks):
|
|
|
|
for (soilChunk, porvChunk) in zip(soilChunks, porvChunks):
|
|
|
|
resultChunk = []
|
|
|
|
number = 0
|
|
|
|
for (soil, porv) in zip(soilChunk.values, porvChunk.values):
|
|
|
|
resultChunk.append(soil * porv)
|
|
|
|
number += 1
|
|
|
|
yield resultChunk
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-03 14:11:27 -05:00
|
|
|
resInsight = rips.Instance.find()
|
2019-06-03 07:33:16 -05:00
|
|
|
case = resInsight.project.case(id=0)
|
|
|
|
timeStepInfo = case.timeSteps()
|
2019-05-31 03:17:44 -05:00
|
|
|
|
2019-08-07 16:33:08 -05:00
|
|
|
porvChunks = case.properties.activeCellPropertyAsync('STATIC_NATIVE', 'PORV', 0)
|
2019-05-31 03:17:44 -05:00
|
|
|
porvArray = []
|
|
|
|
for porvChunk in porvChunks:
|
|
|
|
porvArray.append(porvChunk)
|
|
|
|
|
2019-06-06 02:13:23 -05:00
|
|
|
for i in range (0, len(timeStepInfo)):
|
2019-08-07 16:33:08 -05:00
|
|
|
soilChunks = case.properties.activeCellPropertyAsync('DYNAMIC_NATIVE', 'SOIL', i)
|
2019-05-31 03:17:44 -05:00
|
|
|
input_iterator = createResult(soilChunks, iter(porvArray))
|
2019-06-03 07:33:16 -05:00
|
|
|
case.properties.setActiveCellPropertyAsync(input_iterator, 'GENERATED', 'SOILPORVAsync', i)
|
2019-05-31 03:17:44 -05:00
|
|
|
|
|
|
|
print("Transferred all results back")
|