#include <grid_sizer.hpp>
Static Public Member Functions | |
| static void | calculate_grid_dimensions (Real energy_cutoff, Real two_pi_over_lattice_parameter_squared, const Matrix3x3 &direct_lattice, const Matrix3x3 &reciprocal_lattice, int &grid_dimension_1, int &grid_dimension_2, int &grid_dimension_3, const int fft_factors[3]=nullptr) |
| static void | compute_fft_factors (const Crystal &crystal_structure, int fft_factors[3]) |
| static int | fft_factor_for_fractional_translation (Real translation_component) |
| static int | get_good_fft_dimension (int number_of_points) |
| static int | get_good_fft_order (int number_of_points, int division_factor=1) |
Definition at line 19 of file grid_sizer.hpp.
|
inlinestatic |
Determine minimum FFT grid dimensions for a given energy cutoff.
Definition at line 101 of file grid_sizer.hpp.
References q3::math::tolerances::energy_cutoff_rounding_tolerance, get_good_fft_order(), and q3::Vector3D::norm2().
Referenced by q3::PlanewaveFFTPair::initialize().
|
inlinestatic |
Compute FFT grid divisibility factors from the space group's fractional translations, so that every operation the code applies moves the real-space grid onto itself (Quantum ESPRESSO's fft_fact).
The translations are those of the symmetry operations spglib accepts, not differences between same-species atom pairs. Two like atoms separated by a fraction of a lattice vector need not be related by any operation of the group – in a supercell most such pairs are not – and the scan also had no way to tell a real fraction from a difference that is none, which is how the committed 2x2x2 silicon supercell ended up with factors (6, 6, 6) where its translations ask for (4, 4, 4).
Reading the group also makes the factor scale with the cell: the primitive cell's own halves are quarters in a cell twice as long, so the supercell asks for twice the divisor and the two grids keep the same spacing. A factor read off atom pairs had no reason to respect that.
Definition at line 83 of file grid_sizer.hpp.
References fft_factor_for_fractional_translation(), and q3::SymmetryAnalyzer::get_symmetry_operations().
Referenced by q3::PlanewaveFFTPair::initialize().
|
inlinestatic |
Divisibility that one component of a fractional translation imposes on the FFT grid dimension along its axis.
A translation by tau carries a grid point onto a grid point only when tau * N is a whole number of steps, so a component equal to 1/n asks for N divisible by n. The component is first folded into [-1/2, 1/2], since a translation and its negative are the same constraint and spglib reports translations in [0, 1) – 3/4 there is -1/4 here, denominator 4 rather than 1.
round(1/|tau|) is an integer for any tau whatsoever, so the candidate denominator is kept only when it reproduces the component it came from. Accepting it unchecked is what read the 0.375 between the two sublattices of the committed 2x2x2 silicon supercell – no fraction of this form at all – as 1/3, and asked for a grid divisible by 3 in a cell whose translations are halves.
Returns 1, no constraint, for a component that is zero, that is not within tolerance of 1/n, or whose denominator is outside {2, 3, 4, 6}. Those four are the denominators a space group's own fractional translations can take (the screw axes and glide planes), and they are also the only ones get_good_fft_order() can be sure to satisfy, as it looks for multiples of the factor among products of 2, 3 and 5 – a denominator of 7 would send it searching forever.
Definition at line 47 of file grid_sizer.hpp.
References q3::math::tolerances::fractional_translation_rounding_tolerance.
Referenced by compute_fft_factors().
|
inlinestatic |
Find good FFT dimension (multiple of small primes).
Definition at line 165 of file grid_sizer.hpp.
References get_good_fft_order().
|
inlinestatic |
Find smallest n >= number_of_points that is a product of 2, 3, 5 and divisible by division_factor.
Definition at line 173 of file grid_sizer.hpp.
Referenced by calculate_grid_dimensions(), and get_good_fft_dimension().