mod_electrostatics Module

TODO Check the signs in electrostatic elemental functions TODO [OPT] Use Laplace equation to simplify the calculations: TODO 1. Egrd(zz) = -(Egrd(xx) + Egrd(yy)) TODO 2. EHes(zzz) = -(EHes(xxz) + EHes(yyz)) TODO 3. EHes(zzx) = -(EHes(xxx) + EHes(yyx)) TODO 4. EHes(zzy) = -(EHes(xxy) + EHes(yyy)) TODO [OPT] Fundamental electrostatic functions should be pure/elemental TODO [BUG] Handling of flags gg


Uses

  • module~~mod_electrostatics~~UsesGraph module~mod_electrostatics mod_electrostatics module~mod_profiling mod_profiling module~mod_electrostatics->module~mod_profiling module~mod_adjacency_mat mod_adjacency_mat module~mod_electrostatics->module~mod_adjacency_mat module~mod_topology mod_topology module~mod_electrostatics->module~mod_topology module~mod_io mod_io module~mod_electrostatics->module~mod_io module~mod_constants mod_constants module~mod_electrostatics->module~mod_constants module~fmmlib_interface fmmlib_interface module~mod_electrostatics->module~fmmlib_interface module~mod_memory mod_memory module~mod_electrostatics->module~mod_memory module~mod_profiling->module~mod_io module~mod_profiling->module~mod_constants module~mod_profiling->module~mod_memory module~mod_adjacency_mat->module~mod_memory module~mod_topology->module~mod_adjacency_mat module~mod_topology->module~mod_memory module~mod_io->module~mod_constants iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~fmmlib_interface->module~mod_constants module~mod_ribtree mod_ribtree module~fmmlib_interface->module~mod_ribtree module~mod_harmonics mod_harmonics module~fmmlib_interface->module~mod_harmonics module~mod_tree mod_tree module~fmmlib_interface->module~mod_tree module~mod_fmm mod_fmm module~fmmlib_interface->module~mod_fmm module~mod_fmm_utils mod_fmm_utils module~fmmlib_interface->module~mod_fmm_utils module~mod_octatree mod_octatree module~fmmlib_interface->module~mod_octatree module~mod_memory->module~mod_io module~mod_memory->module~mod_constants module~mod_memory->iso_c_binding module~mod_ribtree->module~mod_profiling module~mod_ribtree->module~mod_constants module~mod_ribtree->module~mod_tree module~mod_ribtree->module~mod_fmm_utils module~mod_harmonics->module~mod_constants module~mod_harmonics->module~mod_fmm_utils module~mod_tree->module~mod_adjacency_mat module~mod_tree->module~mod_constants module~mod_tree->module~mod_fmm_utils module~mod_fmm->module~mod_constants module~mod_fmm->module~mod_harmonics module~mod_fmm->module~mod_tree module~mod_fmm->module~mod_fmm_utils module~mod_fmm_utils->module~mod_constants module~mod_octatree->module~mod_profiling module~mod_octatree->module~mod_constants module~mod_octatree->module~mod_tree module~mod_octatree->module~mod_fmm_utils

Used by

  • module~~mod_electrostatics~~UsedByGraph module~mod_electrostatics mod_electrostatics proc~mmpol_init mmpol_init proc~mmpol_init->module~mod_electrostatics proc~electrostatic_for_grad electrostatic_for_grad proc~electrostatic_for_grad->module~mod_electrostatics proc~c_ommp_set_fmm_distance C_ommp_set_fmm_distance proc~c_ommp_set_fmm_distance->module~mod_electrostatics proc~ommp_get_polelec_energy ommp_get_polelec_energy proc~ommp_get_polelec_energy->module~mod_electrostatics module~mod_polarization mod_polarization proc~ommp_get_polelec_energy->module~mod_polarization proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->module~mod_electrostatics module~mod_mmpol mod_mmpol proc~mmpol_init_from_xyz->module~mod_mmpol module~mod_prm mod_prm proc~mmpol_init_from_xyz->module~mod_prm module~mod_mmpol->module~mod_electrostatics proc~init_eel_for_link_atom init_eel_for_link_atom proc~init_eel_for_link_atom->module~mod_electrostatics proc~init_eel_for_link_atom->module~mod_prm proc~mmpol_init_from_mmp mmpol_init_from_mmp proc~mmpol_init_from_mmp->module~mod_electrostatics proc~mmpol_init_from_mmp->module~mod_mmpol proc~rotate_multipoles rotate_multipoles proc~rotate_multipoles->module~mod_electrostatics proc~mmpol_init_from_hdf5 mmpol_init_from_hdf5 proc~mmpol_init_from_hdf5->module~mod_electrostatics proc~mmpol_init_from_hdf5->module~mod_mmpol proc~assign_mpoles assign_mpoles proc~assign_mpoles->module~mod_electrostatics proc~ommp_potential_mm2ext ommp_potential_mm2ext proc~ommp_potential_mm2ext->module~mod_electrostatics proc~fixedelec_geomgrad fixedelec_geomgrad proc~fixedelec_geomgrad->module~mod_electrostatics proc~ommp_get_fixedelec_energy ommp_get_fixedelec_energy proc~ommp_get_fixedelec_energy->module~mod_electrostatics module~mod_solvers mod_solvers module~mod_solvers->module~mod_electrostatics proc~tmatvec_otf TMatVec_otf proc~tmatvec_otf->module~mod_electrostatics proc~c_ommp_field_mm2ext C_ommp_field_mm2ext proc~c_ommp_field_mm2ext->module~mod_electrostatics proc~ommp_turn_pol_off ommp_turn_pol_off proc~ommp_turn_pol_off->module~mod_electrostatics proc~c_ommp_field_pol2ext C_ommp_field_pol2ext proc~c_ommp_field_pol2ext->module~mod_electrostatics module~ommp_interface ommp_interface module~ommp_interface->module~mod_electrostatics module~ommp_interface->module~mod_mmpol module~mod_iohdf5 mod_iohdf5 module~ommp_interface->module~mod_iohdf5 module~mod_qm_helper mod_qm_helper module~ommp_interface->module~mod_qm_helper module~mod_iohdf5->module~mod_electrostatics module~mod_iohdf5->module~mod_mmpol proc~ommp_set_default_matv ommp_set_default_matv proc~ommp_set_default_matv->module~mod_electrostatics proc~ommp_field_mm2ext ommp_field_mm2ext proc~ommp_field_mm2ext->module~mod_electrostatics proc~ommp_field_pol2ext ommp_field_pol2ext proc~ommp_field_pol2ext->module~mod_electrostatics proc~ommp_potential_mmpol2ext ommp_potential_mmpol2ext proc~ommp_potential_mmpol2ext->module~mod_electrostatics proc~mmpol_terminate mmpol_terminate proc~mmpol_terminate->module~mod_electrostatics proc~ommp_set_default_solver ommp_set_default_solver proc~ommp_set_default_solver->module~mod_electrostatics proc~ommp_set_external_field ommp_set_external_field proc~ommp_set_external_field->module~mod_electrostatics proc~ommp_set_external_field->module~mod_polarization proc~ommp_field_mmpol2ext ommp_field_mmpol2ext proc~ommp_field_mmpol2ext->module~mod_electrostatics proc~update_coordinates update_coordinates proc~update_coordinates->module~mod_electrostatics proc~electrostatic_for_ene electrostatic_for_ene proc~electrostatic_for_ene->module~mod_electrostatics proc~ommp_potential_pol2ext ommp_potential_pol2ext proc~ommp_potential_pol2ext->module~mod_electrostatics proc~rotation_geomgrad rotation_geomgrad proc~rotation_geomgrad->module~mod_electrostatics proc~mmpol_prepare mmpol_prepare proc~mmpol_prepare->module~mod_electrostatics proc~c_ommp_set_fmm_min_cell_size C_ommp_set_fmm_min_cell_size proc~c_ommp_set_fmm_min_cell_size->module~mod_electrostatics module~mod_polarization->module~mod_electrostatics module~mod_polarization->module~mod_mmpol proc~dipole_t dipole_T proc~dipole_t->module~mod_electrostatics proc~assign_pol assign_pol proc~assign_pol->module~mod_electrostatics proc~polelec_geomgrad polelec_geomgrad proc~polelec_geomgrad->module~mod_electrostatics proc~polelec_geomgrad->module~mod_polarization module~mod_prm->module~mod_electrostatics proc~polarization polarization proc~polarization->module~mod_solvers proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->module~mod_mmpol proc~ommp_system_from_qm_helper->module~mod_prm proc~qm_helper_link_atom_geomgrad qm_helper_link_atom_geomgrad proc~qm_helper_link_atom_geomgrad->module~mod_mmpol module~mod_inputloader mod_inputloader module~mod_inputloader->module~mod_mmpol proc~r1_hdf5_read_array r1_hdf5_read_array proc~r1_hdf5_read_array->module~mod_mmpol proc~r2_hdf5_read_array r2_hdf5_read_array proc~r2_hdf5_read_array->module~mod_mmpol proc~i2_hdf5_read_array i2_hdf5_read_array proc~i2_hdf5_read_array->module~mod_mmpol proc~i1_hdf5_read_array i1_hdf5_read_array proc~i1_hdf5_read_array->module~mod_mmpol module~mod_qm_helper->module~mod_mmpol proc~qm_helper_vdw_energy qm_helper_vdw_energy proc~qm_helper_vdw_energy->module~mod_mmpol proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->module~mod_prm proc~init_bonded_for_link_atom init_bonded_for_link_atom proc~init_bonded_for_link_atom->module~mod_prm proc~l1_hdf5_read_array l1_hdf5_read_array proc~l1_hdf5_read_array->module~mod_mmpol proc~i3_hdf5_read_array i3_hdf5_read_array proc~i3_hdf5_read_array->module~mod_mmpol proc~ommp_terminate ommp_terminate proc~ommp_terminate->module~mod_mmpol proc~qm_helper_vdw_geomgrad qm_helper_vdw_geomgrad proc~qm_helper_vdw_geomgrad->module~mod_mmpol module~mod_geomgrad mod_geomgrad module~mod_geomgrad->module~mod_mmpol proc~ommp_create_link_atom ommp_create_link_atom proc~ommp_create_link_atom->module~mod_mmpol proc~ommp_create_link_atom->module~mod_qm_helper proc~r3_hdf5_read_array r3_hdf5_read_array proc~r3_hdf5_read_array->module~mod_mmpol proc~l2_hdf5_read_array l2_hdf5_read_array proc~l2_hdf5_read_array->module~mod_mmpol proc~c_ommp_full_geomgrad C_ommp_full_geomgrad proc~c_ommp_full_geomgrad->module~ommp_interface proc~c_ommp_update_coordinates C_ommp_update_coordinates proc~c_ommp_update_coordinates->module~mod_mmpol module~mod_ommp_c_interface mod_ommp_C_interface module~mod_ommp_c_interface->module~ommp_interface proc~ommp_fixedelec_geomgrad ommp_fixedelec_geomgrad proc~ommp_fixedelec_geomgrad->module~mod_geomgrad proc~c_ommp_qm_helper_use_frozen C_ommp_qm_helper_use_frozen proc~c_ommp_qm_helper_use_frozen->module~mod_qm_helper proc~c_ommp_qm_helper_get_cqm C_ommp_qm_helper_get_cqm proc~c_ommp_qm_helper_get_cqm->module~mod_qm_helper proc~c_ommp_qm_helper_get_v_m2n C_ommp_qm_helper_get_V_m2n proc~c_ommp_qm_helper_get_v_m2n->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_p2n C_ommp_qm_helper_get_E_p2n proc~c_ommp_qm_helper_get_e_p2n->module~mod_qm_helper proc~c_ommp_qm_helper_get_h_n2m C_ommp_qm_helper_get_H_n2m proc~c_ommp_qm_helper_get_h_n2m->module~mod_qm_helper proc~ommp_qm_helper_vdw_energy ommp_qm_helper_vdw_energy proc~ommp_qm_helper_vdw_energy->module~mod_qm_helper proc~ommp_terminate_qm_helper ommp_terminate_qm_helper proc~ommp_terminate_qm_helper->module~mod_qm_helper proc~ommp_qm_helper_vdw_geomgrad ommp_qm_helper_vdw_geomgrad proc~ommp_qm_helper_vdw_geomgrad->module~mod_qm_helper proc~c_ommp_qm_helper_get_frozen C_ommp_qm_helper_get_frozen proc~c_ommp_qm_helper_get_frozen->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_n2p C_ommp_qm_helper_get_E_n2p proc~c_ommp_qm_helper_get_e_n2p->module~mod_qm_helper proc~ommp_full_geomgrad ommp_full_geomgrad proc~ommp_full_geomgrad->module~mod_geomgrad proc~ommp_polelec_geomgrad ommp_polelec_geomgrad proc~ommp_polelec_geomgrad->module~mod_geomgrad proc~c_ommp_qm_helper_get_g_n2p C_ommp_qm_helper_get_G_n2p proc~c_ommp_qm_helper_get_g_n2p->module~mod_qm_helper proc~ommp_init_qm_helper ommp_init_qm_helper proc~ommp_init_qm_helper->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_n2m C_ommp_qm_helper_get_E_n2m proc~c_ommp_qm_helper_get_e_n2m->module~mod_qm_helper proc~c_ommp_qm_helper_get_g_n2m C_ommp_qm_helper_get_G_n2m proc~c_ommp_qm_helper_get_g_n2m->module~mod_qm_helper proc~ommp_init_mmp ommp_init_mmp proc~ommp_init_mmp->module~mod_inputloader proc~c_ommp_qm_helper_use_nonbonded C_ommp_qm_helper_use_nonbonded proc~c_ommp_qm_helper_use_nonbonded->module~mod_qm_helper proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->module~mod_inputloader proc~ommp_qm_helper_update_coord ommp_qm_helper_update_coord proc~ommp_qm_helper_update_coord->module~mod_qm_helper proc~ommp_qm_helper_link_atom_geomgrad ommp_qm_helper_link_atom_geomgrad proc~ommp_qm_helper_link_atom_geomgrad->module~mod_qm_helper proc~ommp_update_link_atoms_position ommp_update_link_atoms_position proc~ommp_update_link_atoms_position->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_m2n C_ommp_qm_helper_get_E_m2n proc~c_ommp_qm_helper_get_e_m2n->module~mod_qm_helper proc~c_ommp_qm_helper_get_qm_atoms C_ommp_qm_helper_get_qm_atoms proc~c_ommp_qm_helper_get_qm_atoms->module~mod_qm_helper proc~c_ommp_qm_helper_get_npol C_ommp_qm_helper_get_npol proc~c_ommp_qm_helper_get_npol->module~mod_qm_helper proc~c_ommp_terminate_qm_helper C_ommp_terminate_qm_helper proc~c_ommp_terminate_qm_helper->module~mod_qm_helper proc~c_ommp_qm_helper_get_nmm C_ommp_qm_helper_get_nmm proc~c_ommp_qm_helper_get_nmm->module~mod_qm_helper proc~c_ommp_qm_helper_get_v_p2n C_ommp_qm_helper_get_V_p2n proc~c_ommp_qm_helper_get_v_p2n->module~mod_qm_helper

Contents


Derived Types

type, public ::  ommp_electrostatics_type

Components

Type Visibility Attributes Name Initial
integer(kind=ip), public :: def_solver

Solver to be used by default for this eel object.

integer(kind=ip), public :: def_matv

Matrix-vector method to be used by default for this eel object.

type(ommp_topology_type), public, pointer :: top

Data structure containing all the topological informations

integer(kind=ip), public :: pol_atoms

number of polarizable atoms

logical(kind=lp), public :: amoeba

True if AMOEBA FF is used

integer(kind=ip), public :: ld_cart

size of the cartesian multipolar distribution (i.e., (l+1)(l+2)(l+3)/6) this is 1 for AMBER (charges only), 10 for AMOEBA (up to quadrupoles). this is also the size of the array that contains the electrostatic properties of the sources at the sources. ld_cder is the leading size of the derivative of such a distribution, which is 3 for AMBER and 19 for AMOEBA.

integer(kind=ip), public :: ld_cder

size of the cartesian multipolar distribution (i.e., (l+1)(l+2)(l+3)/6) this is 1 for AMBER (charges only), 10 for AMOEBA (up to quadrupoles). this is also the size of the array that contains the electrostatic properties of the sources at the sources. ld_cder is the leading size of the derivative of such a distribution, which is 3 for AMBER and 19 for AMOEBA.

integer(kind=ip), public :: n_ipd

number of induced point dipoles distributions this is 1 for AMBER and 2 for AMOEBA

real(kind=rp), public :: mscale(4)

factors for charge-charge (or multipole-multipole) interactions

real(kind=rp), public :: pscale(4)

factors for chrage-ipd (or multipole-ipd) interactions. in AMOEBA, this is used to define the polarization field, i.e., the right-hand side to the polarization equations, and depends on the connectivity.

real(kind=rp), public :: pscale_intra(4)

Only used for AMOEBA, same as pscale but for atoms that belong to the same polarization group

real(kind=rp), public :: dscale(4)

factors for multipoles-ipd interactions used to compute the direct field, which is used to define the polarization energy. these factors depend on the polarization group "connectivity" (AMOEBA only)

real(kind=rp), public :: uscale(4)

factor for ipd-ipd interactions. these depend on the connectivity (AMBER) or on the polarization group " connectivity (AMOEBA)

real(kind=rp), public, allocatable :: thole(:)

array to store the thole factors for computing damping functions

real(kind=rp), public :: thole_scale

Scale factor for thole damping (only used by non-AMOEBA FF); all the element of thole(:) are multiplied by thole_scale ** 0.5

real(kind=rp), public, allocatable :: cpol(:,:)

Coordinates of polarizable atoms (3:pol_atoms)

real(kind=rp), public, allocatable :: q(:,:)

Mutlipolar distribution (ld_cart:mm_atoms) For AMOEBA this is the rotated distribution. The order for the stored multipoles is q, px, py, pz, Qxx, Qxy, Qyy, Qxz, Qyx, Qzz.

real(kind=rp), public, allocatable :: q0(:,:)

Unrotated utlipolar distribution (ld_cart:mm_atoms) (AMOEBA only)

real(kind=rp), public, allocatable :: pol(:)

Polarizabilities for each polarizable atom

integer(kind=ip), public, allocatable :: mm_polar(:)

for each mm atom: 0 if is not polarizable, index in polarizable atom list otherwise

integer(kind=ip), public, allocatable :: polar_mm(:)

positions of a polarizable atom in the mm atoms list

integer(kind=ip), public, allocatable :: C_polar_mm(:)

polar_mm with 0-based C-indexing, only allocated at need.

integer(kind=ip), public, allocatable :: mmat_polgrp(:)

Polarizability group index for each MM site

type(yale_sparse), public :: polgrp_mmat

For each polarization group index, list all the MM atoms included. It basically is a sparse boolean matrix of dimension N_polgroups x N_mmatoms

type(yale_sparse), public, allocatable :: pg_conn(:)

Adjacency and connectivity matytrices between polarizability groups. Two groups are said to be adjacent if they are connected by a chemical bond. The 1st element is the identity matrix for code simplicity.

integer(kind=ip), public, allocatable :: mol_frame(:)

definition of the molecular frame convention: 0 ... do not rotate 1 ... z-then-x 2 ... bisector 3 ... z-only 4 ... z-bisector 5 ... 3-fold

integer(kind=ip), public, allocatable :: ix(:)

neighboring atoms used to define the axes of the molecular frame

integer(kind=ip), public, allocatable :: iy(:)

neighboring atoms used to define the axes of the molecular frame

integer(kind=ip), public, allocatable :: iz(:)

neighboring atoms used to define the axes of the molecular frame

logical(kind=lp), public :: use_fmm = .false.

flag to use fast multipoles

integer(kind=ip), public :: fmm_maxl_static = 0

Maximum angular moment used in fast multipoles for fixed part

integer(kind=ip), public :: fmm_maxl_pol = 0

Maximum angular moment used in fast multipoles for polarizable part

real(kind=rp), public :: fmm_min_cell_size = 0.0

Minimum dimension for cell size used in FMM

real(kind=rp), public :: fmm_distance = 0.0

Threshold distance for considering two nodes in FMM tree as far

type(fmm_type), public, allocatable :: fmm_static

Fast multipoles object for static multipoles sources

logical(kind=lp), public :: fmm_static_done = .false.

Flag for a fresh solution of ipd fmm

type(fmm_type), public, allocatable :: fmm_ipd(:)

Fast multipoles object for static multipoles sources

logical(kind=lp), public, allocatable :: fmm_ipd_done(:)

Flag for a fresh solution of ipd fmm

type(fmm_tree_type), public, allocatable :: tree

Tree object

type(yale_sparse), public :: fmm_near_field_list

For each particle, all the particles that should be included in near field

logical(kind=lp), public :: M2M_done = .false.

flag to set when M2M electrostatic quantities are computed.

logical(kind=lp), public :: M2Mgg_done = .false.

flag to set when M2M electrostatic quantities for geometrical gradients are computed.

real(kind=rp), public, allocatable :: V_M2M(:)

potential of MM permanent multipoles at MM sites;

real(kind=rp), public, allocatable :: E_M2M(:,:)

electric_field of MM permanent multipoles at MM sites;

real(kind=rp), public, allocatable :: Egrd_M2M(:,:)

electric_field gradient of MM permanent multipoles at MM sites;

real(kind=rp), public, allocatable :: EHes_M2M(:,:)

electric field Hessian of MM permanent multipoles at MM sites;

logical(kind=lp), public :: M2D_done = .false.

Flag to set when M2D electrostatics have been computed.

logical(kind=lp), public :: M2Dgg_done = .false.

Flag to set when M2D electrostatics for geometrical gradients have been computed.

real(kind=rp), public, allocatable :: V_M2D(:,:)
real(kind=rp), public, allocatable :: E_M2D(:,:,:)

electric field of MM permanent multipoles at POL sites;

real(kind=rp), public, allocatable :: Egrd_M2D(:,:,:)

electric field of MM permanent multipoles at POL sites;

real(kind=rp), public, allocatable :: EHes_M2D(:,:,:)
logical(kind=lp), public :: D2Mgg_done = .false.
real(kind=rp), public, allocatable :: V_D2M(:)
real(kind=rp), public, allocatable :: E_D2M(:,:)
real(kind=rp), public, allocatable :: Egrd_D2M(:,:)
real(kind=rp), public, allocatable :: EHes_D2M(:,:)
logical(kind=lp), public :: D2Dgg_done = .false.
real(kind=rp), public, allocatable :: V_D2D(:,:)
real(kind=rp), public, allocatable :: E_D2D(:,:,:)
real(kind=rp), public, allocatable :: Egrd_D2D(:,:,:)
real(kind=rp), public, allocatable :: EHes_D2D(:,:,:)
logical(kind=lp), public :: ipd_done = .false.

Flag to set when IPD have been computed.

logical(kind=lp), public :: ipd_use_guess = .false.

Flag to set when current value of IPD can be used as guess for next solution of LS.

real(kind=rp), public, allocatable :: ipd(:,:,:)

induced point dipoles (3:pol_atoms:ipd)

real(kind=rp), public, allocatable :: TMat(:,:)

Interaction tensor, only allocated for the methods that explicitly requires it.

logical(kind=lp), public :: screening_list_done = .false.

Flag to check if screening list have already been prepared

type(yale_sparse), public, allocatable :: list_S_S

Sparse matrix containg the scale factors for the scaled elements
of electrostatic interactions (all the element that are not
present in the sparse matrix have a scaling factor 1.0).
When FMM are enabled, those lists are only for near-field
interactions

type(yale_sparse), public, allocatable :: list_P_P

Sparse matrix containg the scale factors for the scaled elements
of electrostatic interactions (all the element that are not
present in the sparse matrix have a scaling factor 1.0).
When FMM are enabled, those lists are only for near-field
interactions

type(yale_sparse), public, allocatable :: list_S_P_P

Sparse matrix containg the scale factors for the scaled elements
of electrostatic interactions (all the element that are not
present in the sparse matrix have a scaling factor 1.0).
When FMM are enabled, those lists are only for near-field
interactions

type(yale_sparse), public, allocatable :: list_S_P_D

Sparse matrix containg the scale factors for the scaled elements
of electrostatic interactions (all the element that are not
present in the sparse matrix have a scaling factor 1.0).
When FMM are enabled, those lists are only for near-field
interactions

type(yale_sparse), public, allocatable :: list_S_S_fmm_far

Sparse matrices containing the scale factors for the scaled elements
of electrostatic far-field interactions (only when FMM are
enabled). If a reasonable FMM distance is chosen, those lists
should be almost empty.

type(yale_sparse), public, allocatable :: list_P_P_fmm_far

Sparse matrices containing the scale factors for the scaled elements
of electrostatic far-field interactions (only when FMM are
enabled). If a reasonable FMM distance is chosen, those lists
should be almost empty.

type(yale_sparse), public, allocatable :: list_S_P_P_fmm_far

Sparse matrices containing the scale factors for the scaled elements
of electrostatic far-field interactions (only when FMM are
enabled). If a reasonable FMM distance is chosen, those lists
should be almost empty.

type(yale_sparse), public, allocatable :: list_S_P_D_fmm_far

Sparse matrices containing the scale factors for the scaled elements
of electrostatic far-field interactions (only when FMM are
enabled). If a reasonable FMM distance is chosen, those lists
should be almost empty.

logical(kind=lp), public, dimension(:), allocatable :: todo_S_S

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_P_P

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_S_P_P

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_S_P_D

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_S_S_fmm_far

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_P_P_fmm_far

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_S_P_P_fmm_far

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

logical(kind=lp), public, dimension(:), allocatable :: todo_S_P_D_fmm_far

Logical array of the same dimension of column-index vector; true if the scaling factor is zero, false otherwise

real(kind=rp), public, dimension(:), allocatable :: scalef_S_S_fmm_far

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_P_P_fmm_far

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_S_P_P_fmm_far

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_S_P_D_fmm_far

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_S_S

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_P_P

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_S_P_P

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0

real(kind=rp), public, dimension(:), allocatable :: scalef_S_P_D

Array of the same dimension of column-index vector; contains the value of the scaling factors different from 1.0


Functions

public function screening_rules(eel, i, kind_i, j, kind_j, in_field) result(scalf)

Utility function used to decide if an interaction between sites i and j should be computed and eventually scaled by a factor. This function is intended to be used in code, for linear scaling code lists should be built. This is written to minimize code repetitions, all the screening rules are handled in two possible cases: 1. rules based on adjacency matrix 2. rules based on AMOEBA polarization groups

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics object

integer(kind=ip), intent(in) :: i

Index of source site (MM index is used for static sites, while Pol index is used for polarizable sites)

character, intent(in) :: kind_i

Type of sites i and j in the interaction for which the screening rules are required; possible choices are 'P' (polarizable site) or 'S' (static site). Any other option will cause a fatal error.

integer(kind=ip), intent(in) :: j

Index of target site (MM index is used for static sites, while Pol index is used for polarizable sites)

character, intent(in) :: kind_j

Type of sites i and j in the interaction for which the screening rules are required; possible choices are 'P' (polarizable site) or 'S' (static site). Any other option will cause a fatal error.

character, intent(in) :: in_field

Which screening rules have to be applied? 'D' = screening rules for direct field; 'P' = screening rules for polarization field

Return Value real(kind=rp)

Scale factor for the interaction

private pure function fmm_list_are_near(eel, i, j) result(near)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel
integer(kind=ip), intent(in) :: i
integer(kind=ip), intent(in) :: j

Return Value logical


Subroutines

public subroutine electrostatics_init(eel_obj, amoeba, pol_atoms, top_obj)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel_obj
logical(kind=lp), intent(in) :: amoeba
integer(kind=ip), intent(in) :: pol_atoms
type(ommp_topology_type), intent(in), target :: top_obj

public subroutine electrostatics_terminate(eel_obj)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel_obj

public subroutine set_def_solver(eel_obj, solver)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel_obj
integer(kind=ip), intent(in) :: solver

public subroutine set_def_matv(eel_obj, matv)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel_obj
integer(kind=ip), intent(in) :: matv

public subroutine set_screening_parameters(eel_obj, m, p, d, u, i)

Subroutine to initialize the screening parameters

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel_obj
real(kind=rp), intent(in) :: m(4)
real(kind=rp), intent(in) :: p(4)
real(kind=rp), intent(in) :: d(4)
real(kind=rp), intent(in) :: u(4)
real(kind=rp), intent(in), optional :: i(4)

public subroutine remove_null_pol(eel)

Check which polarizabilities are close enough to 0 to be just excluded from the calculation, and remove them.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

public subroutine make_screening_lists(eel)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

public subroutine thole_init(eel)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

public subroutine energy_MM_MM(eel, ene)

This function computes the interaction energy of static electric multipoles

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

real(kind=rp), intent(inout) :: ene

Energy (results will be added)

public subroutine energy_MM_pol(eel, ene)

This function computes the interaction energy of static electric multipoles

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

real(kind=rp), intent(inout) :: ene

Energy (results will be added)

public subroutine coulomb_kernel(dr, maxder, res)

This function compute the coulomb kernel for the distance vector dr and its derivative up to the value required by maxder.

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(in) :: dr(3)

Distance vector from atom i to atom j

integer(kind=ip), intent(in) :: maxder

Maximum derivative to be computed

real(kind=rp), intent(out), dimension(maxder+1) :: res

Results vector

public subroutine damped_coulomb_kernel(eel, i, j, maxder, res, dr)

This subroutine computes the damped coulomb kernel between two atoms. Note that this only makes sense between two MM atoms, as it is only used to compute the field that induces the point dipoles!

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

integer(kind=ip), intent(in) :: i

Index of atoms (in MM atom list) for which the kernel should be computed

integer(kind=ip), intent(in) :: j

Index of atoms (in MM atom list) for which the kernel should be computed

integer(kind=ip), intent(in) :: maxder

Maximum derivative to be computed

real(kind=rp), intent(out), dimension(maxder+1) :: res

Results vector

real(kind=rp), intent(out), dimension(3) :: dr

Distance vector between i and j

public subroutine q_elec_prop(q, dr, kernel, do_V, V, do_E, E, do_grdE, grdE, do_HE, HE)

TODO Computes the electric potential of a charge at position from the charge itself. Pre-computed kernel should be provided as input. The result is added to .

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(in) :: q

Charge

real(kind=rp), intent(in) :: dr(3)

Distance vector

real(kind=rp), intent(in) :: kernel(:)

Array of coulomb kernel (either damped or undamped)

logical, intent(in) :: do_V

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: V

Electric potential

logical, intent(in) :: do_E

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: E(3)

Electric potential

logical, intent(in) :: do_grdE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: grdE(6)

Electric potential

logical, intent(in) :: do_HE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: HE(10)

Electric potential

private subroutine mu_elec_prop(mu, dr, kernel, do_V, V, do_E, E, do_grdE, grdE, do_HE, HE)

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(in) :: mu(3)

point dipole

real(kind=rp), intent(in) :: dr(3)

Distance vector

real(kind=rp), intent(in) :: kernel(:)

Array of coulomb kernel (either damped or undamped)

logical, intent(in) :: do_V

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: V

Electric potential

logical, intent(in) :: do_E

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: E(3)

Electric potential

logical, intent(in) :: do_grdE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: grdE(6)

Electric potential

logical, intent(in) :: do_HE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: HE(10)

Electric potential

private subroutine quad_elec_prop(quad, dr, kernel, do_V, V, do_E, E, do_grdE, grdE, do_HE, HE)

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(in) :: quad(6)

point quadrupole stored as (xx, xy, yy, xz, yz, zz)

real(kind=rp), intent(in) :: dr(3)

Distance vector

real(kind=rp), intent(in) :: kernel(:)

Array of coulomb kernel (either damped or undamped)

logical, intent(in) :: do_V

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: V

Electric potential

logical, intent(in) :: do_E

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: E(3)

Electric potential

logical, intent(in) :: do_grdE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: grdE(6)

Electric potential

logical, intent(in) :: do_HE

Flags to enable/disable calculation of different electrostatic properties

real(kind=rp), intent(inout) :: HE(10)

Electric potential

public subroutine prepare_fixedelec(eel, arg_dogg)

This function allocate and populate array of electrostatic properties of static multipoles at static multipoles sites. It should be called blindly before any calculation that requires V_M2M etc.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel
logical, intent(in), optional :: arg_dogg

public subroutine prepare_polelec(eel, arg_dogg)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel
logical, intent(in), optional :: arg_dogg

private subroutine preapare_fmm_static(eel)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

private subroutine prepare_fmm_ext_ipd(eel, fmm, ipd)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

type(fmm_type), intent(inout) :: fmm

fmm object used to run the calculation

real(kind=rp), intent(in) :: ipd(3,eel%pol_atoms)

External induced point dipoles at polarizable sites

private subroutine prepare_fmm_ipd(eel, knd)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

integer(kind=ip), intent(in) :: knd

Index for the set of dipoles to use.

private subroutine elec_prop_M2M(eel, do_V, do_E, do_Egrd, do_EHes)

Computes the electric potential, field and field gradients of static multipoles at all sites (polarizable sites are a subset of static ones)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

logical, intent(in) :: do_V

Flags to enable/disable the calculation of different components

logical, intent(in) :: do_E

Flags to enable/disable the calculation of different components

logical, intent(in) :: do_Egrd

Flags to enable/disable the calculation of different components

logical, intent(in) :: do_EHes

Flags to enable/disable the calculation of different components

public subroutine field_extD2D(eel, ext_ipd, E)

Computes the electric field of a trial set of induced point dipoles at polarizable sites. This is intended to be used as matrix-vector routine in the solution of the linear system.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Data structure for electrostatic part of the system

real(kind=rp), intent(in) :: ext_ipd(3,eel%pol_atoms)

External induced point dipoles at polarizable sites

real(kind=rp), intent(inout) :: E(3,eel%pol_atoms)

Electric field (results will be added)

private subroutine elec_prop_D2D(eel, in_kind, do_V, do_E, do_Egrd, do_EHes)

Computes the electric field of a trial set of induced point dipoles at polarizable sites. This is intended to be used as matrix-vector routine in the solution of the linear system.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Data structure for electrostatic part of the system

character, intent(in) :: in_kind
logical, intent(in) :: do_V

Flag to control which properties have to be computed.

logical, intent(in) :: do_E

Flag to control which properties have to be computed.

logical, intent(in) :: do_Egrd

Flag to control which properties have to be computed.

logical, intent(in) :: do_EHes

Flag to control which properties have to be computed.

private subroutine elec_prop_M2D(eel, do_V, do_E, do_Egrd, do_EHes)

Computes the electric field of static multipoles at induced dipoles sites. This is only intended to be used to build the RHS of the linear system. This field is modified by the indroduction of the damped kernels and by the connectivity-based screening rules.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

logical, intent(in) :: do_V

Flag to control which properties have to be computed.

logical, intent(in) :: do_E

Flag to control which properties have to be computed.

logical, intent(in) :: do_Egrd

Flag to control which properties have to be computed.

logical, intent(in) :: do_EHes

Flag to control which properties have to be computed.

private subroutine elec_prop_D2M(eel, in_kind, do_V, do_E, do_Egrd, do_EHes)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

Electrostatics data structure

character, intent(in) :: in_kind
logical, intent(in) :: do_V

Flag to control which properties have to be computed.

logical, intent(in) :: do_E

Flag to control which properties have to be computed.

logical, intent(in) :: do_Egrd

Flag to control which properties have to be computed.

logical, intent(in) :: do_EHes

Flag to control which properties have to be computed.

public subroutine potential_D2E(eel, cpt, V, amoeba_P_insted_of_D_)

This subroutine computes the potential generated by the induced point dipoles to a set of arbitrary coordinates, without applying any screening rules. Note: for AMOEBA D dipoles should be used.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

real(kind=rp), intent(in) :: cpt(:,:)

Coordinates at which the electric field is requested

real(kind=rp), intent(inout) :: V(:)

Electric field (results will be added)

logical, intent(in), optional :: amoeba_P_insted_of_D_

For AMOEBA FF, if true the potential of P dipoles is computed, otherwise potential of D dipoles is computed

public subroutine potential_M2E(eel, cpt, V)

This subroutine computes the potential generated by the static multipoles to a set of arbitrary coordinates, without applying any screening rules.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

real(kind=rp), intent(in) :: cpt(:,:)

Coordinates at which the electric field is requested

real(kind=rp), intent(inout) :: V(:)

Electric field (results will be added)

public subroutine field_D2E(eel, cpt, E)

This subroutine computes the potential generated by the static multipoles to a set of arbitrary coordinates, without applying any screening rules.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

real(kind=rp), intent(in) :: cpt(:,:)

Coordinates at which the electric field is requested

real(kind=rp), intent(inout) :: E(:,:)

Electric field (results will be added)

public subroutine field_M2E(eel, cpt, E)

This subroutine computes the potential generated by the static multipoles to a set of arbitrary coordinates, without applying any screening rules.

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

Electrostatics data structure

real(kind=rp), intent(in) :: cpt(:,:)

Coordinates at which the electric field is requested

real(kind=rp), intent(inout) :: E(:,:)

Electric field (results will be added)

public subroutine fmm_coordinates_update(eel)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

private subroutine fmm_make_neigh_list(eel)

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(inout) :: eel

private subroutine fmm_solve_for_multipoles(fmm_obj, q, use_q, mu, use_mu, quad, use_quad)

Arguments

Type IntentOptional Attributes Name
type(fmm_type), intent(inout) :: fmm_obj

FMM object, it should be already initialized

real(kind=rp), intent(in) :: q(:)
logical(kind=lp), intent(in) :: use_q
real(kind=rp), intent(in) :: mu(:,:)
logical(kind=lp), intent(in) :: use_mu
real(kind=rp), intent(in) :: quad(:,:)
logical(kind=lp), intent(in) :: use_quad