Hi MA,
if it is specifically only a numpy array you need to store and reload, numpy has a
save function
. For more general objects (including ngsolve objects, such as GridFunctions, FESpaces...), you could use pythons pickle module:
Code:
import numpy as np
import pickle
x = np.array([1,2,3])
y = np.array([4,5,6])
pickle.dump([x,y], open("filename", "wb"))
unpickler = pickle.Unpickler( open("filename", "rb") )
a,b = unpickler.load()
for i in range(len(x)):
assert a[i] == x[i]
for i in range(len(y)):
assert b[i] == y[i]
Best wishes,
Henry