47#include "./base/base_uses.f90"
53 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
54 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'nnp_force'
69 TYPE(
nnp_type),
INTENT(INOUT),
POINTER :: nnp
70 LOGICAL,
INTENT(IN) :: calc_forces
72 CHARACTER(len=*),
PARAMETER :: routinen =
'nnp_calc_energy_force'
74 INTEGER :: handle, handle_loop, i, i_com, ie, ig, &
75 il, ind, istart, j, k, m, &
76 max_input_nodes, mecalc, &
77 n_input_nodes, nthreads, t, tid
78 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: allcalc
79 LOGICAL :: calc_stress
80 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: denergydsym
81 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: stress
82 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :, :) :: my_cstress_t, my_force_t
92 CALL timeset(routinen, handle)
94 NULLIFY (particle_set, logger, local_particles, subsys, &
98 cpassert(
ASSOCIATED(nnp))
99 cpassert(nnp%n_committee >= 1)
100 CALL nnp_env_get(nnp_env=nnp, particle_set=particle_set, &
101 subsys=subsys, local_particles=local_particles, &
102 atomic_kind_set=atomic_kind_set)
107 calc_stress = virial%pv_availability .AND. (.NOT. virial%pv_numer)
108 IF (calc_stress .AND. .NOT. calc_forces)
THEN
109 cpabort(
'Stress cannot be calculated without forces')
112 nnp%atomic_energy(:, :) = 0.0_dp
113 IF (calc_forces) nnp%myforce(:, :, :) = 0.0_dp
114 IF (calc_forces) nnp%committee_forces(:, :, :) = 0.0_dp
115 IF (calc_stress) nnp%committee_stress(:, :, :) = 0.0_dp
120 DO j = 1, nnp%num_atoms
121 IF (nnp%ele(i) == particle_set(j)%atomic_kind%element_symbol)
THEN
123 nnp%coord(m, ig) = particle_set(j)%r(m)
125 nnp%atoms(ig) = nnp%ele(i)
136 mecalc = nnp%num_atoms/logger%para_env%num_pe + &
137 min(mod(nnp%num_atoms, logger%para_env%num_pe)/ &
138 (logger%para_env%mepos + 1), 1)
139 ALLOCATE (allcalc(logger%para_env%num_pe))
141 CALL logger%para_env%allgather(mecalc, allcalc)
143 DO i = 2, logger%para_env%mepos + 1
144 istart = istart + allcalc(i - 1)
148 nnp%output_expol = .false.
154 max_input_nodes = max(max_input_nodes, nnp%arc(i)%n_nodes(1))
160 IF (calc_forces)
THEN
162 ALLOCATE (my_force_t(3, nnp%num_atoms, nnp%n_committee, 0:nthreads - 1))
163 my_force_t(:, :, :, :) = 0.0_dp
164 IF (calc_stress)
THEN
165 ALLOCATE (my_cstress_t(3, 3, nnp%n_committee, 0:nthreads - 1))
166 my_cstress_t(:, :, :, :) = 0.0_dp
172 CALL timeset(
'nnp_per_rank_atom_loop', handle_loop)
194 ALLOCATE (my_arc(nnp%n_ele))
196 ALLOCATE (my_arc(ie)%n_nodes, source=nnp%arc(ie)%n_nodes)
197 ALLOCATE (my_arc(ie)%layer(nnp%n_layer))
198 DO il = 1, nnp%n_layer
199 IF (
ALLOCATED(nnp%arc(ie)%layer(il)%weights))
THEN
200 ALLOCATE (my_arc(ie)%layer(il)%weights, source=nnp%arc(ie)%layer(il)%weights)
202 IF (
ALLOCATED(nnp%arc(ie)%layer(il)%bweights))
THEN
203 ALLOCATE (my_arc(ie)%layer(il)%bweights, source=nnp%arc(ie)%layer(il)%bweights)
205 IF (
ALLOCATED(nnp%arc(ie)%layer(il)%node))
THEN
206 ALLOCATE (my_arc(ie)%layer(il)%node, source=nnp%arc(ie)%layer(il)%node)
208 IF (
ALLOCATED(nnp%arc(ie)%layer(il)%node_grad))
THEN
209 ALLOCATE (my_arc(ie)%layer(il)%node_grad, source=nnp%arc(ie)%layer(il)%node_grad)
211 IF (
ALLOCATED(nnp%arc(ie)%layer(il)%tmp_der))
THEN
212 ALLOCATE (my_arc(ie)%layer(il)%tmp_der, source=nnp%arc(ie)%layer(il)%tmp_der)
217 IF (calc_forces)
THEN
218 ALLOCATE (denergydsym(max_input_nodes))
219 denergydsym(:) = 0.0_dp
220 IF (calc_stress)
THEN
221 ALLOCATE (stress(3, 3, max_input_nodes))
222 stress(:, :, :) = 0.0_dp
228 DO i = istart, istart + mecalc - 1
232 n_input_nodes = nnp%arc(ind)%n_nodes(1)
235 my_arc(ind)%layer(1)%node(:) = 0.0_dp
238 IF (calc_forces)
THEN
240 my_arc(ind)%layer(1)%node_grad(:) = 0.0_dp
241 IF (calc_stress)
THEN
242 stress(:, :, 1:n_input_nodes) = 0.0_dp
243 CALL nnp_calc_acsf(nnp, i, .true., my_arc(ind), stress(:, :, 1:n_input_nodes))
251 DO i_com = 1, nnp%n_committee
254 nnp%atomic_energy(i, i_com) = my_arc(ind)%layer(nnp%n_layer)%node(1) + &
255 nnp%atom_energies(ind)
258 IF (calc_forces)
THEN
259 denergydsym(1:n_input_nodes) = 0.0_dp
260 CALL nnp_gradients(my_arc(ind), nnp, i_com, denergydsym(1:n_input_nodes))
266 my_force_t(:, :, i_com, tid - 1))
268 IF (calc_stress)
THEN
269 DO j = 1, n_input_nodes
270 my_cstress_t(:, :, i_com, tid - 1) = my_cstress_t(:, :, i_com, tid - 1) - &
271 denergydsym(j)*stress(:, :, j)
280 IF (calc_forces)
THEN
281 DEALLOCATE (denergydsym)
282 IF (calc_stress)
DEALLOCATE (stress)
292 DO il = 1, nnp%n_layer
293 IF (
ALLOCATED(my_arc(ie)%layer(il)%weights))
DEALLOCATE (my_arc(ie)%layer(il)%weights)
294 IF (
ALLOCATED(my_arc(ie)%layer(il)%bweights))
DEALLOCATE (my_arc(ie)%layer(il)%bweights)
295 IF (
ALLOCATED(my_arc(ie)%layer(il)%node))
DEALLOCATE (my_arc(ie)%layer(il)%node)
296 IF (
ALLOCATED(my_arc(ie)%layer(il)%node_grad))
DEALLOCATE (my_arc(ie)%layer(il)%node_grad)
297 IF (
ALLOCATED(my_arc(ie)%layer(il)%tmp_der))
DEALLOCATE (my_arc(ie)%layer(il)%tmp_der)
299 DEALLOCATE (my_arc(ie)%layer)
307 IF (calc_forces)
THEN
308 DO t = 0, nthreads - 1
309 nnp%myforce(:, :, :) = nnp%myforce(:, :, :) + my_force_t(:, :, :, t)
311 DEALLOCATE (my_force_t)
312 IF (calc_stress)
THEN
313 DO t = 0, nthreads - 1
314 nnp%committee_stress(:, :, :) = nnp%committee_stress(:, :, :) + my_cstress_t(:, :, :, t)
316 DEALLOCATE (my_cstress_t)
320 CALL timestop(handle_loop)
323 CALL logger%para_env%sum(nnp%atomic_energy(:, :))
324 nnp%committee_energy(:) = sum(nnp%atomic_energy, 1)
325 nnp%nnp_potential_energy = sum(nnp%committee_energy)/real(nnp%n_committee,
dp)
327 IF (calc_forces)
THEN
329 DO j = 1, nnp%num_atoms
331 nnp%committee_forces(k, (nnp%sort(j)), :) = nnp%myforce(k, j, :)
334 CALL logger%para_env%sum(nnp%committee_forces)
335 nnp%nnp_forces(:, :) = sum(nnp%committee_forces, dim=3)/real(nnp%n_committee,
dp)
336 DO j = 1, nnp%num_atoms
337 particle_set(j)%f(:) = nnp%nnp_forces(:, j)
341 IF (calc_stress)
THEN
342 CALL logger%para_env%sum(nnp%committee_stress)
343 virial%pv_virial = sum(nnp%committee_stress, dim=3)/real(nnp%n_committee,
dp)
348 CALL nnp_bias_sigma(nnp, calc_forces)
349 nnp%nnp_potential_energy = nnp%nnp_potential_energy + nnp%bias_energy
350 IF (calc_forces)
THEN
351 DO j = 1, nnp%num_atoms
352 particle_set(j)%f(:) = particle_set(j)%f(:) + nnp%bias_forces(:, j)
357 CALL nnp_print_bias(nnp, print_section)
362 CALL nnp_print(nnp, print_section)
366 CALL timestop(handle)
377 SUBROUTINE nnp_bias_sigma(nnp, calc_forces)
378 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
379 LOGICAL,
INTENT(IN) :: calc_forces
381 CHARACTER(len=*),
PARAMETER :: routinen =
'nnp_bias_sigma'
384 REAL(kind=
dp) :: avrg, pref, sigma
386 CALL timeset(routinen, handle)
390 nnp%bias_energy = 0.0_dp
391 IF (calc_forces) nnp%bias_forces = 0.0_dp
394 IF (nnp%bias_align)
THEN
396 nnp%committee_energy(:) = nnp%committee_energy(:) - nnp%bias_e_avrg(:)
402 avrg = sum(nnp%committee_energy)/real(nnp%n_committee,
dp)
403 DO i = 1, nnp%n_committee
404 sigma = sigma + (nnp%committee_energy(i) - avrg)**2
406 sigma = sqrt(sigma/real(nnp%n_committee,
dp))
407 nnp%bias_sigma = sigma
409 IF (sigma > nnp%bias_sigma0)
THEN
411 nnp%bias_energy = 0.5_dp*nnp%bias_kb*(sigma - nnp%bias_sigma0)**2
413 IF (calc_forces)
THEN
417 pref = nnp%bias_kb*(1.0_dp - nnp%bias_sigma0/sigma)
418 DO i = 1, nnp%n_committee
419 nnp%bias_forces(:, :) = nnp%bias_forces(:, :) + &
420 (nnp%committee_energy(i) - avrg)* &
421 (nnp%committee_forces(:, :, i) - nnp%nnp_forces(:, :))
423 pref = pref/real(nnp%n_committee,
dp)
424 nnp%bias_forces(:, :) = nnp%bias_forces(:, :)*pref
428 CALL timestop(handle)
430 END SUBROUTINE nnp_bias_sigma
439 SUBROUTINE nnp_print(nnp, print_section)
440 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
444 LOGICAL :: explicit, file_is_new
448 NULLIFY (logger, print_key)
454 middle_name=
"nnp-energies", is_new_file=file_is_new)
455 IF (unit_nr > 0)
CALL nnp_print_energies(nnp, unit_nr, file_is_new)
461 CALL nnp_print_forces(nnp, print_key)
467 middle_name=
"nnp-forces-std")
468 IF (unit_nr > 0)
CALL nnp_print_force_sigma(nnp, unit_nr)
473 CALL logger%para_env%sum(nnp%output_expol)
474 IF (nnp%output_expol)
THEN
478 middle_name=
"nnp-extrapolation")
479 IF (unit_nr > 0)
CALL nnp_print_expol(nnp, unit_nr)
491 middle_name=
"nnp-sumforce", is_new_file=file_is_new)
492 IF (unit_nr > 0)
CALL nnp_print_sumforces(nnp, print_section, unit_nr, file_is_new)
497 END SUBROUTINE nnp_print
507 SUBROUTINE nnp_print_energies(nnp, unit_nr, file_is_new)
508 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
509 INTEGER,
INTENT(IN) :: unit_nr
510 LOGICAL,
INTENT(IN) :: file_is_new
512 CHARACTER(LEN=12) :: fmt_string
516 IF (file_is_new)
THEN
517 WRITE (unit_nr,
"(A1,1X,A20)", advance=
'no')
"#",
"NNP Average [a.u.],"
518 WRITE (unit_nr,
"(A20)", advance=
'no')
"NNP sigma [a.u.]"
519 DO i = 1, nnp%n_committee
520 WRITE (unit_nr,
"(A17,I3)", advance=
'no')
"NNP", i
522 WRITE (unit_nr,
"(A)")
""
525 fmt_string =
"(2X, F20.9)"
526 WRITE (unit=fmt_string(5:6), fmt=
"(I2)") nnp%n_committee + 2
527 std = sum((sum(nnp%atomic_energy, 1) - nnp%nnp_potential_energy)**2)
528 std = std/real(nnp%n_committee,
dp)
530 WRITE (unit_nr, fmt_string) nnp%nnp_potential_energy, std, sum(nnp%atomic_energy, 1)
532 END SUBROUTINE nnp_print_energies
541 SUBROUTINE nnp_print_forces(nnp, print_key)
542 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
545 CHARACTER(len=default_path_length) :: fmt_string, middle_name
546 INTEGER :: i, j, unit_nr
552 DO i = 1, nnp%n_committee
553 WRITE (fmt_string, *) i
554 WRITE (middle_name,
"(A,A)")
"nnp-forces-", adjustl(trim(fmt_string))
556 middle_name=trim(middle_name))
557 IF (unit_nr > 0)
THEN
558 WRITE (unit_nr, *) nnp%num_atoms
559 WRITE (unit_nr,
"(A,1X,A,A,F20.9)")
"NNP forces [a.u.] of committee member", &
560 adjustl(trim(fmt_string)),
"energy [a.u.]=", nnp%committee_energy(i)
562 fmt_string =
"(A4,1X,3F20.10)"
563 DO j = 1, nnp%num_atoms
564 WRITE (unit_nr, fmt_string) nnp%atoms(nnp%sort_inv(j)), nnp%committee_forces(:, j, i)
570 END SUBROUTINE nnp_print_forces
579 SUBROUTINE nnp_print_force_sigma(nnp, unit_nr)
580 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
581 INTEGER,
INTENT(IN) :: unit_nr
584 REAL(kind=
dp),
DIMENSION(3) :: var
586 IF (unit_nr > 0)
THEN
587 WRITE (unit_nr, *) nnp%num_atoms
588 WRITE (unit_nr,
"(A,1X,A)")
"NNP sigma of forces [a.u.]"
590 DO i = 1, nnp%num_atoms
592 DO j = 1, nnp%n_committee
593 var = var + (nnp%committee_forces(:, i, j) - nnp%nnp_forces(:, i))**2
595 var = var/real(nnp%n_committee,
dp)
597 WRITE (unit_nr,
"(A4,1X,3F20.10)") nnp%atoms(nnp%sort_inv(i)), var
601 END SUBROUTINE nnp_print_force_sigma
610 SUBROUTINE nnp_print_expol(nnp, unit_nr)
611 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
612 INTEGER,
INTENT(IN) :: unit_nr
614 CHARACTER(len=default_path_length) :: fmt_string
616 REAL(kind=
dp) :: mass, unit_conv
617 REAL(kind=
dp),
DIMENSION(3) :: com
619 nnp%expol = nnp%expol + 1
620 WRITE (unit_nr, *) nnp%num_atoms
621 WRITE (unit_nr,
"(A,1X,I6)")
"NNP extrapolation point N =", nnp%expol
627 DO i = 1, nnp%num_atoms
629 com(:) = com(:) + nnp%coord(:, i)*unit_conv
630 mass = mass + unit_conv
634 DO i = 1, nnp%num_atoms
635 nnp%coord(:, i) = nnp%coord(:, i) - com(:)
640 fmt_string =
"(A4,1X,3F20.10)"
641 DO i = 1, nnp%num_atoms
642 WRITE (unit_nr, fmt_string) &
643 nnp%atoms(nnp%sort_inv(i)), &
644 nnp%coord(1, nnp%sort_inv(i))*unit_conv, &
645 nnp%coord(2, nnp%sort_inv(i))*unit_conv, &
646 nnp%coord(3, nnp%sort_inv(i))*unit_conv
649 END SUBROUTINE nnp_print_expol
658 SUBROUTINE nnp_print_bias(nnp, print_section)
659 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
663 LOGICAL :: file_is_new
667 NULLIFY (logger, print_key)
673 middle_name=
"nnp-bias-energy", is_new_file=file_is_new)
674 IF (unit_nr > 0)
CALL nnp_print_bias_energy(nnp, unit_nr, file_is_new)
681 middle_name=
"nnp-bias-forces")
682 IF (unit_nr > 0)
CALL nnp_print_bias_forces(nnp, unit_nr)
686 END SUBROUTINE nnp_print_bias
696 SUBROUTINE nnp_print_bias_energy(nnp, unit_nr, file_is_new)
697 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
698 INTEGER,
INTENT(IN) :: unit_nr
699 LOGICAL,
INTENT(IN) :: file_is_new
701 CHARACTER(len=default_path_length) :: fmt_string
704 IF (file_is_new)
THEN
705 WRITE (unit_nr,
"(A1)", advance=
'no')
"#"
706 WRITE (unit_nr,
"(2(2X,A19))", advance=
'no')
"Sigma [a.u.]",
"Bias energy [a.u.]"
707 DO i = 1, nnp%n_committee
708 IF (nnp%bias_align)
THEN
709 WRITE (unit_nr,
"(2X,A16,I3)", advance=
'no')
"shifted E_NNP", i
711 WRITE (unit_nr,
"(2X,A16,I3)", advance=
'no')
"E_NNP", i
714 WRITE (unit_nr,
"(A)")
""
718 WRITE (fmt_string,
"(A,I3,A)")
"(2X,", nnp%n_committee + 2,
"(F20.9,1X))"
719 WRITE (unit_nr, fmt_string) nnp%bias_sigma, nnp%bias_energy, nnp%committee_energy
721 END SUBROUTINE nnp_print_bias_energy
730 SUBROUTINE nnp_print_bias_forces(nnp, unit_nr)
731 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
732 INTEGER,
INTENT(IN) :: unit_nr
734 CHARACTER(len=default_path_length) :: fmt_string
737 WRITE (unit_nr, *) nnp%num_atoms
738 WRITE (unit_nr,
"(A,F20.9)")
"NNP bias forces [a.u.] for bias energy [a.u]=", nnp%bias_energy
740 fmt_string =
"(A4,1X,3F20.10)"
741 DO i = 1, nnp%num_atoms
742 WRITE (unit_nr, fmt_string) nnp%atoms(nnp%sort_inv(i)), nnp%bias_forces(:, i)
745 END SUBROUTINE nnp_print_bias_forces
756 SUBROUTINE nnp_print_sumforces(nnp, print_section, unit_nr, file_is_new)
757 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
759 INTEGER,
INTENT(IN) :: unit_nr
760 LOGICAL,
INTENT(IN) :: file_is_new
762 CHARACTER(len=default_path_length) :: fmt_string
763 CHARACTER(LEN=default_string_length), &
764 DIMENSION(:),
POINTER :: atomlist
765 INTEGER :: i, ig, j, n
766 REAL(kind=
dp),
DIMENSION(3) :: rvec
769 IF (file_is_new)
THEN
770 WRITE (unit_nr,
"(A)")
"# Summed forces [a.u.]"
778 IF (
ASSOCIATED(atomlist))
THEN
780 DO i = 1, nnp%num_atoms
783 IF (trim(adjustl(atomlist(j))) == trim(adjustl(nnp%atoms(ig))))
THEN
784 rvec(:) = rvec(:) + nnp%nnp_forces(:, i)
790 fmt_string =
"(3(F20.10,1X))"
791 WRITE (unit_nr, fmt_string) rvec
793 END SUBROUTINE nnp_print_sumforces
818 INTEGER,
INTENT(IN) :: ind, i
819 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: denergydsym
820 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: force_xyz
822 INTEGER :: j, k, k_atom, m, n_ang1_s, n_ang2_s, &
823 n_input_nodes, n_symf_s, off, s, sf, &
830 associate(workspace => nnp%neighbor_interface_state%workspace(ind, tid), &
831 neighbor => nnp%neighbor_interface_state%workspace(ind, tid)%neighbor, &
832 self_dgdr => nnp%neighbor_interface_state%workspace(ind, tid)%self_dGdr)
834 n_input_nodes = workspace%n_input_nodes
837 DO j = 1, n_input_nodes
839 force_xyz(1, i) = force_xyz(1, i) - de*self_dgdr(1, j)
840 force_xyz(2, i) = force_xyz(2, i) - de*self_dgdr(2, j)
841 force_xyz(3, i) = force_xyz(3, i) - de*self_dgdr(3, j)
845 DO s = 1, nnp%rad(ind)%n_symfgrp
846 n_symf_s = nnp%rad(ind)%symfgrp(s)%n_symf
847 associate(rad_buf => workspace%dGdr_rad(s)%data)
848 DO j = 1, neighbor%n_rad(s)
849 k_atom = neighbor%rad(s)%ind(j)
851 m = nnp%rad(ind)%symfgrp(s)%symf(sf)
853 force_xyz(1, k_atom) = force_xyz(1, k_atom) - de*rad_buf(1, sf, j)
854 force_xyz(2, k_atom) = force_xyz(2, k_atom) - de*rad_buf(2, sf, j)
855 force_xyz(3, k_atom) = force_xyz(3, k_atom) - de*rad_buf(3, sf, j)
863 DO s = 1, nnp%ang(ind)%n_symfgrp
864 n_symf_s = nnp%ang(ind)%symfgrp(s)%n_symf
865 n_ang1_s = neighbor%n_ang1(s)
866 homo_grp = (nnp%ang(ind)%symfgrp(s)%ele(1) == nnp%ang(ind)%symfgrp(s)%ele(2))
870 n_ang2_s = neighbor%n_ang2(s)
873 associate(jj_buf => workspace%dGdr_ang_jj(s)%data, &
874 kk_buf => workspace%dGdr_ang_kk(s)%data)
877 k_atom = neighbor%ang1(s)%ind(j)
879 m = off + nnp%ang(ind)%symfgrp(s)%symf(sf)
881 force_xyz(1, k_atom) = force_xyz(1, k_atom) - de*jj_buf(1, sf, j)
882 force_xyz(2, k_atom) = force_xyz(2, k_atom) - de*jj_buf(2, sf, j)
883 force_xyz(3, k_atom) = force_xyz(3, k_atom) - de*jj_buf(3, sf, j)
890 k_atom = neighbor%ang1(s)%ind(k)
892 m = off + nnp%ang(ind)%symfgrp(s)%symf(sf)
894 force_xyz(1, k_atom) = force_xyz(1, k_atom) - de*kk_buf(1, sf, k)
895 force_xyz(2, k_atom) = force_xyz(2, k_atom) - de*kk_buf(2, sf, k)
896 force_xyz(3, k_atom) = force_xyz(3, k_atom) - de*kk_buf(3, sf, k)
901 k_atom = neighbor%ang2(s)%ind(k)
903 m = off + nnp%ang(ind)%symfgrp(s)%symf(sf)
905 force_xyz(1, k_atom) = force_xyz(1, k_atom) - de*kk_buf(1, sf, k)
906 force_xyz(2, k_atom) = force_xyz(2, k_atom) - de*kk_buf(2, sf, k)
907 force_xyz(3, k_atom) = force_xyz(3, k_atom) - de*kk_buf(3, sf, k)
Define the atomic kind types and their sub types.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell)
returns information about various attributes of the given subsys
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Functionality for atom centered symmetry functions for neural network potentials.
subroutine, public nnp_calc_acsf(nnp, i, calc_forces, arc, stress)
Calculate atom centered symmetry functions for given atom i.
subroutine, public nnp_prepare_neighbor_cache(nnp)
Prepare or update the linked-cell / Verlet cache for the current geometry. Lazily allocates nnpcell_l...
Data types for neural network potentials.
subroutine, public nnp_env_get(nnp_env, nnp_forces, subsys, atomic_kind_set, particle_set, local_particles, molecule_kind_set, molecule_set, local_molecules, nnp_input, force_env_input, cell, cell_ref, use_ref_cell, nnp_potential_energy, virial)
Returns various attributes of the nnp environment.
Methods dealing with Neural Network potentials.
subroutine, public nnp_scatter_dgdr_to_forces(nnp, ind, i, denergydsym, force_xyz)
Scatter the per-neighbour dG/dr arrays held in the nnp_neighbor_workspace into a per-atom Cartesian f...
subroutine, public nnp_calc_energy_force(nnp, calc_forces)
Calculate the energy and force for a given configuration with the NNP.
Methods dealing with core routines for artificial neural networks.
subroutine, public nnp_predict(arc, nnp, i_com)
Predict energy by evaluating neural network.
subroutine, public nnp_gradients(arc, nnp, i_com, denergydsym)
Calculate gradients of neural network.
Define the data structure for the particle information.
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Definition of physical constants:
real(kind=dp), parameter, public angstrom
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
structure to store local (to a processor) ordered lists of integers.
Data type for artificial neural networks.
Main data type collecting all relevant data for neural network potentials.