(git:374b731)
Loading...
Searching...
No Matches
qmmm_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Basic container type for QM/MM.
10!> \author Ole Schuett
11! **************************************************************************************************
18 USE kinds, ONLY: dp
25#include "./base/base_uses.f90"
26
27 IMPLICIT NONE
28 PRIVATE
29
30 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qmmm_types'
31
33
35 TYPE(qs_environment_type), POINTER :: qs_env => null()
36 TYPE(fist_environment_type), POINTER :: fist_env => null()
37 TYPE(qmmm_env_qm_type), POINTER :: qm => null()
38 END TYPE qmmm_env_type
39
40CONTAINS
41
42! **************************************************************************************************
43!> \brief ...
44!> \param qmmm_env ...
45!> \param subsys ...
46!> \param potential_energy ...
47!> \param kinetic_energy ...
48! **************************************************************************************************
49 SUBROUTINE qmmm_env_get(qmmm_env, subsys, potential_energy, kinetic_energy)
50 TYPE(qmmm_env_type), INTENT(IN) :: qmmm_env
51 TYPE(cp_subsys_type), OPTIONAL, POINTER :: subsys
52 REAL(kind=dp), INTENT(OUT), OPTIONAL :: potential_energy, kinetic_energy
53
54 TYPE(fist_energy_type), POINTER :: thermo
55 TYPE(qs_energy_type), POINTER :: qs_energy
56
57 NULLIFY (qs_energy, thermo)
58
59 IF (PRESENT(kinetic_energy)) THEN
60 CALL fist_env_get(qmmm_env%fist_env, thermo=thermo)
61 kinetic_energy = thermo%kin
62 END IF
63 IF (PRESENT(subsys)) THEN
64 CALL fist_env_get(qmmm_env%fist_env, subsys=subsys)
65 END IF
66 IF (PRESENT(potential_energy)) THEN
67 ! get the underlying energies from primary subsys. This is the only subsys
68 ! for conventional QM/MM, and force-mixing knows to put relevant energy there.
69 CALL fist_env_get(qmmm_env%fist_env, thermo=thermo)
70 CALL get_qs_env(qmmm_env%qs_env, energy=qs_energy)
71 potential_energy = thermo%pot + qs_energy%total
72 END IF
73 END SUBROUTINE qmmm_env_get
74
75! **************************************************************************************************
76!> \brief releases the given qmmm_env (see doc/ReferenceCounting.html)
77!> \param qmmm_env the object to release
78!> \author Ole Schuett
79! **************************************************************************************************
80 SUBROUTINE qmmm_env_release(qmmm_env)
81 TYPE(qmmm_env_type), INTENT(INOUT) :: qmmm_env
82
83 CALL qs_env_release(qmmm_env%qs_env)
84 DEALLOCATE (qmmm_env%qs_env)
85 CALL qmmm_env_qm_release(qmmm_env%qm)
86 DEALLOCATE (qmmm_env%qm)
87 CALL fist_env_release(qmmm_env%fist_env)
88 DEALLOCATE (qmmm_env%fist_env)
89
90 END SUBROUTINE qmmm_env_release
91
92END MODULE qmmm_types
types that represent a subsys, i.e. a part of the system
subroutine, public fist_env_release(fist_env)
releases the given fist_env (see doc/ReferenceCounting.html)
subroutine, public fist_env_get(fist_env, atomic_kind_set, particle_set, ewald_pw, local_particles, local_molecules, molecule_kind_set, molecule_set, cell, cell_ref, ewald_env, fist_nonbond_env, thermo, para_env, subsys, qmmm, qmmm_env, input, shell_model, shell_model_ad, shell_particle_set, core_particle_set, multipoles, results, exclusions, efield)
Purpose: Get the FIST environment.
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
subroutine, public qmmm_env_qm_release(qmmm_env)
releases the given qmmm_env (see doc/ReferenceCounting.html)
Basic container type for QM/MM.
Definition qmmm_types.F:12
subroutine, public qmmm_env_release(qmmm_env)
releases the given qmmm_env (see doc/ReferenceCounting.html)
Definition qmmm_types.F:81
subroutine, public qmmm_env_get(qmmm_env, subsys, potential_energy, kinetic_energy)
...
Definition qmmm_types.F:50
Perform a QUICKSTEP wavefunction optimization (single point)
Definition qs_energy.F:14
subroutine, public qs_env_release(qs_env)
releases the given qs_env (see doc/ReferenceCounting.html)
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Get the QUICKSTEP environment.
represents a system: atoms, molecules, their pos,vel,...