![]() |
Octopus
|
The Ono-Hirose double-grid technique [T. Ono and K. Hirose, Phys. Rev. Lett. 82, 5016 (1999); Phys. Rev. B 72, 085115 (2005)]. More...
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 the given 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 | dg_axis_kernel_t |
| One-dimensional transpose-interpolation kernel along a single Cartesian axis. The full 3D tensor-product scatter weight factorizes as K1(c1,g1) K2(c2,g2) K3(c3,g3), so the scatter is done as three separable banded contractions instead of an (order+1)^3 tensor product per fine point. Fine index g = (ia - amin)*divisor + (o + nn) + 1 enumerates anchor ia and sub-offset o; each fine index scatters to at most order+1 coarse (submesh-box) points c in [1, nc]. More... | |
| type | double_grid_cache_t |
| Persistent, function-independent geometry of the double-grid transpose scatter for one submesh. Everything here depends only on the submesh geometry and the double-grid parameters (divisor, order, coordinate system), NOT on the functions being transformed, so it can be built once with double_grid_cache_init and reused by every double_grid_transform on that submesh. The integer keys are the periodicity/replica-correct rel_x-based keys (relative to the first LOCAL submesh point), so the cache is per-domain under domain decomposition, exactly like the on-the-fly path. More... | |
| 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, cache) |
| 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, cache) |
| 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. The fine points are those of the anchor sites (the coarse sites of the key bounding box expanded by the stencil reach) and their offsets; their analytic values are folded onto 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... | |
| subroutine, public | double_grid_cache_init (cache, this, sm) |
| Precompute the function-independent geometry of the double-grid transpose scatter for one submesh: the integer keys (relative to the first LOCAL submesh point, periodicity/replica correct), their bounding box and dense key->point map, the per-axis Cartesian cell steps, the fine offsets, and the interpolation-stencil targets/weights. None of this depends on the functions being transformed, so a cache built here is reused by every double_grid_transform on this submesh. Because the keys are built from the LOCAL submesh points, the cache is per-domain and matches the on-the-fly path exactly under domain decomposition. Must be rebuilt if the submesh geometry changes (e.g. the atom moves) or the double-grid parameters change. More... | |
| subroutine, public | double_grid_cache_end (cache) |
| 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 206 of file double_grid.F90.
| subroutine, public double_grid_oct_m::double_grid_end | ( | type(double_grid_t), intent(inout) | this | ) |
Definition at line 294 of file double_grid.F90.
| 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 310 of file double_grid.F90.
| 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, | ||
| type(double_grid_cache_t), intent(in), optional | cache | ||
| ) |
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.
| [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) |
| [in] | cache | Optional precomputed geometry (double_grid_cache_init) for this submesh, reused across calls. |
Definition at line 340 of file double_grid.F90.
|
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. The fine points are those of the anchor sites (the coarse sites of the key bounding box expanded by the stencil reach) and their offsets; their analytic values are folded onto 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.
The 3D tensor-product scatter weight factorizes as K1(c1,g1) K2(c2,g2) K3(c3,g3), so the fine values are contracted along one axis at a time with the banded 1D kernels of the cache, instead of scattering each fine point to (order+1)^3 coarse points.
| [in] | cache | Optional precomputed geometry for this submesh; built on the fly if absent. |
Definition at line 426 of file double_grid.F90.
| subroutine, public double_grid_oct_m::double_grid_cache_init | ( | type(double_grid_cache_t), intent(out) | cache, |
| type(double_grid_t), intent(in) | this, | ||
| type(submesh_t), intent(in) | sm | ||
| ) |
Precompute the function-independent geometry of the double-grid transpose scatter for one submesh: the integer keys (relative to the first LOCAL submesh point, periodicity/replica correct), their bounding box and dense key->point map, the per-axis Cartesian cell steps, the fine offsets, and the interpolation-stencil targets/weights. None of this depends on the functions being transformed, so a cache built here is reused by every double_grid_transform on this submesh. Because the keys are built from the LOCAL submesh points, the cache is per-domain and matches the on-the-fly path exactly under domain decomposition. Must be rebuilt if the submesh geometry changes (e.g. the atom moves) or the double-grid parameters change.
Definition at line 676 of file double_grid.F90.
| subroutine, public double_grid_oct_m::double_grid_cache_end | ( | type(double_grid_cache_t), intent(inout) | cache | ) |
Definition at line 821 of file double_grid.F90.