mbd_calc_t Derived Type

type, public :: mbd_calc_t

Represents an MBD calculation.


Contents


Type-Bound Procedures

procedure, public :: init => mbd_calc_init

  • private subroutine mbd_calc_init(this, input)

    Initialize an MBD calculation from an MBD input.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout), target:: this
    type(mbd_input_t), intent(in) :: input

    MBD input.

procedure, public :: destroy => mbd_calc_destroy

  • private subroutine mbd_calc_destroy(this)

    Finalize an MBD calculation.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout), target:: this

procedure, public :: switch_forces => mbd_calc_switch_forces

  • private subroutine mbd_calc_switch_forces(this, forces)

    Update whether to calculate forces.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    logical, intent(in) :: forces

    Whether to calcualte forces.

procedure, public :: update_coords => mbd_calc_update_coords

  • private subroutine mbd_calc_update_coords(this, coords)

    Update atomic coordinates.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(in) :: coords(:,:)

    (, a.u.) New atomic coordinates.

procedure, public :: update_lattice_vectors => mbd_calc_update_lattice_vectors

  • private subroutine mbd_calc_update_lattice_vectors(this, latt_vecs)

    Update unit-cell lattice vectors.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(in) :: latt_vecs(:,:)

    (, a.u.) New lattice vectors in columns.

procedure, public :: update_vdw_params_custom => mbd_calc_update_vdw_params_custom

  • private subroutine mbd_calc_update_vdw_params_custom(this, alpha_0, C6, r_vdw)

    Update vdW parameters in a custom way.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(in) :: alpha_0(:)

    (a.u.) New atomic static polarizabilities.

    real(kind=dp), intent(in) :: C6(:)

    (a.u.) New atomic coefficients.

    real(kind=dp), intent(in) :: r_vdw(:)

    (a.u.) New atomic vdW radii.

procedure, public :: update_vdw_params_from_ratios => mbd_calc_update_vdw_params_from_ratios

  • private subroutine mbd_calc_update_vdw_params_from_ratios(this, ratios)

    Update vdW parameters based on scaling of free-atom values.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(in) :: ratios(:)

    Ratios of atomic volumes in the system and in vacuum.

procedure, public :: update_vdw_params_nl => mbd_calc_update_vdw_params_nl

  • private subroutine mbd_calc_update_vdw_params_nl(this, alpha_0_ratios, C6_ratios)

    Update vdW parameters for the MBD-NL method.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(in) :: alpha_0_ratios(:)

    Ratios of free-atom exact static polarizabilities and those from the VV functional.

    real(kind=dp), intent(in) :: C6_ratios(:)

    Ratios of free-atom exact coefficients and those from the VV functional.

procedure, public :: evaluate_vdw_method => mbd_calc_evaluate_vdw_method

  • private subroutine mbd_calc_evaluate_vdw_method(this, energy)

    Evaluate a given vdW method for a given system and vdW parameters, retrieve energy.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(out) :: energy

    (a.u.) VdW energy.

procedure, public :: get_gradients => mbd_calc_get_gradients

  • private subroutine mbd_calc_get_gradients(this, gradients)

    Retrieve nuclear energy gradients if they were requested in the MBD input.

    The gradients are calculated together with the energy, so a call to this method must be preceeded by a call to evaluate_vdw_method. For the same reason, the gradients must be requested prior to this called via calculate_forces.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(in) :: this
    real(kind=dp), intent(out) :: gradients(:,:)

    (, a.u.) Energy gradients, , index runs over columns.

procedure, public :: get_vdw_params_ratios_gradients => mbd_calc_get_vdw_params_ratios_gradients

  • private subroutine mbd_calc_get_vdw_params_ratios_gradients(this, dE_dratios)

    Get gradients of the energy w.r.t. Hirshfeld ratios if they were requested in the MBD input.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(out) :: dE_dratios(:)

    Gradients of the energy w.r.t. Hirshfeld ratios.

procedure, public :: get_lattice_derivs => mbd_calc_get_lattice_derivs

  • private subroutine mbd_calc_get_lattice_derivs(this, latt_derivs)

    Provide lattice-vector energy gradients if they were requested in the MBD input.

    The gradients are actually calculated together with the energy, so a call to this method must be preceeded by a call to evaluate_vdw_method. For the same reason, the gradients must be requested prior to this called via calculate_forces.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(in) :: this
    real(kind=dp), intent(out) :: latt_derivs(:,:)

    (, a.u.) Energy gradients, , index runs over columns.

procedure, public :: get_lattice_stress => mbd_calc_get_lattice_stress

  • private subroutine mbd_calc_get_lattice_stress(this, stress)

    Provide stress tensor of the lattice.

    This is a utility function wrapping get_lattice_derivs. The lattice vector gradients are coverted to the stress tensor.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(in) :: this
    real(kind=dp), intent(out) :: stress(:,:)

    (, a.u.) Stress tensor.

procedure, public :: get_spectrum_modes => mbd_calc_get_spectrum_modes

  • private subroutine mbd_calc_get_spectrum_modes(this, spectrum, modes)

    Provide MBD spectrum if it was requested in the MBD input.

    The spectrum is actually calculated together with the energy, so a call to this method must be preceeded by a call to evaluate_vdw_method. For the same reason, the spectrum must be requested prior to this call via calculate_spectrum.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(out) :: spectrum(:)

    (, a.u.) Energies (frequencies) of coupled MBD modues, .

    real(kind=dp), intent(out), optional allocatable:: modes(:,:)

    () Coupled-mode wave functions (MBD eigenstates), , in the basis of uncoupled states, , index runs over columns.

    To save memory, the argument must be allocatable, and the method transfers allocation from the internal state to the argument. For this reason, the method can be called only once wih this optional argument per calculation.

procedure, public :: get_rpa_orders => mbd_calc_get_rpa_orders

  • private subroutine mbd_calc_get_rpa_orders(this, rpa_orders)

    Provide RPA orders if they were requested in the MBD input.

    The orders are actually calculated together with the energy, so a call to this method must be preceeded by a call to evaluate_vdw_method. For the same reason, the spectrum must be requested prior to this call via do_rpa and rpa_orders.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    real(kind=dp), intent(out), allocatable:: rpa_orders(:)

    (a.u.) MBD energy decomposed to RPA orders.

procedure, public :: get_exception => mbd_calc_get_exception

  • private subroutine mbd_calc_get_exception(this, code, origin, msg)

    Retrieve an exception in the MBD calculation if it occured.

    Arguments

    Type IntentOptional AttributesName
    class(mbd_calc_t), intent(inout) :: this
    integer, intent(out) :: code

    Exception code, values defined in mbd_constants.

    character(len=*), intent(out) :: origin

    Exception origin.

    character(len=*), intent(out) :: msg

    Exception message.