Is it possible in OpenTurns to create a discrete distribution containing non-numeric (string) values?
One application would be to select different turbulence models in my CFD code, that are given as string-values (e.g. ‘k-e’, ‘k-om’, ‘WALE’).
I am thinking of something like this, but it gives an error:
points = ot.Sample([['k-e'], ['k-om'], ['WALE']]) weights = ot.Point([1, 1, 1]) my_distribution = ot.UserDefined(points, weights)
9376 def __init__(self, *args): -> 9377 _typ.Sample_swiginit(self, _typ.new_Sample(*args)) 9378 9379 def __eq__(self, *args): TypeError: Object passed as argument is not convertible to a Sample
If is not possible to handle non-numeric variables in OT, I would have to do a mapping of numerical values to the given strings in my Simulator Code.