awslabs / palace

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

Fix divergence cleaning when a model has no real boundaries #269

Closed sebastiangrimberg closed 1 week ago

sebastiangrimberg commented 1 week ago

This avoids solving a singular Laplace problem when calculating the scalar potential for a model with no real boundaries. For example, this can be observed by printing the output of divergence-free projection linear solve for the cavity example with PMC boundaries. After this PR, the divergence-free solves actually converge normally in a few iterations and the eigensolve converges as well.

Correctly handles the case of some subdomains having potentially no true dofs and just enforces a potential = 0 on the processor of lowest rank with some non-zero number of local true dofs.