Hello,
I would like to do a Radioss 2025 simulation where the force is interpolated from a table based on the X and Z positions. For this, I am using a /FUNC_PYTHON:
#####################
/FUNC_PYTHON/1
def f(x):
from scipy.interpolate import LinearNDInterpolator
import numpy as np
X = [0, 1, 0, 0] #a simple exemple of my table
Z = [0, 0, 1, 0]
Fx = [0, 1, 2, 3]
Pos = np.column_stack((X, Z))
xq, zq = DX(1), DZ(1)
interp_fx = LinearNDInterpolator(Pos, Fx) #this line takes a long time
fx = interp_fx(xq, zq)
return fx
#####################
However, when the table size exceeds 300 values, the computation time becomes excessively long. This is because the LinearNDInterpolator initialization occurs with every function call.
Do you have a solution to speed up the computation time? Or an other way to do a Delaunay interpolation from a table ?
Thank you,
Romain