ommp_set_external_field Subroutine

public subroutine ommp_set_external_field(sys_obj, ext_field, solver, matv, add_mm_field)

Uses

  • proc~~ommp_set_external_field~~UsesGraph proc~ommp_set_external_field ommp_set_external_field module~mod_electrostatics mod_electrostatics proc~ommp_set_external_field->module~mod_electrostatics module~mod_memory mod_memory proc~ommp_set_external_field->module~mod_memory module~mod_polarization mod_polarization proc~ommp_set_external_field->module~mod_polarization module~mod_electrostatics->module~mod_memory 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->module~mod_io module~mod_memory->module~mod_constants iso_c_binding iso_c_binding module~mod_memory->iso_c_binding module~mod_polarization->module~mod_electrostatics module~mod_polarization->module~mod_memory module~mod_polarization->module~mod_io module~mod_mmpol mod_mmpol module~mod_polarization->module~mod_mmpol module~mod_profiling->module~mod_memory module~mod_profiling->module~mod_io module~mod_profiling->module~mod_constants module~mod_adjacency_mat->module~mod_memory module~mod_topology->module~mod_memory module~mod_topology->module~mod_adjacency_mat module~mod_io->module~mod_constants module~mod_constants->iso_c_binding module~fmmlib_interface->module~mod_constants module~mod_tree mod_tree module~fmmlib_interface->module~mod_tree module~mod_ribtree mod_ribtree module~fmmlib_interface->module~mod_ribtree module~mod_harmonics mod_harmonics module~fmmlib_interface->module~mod_harmonics module~mod_fmm_utils mod_fmm_utils module~fmmlib_interface->module~mod_fmm_utils module~mod_fmm mod_fmm module~fmmlib_interface->module~mod_fmm module~mod_octatree mod_octatree module~fmmlib_interface->module~mod_octatree module~mod_mmpol->module~mod_electrostatics module~mod_mmpol->module~mod_memory module~mod_mmpol->module~mod_adjacency_mat module~mod_mmpol->module~mod_topology module~mod_mmpol->module~mod_io module~mod_mmpol->module~mod_constants module~mod_link_atom mod_link_atom module~mod_mmpol->module~mod_link_atom module~mod_bonded mod_bonded module~mod_mmpol->module~mod_bonded module~mod_nonbonded mod_nonbonded module~mod_mmpol->module~mod_nonbonded module~mod_tree->module~mod_adjacency_mat module~mod_tree->module~mod_constants module~mod_tree->module~mod_fmm_utils 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_fmm_utils->module~mod_constants module~mod_fmm->module~mod_constants module~mod_fmm->module~mod_tree module~mod_fmm->module~mod_harmonics module~mod_fmm->module~mod_fmm_utils 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 module~mod_link_atom->module~mod_memory module~mod_link_atom->module~mod_topology module~mod_link_atom->module~mod_io module~mod_link_atom->module~mod_constants module~mod_link_atom->module~mod_bonded module~mod_link_atom->module~mod_nonbonded module~mod_utils mod_utils module~mod_link_atom->module~mod_utils module~mod_bonded->module~mod_memory module~mod_bonded->module~mod_topology module~mod_bonded->module~mod_io module~mod_nonbonded->module~mod_memory module~mod_nonbonded->module~mod_adjacency_mat module~mod_nonbonded->module~mod_topology module~mod_nonbonded->module~mod_constants module~mod_neighbor_list mod_neighbor_list module~mod_nonbonded->module~mod_neighbor_list module~mod_utils->module~mod_memory module~mod_utils->module~mod_constants module~mod_neighbor_list->module~mod_memory module~mod_neighbor_list->module~mod_adjacency_mat module~mod_neighbor_list->module~mod_io

This function get an external field and solve the polarization system in the presence of the provided external field.

Arguments

Type IntentOptional Attributes Name
type(ommp_system), intent(inout), target :: sys_obj
real(kind=ommp_real), intent(in) :: ext_field(3,sys_obj%eel%pol_atoms)
integer(kind=ommp_integer), intent(in), value :: solver
integer(kind=ommp_integer), intent(in), value :: matv
logical, intent(in), optional, value :: add_mm_field

Calls

proc~~ommp_set_external_field~~CallsGraph proc~ommp_set_external_field ommp_set_external_field interface~mallocate mallocate proc~ommp_set_external_field->interface~mallocate proc~prepare_polelec prepare_polelec proc~ommp_set_external_field->proc~prepare_polelec interface~mfree mfree proc~ommp_set_external_field->interface~mfree proc~polarization polarization proc~ommp_set_external_field->proc~polarization proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~i_alloc3 i_alloc3 interface~mallocate->proc~i_alloc3 proc~l_alloc2 l_alloc2 interface~mallocate->proc~l_alloc2 proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~r_alloc2 r_alloc2 interface~mallocate->proc~r_alloc2 proc~l_alloc1 l_alloc1 interface~mallocate->proc~l_alloc1 proc~prepare_polelec->interface~mallocate proc~elec_prop_d2m elec_prop_D2M proc~prepare_polelec->proc~elec_prop_d2m proc~fatal_error fatal_error proc~prepare_polelec->proc~fatal_error 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~l_free1 l_free1 interface~mfree->proc~l_free1 proc~i_free2 i_free2 interface~mfree->proc~i_free2 proc~r_free3 r_free3 interface~mfree->proc~r_free3 proc~r_free2 r_free2 interface~mfree->proc~r_free2 proc~l_free2 l_free2 interface~mfree->proc~l_free2 proc~i_free1 i_free1 interface~mfree->proc~i_free1 proc~r_free1 r_free1 interface~mfree->proc~r_free1 proc~i_free3 i_free3 interface~mfree->proc~i_free3 proc~polarization->interface~mallocate proc~polarization->interface~mfree proc~ommp_message ommp_message proc~polarization->proc~ommp_message proc~time_pull time_pull proc~polarization->proc~time_pull proc~polarization->proc~fatal_error proc~create_tmat create_tmat proc~polarization->proc~create_tmat proc~inversion_solver inversion_solver proc~polarization->proc~inversion_solver proc~jacobi_diis_solver jacobi_diis_solver proc~polarization->proc~jacobi_diis_solver proc~time_push time_push proc~polarization->proc~time_push proc~conjugate_gradient_solver conjugate_gradient_solver proc~polarization->proc~conjugate_gradient_solver proc~time_pull->proc~ommp_message proc~time_pull->proc~fatal_error proc~mem_stat mem_stat proc~time_pull->proc~mem_stat proc~chk_free chk_free proc~l_free1->proc~chk_free proc~elec_prop_d2m->proc~fatal_error proc~cart_propfar_at_ipart cart_propfar_at_ipart proc~elec_prop_d2m->proc~cart_propfar_at_ipart proc~mu_elec_prop mu_elec_prop proc~elec_prop_d2m->proc~mu_elec_prop proc~prepare_fmm_ipd prepare_fmm_ipd proc~elec_prop_d2m->proc~prepare_fmm_ipd proc~damped_coulomb_kernel damped_coulomb_kernel proc~elec_prop_d2m->proc~damped_coulomb_kernel proc~i_free2->proc~chk_free proc~r_free3->proc~chk_free proc~memory_init memory_init proc~i_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~i_alloc1->proc~chk_alloc proc~i_alloc3->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~r_free2->proc~chk_free proc~create_tmat->proc~ommp_message proc~dipole_t dipole_T proc~create_tmat->proc~dipole_t proc~l_free2->proc~chk_free proc~inversion_solver->interface~mallocate proc~inversion_solver->interface~mfree dgemm dgemm proc~inversion_solver->dgemm dgetrf dgetrf proc~inversion_solver->dgetrf dgetri dgetri proc~inversion_solver->dgetri proc~jacobi_diis_solver->interface~mallocate proc~jacobi_diis_solver->interface~mfree proc~jacobi_diis_solver->proc~ommp_message proc~jacobi_diis_solver->proc~fatal_error proc~diis diis proc~jacobi_diis_solver->proc~diis proc~rmsvec rmsvec proc~jacobi_diis_solver->proc~rmsvec proc~i_free1->proc~chk_free proc~r_free1->proc~chk_free proc~r_alloc1->proc~memory_init proc~r_alloc1->proc~chk_alloc proc~r_alloc3->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~i_alloc2->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~r_alloc2->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~l_alloc1->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~elec_prop_d2d->proc~fatal_error proc~elec_prop_d2d->proc~cart_propfar_at_ipart proc~elec_prop_d2d->proc~mu_elec_prop proc~elec_prop_d2d->proc~prepare_fmm_ipd proc~elec_prop_d2d->proc~damped_coulomb_kernel proc~i_free3->proc~chk_free proc~elec_prop_m2d->proc~cart_propfar_at_ipart proc~elec_prop_m2d->proc~mu_elec_prop proc~elec_prop_m2d->proc~damped_coulomb_kernel proc~quad_elec_prop quad_elec_prop proc~elec_prop_m2d->proc~quad_elec_prop proc~q_elec_prop q_elec_prop proc~elec_prop_m2d->proc~q_elec_prop proc~preapare_fmm_static preapare_fmm_static proc~elec_prop_m2d->proc~preapare_fmm_static proc~time_push->proc~fatal_error proc~time_push->proc~mem_stat proc~conjugate_gradient_solver->interface~mallocate proc~conjugate_gradient_solver->interface~mfree proc~conjugate_gradient_solver->proc~ommp_message proc~conjugate_gradient_solver->proc~fatal_error proc~diis->interface~mallocate proc~diis->interface~mfree dgesv dgesv proc~diis->dgesv proc~makeb makeb proc~diis->proc~makeb proc~mem_stat->proc~memory_init proc~chk_free->proc~fatal_error proc~fmm_l2l fmm_l2l proc~cart_propfar_at_ipart->proc~fmm_l2l proc~ntot_sph_harm ntot_sph_harm proc~cart_propfar_at_ipart->proc~ntot_sph_harm proc~prepare_fmm_ipd->proc~fatal_error proc~prepare_fmm_ext_ipd prepare_fmm_ext_ipd proc~prepare_fmm_ipd->proc~prepare_fmm_ext_ipd 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~close_output->proc~ommp_message proc~dipole_t->proc~damped_coulomb_kernel proc~screening_rules screening_rules proc~dipole_t->proc~screening_rules proc~preapare_fmm_static->interface~mallocate proc~preapare_fmm_static->interface~mfree proc~fmm_solve_for_multipoles fmm_solve_for_multipoles proc~preapare_fmm_static->proc~fmm_solve_for_multipoles proc~make_vfact make_vfact proc~fmm_l2l->proc~make_vfact proc~fmm_l2l_rotation_work fmm_l2l_rotation_work proc~fmm_l2l->proc~fmm_l2l_rotation_work proc~prepare_fmm_ext_ipd->interface~mallocate proc~prepare_fmm_ext_ipd->interface~mfree proc~prepare_fmm_ext_ipd->proc~fmm_solve_for_multipoles proc~coulomb_kernel->proc~fatal_error proc~screening_rules->proc~fatal_error proc~fmm_solve_for_multipoles->proc~time_pull proc~fmm_solve_for_multipoles->proc~fatal_error proc~fmm_solve_for_multipoles->proc~time_push proc~tree_m2m tree_m2m proc~fmm_solve_for_multipoles->proc~tree_m2m proc~tree_m2l tree_m2l proc~fmm_solve_for_multipoles->proc~tree_m2l proc~tree_p2m tree_p2m proc~fmm_solve_for_multipoles->proc~tree_p2m proc~tree_l2l tree_l2l proc~fmm_solve_for_multipoles->proc~tree_l2l proc~carttosph carttosph proc~fmm_l2l_rotation_work->proc~carttosph proc~fmm_l2l_ztranslate_work fmm_l2l_ztranslate_work proc~fmm_l2l_rotation_work->proc~fmm_l2l_ztranslate_work proc~trgev trgev proc~fmm_l2l_rotation_work->proc~trgev proc~fmm_sph_rotate_oxz_work fmm_sph_rotate_oxz_work proc~fmm_l2l_rotation_work->proc~fmm_sph_rotate_oxz_work proc~fmm_sph_rotate_oz_adj_work fmm_sph_rotate_oz_adj_work proc~fmm_l2l_rotation_work->proc~fmm_sph_rotate_oz_adj_work proc~fmm_sph_rotate_oz_work fmm_sph_rotate_oz_work proc~fmm_l2l_rotation_work->proc~fmm_sph_rotate_oz_work proc~tree_m2m->proc~ntot_sph_harm proc~fmm_m2m fmm_m2m proc~tree_m2m->proc~fmm_m2m proc~tree_m2l->proc~ntot_sph_harm proc~fmm_m2l fmm_m2l proc~tree_m2l->proc~fmm_m2l proc~tree_p2m->proc~ntot_sph_harm proc~tree_p2m->proc~fmm_m2m proc~fmm_error fmm_error proc~tree_p2m->proc~fmm_error proc~tree_l2l->proc~fmm_l2l proc~tree_l2l->proc~ntot_sph_harm proc~fmm_m2m_rotation_work fmm_m2m_rotation_work proc~fmm_m2m->proc~fmm_m2m_rotation_work proc~fmm_m2l_rotation_work fmm_m2l_rotation_work proc~fmm_m2l->proc~fmm_m2l_rotation_work proc~fmm_m2m_rotation_work->proc~carttosph proc~fmm_m2m_rotation_work->proc~trgev proc~fmm_m2m_rotation_work->proc~fmm_sph_rotate_oxz_work proc~fmm_m2m_rotation_work->proc~fmm_sph_rotate_oz_adj_work proc~fmm_m2m_rotation_work->proc~fmm_sph_rotate_oz_work proc~fmm_m2m_ztranslate_work fmm_m2m_ztranslate_work proc~fmm_m2m_rotation_work->proc~fmm_m2m_ztranslate_work proc~fmm_m2l_rotation_work->proc~carttosph proc~fmm_m2l_rotation_work->proc~trgev proc~fmm_m2l_rotation_work->proc~fmm_sph_rotate_oxz_work proc~fmm_m2l_rotation_work->proc~fmm_sph_rotate_oz_adj_work proc~fmm_m2l_rotation_work->proc~fmm_sph_rotate_oz_work proc~fmm_m2l_ztranslate_work fmm_m2l_ztranslate_work proc~fmm_m2l_rotation_work->proc~fmm_m2l_ztranslate_work

Called by

proc~~ommp_set_external_field~~CalledByGraph proc~ommp_set_external_field ommp_set_external_field proc~ommp_set_external_field_nomm ommp_set_external_field_nomm proc~ommp_set_external_field_nomm->proc~ommp_set_external_field proc~c_ommp_set_external_field_nomm C_ommp_set_external_field_nomm proc~c_ommp_set_external_field_nomm->proc~ommp_set_external_field proc~c_ommp_set_external_field C_ommp_set_external_field proc~c_ommp_set_external_field->proc~ommp_set_external_field

Contents


Source Code

        subroutine ommp_set_external_field(sys_obj, ext_field, solver, matv, &
                                           add_mm_field)
            !! This function get an external field and solve the polarization
            !! system in the presence of the provided external field.
            use mod_polarization, only: polarization
            use mod_electrostatics, only: prepare_polelec
            use mod_memory, only: mallocate, mfree

            implicit none
            
            type(ommp_system), intent(inout), target :: sys_obj
            real(ommp_real), intent(in) :: ext_field(3,sys_obj%eel%pol_atoms)
            integer(ommp_integer), intent(in), value :: solver
            integer(ommp_integer), intent(in), value :: matv
            logical, intent(in), value, optional :: add_mm_field
            
            type(ommp_electrostatics_type), pointer :: eel
            real(ommp_real), allocatable :: ef(:,:,:)
            integer :: i
            logical :: do_mm_f

            eel => sys_obj%eel

            if(present(add_mm_field)) then
                do_mm_f = add_mm_field
            else
                do_mm_f = .true.
            end if

            eel%ipd_done = .false.

            if(do_mm_f) then
                call mallocate('ommp_get_polelec_energy [ef]', &
                               3_ommp_integer, eel%pol_atoms, eel%n_ipd, ef)
                call prepare_polelec(eel)
                do i=1, eel%n_ipd
                    ef(:,:,i) = eel%e_m2d(:,:,i) + ext_field
                end do
                call polarization(sys_obj, ef, solver)
                call mfree('ommp_get_polelec_energy [ef]', ef)
            else
                call mallocate('ommp_get_polelec_energy [ef]', &
                               3_ommp_integer, eel%pol_atoms, eel%n_ipd, ef)
                
                ef(:,:,1) = ext_field
                call polarization(sys_obj, ef, solver, matv, [.true., .false.] )
                
                call mfree('ommp_get_polelec_energy [ef]', ef)
            end if
        end subroutine ommp_set_external_field