Skip to content

WIP: MultilevelPoissonSolver wrapper

Tuomas Rossi requested to merge trossi/gpaw:multilevelpoisson into master

Add MultilevelPoissonSolver wrapper for PoissonSolver. This wrapper generalizes the extended grid feature of ExtendedPoissonSolver for multiple extended grids and adds a possibility to apply coarsening after extension.

The wrapper essentially implements a simple mesh-coarsening scheme for PoissonSolver allowing to use large vacuum (without needing to alter other parts of the code). The feature could also be implemented within the usual multigrid scheme, see related discussion here https://listserv.fysik.dtu.dk/pipermail/gpaw-users/2016-December/004410.html

The code is intended for non-periodic systems, but it should be generalizable for mixed boundaries along non-periodic axis.

Illustration of the wrapper:

grids

Let the blue N x N grid on the picture be the original cell with grid spacing h. The wrapper first solves the potential on the larger user-specified red M x M grid with larger grid spacing 2h. This larger coarser grid is intended for capturing the smooth slowly-decaying tail of the potential. The obtained coarse potential is used to correct the boundary conditions of the potential calculated on the finer original cell. The wrapper implements any number of larger and coarser grids (with a specified number of coarsenings per grid).

Usage example for an original cell of size [216, 192, 56]:

from gpaw.poisson import PoissonSolver
from gpaw.poisson_multi import MultilevelPoissonSolver
gpts_l = [[384, 384, 128], [512, 512, 256], [1024, 1024, 512]]
poissonsolver_l = [PoissonSolver(eps=1e-16) for l in range(len(gpts_l)+1)]
poissonsolver = MultilevelPoissonSolver(gpts_l, poissonsolver_l)

This specifies three larger cells that are consecutively coarser. The largest cell [1024, 1024, 512] has actually only [1024, 1024, 512]/2**3 = [128, 128, 64] grid points in the calculation due to the coarsening.

Tasks to be done:

  • tests
  • documentation

Merge request reports