Skip to content

Fix computation of stencil weights for non-orthogonal cells

Description

Always compute the polynomials that are used to generate the weights in primitive coordinates and compute the right-hand side taking the metric into account. Moreover, ensure that the star_general stencil uses a set of polynomials that yields a non-singular matrix for all 14 Bravais lattices. This removes the need for using the singular value decomposition.

With these changes, both the default (i.e. star_general) and the cube stencil give reasonable errors for the Laplacian and the gradient on all 14 Bravais lattices. Tests are added for all these cases.

News snippet

Fix computation of stencil weights for non-orthogonal cells

Checklist

  • I have checked that my code follows the Octopus coding standards
  • I have added tests for all the new features added in this request.

Merge request reports

Loading