Functionality of the normal vectors unclear?

More
5 years 6 months ago #1636 by creativeworker
Hello,

i'd like to calculate the forces on a surface by taking the stress tensor times the normal vectors. Therefore, i adjusted a simple example given by the forum.

File Attachment:

File Name: BoundaryFr...me_v2.py
File Size:1 KB


There are two strange behaviors:
  • defining the specialcf.normal(3) on regions leads to unexpected results
  • The BoundaryFromVolume result is completely zero when trying to export to vtk

Perhaps i didn't understand well how the specialcf.normal works?

Thanks in advance!
More
5 years 6 months ago #1637 by joachim
your modification brought in the problem:
The (0,0,0) - coefficientfunction is something different as 'None'.

This one works:
Code:
func_domain2 = CoefficientFunction ([specialcf.normal(3) if mat== "outer" else None for mat in mesh.GetMaterials()])
More
5 years 6 months ago #1638 by creativeworker
Thank you! That indeed solves the first point. But still, the vtk export has no entry.
Also, trying to check the normal on one face of the box results in (0,0,0)

bfv2(mesh(0.5,0.5,0))= (0.0, 0.0, 0.0)
Time to create page: 0.099 seconds