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
96 IF (helium%periodic) periodicity = 1
99 periodic=periodicity, tag=
"HELIUM NNP")
104 ALLOCATE (nnp%ele_ind(nnp%num_atoms))
105 ALLOCATE (nnp%nuc_atoms(nnp%num_atoms))
106 ALLOCATE (nnp%coord(3, nnp%num_atoms))
107 ALLOCATE (nnp%nnp_forces(3, nnp%num_atoms))
108 ALLOCATE (nnp%atoms(nnp%num_atoms))
109 ALLOCATE (nnp%sort(nnp%num_atoms - 1))
115 IF (nnp%ele(i) ==
'He')
THEN
121 DO j = 1, helium%solute_atoms
122 IF (nnp%ele(i) == helium%solute_element(j))
THEN
123 nnp%atoms(ig) = nnp%ele(i)
133 ALLOCATE (helium%nnp_sr_cut(nnp%n_ele))
134 helium%nnp_sr_cut = 0.0_dp
142 IF (trim(nnp%ele(ig)) == trim(elem))
THEN
148 IF (.NOT. found)
THEN
149 msg_str =
"SR_CUTOFF for element "//trim(elem)//
" defined but not found in NNP"
153 helium%nnp_sr_cut(:) = helium%nnp_sr_cut(:)**2
168 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
170 INTEGER,
INTENT(IN) :: ind_he
173 LOGICAL :: file_is_new
177 NULLIFY (logger, print_key)
183 middle_name=
"helium-nnp-energies", is_new_file=file_is_new)
184 IF (unit_nr > 0)
CALL helium_nnp_print_energies(nnp, unit_nr, file_is_new)
191 middle_name=
"helium-nnp-forces-std", is_new_file=file_is_new)
192 IF (unit_nr > 0)
CALL helium_nnp_print_force_sigma(nnp, unit_nr, file_is_new)
196 CALL logger%para_env%sum(nnp%output_expol)
197 IF (nnp%output_expol)
THEN
201 middle_name=
"-NNP-He-extrapolation")
202 IF (unit_nr > 0)
CALL helium_nnp_print_expol(nnp, unit_nr, ind_he)
217 SUBROUTINE helium_nnp_print_energies(nnp, unit_nr, file_is_new)
218 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
219 INTEGER,
INTENT(IN) :: unit_nr
220 LOGICAL,
INTENT(IN) :: file_is_new
222 CHARACTER(len=default_path_length) :: fmt_string
226 IF (file_is_new)
THEN
227 WRITE (unit_nr,
"(A1,1X,A20)", advance=
'no')
"#",
"NNP Average [a.u.],"
228 WRITE (unit_nr,
"(A20)", advance=
'no')
"NNP sigma [a.u.]"
229 DO i = 1, nnp%n_committee
230 WRITE (unit_nr,
"(A17,I3)", advance=
'no')
"NNP", i
232 WRITE (unit_nr,
"(A)")
""
235 fmt_string =
"(2X,2(F20.9))"
236 WRITE (fmt_string,
"(A,I3,A)")
"(2X", nnp%n_committee + 2,
"(F20.9))"
237 std = sum((sum(nnp%atomic_energy, 1) - nnp%nnp_potential_energy)**2)
238 std = std/real(nnp%n_committee,
dp)
240 WRITE (unit_nr, fmt_string) nnp%nnp_potential_energy, std, sum(nnp%atomic_energy, 1)
242 END SUBROUTINE helium_nnp_print_energies
252 SUBROUTINE helium_nnp_print_force_sigma(nnp, unit_nr, file_is_new)
253 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
254 INTEGER,
INTENT(IN) :: unit_nr
255 LOGICAL,
INTENT(IN) :: file_is_new
258 REAL(kind=
dp),
DIMENSION(3) :: var
260 IF (unit_nr > 0)
THEN
261 IF (file_is_new)
THEN
262 WRITE (unit_nr,
"(A,1X,A)")
"# NNP sigma of forces [a.u.] x, y, z coordinates"
266 DO i = 1, nnp%num_atoms
267 IF (nnp%ele(i) ==
'He')
THEN
269 DO j = 1, nnp%n_committee
270 var = var + (nnp%committee_forces(:, i, j) - nnp%nnp_forces(:, i))**2
272 WRITE (unit_nr,
"(A4,1X,3E20.10)") nnp%ele(i), var
278 END SUBROUTINE helium_nnp_print_force_sigma
288 SUBROUTINE helium_nnp_print_expol(nnp, unit_nr, ind_he)
289 TYPE(
nnp_type),
INTENT(INOUT) :: nnp
290 INTEGER,
INTENT(IN) :: unit_nr, ind_he
292 CHARACTER(len=default_path_length) :: fmt_string
294 REAL(kind=
dp) :: mass, unit_conv
295 REAL(kind=
dp),
DIMENSION(3) :: com
301 nnp%expol = nnp%expol + 1
302 WRITE (unit_nr, *) nnp%num_atoms
303 WRITE (unit_nr,
"(A,1X,I6)")
"HELIUM-NNP extrapolation point N =", nnp%expol
309 DO i = 1, nnp%num_atoms
310 IF (i == ind_he) cycle
312 com(:) = com(:) + nnp%coord(:, i)*unit_conv
313 mass = mass + unit_conv
317 DO i = 1, nnp%num_atoms
318 nnp%coord(:, i) = nnp%coord(:, i) - com(:)
319 nnp%coord(:, i) =
pbc(nnp%coord(:, i), cell)
323 fmt_string =
"(A4,1X,3F20.10)"
324 DO i = 1, nnp%num_atoms
325 WRITE (unit_nr, fmt_string) &
327 nnp%coord(1, i)*unit_conv, &
328 nnp%coord(2, i)*unit_conv, &
329 nnp%coord(3, i)*unit_conv
332 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...
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...
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)
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.