mctc_cutoff Module

Provides realspace cutoff and lattice generation Realspace cutoff and lattice point generator utilities

Periodic directions are selected by a mask over the three lattice vectors, lattice vectors of nonperiodic directions are ignored. A one-element mask, as created for molecular structures, applies to all three directions.



Interfaces

public interface get_lattice_points

  • private pure subroutine get_lattice_points_cutoff(periodic, lat, rthr, trans, error)

    Create lattice points within a given cutoff

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: periodic(:)

    Periodic dimensions

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

    Lattice parameters

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

    Real space cutoff

    real(kind=wp), intent(out), allocatable :: trans(:,:)

    Generated lattice points

    type(error_type), intent(out), allocatable :: error

    Error handling

  • private subroutine get_lattice_points_cutoff_legacy(periodic, lat, rthr, trans)

    Create lattice points within a given cutoff.

    Note

    Deprecated: pass an explicit error argument instead.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: periodic(:)

    Periodic dimensions

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

    Lattice parameters

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

    Real space cutoff

    real(kind=wp), intent(out), allocatable :: trans(:,:)

    Generated lattice points

  • private pure subroutine get_lattice_points_rep_3d(lat, rep, origin, trans, error)

    Generate lattice points from repetitions

    Arguments

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

    Lattice vectors

    integer, intent(in) :: rep(:)

    Repeatitions of lattice points to generate

    logical, intent(in) :: origin

    Include the origin in the generated lattice points

    real(kind=wp), intent(out), allocatable :: trans(:,:)

    Generated lattice points

    type(error_type), intent(out), allocatable :: error

    Error handling

  • private subroutine get_lattice_points_rep_3d_legacy(lat, rep, origin, trans)

    Generate lattice points from repetitions.

    Note

    Deprecated: pass an explicit error argument instead.

    Arguments

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

    Lattice vectors

    integer, intent(in) :: rep(:)

    Repeatitions of lattice points to generate

    logical, intent(in) :: origin

    Include the origin in the generated lattice points

    real(kind=wp), intent(out), allocatable :: trans(:,:)

    Generated lattice points


Subroutines

public pure subroutine get_inverse_metric(periodic, lattice, lat, ginv, error)

Lattice vectors of the periodic directions and the inverse metric of the periodic subspace.

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: periodic(:)

Periodic dimensions

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

Lattice vectors

real(kind=wp), intent(out) :: lat(3,3)

Lattice vectors of the periodic directions, zero for nonperiodic ones

real(kind=wp), intent(out) :: ginv(3,3)

Inverse metric of the periodic subspace, zero for nonperiodic directions

type(error_type), intent(out), allocatable :: error

Error handling

public pure subroutine get_periodic_axes(periodic, ndim, p_axes)

Extract the number and indices of the periodic lattice directions

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: periodic(:)

Periodic dimensions, a one-element mask applies to all directions

integer, intent(out) :: ndim

Number of periodic dimensions (0, 1, 2, or 3)

integer, intent(out) :: p_axes(3)

Indices of the periodic directions in 1..ndim

public pure subroutine reduce_basis(lat)

Pairwise size reduction of the lattice vectors, which gives a shorter and more orthogonal basis of the same lattice

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: lat(3,3)

Lattice vectors, zero for nonperiodic directions

public pure subroutine wrap_to_central_cell(xyz, lattice, periodic)

Wrap Cartesian coordinates into the central cell along the periodic directions, the components perpendicular to the periodic subspace are kept.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: xyz(:,:)

Cartesian atomic coordinates, updated in place

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

Lattice vectors

logical, intent(in) :: periodic(:)

Periodic dimensions