get_spme_mesh Function

public pure function get_spme_mesh(lattice, kcut) result(mesh)

Number of mesh points resolving the requested reciprocal space cutoff

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: lattice(:,:)

Direct lattice vectors

real(kind=wp), intent(in) :: kcut

Reciprocal space cutoff

Return Value integer, (3)

Number of mesh points along each direction


Source Code

pure function get_spme_mesh(lattice, kcut) result(mesh)

   !> Direct lattice vectors
   real(wp), intent(in) :: lattice(:, :)

   !> Reciprocal space cutoff
   real(wp), intent(in) :: kcut

   !> Number of mesh points along each direction
   integer :: mesh(3)

   integer :: idir

   ! the mesh has to resolve oscillations of wavelength 2*pi/kcut along each
   ! lattice vector, the transform rounds the request up to a supported size
   do idir = 1, 3
      mesh(idir) = valid_mesh_size(ceiling(kcut * norm2(lattice(:, idir)) / pi))
   end do

end function get_spme_mesh