mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Python: Rename example directory to PythonExamples
* This is so that when we add the folder to the Script Path it will look more sensible to the user.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import rips
|
||||
import time
|
||||
import numpy as np
|
||||
|
||||
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
|
||||
|
||||
npSoilChunk = np.array(soilChunk.values)
|
||||
npPorvChunk = np.array(porvChunk.values)
|
||||
yield npSoilChunk + npPorvChunk
|
||||
|
||||
|
||||
resInsight = rips.Instance.find()
|
||||
start = time.time()
|
||||
case = resInsight.project.case(id=0)
|
||||
timeStepInfo = case.timeSteps()
|
||||
|
||||
@@ -25,4 +26,7 @@ for i in range (0, len(timeStepInfo)):
|
||||
input_iterator = createResult(soilChunks, iter(porvArray))
|
||||
case.properties.setActiveCellPropertyAsync(input_iterator, 'GENERATED', 'SOILPORVAsync', i)
|
||||
|
||||
end = time.time()
|
||||
print("Time elapsed: ", end - start)
|
||||
|
||||
print("Transferred all results back")
|
||||
@@ -1,6 +1,8 @@
|
||||
import rips
|
||||
import time
|
||||
|
||||
resInsight = rips.Instance.find()
|
||||
start = time.time()
|
||||
case = resInsight.project.case(id=0)
|
||||
|
||||
porvResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
|
||||
@@ -13,4 +15,8 @@ for i in range (0, len(timeStepInfo)):
|
||||
results.append(soil * porv)
|
||||
|
||||
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
|
||||
|
||||
end = time.time()
|
||||
print("Time elapsed: ", end - start)
|
||||
|
||||
print("Transferred all results back")
|
||||
Reference in New Issue
Block a user