65 #include "./base/base_uses.f90"
71 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .true.
72 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'nnp_environment'
90 SUBROUTINE nnp_init(nnp_env, root_section, para_env, force_env_section, subsys_section, &
92 TYPE(nnp_type),
INTENT(INOUT),
POINTER :: nnp_env
93 TYPE(section_vals_type),
INTENT(IN),
POINTER :: root_section
94 TYPE(mp_para_env_type),
INTENT(IN),
POINTER :: para_env
95 TYPE(section_vals_type),
INTENT(INOUT),
POINTER :: force_env_section, subsys_section
96 LOGICAL,
INTENT(IN) :: use_motion_section
98 CHARACTER(len=*),
PARAMETER :: routinen =
'nnp_init'
101 LOGICAL :: explicit, use_ref_cell
102 REAL(kind=
dp),
DIMENSION(3) :: abc
103 TYPE(cell_type),
POINTER :: cell, cell_ref
104 TYPE(cp_subsys_type),
POINTER :: subsys
105 TYPE(section_vals_type),
POINTER :: cell_section, nnp_section
107 CALL timeset(routinen, handle)
113 cpassert(
ASSOCIATED(nnp_env))
115 NULLIFY (cell_section, nnp_section, cell, cell_ref, subsys)
117 IF (.NOT.
ASSOCIATED(subsys_section))
THEN
123 IF (.NOT. explicit)
THEN
124 cpwarn(
"NNP section not explicitly stated. Using default file names.")
127 CALL nnp_env_set(nnp_env=nnp_env, nnp_input=nnp_section, &
128 force_env_input=force_env_section)
130 CALL read_cell(cell=cell, cell_ref=cell_ref, use_ref_cell=use_ref_cell, cell_section=cell_section, &
133 CALL write_cell(cell=cell, subsys_section=subsys_section)
136 force_env_section=force_env_section, subsys_section=subsys_section, &
137 use_motion_section=use_motion_section)
139 CALL nnp_init_subsys(nnp_env=nnp_env, subsys=subsys, cell=cell, &
140 cell_ref=cell_ref, use_ref_cell=use_ref_cell, &
141 subsys_section=subsys_section)
146 CALL timestop(handle)
161 SUBROUTINE nnp_init_subsys(nnp_env, subsys, cell, cell_ref, use_ref_cell, subsys_section)
162 TYPE(nnp_type),
INTENT(INOUT),
POINTER :: nnp_env
163 TYPE(cp_subsys_type),
INTENT(IN),
POINTER :: subsys
164 TYPE(cell_type),
INTENT(INOUT),
POINTER :: cell, cell_ref
165 LOGICAL,
INTENT(IN) :: use_ref_cell
166 TYPE(section_vals_type),
INTENT(IN),
POINTER :: subsys_section
168 CHARACTER(len=*),
PARAMETER :: routinen =
'nnp_init_subsys'
170 INTEGER :: handle, natom
171 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
172 TYPE(distribution_1d_type),
POINTER :: local_molecules, local_particles
173 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
174 TYPE(molecule_type),
DIMENSION(:),
POINTER :: molecule_set
175 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
177 CALL timeset(routinen, handle)
179 NULLIFY (atomic_kind_set, molecule_kind_set, particle_set, molecule_set, &
180 local_molecules, local_particles)
182 particle_set => subsys%particles%els
183 atomic_kind_set => subsys%atomic_kinds%els
184 molecule_kind_set => subsys%molecule_kinds%els
185 molecule_set => subsys%molecules%els
193 subsys_section=subsys_section)
195 input_section=subsys_section)
199 particle_set=particle_set, &
200 local_particles=local_particles, &
201 molecule_kind_set=molecule_kind_set, &
202 molecule_set=molecule_set, &
203 local_molecules=local_molecules, &
204 force_env_section=nnp_env%force_env_input)
206 natom =
SIZE(particle_set)
208 ALLOCATE (nnp_env%nnp_forces(3, natom))
210 nnp_env%nnp_forces(:, :) = 0.0_dp
212 nnp_env%nnp_potential_energy = 0.0_dp
215 nnp_env%num_atoms = natom
216 ALLOCATE (nnp_env%ele_ind(natom))
217 ALLOCATE (nnp_env%nuc_atoms(natom))
218 ALLOCATE (nnp_env%coord(3, natom))
219 ALLOCATE (nnp_env%atoms(natom))
220 ALLOCATE (nnp_env%sort(natom))
221 ALLOCATE (nnp_env%sort_inv(natom))
226 cell_ref=cell_ref, use_ref_cell=use_ref_cell, &
227 local_molecules=local_molecules, &
228 local_particles=local_particles)
235 CALL timestop(handle)
237 END SUBROUTINE nnp_init_subsys
247 TYPE(nnp_type),
INTENT(INOUT),
POINTER :: nnp_env
248 CHARACTER(LEN=*),
INTENT(IN) :: printtag
250 CHARACTER(len=*),
PARAMETER :: routinen =
'nnp_init_model'
251 INTEGER,
PARAMETER :: def_str_len = 256, &
254 CHARACTER(len=1),
ALLOCATABLE,
DIMENSION(:) :: cactfnct
255 CHARACTER(len=2) :: ele
256 CHARACTER(len=def_str_len) :: dummy, line
257 CHARACTER(len=default_path_length) :: base_name, file_name
258 INTEGER :: handle, i, i_com, io, iweight, j, k, l, &
259 n_weight, nele, nuc_ele, symfnct_type, &
261 LOGICAL :: at_end, atom_e_found, explicit, first, &
263 REAL(kind=
dp) :: energy
264 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: weights
265 REAL(kind=
dp),
DIMENSION(7) :: test_array
266 REAL(kind=
dp),
DIMENSION(:),
POINTER :: work
267 TYPE(cp_logger_type),
POINTER :: logger
268 TYPE(cp_parser_type) :: parser
269 TYPE(section_vals_type),
POINTER :: bias_section, model_section
271 CALL timeset(routinen, handle)
277 IF (logger%para_env%is_source())
THEN
279 WRITE (unit_nr, *)
""
280 WRITE (unit_nr, *) trim(printtag)//
"| Neural Network Potential Force Environment"
285 ALLOCATE (nnp_env%atomic_energy(nnp_env%num_atoms, nnp_env%n_committee))
286 ALLOCATE (nnp_env%committee_energy(nnp_env%n_committee))
287 ALLOCATE (nnp_env%myforce(3, nnp_env%num_atoms, nnp_env%n_committee))
288 ALLOCATE (nnp_env%committee_forces(3, nnp_env%num_atoms, nnp_env%n_committee))
289 ALLOCATE (nnp_env%committee_stress(3, 3, nnp_env%n_committee))
292 CALL parser_create(parser, file_name, para_env=logger%para_env)
295 nnp_env%scale_acsf = .false.
296 nnp_env%scale_sigma_acsf = .false.
298 nnp_env%scmin = 0.0_dp
299 nnp_env%scmax = 1.0_dp
300 nnp_env%center_acsf = .false.
301 nnp_env%normnodes = .false.
304 IF (logger%para_env%is_source())
THEN
306 WRITE (unit_nr, *) trim(printtag)//
"| Reading NNP input from file: ", trim(file_name)
310 search_from_begin_of_file=.true.)
312 READ (line, *) dummy, nnp_env%n_ele
314 CALL cp_abort(__location__, trim(printtag)// &
315 "| number of elements missing in NNP_INPUT_FILE")
319 search_from_begin_of_file=.true.)
320 nnp_env%scale_sigma_acsf = found
323 search_from_begin_of_file=.true.)
324 nnp_env%scale_acsf = found
328 IF (found .AND. nnp_env%scale_sigma_acsf)
THEN
329 cpwarn(
'Two scaling keywords in the input, we will ignore sigma scaling in this case')
330 nnp_env%scale_sigma_acsf = .false.
331 ELSE IF (.NOT. found .AND. nnp_env%scale_sigma_acsf)
THEN
332 nnp_env%scale_acsf = .false.
336 search_from_begin_of_file=.true.)
337 IF (found)
READ (line, *) dummy, nnp_env%scmin
340 search_from_begin_of_file=.true.)
341 IF (found)
READ (line, *) dummy, nnp_env%scmax
344 search_from_begin_of_file=.true.)
345 nnp_env%center_acsf = found
347 IF (nnp_env%scale_sigma_acsf .AND. nnp_env%center_acsf)
THEN
348 nnp_env%scale_sigma_acsf = .false.
352 search_from_begin_of_file=.true.)
353 nnp_env%normnodes = found
356 search_from_begin_of_file=.true.)
358 READ (line, *) dummy, nnp_env%cut_type
360 CALL cp_abort(__location__, trim(printtag)// &
361 "| no cutoff type specified in NNP_INPUT_FILE")
365 search_from_begin_of_file=.true.)
367 READ (line, *) dummy, nnp_env%n_hlayer
369 CALL cp_abort(__location__, trim(printtag)// &
370 "| number of hidden layers missing in NNP_INPUT_FILE")
372 nnp_env%n_layer = nnp_env%n_hlayer + 2
375 ALLOCATE (nnp_env%rad(nele))
376 ALLOCATE (nnp_env%ang(nele))
377 ALLOCATE (nnp_env%n_rad(nele))
378 ALLOCATE (nnp_env%n_ang(nele))
379 ALLOCATE (nnp_env%actfnct(nnp_env%n_hlayer + 1))
380 ALLOCATE (cactfnct(nnp_env%n_hlayer + 1))
381 ALLOCATE (nnp_env%ele(nele))
382 ALLOCATE (nnp_env%nuc_ele(nele))
383 ALLOCATE (nnp_env%arc(nele))
385 ALLOCATE (nnp_env%arc(i)%layer(nnp_env%n_layer))
386 ALLOCATE (nnp_env%arc(i)%n_nodes(nnp_env%n_layer))
388 ALLOCATE (nnp_env%n_hnodes(nnp_env%n_hlayer))
389 ALLOCATE (nnp_env%atom_energies(nele))
390 nnp_env%atom_energies = 0.0_dp
398 IF (trim(adjustl(dummy)) ==
"elements")
THEN
399 READ (line, *) dummy, nnp_env%ele(:)
404 CALL cp_abort(__location__, trim(printtag)// &
405 "| elements not specified in NNP_INPUT_FILE")
410 search_from_begin_of_file=.true.)
412 IF (atom_e_found)
THEN
418 READ (line, *) dummy, ele, energy
420 IF (nnp_env%ele(j) == trim(ele))
THEN
422 nnp_env%atom_energies(j) = energy
427 CALL cp_abort(__location__, trim(printtag)// &
428 "| atom energies are not specified")
434 search_from_begin_of_file=.true.)
436 READ (line, *) dummy, nnp_env%n_hnodes(:)
438 CALL cp_abort(__location__, trim(printtag)// &
439 "NNP| global_nodes_short not specified in NNP_INPUT_FILE")
443 search_from_begin_of_file=.true.)
445 READ (line, *) dummy, cactfnct(:)
447 CALL cp_abort(__location__, trim(printtag)// &
448 "| global_activation_short not specified in NNP_INPUT_FILE")
451 DO i = 1, nnp_env%n_hlayer + 1
452 SELECT CASE (cactfnct(i))
472 CALL cp_abort(__location__, trim(printtag)// &
473 "| Activation function unkown")
489 READ (line, *) dummy, ele, symfnct_type
491 IF (trim(ele) .EQ. nnp_env%ele(i))
THEN
492 IF (symfnct_type .EQ. 2)
THEN
493 nnp_env%n_rad(i) = nnp_env%n_rad(i) + 1
494 ELSE IF (symfnct_type .EQ. 3)
THEN
495 nnp_env%n_ang(i) = nnp_env%n_ang(i) + 1
497 CALL cp_abort(__location__, trim(printtag)// &
498 "| Symmetry function type not supported")
504 IF (first)
CALL cp_abort(__location__, trim(printtag)// &
505 "| no symfunction_short specified in NNP_INPUT_FILE")
512 ALLOCATE (nnp_env%rad(i)%y(nnp_env%n_rad(i)))
513 ALLOCATE (nnp_env%rad(i)%funccut(nnp_env%n_rad(i)))
514 ALLOCATE (nnp_env%rad(i)%eta(nnp_env%n_rad(i)))
515 ALLOCATE (nnp_env%rad(i)%rs(nnp_env%n_rad(i)))
516 ALLOCATE (nnp_env%rad(i)%loc_min(nnp_env%n_rad(i)))
517 ALLOCATE (nnp_env%rad(i)%loc_max(nnp_env%n_rad(i)))
518 ALLOCATE (nnp_env%rad(i)%loc_av(nnp_env%n_rad(i)))
519 ALLOCATE (nnp_env%rad(i)%sigma(nnp_env%n_rad(i)))
520 ALLOCATE (nnp_env%rad(i)%ele(nnp_env%n_rad(i)))
521 ALLOCATE (nnp_env%rad(i)%nuc_ele(nnp_env%n_rad(i)))
522 nnp_env%rad(i)%funccut = 0.0_dp
523 nnp_env%rad(i)%eta = 0.0_dp
524 nnp_env%rad(i)%rs = 0.0_dp
525 nnp_env%rad(i)%ele =
'X'
526 nnp_env%rad(i)%nuc_ele = 0
528 ALLOCATE (nnp_env%ang(i)%y(nnp_env%n_ang(i)))
529 ALLOCATE (nnp_env%ang(i)%funccut(nnp_env%n_ang(i)))
530 ALLOCATE (nnp_env%ang(i)%eta(nnp_env%n_ang(i)))
531 ALLOCATE (nnp_env%ang(i)%zeta(nnp_env%n_ang(i)))
532 ALLOCATE (nnp_env%ang(i)%prefzeta(nnp_env%n_ang(i)))
533 ALLOCATE (nnp_env%ang(i)%lam(nnp_env%n_ang(i)))
534 ALLOCATE (nnp_env%ang(i)%loc_min(nnp_env%n_ang(i)))
535 ALLOCATE (nnp_env%ang(i)%loc_max(nnp_env%n_ang(i)))
536 ALLOCATE (nnp_env%ang(i)%loc_av(nnp_env%n_ang(i)))
537 ALLOCATE (nnp_env%ang(i)%sigma(nnp_env%n_ang(i)))
538 ALLOCATE (nnp_env%ang(i)%ele1(nnp_env%n_ang(i)))
539 ALLOCATE (nnp_env%ang(i)%ele2(nnp_env%n_ang(i)))
540 ALLOCATE (nnp_env%ang(i)%nuc_ele1(nnp_env%n_ang(i)))
541 ALLOCATE (nnp_env%ang(i)%nuc_ele2(nnp_env%n_ang(i)))
542 nnp_env%ang(i)%funccut = 0.0_dp
543 nnp_env%ang(i)%eta = 0.0_dp
544 nnp_env%ang(i)%zeta = 0.0_dp
545 nnp_env%ang(i)%prefzeta = 1.0_dp
546 nnp_env%ang(i)%lam = 0.0_dp
547 nnp_env%ang(i)%ele1 =
'X'
548 nnp_env%ang(i)%ele2 =
'X'
549 nnp_env%ang(i)%nuc_ele1 = 0
550 nnp_env%ang(i)%nuc_ele2 = 0
553 nnp_env%arc(i)%n_nodes(1) = nnp_env%n_rad(i) + nnp_env%n_ang(i)
554 nnp_env%arc(i)%n_nodes(2:nnp_env%n_layer - 1) = nnp_env%n_hnodes
555 nnp_env%arc(i)%n_nodes(nnp_env%n_layer) = 1
556 DO j = 1, nnp_env%n_layer
557 ALLOCATE (nnp_env%arc(i)%layer(j)%node(nnp_env%arc(i)%n_nodes(j)))
558 ALLOCATE (nnp_env%arc(i)%layer(j)%node_grad(nnp_env%arc(i)%n_nodes(j)))
559 ALLOCATE (nnp_env%arc(i)%layer(j)%tmp_der(nnp_env%arc(i)%n_nodes(1), nnp_env%arc(i)%n_nodes(j)))
570 nnp_env%max_cut = 0.0_dp
574 READ (line, *) dummy, ele, symfnct_type
576 IF (trim(ele) .EQ. nnp_env%ele(i))
THEN
577 IF (symfnct_type .EQ. 2)
THEN
578 nnp_env%n_rad(i) = nnp_env%n_rad(i) + 1
579 READ (line, *) dummy, ele, symfnct_type, &
580 nnp_env%rad(i)%ele(nnp_env%n_rad(i)), &
581 nnp_env%rad(i)%eta(nnp_env%n_rad(i)), &
582 nnp_env%rad(i)%rs(nnp_env%n_rad(i)), &
583 nnp_env%rad(i)%funccut(nnp_env%n_rad(i))
584 IF (nnp_env%max_cut < nnp_env%rad(i)%funccut(nnp_env%n_rad(i)))
THEN
585 nnp_env%max_cut = nnp_env%rad(i)%funccut(nnp_env%n_rad(i))
587 ELSE IF (symfnct_type .EQ. 3)
THEN
588 nnp_env%n_ang(i) = nnp_env%n_ang(i) + 1
589 READ (line, *) dummy, ele, symfnct_type, &
590 nnp_env%ang(i)%ele1(nnp_env%n_ang(i)), &
591 nnp_env%ang(i)%ele2(nnp_env%n_ang(i)), &
592 nnp_env%ang(i)%eta(nnp_env%n_ang(i)), &
593 nnp_env%ang(i)%lam(nnp_env%n_ang(i)), &
594 nnp_env%ang(i)%zeta(nnp_env%n_ang(i)), &
595 nnp_env%ang(i)%funccut(nnp_env%n_ang(i))
596 nnp_env%ang(i)%prefzeta(nnp_env%n_ang(i)) = &
597 2.0_dp**(1.0_dp - nnp_env%ang(i)%zeta(nnp_env%n_ang(i)))
598 IF (nnp_env%max_cut < nnp_env%ang(i)%funccut(nnp_env%n_ang(i)))
THEN
599 nnp_env%max_cut = nnp_env%ang(i)%funccut(nnp_env%n_ang(i))
602 CALL cp_abort(__location__, trim(printtag)// &
603 "| Symmetry function type not supported")
609 IF (first)
CALL cp_abort(__location__, trim(printtag)// &
610 "| no symfunction_short specified in NNP_INPUT_FILE")
617 DO j = 1, nnp_env%n_rad(i)
618 CALL get_ptable_info(nnp_env%rad(i)%ele(j), number=nnp_env%rad(i)%nuc_ele(j))
620 DO j = 1, nnp_env%n_ang(i)
621 CALL get_ptable_info(nnp_env%ang(i)%ele1(j), number=nnp_env%ang(i)%nuc_ele1(j))
622 CALL get_ptable_info(nnp_env%ang(i)%ele2(j), number=nnp_env%ang(i)%nuc_ele2(j))
624 IF (nnp_env%ang(i)%nuc_ele1(j) .GT. nnp_env%ang(i)%nuc_ele2(j))
THEN
625 ele = nnp_env%ang(i)%ele1(j)
626 nnp_env%ang(i)%ele1(j) = nnp_env%ang(i)%ele2(j)
627 nnp_env%ang(i)%ele2(j) = ele
628 nuc_ele = nnp_env%ang(i)%nuc_ele1(j)
629 nnp_env%ang(i)%nuc_ele1(j) = nnp_env%ang(i)%nuc_ele2(j)
630 nnp_env%ang(i)%nuc_ele2(j) = nuc_ele
643 IF (nnp_env%scale_acsf .OR. nnp_env%center_acsf .OR. nnp_env%scale_sigma_acsf)
THEN
644 IF (logger%para_env%is_source())
THEN
645 WRITE (unit_nr, *) trim(printtag)//
"| Reading scaling information from file: ", trim(file_name)
649 CALL parser_create(parser, file_name, para_env=logger%para_env)
655 READ (parser%input_line, *, iostat=io) test_array(1:k)
661 IF (k == 5 .AND. nnp_env%scale_sigma_acsf)
THEN
662 cpabort(
"Sigma scaling requested, but scaling.data does not contain sigma.")
666 DO i = 1, nnp_env%n_ele
667 DO j = 1, nnp_env%n_rad(i)
669 IF (nnp_env%scale_sigma_acsf)
THEN
670 READ (parser%input_line, *) dummy, dummy, &
671 nnp_env%rad(i)%loc_min(j), &
672 nnp_env%rad(i)%loc_max(j), &
673 nnp_env%rad(i)%loc_av(j), &
674 nnp_env%rad(i)%sigma(j)
676 READ (parser%input_line, *) dummy, dummy, &
677 nnp_env%rad(i)%loc_min(j), &
678 nnp_env%rad(i)%loc_max(j), &
679 nnp_env%rad(i)%loc_av(j)
682 DO j = 1, nnp_env%n_ang(i)
684 IF (nnp_env%scale_sigma_acsf)
THEN
685 READ (parser%input_line, *) dummy, dummy, &
686 nnp_env%ang(i)%loc_min(j), &
687 nnp_env%ang(i)%loc_max(j), &
688 nnp_env%ang(i)%loc_av(j), &
689 nnp_env%ang(i)%sigma(j)
691 READ (parser%input_line, *) dummy, dummy, &
692 nnp_env%ang(i)%loc_min(j), &
693 nnp_env%ang(i)%loc_max(j), &
694 nnp_env%ang(i)%loc_av(j)
704 DO i = 1, nnp_env%n_ele
705 DO j = 2, nnp_env%n_layer
706 ALLOCATE (nnp_env%arc(i)%layer(j)%weights(nnp_env%arc(i)%n_nodes(j - 1), &
707 nnp_env%arc(i)%n_nodes(j), nnp_env%n_committee))
708 ALLOCATE (nnp_env%arc(i)%layer(j)%bweights(nnp_env%arc(i)%n_nodes(j), nnp_env%n_committee))
711 DO i_com = 1, nnp_env%n_committee
713 IF (logger%para_env%is_source())
THEN
714 WRITE (unit_nr, *) trim(printtag)//
"| Initializing weights for model: ", i_com
716 DO i = 1, nnp_env%n_ele
717 WRITE (file_name,
'(A,I0.3,A)') trim(base_name)//
".", nnp_env%nuc_ele(i),
".data"
718 IF (logger%para_env%is_source())
THEN
719 WRITE (unit_nr, *) trim(printtag)//
"| Reading weights from file: ", trim(file_name)
721 CALL parser_create(parser, file_name, para_env=logger%para_env)
726 n_weight = n_weight + 1
729 ALLOCATE (weights(n_weight))
734 READ (parser%input_line, *) weights(j)
740 DO j = 2, nnp_env%n_layer
741 DO k = 1, nnp_env%arc(i)%n_nodes(j - 1)
742 DO l = 1, nnp_env%arc(i)%n_nodes(j)
743 iweight = iweight + 1
744 nnp_env%arc(i)%layer(j)%weights(k, l, i_com) = weights(iweight)
748 DO k = 1, nnp_env%arc(i)%n_nodes(j)
749 iweight = iweight + 1
750 nnp_env%arc(i)%layer(j)%bweights(k, i_com) = weights(iweight)
762 NULLIFY (bias_section)
766 IF (
ASSOCIATED(bias_section))
CALL section_vals_get(bias_section, explicit=explicit)
767 nnp_env%bias = .false.
769 IF (nnp_env%n_committee > 1)
THEN
770 IF (logger%para_env%is_source())
THEN
771 WRITE (unit_nr, *)
"NNP| Biasing of committee disagreement enabled"
773 nnp_env%bias = .true.
774 ALLOCATE (nnp_env%bias_forces(3, nnp_env%num_atoms))
775 ALLOCATE (nnp_env%bias_e_avrg(nnp_env%n_committee))
778 nnp_env%bias_e_avrg(:) = 0.0_dp
780 nnp_env%bias_align = explicit
784 IF (
SIZE(work) .NE. nnp_env%n_committee)
THEN
785 cpabort(
"ALIGN_NNP_ENERGIES size mismatch wrt committee size.")
787 nnp_env%bias_e_avrg(:) = work
788 IF (logger%para_env%is_source())
THEN
789 WRITE (unit_nr, *) trim(printtag)//
"| Biasing is aligned by shifting the energy prediction of the C-NNP members"
793 cpwarn(
"NNP committee size is 1, BIAS section is ignored.")
797 IF (logger%para_env%is_source())
THEN
798 WRITE (unit_nr, *) trim(printtag)//
"| NNP force environment initialized"
801 CALL timestop(handle)
Define the atomic kind types and their sub types.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public schran2020b
integer, save, public schran2020a
integer, save, public behler2011
integer, save, public behler2007
Handles all functions related to the CELL.
recursive subroutine, public read_cell(cell, cell_ref, use_ref_cell, cell_section, check_for_ref, para_env)
...
subroutine, public write_cell(cell, subsys_section, tag)
Write the cell parameters to the output unit.
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
subroutine, public parser_search_string(parser, string, ignore_case, found, line, begin_line, search_from_begin_of_file)
Search a string pattern in a file defined by its logical unit number "unit". A case sensitive search ...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_reset(parser)
Resets the parser: rewinding the unit and re-initializing all parser structures.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
Initialize a small environment for a particular calculation.
subroutine, public cp_subsys_create(subsys, para_env, root_section, force_env_section, subsys_section, use_motion_section, qmmm, qmmm_env, exclusions, elkind)
Creates allocates and fills subsys from given input.
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_set(subsys, atomic_kinds, particles, local_particles, molecules, molecule_kinds, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, results, cell)
sets various propreties of the subsys
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
subroutine, public distribution_1d_release(distribution_1d)
releases the given distribution_1d
Distribution methods for atoms, particles, or molecules.
subroutine, public distribute_molecules_1d(atomic_kind_set, particle_set, local_particles, molecule_kind_set, molecule_set, local_molecules, force_env_section, prev_molecule_kind_set, prev_local_molecules)
Distribute molecules and particles.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
subroutine, public write_molecule_kind_set(molecule_kind_set, subsys_section)
Write a moleculeatomic kind set data set to the output unit.
Define the data structure for the molecule information.
Functionality for atom centered symmetry functions for neural network potentials.
subroutine, public nnp_write_acsf(nnp, para_env, printtag)
Write symmetry function information.
subroutine, public nnp_init_acsf_groups(nnp)
Initialize symmetry function groups.
subroutine, public nnp_sort_acsf(nnp)
Sort symmetry functions according to different criteria.
subroutine, public nnp_sort_ele(ele, nuc_ele)
Sort element array according to atomic number.
Data types for neural network potentials.
integer, parameter, public nnp_actfnct_lin
subroutine, public nnp_env_set(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)
Sets various attributes of the nnp environment.
integer, parameter, public nnp_actfnct_cos
integer, parameter, public nnp_actfnct_invsig
integer, parameter, public nnp_actfnct_sig
integer, parameter, public nnp_actfnct_exp
integer, parameter, public nnp_actfnct_softplus
integer, parameter, public nnp_actfnct_quad
integer, parameter, public nnp_actfnct_gaus
integer, parameter, public nnp_actfnct_tanh
Methods dealing with Neural Network potentials.
subroutine, public nnp_init_model(nnp_env, printtag)
Initialize the Neural Network Potential.
subroutine, public nnp_init(nnp_env, root_section, para_env, force_env_section, subsys_section, use_motion_section)
Read and initialize all the information for neural network potentials.
Methods dealing with core routines for artificial neural networks.
subroutine, public nnp_write_arc(nnp, para_env, printtag)
Write neural network architecture information.
Define methods related to particle_type.
subroutine, public write_fist_particle_coordinates(particle_set, subsys_section, charges)
Write the atomic coordinates to the output unit.
subroutine, public write_structure_data(particle_set, cell, input_section)
Write structure data requested by a separate structure data input section to the output unit....
subroutine, public write_particle_distances(particle_set, cell, subsys_section)
Write the matrix of the particle distances to the output unit.
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.