mbe_result_t Derived Type

type, public :: mbe_result_t

Container for Many-Body Expansion aggregated results

Stores total properties computed via MBE: energy, gradient, hessian, dipole. Caller allocates desired components before calling compute_mbe; the function uses allocated() to determine what to compute and sets has_* flags on success.


Components

Type Visibility Attributes Name Initial
real(kind=dp), public, allocatable :: dipole(:)

Total dipole moment (3) (e*Bohr)

real(kind=dp), public, allocatable :: dipole_derivatives(:,:)

Dipole derivatives (3, 3*natoms) for IR intensities

real(kind=dp), public, allocatable :: gradient(:,:)

Total gradient (3, total_atoms) (Hartree/Bohr)

logical, public :: has_dipole = .false.

Dipole has been computed

logical, public :: has_dipole_derivatives = .false.

Dipole derivatives have been computed

logical, public :: has_energy = .false.

Energy has been computed

logical, public :: has_gradient = .false.

Gradient has been computed

logical, public :: has_hessian = .false.

Hessian has been computed

real(kind=dp), public, allocatable :: hessian(:,:)

Total Hessian (3natoms, 3natoms)

real(kind=dp), public :: total_energy = 0.0_dp

Total MBE energy (Hartree)


Type-Bound Procedures

procedure, public :: allocate_dipole => mbe_result_allocate_dipole

procedure, public :: allocate_gradient => mbe_result_allocate_gradient

  • private subroutine mbe_result_allocate_gradient(this, total_atoms)

    Allocate gradient array for total_atoms

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_result_t), intent(inout) :: this
    integer, intent(in) :: total_atoms

procedure, public :: allocate_hessian => mbe_result_allocate_hessian

  • private subroutine mbe_result_allocate_hessian(this, total_atoms)

    Allocate hessian array for total_atoms

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_result_t), intent(inout) :: this
    integer, intent(in) :: total_atoms

procedure, public :: destroy => mbe_result_destroy

Clean up allocated memory

  • private subroutine mbe_result_destroy(this)

    Clean up allocated memory in mbe_result_t

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_result_t), intent(inout) :: this

procedure, public :: reset => mbe_result_reset

Reset all values and flags

  • private subroutine mbe_result_reset(this)

    Reset all values and flags in mbe_result_t

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_result_t), intent(inout) :: this

Source Code

   type :: mbe_result_t
      !! Container for Many-Body Expansion aggregated results
      !!
      !! Stores total properties computed via MBE: energy, gradient, hessian, dipole.
      !! Caller allocates desired components before calling compute_mbe; the function
      !! uses allocated() to determine what to compute and sets has_* flags on success.

      real(dp) :: total_energy = 0.0_dp              !! Total MBE energy (Hartree)
      real(dp), allocatable :: gradient(:, :)        !! Total gradient (3, total_atoms) (Hartree/Bohr)
      real(dp), allocatable :: hessian(:, :)         !! Total Hessian (3*natoms, 3*natoms)
      real(dp), allocatable :: dipole(:)             !! Total dipole moment (3) (e*Bohr)
      real(dp), allocatable :: dipole_derivatives(:, :)  !! Dipole derivatives (3, 3*natoms) for IR intensities

      ! Computation status flags
      logical :: has_energy = .false.                !! Energy has been computed
      logical :: has_gradient = .false.              !! Gradient has been computed
      logical :: has_hessian = .false.               !! Hessian has been computed
      logical :: has_dipole = .false.                !! Dipole has been computed
      logical :: has_dipole_derivatives = .false.    !! Dipole derivatives have been computed
   contains
      procedure :: destroy => mbe_result_destroy            !! Clean up allocated memory
      procedure :: reset => mbe_result_reset                !! Reset all values and flags
      procedure :: allocate_gradient => mbe_result_allocate_gradient
      procedure :: allocate_hessian => mbe_result_allocate_hessian
      procedure :: allocate_dipole => mbe_result_allocate_dipole
   end type mbe_result_t