Shell Principal Stresses in Karamba API

Hi everyone,
I am trying to get the Principal Stress (PS) values from a shell model using Karamba API.
In a previous Grasshopper prototype I used the ShellVecResults component, and the closest equivalent function I found in the API was PrincipalStressDirs, which I’m using like this to get PS values for the bottom layer:

PrincipalStressDirs.solve(k3dModel, 0, -1, new feb.VectReal(), out _, out _, out _, out List<double> bottomPS1s, out List<double> bottomPS2s);

However, all the resulting PS values are 0. I guess that I’m using some input wrong, and I’d say the culprit is the 4th argument, “superimp_factors (Type: VectReal): vector of doubles for superimposing the loadcases” according to the documentation: PrincipalStressDirs.solve Method, which I’m setting to new feb.VectReal(), even though I couldn’t really understand what is it doing. But since I only have one loadcase, I wonder if it actually matters.

Either the problem is that or the second argument, "layer_ind: index of layer of shell where force flow lines shall be computed) that I’m setting to 0.
Alternatively, is there a better way of getting PS values?
Thanks in advance, Eduardo

Hi @castroecosta,
the VectReal superimp_factors is a vector of load-case-multipliers.
Try the following: create a new VectReal via ‘var superimp_factors = new VectReal()’ and set the entry which corresponds to the first load-case to ‘1’ via ‘superimp_factors.Add(1)’.
‘layer_ind = 0’ is ok: This is the layer of the basic cross section. Layer indexes larger than 0 belong to e.g. reinforcement.
– Clemens

Thanks Clemens, worked like a charm!
Actually, I used this shorter version (as suggested by Visual Studio):
PrincipalStressDirs.solve(k3dModel, 0, -1, new feb.VectReal { 1 }, out _, out _, out _, out List<double> bottomPS1s, out List<double> bottomPS2s);