Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Functionality of the normal vectors unclear?

More
4 years 10 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
4 years 10 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
4 years 10 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.123 seconds