Hello!
I am working on a script with pyDPF-core and had a question about how generalized_inner_product() works. I am computing the traction vector from the stress vector and surface normal. However, when I use the generalized_inner_product() operator, I got unexpected results.
Made a minimal example:
from ansys.dpf import core as dpf
# Initialize Fields
field1 = dpf.Field(nentities=2, nature=dpf.natures.symmatrix)
field2 = dpf.Field(nentities=1)
field1.data = [1, 2, 3, 4, 5, 6, 11, 2, 3, 4, 5, 6]
field2.data = [1, 1, 1]
field1.scoping.ids = range(2)
field2.scoping.ids = range(1)
dot_op = dpf.operators.math.generalized_inner_product(field1, field2)
field3 = dot_op.eval()
print(field3.data)
Output:
[[6. 6.5 8.5]
[0. 0. 0. ]]
Expected Output:
[[11. 11. 14.]
[0. 0. 0. ]]
This confirmed that when acting on fields with nature=symmatrix, generalized_inner_product() divides the off-diagonal components by 2 before computing the product.
Wanted to know if this is intended behavior. Is there some property I can set to get around this?
Wanted to know if this is intended behavior. Is there some property I can set to get around this?