Files
ResInsight/Python/examples/SetResultValues.py

20 lines
525 B
Python
Raw Normal View History

import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '../api'))
import ResInsight
resInsight = ResInsight.Instance.find()
2019-05-22 16:03:03 +02:00
activeCellCount = resInsight.gridInfo.cellCount(caseId=0).active_cell_count
values = []
2019-05-22 16:03:03 +02:00
for i in range(0, activeCellCount):
values.append(i % 2 * 0.5);
2019-05-22 16:03:03 +02:00
timeSteps = resInsight.gridInfo.timeSteps(caseId=0)
for i in range(0, len(timeSteps)):
print("Applying values to all time step " + str(i))
resInsight.properties.setActiveCellResults(values, 0, 'DYNAMIC_NATIVE', 'SOIL', i)