Question about generalized_inner_product() and handling of symmetric tensors
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?
Answers
-
Have you considered using the element nodal forces of the nodes on the surface.
In that case you would have a Force vector.Is your original stress tensor from solid elements, contact, or something else?
0 -
Haven't looked into using the element nodal forces, will take a look. But the question still stand since I will be using the dot product for rotating the stress tensor (critical plane analysis).
My original stress/strain tensor is from solid elements and is represented as 6 components. The field nature is dpf.natures.symmatrix.
My main question is really if I'm missing something about generalized_inner_product() and if there's a work-around.
0