Functionality of the normal vectors unclear?


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.

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

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

Thanks in advance!


your modification brought in the problem:
The (0,0,0) - coefficientfunction is something different as ‘None’.

This one works:

func_domain2 = CoefficientFunction ([specialcf.normal(3) if mat== "outer" else None for mat in mesh.GetMaterials()])

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)