awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
237 stars 49 forks source link

Fix ParaView output on boundary mesh for shared faces #200

Closed sebastiangrimberg closed 7 months ago

sebastiangrimberg commented 7 months ago

We redimensionalize the mesh coordinates and the local parts of the fields, but also need to redimensionalize the face neighbor data vectors (which have already been exchanged, based on the nondimensional dof data). This resolves issues where the fields for shared faces appear to be very small or very large relative to the rest of the boundary visualization.

Note: This should not have an effect on surface integrals based on boundary coefficients for problems with internal boundaries (like integrated charge, or surface participation). These integrals are computed outside of the field nondimensionalization/redimensionalization, so this bug only affects visualization and also only for parallel simulations which boundary elements coinciding with shared faces.

sebastiangrimberg commented 7 months ago

For example, the cpw/wave_uniform case prior to this PR, visualizing electric field energy in paraview_bdr on the chip surface, in log scale (pardon the coarse mesh):

Screenshot 2024-02-20 at 9 05 02 AM

After this PR:

Screenshot 2024-02-20 at 9 04 47 AM

One can see that the few triangles on the chip surface which had very small values are resolved. These triangles correspond to subdomain boundary faces where the evaluation in the neighboring subdomain, using the boundary face neighbor data, is incorrect due to the missing redimensionalization.