mod_polarization Module

Module to handle the calculation of the induced dipoles; this means find the solution of the polarization problem. The polarization problem is defined by the linear system where is the 'external' (here external means the sum of the electric field generated by QM density and the one generated by the MM sites) electric field at induced dipole sites, are the induced dipoles - the solution of the linear system -, and is the interaction tensor between the induced point dipoles.

Linear system \eqref{eq:pol_ls} can be solved with different methods (see mod_solvers for further details). Some of them requires to explicitly build in memory (eg. [[mod_solvers::inversion_solver]]), while other only requires to perform matrix-vector multiplication without building explicitly the interaction tensor. Interaction tensor is conveniently tought as a square matrix of dimension number of induced dipoles, of rank 3 tensors expressing the interaction between the two elements. We can distinguish the case of diagonal elements: and the off-diagonal elements:


Uses

  • module~~mod_polarization~~UsesGraph module~mod_polarization mod_polarization module~mod_io mod_io module~mod_polarization->module~mod_io module~mod_mmpol mod_mmpol module~mod_polarization->module~mod_mmpol module~mod_memory mod_memory module~mod_polarization->module~mod_memory module~mod_electrostatics mod_electrostatics module~mod_polarization->module~mod_electrostatics module~mod_constants mod_constants module~mod_io->module~mod_constants module~mod_mmpol->module~mod_io module~mod_mmpol->module~mod_memory module~mod_mmpol->module~mod_electrostatics module~mod_mmpol->module~mod_constants module~mod_topology mod_topology module~mod_mmpol->module~mod_topology module~mod_link_atom mod_link_atom module~mod_mmpol->module~mod_link_atom module~mod_nonbonded mod_nonbonded module~mod_mmpol->module~mod_nonbonded module~mod_bonded mod_bonded module~mod_mmpol->module~mod_bonded module~mod_adjacency_mat mod_adjacency_mat module~mod_mmpol->module~mod_adjacency_mat module~mod_memory->module~mod_io module~mod_memory->module~mod_constants iso_c_binding iso_c_binding module~mod_memory->iso_c_binding module~mod_electrostatics->module~mod_io module~mod_electrostatics->module~mod_memory module~mod_electrostatics->module~mod_constants module~mod_electrostatics->module~mod_topology module~mod_electrostatics->module~mod_adjacency_mat module~mod_profiling mod_profiling module~mod_electrostatics->module~mod_profiling module~mod_constants->iso_c_binding module~mod_topology->module~mod_memory module~mod_topology->module~mod_adjacency_mat module~mod_link_atom->module~mod_io module~mod_link_atom->module~mod_memory module~mod_link_atom->module~mod_constants module~mod_link_atom->module~mod_topology module~mod_link_atom->module~mod_nonbonded module~mod_link_atom->module~mod_bonded module~mod_utils mod_utils module~mod_link_atom->module~mod_utils module~mod_nonbonded->module~mod_memory module~mod_nonbonded->module~mod_constants module~mod_nonbonded->module~mod_topology module~mod_nonbonded->module~mod_adjacency_mat module~mod_neighbor_list mod_neighbor_list module~mod_nonbonded->module~mod_neighbor_list module~mod_bonded->module~mod_io module~mod_bonded->module~mod_memory module~mod_bonded->module~mod_topology module~mod_adjacency_mat->module~mod_memory module~mod_profiling->module~mod_io module~mod_profiling->module~mod_memory module~mod_profiling->module~mod_constants module~mod_utils->module~mod_memory module~mod_utils->module~mod_constants module~mod_neighbor_list->module~mod_io module~mod_neighbor_list->module~mod_memory module~mod_neighbor_list->module~mod_adjacency_mat

Used by

  • module~~mod_polarization~~UsedByGraph module~mod_polarization mod_polarization proc~ommp_get_polelec_energy ommp_get_polelec_energy proc~ommp_get_polelec_energy->module~mod_polarization proc~ommp_set_external_field ommp_set_external_field proc~ommp_set_external_field->module~mod_polarization proc~polelec_geomgrad polelec_geomgrad proc~polelec_geomgrad->module~mod_polarization

Contents


Subroutines

public subroutine polarization(sys_obj, e, arg_solver, arg_mvmethod, arg_ipd_mask)

Main driver for the calculation of induced dipoles. Takes electric field at induced dipole sites as input and -- if solver converges -- provides induced dipoles as output. Since AMOEBA requires the calculations of two sets of induced dipoles generated from two different electric fields (normally called direct (D) and polarization (P)) both electric field and induced dipoles are shaped with an extra dimension and this routine calls the solver twice to solve the two linear systems in the case of AMOEBA FF. Direct electric field and induced dipoles are stored in e(:,:,1)/ipds(:,:,1) while polarization field/dipole are stored in e(:,:,2)/ipds(:,:,2).

Read more…

Arguments

Type IntentOptional Attributes Name
type(ommp_system), intent(inout), target :: sys_obj

Fundamental data structure for OMMP system

real(kind=rp), intent(in), dimension(3, sys_obj%eel%pol_atoms, sys_obj%eel%n_ipd) :: e

Total electric field that induces the dipoles

integer(kind=ip), intent(in), optional :: arg_solver

Flag for the solver to be used; optional, should be one OMMP_SOLVER_ if not provided ommp_solver_default is used.

integer(kind=ip), intent(in), optional :: arg_mvmethod

Flag for the matrix-vector method to be used; optional, should be one of OMMP_MATV_ if not provided ommp_matv_default is used.

logical, intent(in), optional :: arg_ipd_mask(sys_obj%eel%n_ipd)

Logical mask to skip calculation of one of the two set of dipoles in AMOEBA calculations (eg. when MM part's field is not taken into account, both P and D field are just external field, so there is no reason to compute it twice). If n_ipd == 1 this is always considered true.

public subroutine polarization_terminate(eel)

Arguments

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

private subroutine dipole_T(eel, i, j, tens)

This subroutine compute the interaction tensor (rank 3) between two polarizable sites i and j. This tensor is built according to the following rules: ... TODO

Arguments

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

The electostatic data structure for which the interaction tensor should be computed

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

Index (in the list of polarizable sites) of the source site

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

Index (in the list of polarizable sites) of the target site

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

Interaction tensor between sites i and j

private subroutine create_tmat(eel)

Explicitly construct polarization tensor in memory. This routine is only used to accumulate results from dipole_T and shape it in the correct way.

Arguments

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

The electostatic data structure for which the interaction tensor should be computed

private subroutine TMatVec_incore(eel, x, y, dodiag)

Perform matrix vector multiplication y = TMat*x, where TMat is polarization matrix (precomputed and stored in memory) and x and y are column vectors

Arguments

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

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector

logical, intent(in) :: dodiag

Logical flag (.true. = diagonal is computed, .false. = diagonal is skipped)

private subroutine TMatVec_otf(eel, x, y, dodiag)

Perform matrix vector multiplication y = TMat*x, where TMat is polarization matrix (precomputed and stored in memory) and x and y are column vectors

Arguments

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

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector

logical, intent(in) :: dodiag

Logical flag (.true. = diagonal is computed, .false. = diagonal is skipped)

private subroutine TMatVec_diag(eel, x, y)

This routine compute the product between the diagonal of T matrix with x, and add it to y. The product is simply computed by each element of x for its inverse polarizability.

Arguments

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

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector

private subroutine TMatVec_offdiag(eel, x, y)

Perform matrix vector multiplication y = [TMat-diag(TMat)]*x, where TMat is polarization matrix (precomputed and stored in memory) and x and y are column vectors

Arguments

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

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector

private subroutine PolVec(eel, x, y)

Perform matrix vector multiplication y = pol*x, where pol is polarizability vector, x and y are column vectors

Arguments

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

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector