|
CP2K 2.4 (Revision 12889)
|
Routines to calculate derivatives with respect to basis function origin. More...
Functions | |
| subroutine, public | derivatives_four_center (qs_env, rho, hfx_section, para_env, irep, use_virial, adiabatic_rescale_factor, error) |
| computes four center derivatives for a full basis set and updates the forcesfock_4c arrays. Uses all 8 eri symmetries | |
| subroutine | forces4 (deriv, ra, rb, rc, rd, npgfa, npgfb, npgfc, npgfd, la_min, la_max, lb_min, lb_max, lc_min, lc_max, ld_min, ld_max, nsgfa, nsgfb, nsgfc, nsgfd, sphi_a_u1, sphi_a_u2, sphi_a_u3, sphi_b_u1, sphi_b_u2, sphi_b_u3, sphi_c_u1, sphi_c_u2, sphi_c_u3, sphi_d_u1, sphi_d_u2, sphi_d_u3, zeta, zetb, zetc, zetd, primitive_integrals, potential_parameter, neighbor_cells, screen1, screen2, eps_schwarz, max_contraction_val, cart_estimate, cell, neris_tmp, log10_pmax, log10_eps_schwarz, R1_pgf, R2_pgf, pgf1, pgf2, pgf_list_ij, pgf_list_kl, pgf_product_list, nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d, sphi_a_ext, sphi_b_ext, sphi_c_ext, sphi_d_ext, ede_work, ede_work2, ede_work_forces, ede_buffer1, ede_buffer2, ede_primitives_tmp, nimages, do_periodic, use_virial, ede_work_virial, ede_work2_virial, ede_primitives_tmp_virial, primitive_integrals_virial, cart_estimate_virial) |
| INTEGER(int_8) | get_1D_idx (i, j, N) |
| Given a 2d index pair, this function returns a 1d index pair for a symmetric upper triangle NxN matrix The compiler should inline this function, therefore it appears in several modules. | |
| subroutine | prefetch_density_matrix (ma_max, mb_max, mc_max, md_max, density, pbd, pbc, pad, pac, iatom, jatom, katom, latom, iset, jset, kset, lset, offset_bd_set, offset_bc_set, offset_ad_set, offset_ac_set, atomic_offset_bd, atomic_offset_bc, atomic_offset_ad, atomic_offset_ac) |
| This routine prefetches density matrix elements, i.e. reshuffles the data in a way that they can be accessed later on in a cache friendly way. | |
| subroutine | update_forces (ma_max, mb_max, mc_max, md_max, pbd, pbc, pad, pac, fac, prim, force, forces_map, coord) |
| This routine updates the forces using bufferd density matrices. | |
| subroutine | update_virial (ma_max, mb_max, mc_max, md_max, pbd, pbc, pad, pac, fac, prim, tmp_virial, coord, l) |
| This routine updates the virial using bufferd density matrices. | |
Variables | |
| CHARACTER(len=*), parameter, private | moduleN = 'hfx_derivatives' |
Routines to calculate derivatives with respect to basis function origin.
| subroutine,public hfx_derivatives::derivatives_four_center | ( | TYPE(qs_environment_type),pointer | qs_env, |
| TYPE(qs_rho_type),pointer | rho, | ||
| TYPE(section_vals_type),pointer | hfx_section, | ||
| TYPE(cp_para_env_type),pointer | para_env, | ||
| INTEGER | irep, | ||
| LOGICAL | use_virial, | ||
| REAL(dp),intent(in),optional | adiabatic_rescale_factor, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
computes four center derivatives for a full basis set and updates the forcesfock_4c arrays. Uses all 8 eri symmetries
| qs_env | |
| ks_matrix | |
| energy | |
| rho | density matrix |
| hfx_section | HFX input section |
| para_env | para_env |
| irep | ID of HFX replica |
| adiabatic_rescale_factor | parameter used for MCY3 hybrid |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 105 of file hfx_derivatives.f90.
References hfx_types::alloc_containers(), hfx_pair_list_methods::build_pair_list(), hfx_load_balance_methods::collect_load_balance_info(), cp_output_handling::cp_p_file, CPPostcondition, hfx_types::dealloc_containers(), input_constants::do_hfx_potential_mix_cl_trunc, kinds::dp, error, forces4(), get_1D_idx(), hfx_communication::get_full_density(), get_pmax_val(), qs_environment_types::get_qs_env(), cp_files::get_unit_number(), hfx_compression_methods::hfx_add_mult_cache_elements(), hfx_types::hfx_init_container(), t_c_g0::init(), gamma::init_md_ftable(), hfx_types::init_t_c_g0_lmax, hfx_types::log_zero, dbcsr_machine::m_walltime(), orbital_pointers::ncoset, prefetch_density_matrix(), timings::timeset(), update_forces(), hfx_screening_methods::update_pmax_mat(), and update_virial().
Referenced by hfx_admm_utils::hfx_ks_matrix(), and xc_adiabatic_utils::rescale_xc_potential().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine hfx_derivatives::forces4 | ( | TYPE(lib_deriv) | deriv, |
| REAL(dp),dimension(3),intent(in) | ra, | ||
| REAL(dp),dimension(3),intent(in) | rb, | ||
| REAL(dp),dimension(3),intent(in) | rc, | ||
| REAL(dp),dimension(3),intent(in) | rd, | ||
| INTEGER,intent(in) | npgfa, | ||
| INTEGER,intent(in) | npgfb, | ||
| INTEGER,intent(in) | npgfc, | ||
| INTEGER,intent(in) | npgfd, | ||
| INTEGER,intent(in) | la_min, | ||
| INTEGER,intent(in) | la_max, | ||
| INTEGER,intent(in) | lb_min, | ||
| INTEGER,intent(in) | lb_max, | ||
| INTEGER,intent(in) | lc_min, | ||
| INTEGER,intent(in) | lc_max, | ||
| INTEGER,intent(in) | ld_min, | ||
| INTEGER,intent(in) | ld_max, | ||
| INTEGER,intent(in) | nsgfa, | ||
| INTEGER,intent(in) | nsgfb, | ||
| INTEGER,intent(in) | nsgfc, | ||
| INTEGER,intent(in) | nsgfd, | ||
| INTEGER,intent(in) | sphi_a_u1, | ||
| INTEGER,intent(in) | sphi_a_u2, | ||
| INTEGER,intent(in) | sphi_a_u3, | ||
| INTEGER,intent(in) | sphi_b_u1, | ||
| INTEGER,intent(in) | sphi_b_u2, | ||
| INTEGER,intent(in) | sphi_b_u3, | ||
| INTEGER,intent(in) | sphi_c_u1, | ||
| INTEGER,intent(in) | sphi_c_u2, | ||
| INTEGER,intent(in) | sphi_c_u3, | ||
| INTEGER,intent(in) | sphi_d_u1, | ||
| INTEGER,intent(in) | sphi_d_u2, | ||
| INTEGER,intent(in) | sphi_d_u3, | ||
| REAL(dp),dimension(1:npgfa),intent(in) | zeta, | ||
| REAL(dp),dimension(1:npgfb),intent(in) | zetb, | ||
| REAL(dp),dimension(1:npgfc),intent(in) | zetc, | ||
| REAL(dp),dimension(1:npgfd),intent(in) | zetd, | ||
| REAL(dp),dimension(nsgfa, nsgfb, nsgfc, nsgfd, 12) | primitive_integrals, | ||
| TYPE(hfx_potential_type) | potential_parameter, | ||
| TYPE(hfx_cell_type),dimension(:),pointer | neighbor_cells, | ||
| REAL(dp),dimension(2),intent(in) | screen1, | ||
| REAL(dp),dimension(2),intent(in) | screen2, | ||
| REAL(dp),intent(in) | eps_schwarz, | ||
| REAL(dp),intent(in) | max_contraction_val, | ||
| REAL(dp) | cart_estimate, | ||
| TYPE(cell_type),pointer | cell, | ||
| INTEGER(int_8) | neris_tmp, | ||
| REAL(dp),intent(in) | log10_pmax, | ||
| REAL(dp),intent(in) | log10_eps_schwarz, | ||
| TYPE(hfx_screen_coeff_type),dimension(:, :),pointer | R1_pgf, | ||
| TYPE(hfx_screen_coeff_type),dimension(:, :),pointer | R2_pgf, | ||
| TYPE(hfx_screen_coeff_type),dimension(:, :),pointer | pgf1, | ||
| TYPE(hfx_screen_coeff_type),dimension(:, :),pointer | pgf2, | ||
| TYPE(hfx_pgf_list),dimension(*) | pgf_list_ij, | ||
| TYPE(hfx_pgf_list),dimension(*) | pgf_list_kl, | ||
| TYPE(hfx_pgf_product_list),dimension(*) | pgf_product_list, | ||
| INTEGER,dimension(0:),intent(in) | nsgfl_a, | ||
| INTEGER,dimension(0:),intent(in) | nsgfl_b, | ||
| INTEGER,dimension(0:),intent(in) | nsgfl_c, | ||
| INTEGER,dimension(0:),intent(in) | nsgfl_d, | ||
| REAL(dp),dimension(sphi_a_u1,sphi_a_u2,sphi_a_u3),intent(in) | sphi_a_ext, | ||
| REAL(dp),dimension(sphi_b_u1,sphi_b_u2,sphi_b_u3),intent(in) | sphi_b_ext, | ||
| REAL(dp),dimension(sphi_c_u1,sphi_c_u2,sphi_c_u3),intent(in) | sphi_c_ext, | ||
| REAL(dp),dimension(sphi_d_u1,sphi_d_u2,sphi_d_u3),intent(in) | sphi_d_ext, | ||
| REAL(dp),dimension(*) | ede_work, | ||
| REAL(dp),dimension(*) | ede_work2, | ||
| REAL(dp),dimension(*) | ede_work_forces, | ||
| REAL(dp),dimension(*) | ede_buffer1, | ||
| REAL(dp),dimension(*) | ede_buffer2, | ||
| REAL(dp),dimension(*) | ede_primitives_tmp, | ||
| INTEGER,dimension(*) | nimages, | ||
| LOGICAL,intent(in) | do_periodic, | ||
| LOGICAL,intent(in) | use_virial, | ||
| REAL(dp),dimension(*) | ede_work_virial, | ||
| REAL(dp),dimension(*) | ede_work2_virial, | ||
| REAL(dp),dimension(*) | ede_primitives_tmp_virial, | ||
| REAL(dp),dimension(nsgfa, nsgfb, nsgfc, nsgfd, 12, 3) | primitive_integrals_virial, | ||
| REAL(dp) | cart_estimate_virial | ||
| ) | [private] |
Definition at line 1663 of file hfx_derivatives.f90.
References cell, hfx_libint_interface::evaluate_deriv_eri(), orbital_pointers::nco, and orbital_pointers::nso.
Referenced by derivatives_four_center().
Here is the call graph for this function:
Here is the caller graph for this function:| INTEGER(int_8) hfx_derivatives::get_1D_idx | ( | INTEGER,intent(in) | i, |
| INTEGER,intent(in) | j, | ||
| INTEGER(int_8),intent(in) | N | ||
| ) | [private] |
Given a 2d index pair, this function returns a 1d index pair for a symmetric upper triangle NxN matrix The compiler should inline this function, therefore it appears in several modules.
| i,j | 2d index |
| N | matrix size |
Definition at line 1845 of file hfx_derivatives.f90.
Referenced by derivatives_four_center().
Here is the caller graph for this function:| subroutine hfx_derivatives::prefetch_density_matrix | ( | INTEGER,intent(in) | ma_max, |
| INTEGER,intent(in) | mb_max, | ||
| INTEGER,intent(in) | mc_max, | ||
| INTEGER,intent(in) | md_max, | ||
| REAL(dp),dimension(:),intent(in) | density, | ||
| REAL(dp),dimension(*),intent(inout) | pbd, | ||
| REAL(dp),dimension(*),intent(inout) | pbc, | ||
| REAL(dp),dimension(*),intent(inout) | pad, | ||
| REAL(dp),dimension(*),intent(inout) | pac, | ||
| INTEGER,intent(in) | iatom, | ||
| INTEGER,intent(in) | jatom, | ||
| INTEGER,intent(in) | katom, | ||
| INTEGER,intent(in) | latom, | ||
| INTEGER,intent(in) | iset, | ||
| INTEGER,intent(in) | jset, | ||
| INTEGER,intent(in) | kset, | ||
| INTEGER,intent(in) | lset, | ||
| INTEGER,dimension(:, :),pointer | offset_bd_set, | ||
| INTEGER,dimension(:, :),pointer | offset_bc_set, | ||
| INTEGER,dimension(:, :),pointer | offset_ad_set, | ||
| INTEGER,dimension(:, :),pointer | offset_ac_set, | ||
| INTEGER,intent(in) | atomic_offset_bd, | ||
| INTEGER,intent(in) | atomic_offset_bc, | ||
| INTEGER,intent(in) | atomic_offset_ad, | ||
| INTEGER,intent(in) | atomic_offset_ac | ||
| ) | [private] |
This routine prefetches density matrix elements, i.e. reshuffles the data in a way that they can be accessed later on in a cache friendly way.
| pa1,pb1,pc1,pd1 | offsets |
| ma_max,mb_max,mc_max,md_max,: | Size of matrix blocks |
| sgfa,sgfb,sgfc,sgfd | offsets |
| pbd,pbc,pad,pac | buffers that will contain P(b,d), P(b,c) ... |
Definition at line 1869 of file hfx_derivatives.f90.
References mathconstants::fac.
Referenced by derivatives_four_center().
Here is the caller graph for this function:| subroutine hfx_derivatives::update_forces | ( | INTEGER,intent(in) | ma_max, |
| INTEGER,intent(in) | mb_max, | ||
| INTEGER,intent(in) | mc_max, | ||
| INTEGER,intent(in) | md_max, | ||
| REAL(dp),dimension(*),intent(in) | pbd, | ||
| REAL(dp),dimension(*),intent(in) | pbc, | ||
| REAL(dp),dimension(*),intent(in) | pad, | ||
| REAL(dp),dimension(*),intent(in) | pac, | ||
| REAL(dp),intent(in) | fac, | ||
| REAL(dp),dimension(ma_max*mb_max*mc_max *md_max),intent(in) | prim, | ||
| TYPE(qs_force_type),dimension(:),pointer | force, | ||
| INTEGER,dimension(4,2),intent(in) | forces_map, | ||
| INTEGER,intent(in) | coord | ||
| ) | [private] |
This routine updates the forces using bufferd density matrices.
| ma_max,mb_max,mc_max,md_max,: | Size of matrix blocks |
| pbd,pbc,pad,pac | buffers that will contain P(b,d), P(b,c) ... |
| fac | mulitplication factor (spin, symmetry) |
| prim | primitve forces |
| force | storage loacation for forces |
| forces_map | index table |
| coord | which of the 12 coords to be updated |
Definition at line 1999 of file hfx_derivatives.f90.
References mathconstants::fac.
Referenced by derivatives_four_center().
Here is the caller graph for this function:| subroutine hfx_derivatives::update_virial | ( | INTEGER,intent(in) | ma_max, |
| INTEGER,intent(in) | mb_max, | ||
| INTEGER,intent(in) | mc_max, | ||
| INTEGER,intent(in) | md_max, | ||
| REAL(dp),dimension(*),intent(in) | pbd, | ||
| REAL(dp),dimension(*),intent(in) | pbc, | ||
| REAL(dp),dimension(*),intent(in) | pad, | ||
| REAL(dp),dimension(*),intent(in) | pac, | ||
| REAL(dp),intent(in) | fac, | ||
| REAL(dp),dimension(ma_max*mb_max*mc_max *md_max),intent(in) | prim, | ||
| REAL(dp),dimension(3,3) | tmp_virial, | ||
| INTEGER,intent(in) | coord, | ||
| INTEGER,intent(in) | l | ||
| ) | [private] |
This routine updates the virial using bufferd density matrices.
| ma_max,mb_max,mc_max,md_max,: | Size of matrix blocks |
| pbd,pbc,pad,pac | buffers that will contain P(b,d), P(b,c) ... |
| fac | mulitplication factor (spin, symmetry) |
| prim | primitve forces |
| force | storage loacation for forces |
| forces_map | index table |
| coord | which of the 12 coords to be updated |
Definition at line 2054 of file hfx_derivatives.f90.
Referenced by derivatives_four_center().
Here is the caller graph for this function:| CHARACTER(len=*),parameter,private hfx_derivatives::moduleN = 'hfx_derivatives' |
Definition at line 78 of file hfx_derivatives.f90.
1.7.3