41#include "../base/base_uses.f90"
46 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
47 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cell_opt_types'
62 LOGICAL :: keep_angles = .false., &
63 keep_symmetry = .false.
64 REAL(kind=
dp) :: pres_ext = 0.0_dp, pres_int = 0.0_dp, pres_tol = 0.0_dp, pres_constr = 0.0_dp
65 REAL(kind=
dp),
DIMENSION(3, 3) :: mtrx = 0.0_dp
66 REAL(kind=
dp),
DIMENSION(3, 3) :: rot_matrix = 0.0_dp
86 CHARACTER(LEN=4) :: label
87 INTEGER :: ip, output_unit
88 REAL(kind=
dp),
DIMENSION(3) :: r
94 NULLIFY (cell_env%ref_cell, cell, subsys, particles)
97 CALL cell_clone(cell, cell_env%ref_cell, tag=
"REF_CELL_OPT")
104 cell_env%rot_matrix = matmul(cell_env%ref_cell%hmat, cell%h_inv)
112 DO ip = 1, particles%n_els
113 r = matmul(transpose(cell_env%rot_matrix), particles%els(ip)%r)
114 particles%els(ip)%r = r
121 IF (output_unit > 0)
THEN
122 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,F20.1)") &
123 "CELL_OPT| Pressure tolerance [bar]: ",
cp_unit_from_cp2k(cell_env%pres_tol,
"bar")
124 IF (cell_env%keep_angles)
THEN
125 WRITE (unit=output_unit, fmt=
"(T2,A,T78,A3)") &
126 "CELL_OPT| Keep angles between the cell vectors: ",
"YES"
128 WRITE (unit=output_unit, fmt=
"(T2,A,T78,A3)") &
129 "CELL_OPT| Keep angles between the cell vectors: ",
" NO"
131 IF (cell_env%keep_symmetry)
THEN
132 WRITE (unit=output_unit, fmt=
"(T2,A,T78,A3)") &
133 "CELL_OPT| Keep cell symmetry: ",
"YES"
135 WRITE (unit=output_unit, fmt=
"(T2,A,T78,A3)") &
136 "CELL_OPT| Keep cell symmetry: ",
" NO"
138 SELECT CASE (cell_env%constraint_id)
154 WRITE (unit=output_unit, fmt=
"(T2,A,T77,A4)") &
155 "CELL_OPT| Constraint: ", label
Handles all functions related to the CELL.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Contains type used for a Simulation Cell Optimization.
subroutine, public cell_opt_env_release(cell_env)
...
subroutine, public cell_opt_env_create(cell_env, force_env, geo_section)
...
contains a functional that calculates the energy and its derivatives for the geometry optimizer
subroutine, public read_external_press_tensor(geo_section, cell, pres_ext, mtrx, rot)
Reads the external pressure tensor.
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public cell_clone(cell_in, cell_out, tag)
Clone cell variable.
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,...
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)
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
Interface for the force calculations.
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env, ipi_env)
returns various attributes about the force environment
Defines the basic variable types.
integer, parameter, public dp
represent a simple array based list of the given type
Type containing all informations abour the simulation cell optimization.
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...
represents a system: atoms, molecules, their pos,vel,...
wrapper to abstract the force evaluation of the various methods
represent a list of objects