45#include "../base/base_uses.f90"
51 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .true.
52 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'helium_nnp'
72 CHARACTER(len=default_path_length) :: msg_str
73 CHARACTER(len=default_string_length) :: elem
74 INTEGER :: i, ig, is, j
75 INTEGER,
DIMENSION(3) :: periodicity
91 nnp%num_atoms = helium%solute_atoms + 1
98 IF (helium%periodic) periodicity = 1
101 periodic=periodicity, tag=
"HELIUM NNP")
106 ALLOCATE (nnp%ele_ind(nnp%num_atoms))
107 ALLOCATE (nnp%nuc_atoms(nnp%num_atoms))
108 ALLOCATE (nnp%coord(3, nnp%num_atoms))
109 ALLOCATE (nnp%nnp_forces(3, nnp%num_atoms))
110 ALLOCATE (nnp%atoms(nnp%num_atoms))
111 ALLOCATE (nnp%sort(nnp%num_atoms - 1))
117 IF (nnp%ele(i) ==
'He')
THEN
123 DO j = 1, helium%solute_atoms
124 IF (nnp%ele(i) == helium%solute_element(j))
THEN
125 nnp%atoms(ig) = nnp%ele(i)
135 ALLOCATE (helium%nnp_sr_cut(nnp%n_ele))
136 helium%nnp_sr_cut = 0.0_dp
144 IF (trim(nnp%ele(ig)) == trim(elem))
THEN
150 IF (.NOT. found)
THEN
151 msg_str =
"SR_CUTOFF for element "//trim(elem)//
" defined but not found in NNP"
155 helium%nnp_sr_cut(:) = helium%nnp_sr_cut(:)**2
170 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
172 INTEGER,
INTENT(IN) :: ind_he
175 LOGICAL :: file_is_new
179 NULLIFY (logger, print_key)
185 middle_name=
"helium-nnp-energies", is_new_file=file_is_new)
186 IF (unit_nr > 0)
CALL helium_nnp_print_energies(nnp, unit_nr, file_is_new)
193 middle_name=
"helium-nnp-forces-std", is_new_file=file_is_new)
194 IF (unit_nr > 0)
CALL helium_nnp_print_force_sigma(nnp, unit_nr, file_is_new)
198 CALL logger%para_env%sum(nnp%output_expol)
199 IF (nnp%output_expol)
THEN
203 middle_name=
"-NNP-He-extrapolation")
204 IF (unit_nr > 0)
CALL helium_nnp_print_expol(nnp, unit_nr, ind_he)
219 SUBROUTINE helium_nnp_print_energies(nnp, unit_nr, file_is_new)
220 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
221 INTEGER,
INTENT(IN) :: unit_nr
222 LOGICAL,
INTENT(IN) :: file_is_new
224 CHARACTER(len=default_path_length) :: fmt_string
228 IF (file_is_new)
THEN
229 WRITE (unit_nr,
"(A1,1X,A20)", advance=
'no')
"#",
"NNP Average [a.u.],"
230 WRITE (unit_nr,
"(A20)", advance=
'no')
"NNP sigma [a.u.]"
231 DO i = 1, nnp%n_committee
232 WRITE (unit_nr,
"(A17,I3)", advance=
'no')
"NNP", i
234 WRITE (unit_nr,
"(A)")
""
237 fmt_string =
"(2X,2(F20.9))"
238 WRITE (fmt_string,
"(A,I3,A)")
"(2X", nnp%n_committee + 2,
"(F20.9))"
239 std = sum((sum(nnp%atomic_energy, 1) - nnp%nnp_potential_energy)**2)
240 std = std/real(nnp%n_committee,
dp)
242 WRITE (unit_nr, fmt_string) nnp%nnp_potential_energy, std, sum(nnp%atomic_energy, 1)
244 END SUBROUTINE helium_nnp_print_energies
254 SUBROUTINE helium_nnp_print_force_sigma(nnp, unit_nr, file_is_new)
255 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
256 INTEGER,
INTENT(IN) :: unit_nr
257 LOGICAL,
INTENT(IN) :: file_is_new
260 REAL(kind=
dp),
DIMENSION(3) :: var
262 IF (unit_nr > 0)
THEN
263 IF (file_is_new)
THEN
264 WRITE (unit_nr,
"(A,1X,A)")
"# NNP sigma of forces [a.u.] x, y, z coordinates"
268 DO i = 1, nnp%num_atoms
269 IF (nnp%ele(i) ==
'He')
THEN
271 DO j = 1, nnp%n_committee
272 var = var + (nnp%committee_forces(:, i, j) - nnp%nnp_forces(:, i))**2
274 WRITE (unit_nr,
"(A4,1X,3E20.10)") nnp%ele(i), var
280 END SUBROUTINE helium_nnp_print_force_sigma
290 SUBROUTINE helium_nnp_print_expol(nnp, unit_nr, ind_he)
291 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
292 INTEGER,
INTENT(IN) :: unit_nr, ind_he
294 CHARACTER(len=default_path_length) :: fmt_string
296 REAL(kind=
dp) :: mass, unit_conv
297 REAL(kind=
dp),
DIMENSION(3) :: com
303 nnp%expol = nnp%expol + 1
304 WRITE (unit_nr, *) nnp%num_atoms
305 WRITE (unit_nr,
"(A,1X,I6)")
"HELIUM-NNP extrapolation point N =", nnp%expol
311 DO i = 1, nnp%num_atoms
312 IF (i == ind_he) cycle
314 com(:) = com(:) + nnp%coord(:, i)*unit_conv
315 mass = mass + unit_conv
319 DO i = 1, nnp%num_atoms
320 nnp%coord(:, i) = nnp%coord(:, i) - com(:)
321 nnp%coord(:, i) =
pbc(nnp%coord(:, i), cell)
325 fmt_string =
"(A4,1X,3F20.10)"
326 DO i = 1, nnp%num_atoms
327 WRITE (unit_nr, fmt_string) &
329 nnp%coord(1, i)*unit_conv, &
330 nnp%coord(2, i)*unit_conv, &
331 nnp%coord(3, i)*unit_conv
334 END SUBROUTINE helium_nnp_print_expol
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.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
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...
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...
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, file_access)
...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Methods dealing with Neural Network interaction potential.
subroutine, public helium_nnp_print(nnp, print_section, ind_he)
Print properties according to the requests in input file.
subroutine, public helium_init_nnp(helium, nnp, input)
Read and initialize all the information for neural network potentials.
Data types representing superfluid helium.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Data types for neural network potentials.
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.
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_init_model(nnp_env, printtag, gpu_capable)
Initialize the Neural Network Potential.
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
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
data structure for solvent helium
Main data type collecting all relevant data for neural network potentials.