mbe_context_t Derived Type

type, public, extends(many_body_expansion_t) :: mbe_context_t

Standard Many-Body Expansion for non-overlapping fragments

Uses polymer representation where each fragment is defined by monomer indices. Coefficients are implicit: (-1)^(n+1) based on fragment size.


Inherits

type~~mbe_context_t~~InheritsGraph type~mbe_context_t mbe_context_t type~many_body_expansion_t many_body_expansion_t type~mbe_context_t->type~many_body_expansion_t type~driver_config_t driver_config_t type~many_body_expansion_t->type~driver_config_t driver_config type~method_config_t method_config_t type~many_body_expansion_t->type~method_config_t method_config type~resources_t resources_t type~many_body_expansion_t->type~resources_t resources type~system_geometry_t system_geometry_t type~many_body_expansion_t->type~system_geometry_t sys_geom type~driver_config_t->type~method_config_t method_config type~aimd_keywords_t aimd_keywords_t type~driver_config_t->type~aimd_keywords_t aimd type~hessian_keywords_t hessian_keywords_t type~driver_config_t->type~hessian_keywords_t hessian type~scf_keywords_t scf_keywords_t type~driver_config_t->type~scf_keywords_t scf type~cc_config_t cc_config_t type~method_config_t->type~cc_config_t cc type~correlation_config_t correlation_config_t type~method_config_t->type~correlation_config_t corr type~dft_config_t dft_config_t type~method_config_t->type~dft_config_t dft type~f12_config_t f12_config_t type~method_config_t->type~f12_config_t f12 type~mcscf_config_t mcscf_config_t type~method_config_t->type~mcscf_config_t mcscf type~scf_config_t scf_config_t type~method_config_t->type~scf_config_t scf type~xtb_config_t xtb_config_t type~method_config_t->type~xtb_config_t xtb type~mpi_comms_t mpi_comms_t type~resources_t->type~mpi_comms_t mpi_comms type~bond_t bond_t type~system_geometry_t->type~bond_t bonds comm_t comm_t type~mpi_comms_t->comm_t world_comm, node_comm

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: calc_type = 0

Calculation type (energy, gradient, hessian)

type(driver_config_t), public, pointer :: driver_config => null()

Driver configuration with calculation-specific settings

integer, public :: max_level = 0

Maximum MBE level (e.g., 2 for dimers, 3 for trimers)

type(method_config_t), public :: method_config

Method configuration (XTB settings, etc.)

integer, public, allocatable :: node_leader_ranks(:)

Ranks of processes that lead each compute node

integer, public :: num_nodes = 1

Number of compute nodes

integer, public, allocatable :: polymers(:,:)

Fragment composition array (fragment_idx, monomer_indices)

type(resources_t), public, pointer :: resources => null()

MPI communicators and hardware resources

type(system_geometry_t), public, allocatable :: sys_geom

System geometry (coordinates, elements, fragments, bonds)

integer(kind=int64), public :: total_fragments = 0

Total number of fragments to process


Type-Bound Procedures

procedure, public :: destroy => mbe_destroy

  • private subroutine mbe_destroy(this)

    Clean up MBE context

    Arguments

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

procedure, public :: destroy_base => mbe_base_destroy

procedure, public :: has_geometry => mbe_base_has_geometry

procedure, public :: has_mpi => mbe_base_has_mpi

  • private pure function mbe_base_has_mpi(this)

    Check if MPI resources are available

    Arguments

    Type IntentOptional Attributes Name
    class(many_body_expansion_t), intent(in) :: this

    Return Value logical

procedure, public :: init => mbe_init

  • private subroutine mbe_init(this, method_config, calc_type)

    Initialize MBE context with required configuration

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_context_t), intent(out) :: this
    type(method_config_t), intent(in) :: method_config
    integer(kind=int32), intent(in) :: calc_type

procedure, public :: run_distributed => mbe_run_distributed

procedure, public :: run_serial => mbe_run_serial

  • private subroutine mbe_run_serial(this, json_data)

    Run serial MBE calculation

    Arguments

    Type IntentOptional Attributes Name
    class(mbe_context_t), intent(inout) :: this
    type(json_output_data_t), intent(out), optional :: json_data

Source Code

   type, extends(many_body_expansion_t) :: mbe_context_t
      !! Standard Many-Body Expansion for non-overlapping fragments
      !!
      !! Uses polymer representation where each fragment is defined by
      !! monomer indices. Coefficients are implicit: (-1)^(n+1) based on
      !! fragment size.

      integer, allocatable :: polymers(:, :)
         !! Fragment composition array (fragment_idx, monomer_indices)
      integer(int64) :: total_fragments = 0
         !! Total number of fragments to process
      integer :: max_level = 0
         !! Maximum MBE level (e.g., 2 for dimers, 3 for trimers)

   contains
      procedure :: run_serial => mbe_run_serial
      procedure :: run_distributed => mbe_run_distributed
      procedure :: init => mbe_init
      procedure :: destroy => mbe_destroy
   end type mbe_context_t