Octopus
double_grid_oct_m Module Reference

The Ono-Hirose double-grid technique [T. Ono and K. Hirose, Phys. Rev. Lett. 82, 5016 (1999); Phys. Rev. B 72, 085115 (2005)]. More...

Detailed Description

The Ono-Hirose double-grid technique [T. Ono and K. Hirose, Phys. Rev. Lett. 82, 5016 (1999); Phys. Rev. B 72, 085115 (2005)].

Localized atom-centered functions f(r) = f_l(r) Y_lm(x) (Kleinman-Bylander projectors, ultrasoft augmentation charges, the short-range local potential, core-correction densities) are evaluated on a fine grid, obtained by dividing each grid cell 'divisor' times per axis, and the transpose of the Lagrange interpolation of order 'order' is folded into the values stored at the coarse points:

\int f \psi \approx h^3 \sum_R \psi(R) f_eff(R), f_eff(R) = (1/d^3) \sum_{fine points x} c_R(x) f(x)

where c_R(x) is the weight of the coarse point R in the interpolation of a smooth function at the fine point x. Since f is analytic (radial spline times a real spherical harmonic), every process computes f_eff at its own submesh points without any communication: contributions to points owned by another domain are dropped, as the owner regenerates them itself. Periodic replicas of a submesh carry distinct integer grid keys, so self-overlapping spheres in small cells accumulate each replica separately.

Data Types

type  double_grid_t
 

Functions/Subroutines

subroutine, public double_grid_init (this, namespace, dim)
 
subroutine, public double_grid_end (this)
 
real(real64) function, public double_grid_margin (this, mesh)
 Submesh radius enlargement needed to contain the effective support of a transformed function: the tensor-product scatter reaches less than interp_max coarse points along each axis beyond the original support, i.e. at most interp_max times the longest cell diagonal. More...
 
subroutine, public double_grid_transform (this, sm, nf, spl, ll, mm, rcut, feff, cart_dir)
 Evaluate a batch of localized functions f_jf(x) = spl_jf(r) * Y_{ll,mm}(x) (or a purely radial spl_jf(r) when ll(jf) == -1, e.g. local potentials and core densities) at the points of a submesh. When the double grid is disabled this is a plain evaluation at the submesh points; when enabled, the effective (interpolation-transpose folded) values are returned. The functions vanish for r > rcut(jf); the effective support then extends up to rcut(jf) + double_grid_margin, which the submesh radius must contain. If cart_dir(jf) > 0, the function is further multiplied by the Cartesian component cart_dir(jf) of the position relative to the center. More...
 
subroutine double_grid_transform_kernel (this, sm, nf, spl, ll, mm, rcut, cdir, feff)
 The transpose-interpolation scatter. All arithmetic is done with integer grid keys relative to the first local submesh point: uniform meshes are integer lattices in the primitive (chi) coordinates, so key(ip) = nint(from_cartesian(rel_x(ip) - rel_x(1))/spacing) is exact, and is unique per (mesh point, periodic replica) within the submesh. Fine points are visited per anchor site (a coarse site of the expanded key bounding box) and offset; their analytic values are scattered to the stencil sites, resolved back to submesh points by a dense key lookup. Scatter targets outside the local submesh are dropped (they belong to another domain or lie outside the box); the submesh radius includes double_grid_margin, so no target is lost at the sphere boundary. More...
 

Function/Subroutine Documentation

◆ double_grid_init()

subroutine, public double_grid_oct_m::double_grid_init ( type(double_grid_t), intent(out)  this,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  dim 
)

Definition at line 159 of file double_grid.F90.

◆ double_grid_end()

subroutine, public double_grid_oct_m::double_grid_end ( type(double_grid_t), intent(inout)  this)

Definition at line 244 of file double_grid.F90.

◆ double_grid_margin()

real(real64) function, public double_grid_oct_m::double_grid_margin ( type(double_grid_t), intent(in)  this,
class(mesh_t), intent(in)  mesh 
)

Submesh radius enlargement needed to contain the effective support of a transformed function: the tensor-product scatter reaches less than interp_max coarse points along each axis beyond the original support, i.e. at most interp_max times the longest cell diagonal.

Definition at line 260 of file double_grid.F90.

◆ double_grid_transform()

subroutine, public double_grid_oct_m::double_grid_transform ( type(double_grid_t), intent(in)  this,
type(submesh_t), intent(in)  sm,
integer, intent(in)  nf,
type(spline_t), dimension(:), intent(in)  spl,
integer, dimension(:), intent(in)  ll,
integer, dimension(:), intent(in)  mm,
real(real64), dimension(:), intent(in)  rcut,
real(real64), dimension(:, :), intent(out)  feff,
integer, dimension(:), intent(in), optional  cart_dir 
)

Evaluate a batch of localized functions f_jf(x) = spl_jf(r) * Y_{ll,mm}(x) (or a purely radial spl_jf(r) when ll(jf) == -1, e.g. local potentials and core densities) at the points of a submesh. When the double grid is disabled this is a plain evaluation at the submesh points; when enabled, the effective (interpolation-transpose folded) values are returned. The functions vanish for r > rcut(jf); the effective support then extends up to rcut(jf) + double_grid_margin, which the submesh radius must contain. If cart_dir(jf) > 0, the function is further multiplied by the Cartesian component cart_dir(jf) of the position relative to the center.

Parameters
[in]spl(nf) radial splines, read-only
[in]ll(nf) l of Y_lm; -1 for radial-only
[in]mm(nf) m of Y_lm
[in]rcut(nf) support radius of each function
[out]feff(smnp, nf) effective values
[in]cart_dir(nf) Cartesian factor; 0 for none (default)

Definition at line 290 of file double_grid.F90.

◆ double_grid_transform_kernel()

subroutine double_grid_oct_m::double_grid_transform_kernel ( type(double_grid_t), intent(in)  this,
type(submesh_t), intent(in)  sm,
integer, intent(in)  nf,
type(spline_t), dimension(:), intent(in)  spl,
integer, dimension(:), intent(in)  ll,
integer, dimension(:), intent(in)  mm,
real(real64), dimension(:), intent(in)  rcut,
integer, dimension(:), intent(in)  cdir,
real(real64), dimension(:, :), intent(out)  feff 
)
private

The transpose-interpolation scatter. All arithmetic is done with integer grid keys relative to the first local submesh point: uniform meshes are integer lattices in the primitive (chi) coordinates, so key(ip) = nint(from_cartesian(rel_x(ip) - rel_x(1))/spacing) is exact, and is unique per (mesh point, periodic replica) within the submesh. Fine points are visited per anchor site (a coarse site of the expanded key bounding box) and offset; their analytic values are scattered to the stencil sites, resolved back to submesh points by a dense key lookup. Scatter targets outside the local submesh are dropped (they belong to another domain or lie outside the box); the submesh radius includes double_grid_margin, so no target is lost at the sphere boundary.

Definition at line 368 of file double_grid.F90.