energy_MM_pol Subroutine

public subroutine energy_MM_pol(eel, ene)

Uses

  • proc~~energy_mm_pol~~UsesGraph proc~energy_mm_pol energy_MM_pol module~mod_memory mod_memory proc~energy_mm_pol->module~mod_memory module~mod_io mod_io module~mod_memory->module~mod_io iso_c_binding iso_c_binding module~mod_memory->iso_c_binding module~mod_constants mod_constants module~mod_memory->module~mod_constants module~mod_io->module~mod_constants module~mod_constants->iso_c_binding

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)


Calls

proc~~energy_mm_pol~~CallsGraph proc~energy_mm_pol energy_MM_pol proc~prepare_polelec prepare_polelec proc~energy_mm_pol->proc~prepare_polelec proc~fatal_error fatal_error proc~energy_mm_pol->proc~fatal_error proc~prepare_polelec->proc~fatal_error interface~mallocate mallocate proc~prepare_polelec->interface~mallocate proc~elec_prop_d2d elec_prop_D2D proc~prepare_polelec->proc~elec_prop_d2d proc~elec_prop_m2d elec_prop_M2D proc~prepare_polelec->proc~elec_prop_m2d proc~elec_prop_d2m elec_prop_D2M proc~prepare_polelec->proc~elec_prop_d2m proc~ommp_message ommp_message proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~r_alloc2 r_alloc2 interface~mallocate->proc~r_alloc2 proc~i_alloc3 i_alloc3 interface~mallocate->proc~i_alloc3 proc~l_alloc1 l_alloc1 interface~mallocate->proc~l_alloc1 proc~l_alloc2 l_alloc2 interface~mallocate->proc~l_alloc2 proc~elec_prop_d2d->proc~fatal_error proc~mu_elec_prop mu_elec_prop proc~elec_prop_d2d->proc~mu_elec_prop proc~damped_coulomb_kernel damped_coulomb_kernel proc~elec_prop_d2d->proc~damped_coulomb_kernel proc~elec_prop_m2d->proc~mu_elec_prop proc~elec_prop_m2d->proc~damped_coulomb_kernel proc~q_elec_prop q_elec_prop proc~elec_prop_m2d->proc~q_elec_prop proc~quad_elec_prop quad_elec_prop proc~elec_prop_m2d->proc~quad_elec_prop proc~elec_prop_d2m->proc~fatal_error proc~elec_prop_d2m->proc~mu_elec_prop proc~elec_prop_d2m->proc~damped_coulomb_kernel proc~close_output->proc~ommp_message proc~memory_init memory_init proc~r_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~r_alloc1->proc~chk_alloc proc~i_alloc2->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~i_alloc1->proc~memory_init proc~i_alloc1->proc~chk_alloc proc~r_alloc3->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~r_alloc2->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~i_alloc3->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~l_alloc1->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~damped_coulomb_kernel->proc~fatal_error proc~coulomb_kernel coulomb_kernel proc~damped_coulomb_kernel->proc~coulomb_kernel proc~chk_alloc->proc~fatal_error proc~coulomb_kernel->proc~fatal_error

Called by

proc~~energy_mm_pol~~CalledByGraph proc~energy_mm_pol energy_MM_pol proc~ommp_get_polelec_energy ommp_get_polelec_energy proc~ommp_get_polelec_energy->proc~energy_mm_pol proc~ommp_get_full_ele_energy ommp_get_full_ele_energy proc~ommp_get_full_ele_energy->proc~ommp_get_polelec_energy program~test_si_potential test_SI_potential program~test_si_potential->proc~ommp_get_polelec_energy proc~c_ommp_get_polelec_energy C_ommp_get_polelec_energy proc~c_ommp_get_polelec_energy->proc~ommp_get_polelec_energy proc~ommp_get_full_energy ommp_get_full_energy proc~ommp_get_full_energy->proc~ommp_get_full_ele_energy proc~c_ommp_get_full_ele_energy C_ommp_get_full_ele_energy proc~c_ommp_get_full_ele_energy->proc~ommp_get_full_ele_energy proc~c_ommp_get_full_energy C_ommp_get_full_energy proc~c_ommp_get_full_energy->proc~ommp_get_full_energy

Contents

Source Code


Source Code

    subroutine energy_MM_pol(eel, ene)
        !! This function computes the interaction energy of 
        !! static electric multipoles
        use mod_memory, only: mallocate, mfree

        implicit none

        type(ommp_electrostatics_type), intent(inout) :: eel
        !! Electrostatics data structure
        real(rp), intent(inout) :: ene
        !! Energy (results will be added)
        real(rp) :: eMM

        integer(ip) :: i

        call prepare_polelec(eel)
        if(.not. eel%ipd_done) call fatal_error("IPD should be computed before&
                                                & computing MM-Pol energy.")
        eMM = 0.0
        
        if(eel%amoeba) then
            do i=1, 3
                eMM = eMM - dot_product(eel%ipd(i,:,_amoeba_D_), &
                                        eel%E_M2D(i,:,_amoeba_P_))
            end do
        else
            do i=1, 3
                eMM = eMM - dot_product(eel%ipd(i,:,1), eel%E_M2D(i,:,1))
            end do
        end if

        ene = ene + 0.5_rp * eMM

    end subroutine energy_MM_pol