(git:f7b9015)
Loading...
Searching...
No Matches
cell_opt_utils.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Parse CELL_OPT constraints, build symmetry constraint rows, and
10!> compute the cell enthalpy gradient.
11!> \par History
12!> 03.2008 - Teodoro Laino [tlaino] - University of Zurich - Cell Optimization
13! **************************************************************************************************
15 USE cell_manifold_utils, ONLY: &
20 USE cell_types, ONLY: &
25 USE input_constants, ONLY: fix_none
28 USE kinds, ONLY: default_string_length,&
29 dp
30 USE mathconstants, ONLY: pi,&
31 sqrt3
34#include "../base/base_uses.f90"
35
36 IMPLICIT NONE
37 PRIVATE
38
39 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cell_opt_utils'
40
41 PUBLIC :: cell_opt_constraint_label, &
43 get_dg_dh, &
51
52CONTAINS
53
54! **************************************************************************************************
55!> \brief Reads the external pressure tensor
56!> \param geo_section ...
57!> \param cell ...
58!> \param pres_ext ...
59!> \param mtrx ...
60!> \param input_to_opt rotation from the input Cartesian frame to the optimization frame
61!> \author Teodoro Laino [tlaino] - University of Zurich - 03.2008
62! **************************************************************************************************
63 SUBROUTINE read_external_press_tensor(geo_section, cell, pres_ext, mtrx, input_to_opt)
64 TYPE(section_vals_type), POINTER :: geo_section
65 TYPE(cell_type), POINTER :: cell
66 REAL(kind=dp), INTENT(OUT) :: pres_ext
67 REAL(kind=dp), DIMENSION(3, 3), INTENT(OUT) :: mtrx
68 REAL(kind=dp), DIMENSION(3, 3), INTENT(IN) :: input_to_opt
69
70 REAL(kind=dp), PARAMETER :: eps_aniso_press = 1.0e-5_dp
71
72 INTEGER :: i, ind, j
73 LOGICAL :: check
74 REAL(kind=dp), DIMENSION(3, 3) :: pres_ext_tens
75 REAL(kind=dp), DIMENSION(:), POINTER :: pvals
76
77 NULLIFY (pvals)
78 mtrx = 0.0_dp
79 pres_ext_tens = 0.0_dp
80 pres_ext = 0.0_dp
81 CALL section_vals_val_get(geo_section, "EXTERNAL_PRESSURE", r_vals=pvals)
82 check = (SIZE(pvals) == 1) .OR. (SIZE(pvals) == 9)
83 IF (.NOT. check) THEN
84 cpabort("EXTERNAL_PRESSURE can have 1 or 9 components only!")
85 END IF
86
87 IF (SIZE(pvals) == 9) THEN
88 ind = 0
89 DO i = 1, 3
90 DO j = 1, 3
91 ind = ind + 1
92 pres_ext_tens(j, i) = pvals(ind)
93 END DO
94 END DO
95 ! Express the pressure tensor in the canonical optimization frame.
96 pres_ext_tens = matmul(input_to_opt, &
97 matmul(pres_ext_tens, transpose(input_to_opt)))
98 DO i = 1, 3
99 pres_ext = pres_ext + pres_ext_tens(i, i)
100 END DO
101 pres_ext = pres_ext/3.0_dp
102 DO i = 1, 3
103 pres_ext_tens(i, i) = pres_ext_tens(i, i) - pres_ext
104 END DO
105 ELSE
106 pres_ext = pvals(1)
107 END IF
108
109 IF (any(abs(pres_ext_tens) > eps_aniso_press)) THEN
110 mtrx = cell%deth*matmul(cell%h_inv, matmul(pres_ext_tens, transpose(cell%h_inv)))
111 END IF
112
113 END SUBROUTINE read_external_press_tensor
114
115! **************************************************************************************************
116!> \brief Parses the tokens of the CONSTRAINT keyword into a cell component mask
117!> \param constraint_tokens value tokens of the CONSTRAINT keyword (char_t list)
118!> \param cell simulation cell (only the periodicity is used)
119!> \param explicit whether the CONSTRAINT keyword was given explicitly
120!> \param mask union of the fixed cell components (comp_* and mask_* bits)
121! **************************************************************************************************
122 SUBROUTINE parse_cell_constraint(constraint_tokens, cell, explicit, mask)
123 CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: constraint_tokens
124 TYPE(cell_type), POINTER :: cell
125 LOGICAL, INTENT(IN) :: explicit
126 INTEGER, INTENT(OUT) :: mask
127
128 CHARACTER(LEN=default_string_length) :: reject_reason, token
129 INTEGER :: axis_index, nonperiodic_axis, overlap, &
130 required_mask, tok_index, tok_mask
131 LOGICAL :: accepted
132
133 ! The input tokenizer delivers a bare keyword as one blank token.
134 IF (SIZE(constraint_tokens) == 0 .OR. &
135 (SIZE(constraint_tokens) == 1 .AND. len_trim(constraint_tokens(1)) == 0)) THEN
136 CALL cp_abort(__location__, &
137 "CELL_OPT CONSTRAINT requires a value.")
138 END IF
139
140 mask = 0
141 DO tok_index = 1, SIZE(constraint_tokens)
142 token = adjustl(constraint_tokens(tok_index))
143 CALL uppercase(token)
144 IF (token == "NONE") THEN
145 ! NONE must be the first and only token: leftover tokens on the
146 ! line or an already-accumulated mask mean it is being combined.
147 IF (tok_index < SIZE(constraint_tokens) .OR. mask /= 0) THEN
148 CALL cp_abort(__location__, &
149 "CELL_OPT CONSTRAINT NONE cannot be combined "// &
150 "with other tokens.")
151 END IF
152 mask = 0
153 cycle
154 END IF
155 CALL parse_token(token, accepted, tok_mask, reject_reason)
156 IF (.NOT. accepted) THEN
157 CALL cp_abort(__location__, trim(reject_reason))
158 END IF
159 overlap = iand(tok_mask, mask)
160 IF (overlap == tok_mask) THEN
161 CALL cp_warn(__location__, &
162 "Redundant CELL_OPT CONSTRAINT token: "//trim(token)// &
163 " (already constrained: "// &
164 trim(adjustl(cell_opt_constraint_label(overlap)))//").")
165 ELSE IF (overlap /= 0) THEN
166 CALL cp_warn(__location__, &
167 "CELL_OPT CONSTRAINT token "//trim(token)//" partially overlaps: "// &
168 "already constrained "// &
169 trim(adjustl(cell_opt_constraint_label(overlap)))// &
170 ", newly fixed "// &
171 trim(adjustl(cell_opt_constraint_label(iand(not(mask), tok_mask))))//".")
172 END IF
173 mask = ior(mask, tok_mask)
174 END DO
175
176 ! For 2D periodicity the non-periodic cell direction must be constrained.
177 ! Complete the constraint automatically if the keyword was not given.
178 IF (count(cell%perd /= 0) == 2) THEN
179 nonperiodic_axis = 0
180 DO axis_index = 1, 3
181 IF (cell%perd(axis_index) == 0) nonperiodic_axis = axis_index
182 END DO
183 required_mask = 0
184 SELECT CASE (nonperiodic_axis)
185 CASE (1)
186 required_mask = mask_x
187 CASE (2)
188 required_mask = mask_y
189 CASE (3)
190 required_mask = mask_z
191 END SELECT
192 IF (.NOT. explicit .AND. mask == 0) THEN
193 mask = required_mask
194 CALL cp_warn(__location__, &
195 "2D CELL_OPT: constraining non-periodic cell direction.")
196 ELSE IF (iand(mask, required_mask) /= required_mask) THEN
197 CALL cp_abort(__location__, &
198 "2D CELL_OPT needs constrained non-periodic cell direction.")
199 END IF
200 END IF
201
202 END SUBROUTINE parse_cell_constraint
203
204! **************************************************************************************************
205!> \brief Returns the label of the cell constraint mask
206!> \param mask bit mask of fixed cell components (comp_*, mask_*)
207!> \return 4-character legacy label or space-separated component names
208! **************************************************************************************************
209 PURE FUNCTION cell_opt_constraint_label(mask) RESULT(label)
210 INTEGER, INTENT(IN) :: mask
211 CHARACTER(LEN=default_string_length) :: label
212
213 SELECT CASE (mask)
214 CASE (fix_none)
215 label = "NONE"
216 CASE (mask_x)
217 label = " X"
218 CASE (mask_y)
219 label = " Y"
220 CASE (mask_z)
221 label = " Z"
222 CASE (mask_xy)
223 label = " XY"
224 CASE (mask_xz)
225 label = " XZ"
226 CASE (mask_yz)
227 label = " YZ"
228 CASE DEFAULT
229 ! Composite constraint: spell out the fixed components
230 label = ""
231 IF (iand(mask, comp_ax) /= 0) label = trim(label)//" AX"
232 IF (iand(mask, comp_bx) /= 0) label = trim(label)//" BX"
233 IF (iand(mask, comp_by) /= 0) label = trim(label)//" BY"
234 IF (iand(mask, comp_cx) /= 0) label = trim(label)//" CX"
235 IF (iand(mask, comp_cy) /= 0) label = trim(label)//" CY"
236 IF (iand(mask, comp_cz) /= 0) label = trim(label)//" CZ"
237 IF (iand(mask, gfix_alpha) /= 0) label = trim(label)//" ALPHA"
238 IF (iand(mask, gfix_beta) /= 0) label = trim(label)//" BETA"
239 IF (iand(mask, gfix_gamma) /= 0) label = trim(label)//" GAMMA"
240 label = adjustl(label)
241 END SELECT
242
243 END FUNCTION cell_opt_constraint_label
244
245! **************************************************************************************************
246!> \brief Translate a crystal system into cell constraint rows.
247!> \param symmetry_id crystal system of the canonical cell
248!> \param mask comp_* bits for canonical entries fixed to zero by symmetry
249!> \param lin_w linear coupling normals, one normal per column
250!> \param n_lin_rows number of active columns in lin_w
251!> \param eq_pair index pairs [m, n] in 1..6 for geometric equalities, one pair per column
252!> \param n_eq_rows number of active columns in eq_pair
253!> \note Rhombohedral (a = b = c, alpha = beta = gamma) and monoclinic_gamma_ab
254!> (a = b with free gamma) produce curved geometric equalities. All other
255!> crystal systems produce constant linear rows with zero curvature.
256! **************************************************************************************************
257 SUBROUTINE symmetry_constraint_rows(symmetry_id, mask, lin_w, n_lin_rows, eq_pair, n_eq_rows)
258 INTEGER, INTENT(IN) :: symmetry_id
259 INTEGER, INTENT(OUT) :: mask
260 REAL(kind=dp), DIMENSION(n_slot, n_slot), &
261 INTENT(OUT) :: lin_w
262 INTEGER, INTENT(OUT) :: n_lin_rows
263 INTEGER, DIMENSION(2, n_geom), INTENT(OUT) :: eq_pair
264 INTEGER, INTENT(OUT) :: n_eq_rows
265
266 REAL(kind=dp), PARAMETER :: half_sqrt3 = 0.5_dp*sqrt3
267
268 mask = 0
269 lin_w = 0.0_dp
270 n_lin_rows = 0
271 eq_pair = 0
272 n_eq_rows = 0
273
274 SELECT CASE (symmetry_id)
276 mask = comp_bx + comp_cx + comp_cy
278 mask = comp_bx + comp_cx + comp_cy
279 n_lin_rows = 1
280 lin_w(slot_ax, 1) = 1.0_dp
281 lin_w(slot_by, 1) = -1.0_dp
283 mask = comp_bx + comp_cx + comp_cy
284 n_lin_rows = 1
285 lin_w(slot_ax, 1) = 1.0_dp
286 lin_w(slot_cz, 1) = -1.0_dp
288 mask = comp_bx + comp_cx + comp_cy
289 n_lin_rows = 1
290 lin_w(slot_by, 1) = 1.0_dp
291 lin_w(slot_cz, 1) = -1.0_dp
292 CASE (cell_sym_cubic)
293 mask = comp_bx + comp_cx + comp_cy
294 n_lin_rows = 2
295 lin_w(slot_ax, 1) = 1.0_dp
296 lin_w(slot_by, 1) = -1.0_dp
297 lin_w(slot_by, 2) = 1.0_dp
298 lin_w(slot_cz, 2) = -1.0_dp
300 mask = comp_cx + comp_cy
301 n_lin_rows = 2
302 lin_w(slot_ax, 1) = -0.5_dp
303 lin_w(slot_bx, 1) = 1.0_dp
304 lin_w(slot_ax, 2) = -half_sqrt3
305 lin_w(slot_by, 2) = 1.0_dp
307 mask = comp_cx + comp_cy
308 n_lin_rows = 2
309 lin_w(slot_ax, 1) = 0.5_dp
310 lin_w(slot_bx, 1) = 1.0_dp
311 lin_w(slot_ax, 2) = -half_sqrt3
312 lin_w(slot_by, 2) = 1.0_dp
314 n_eq_rows = 4
315 eq_pair(:, 1) = [geom_a, geom_b]
316 eq_pair(:, 2) = [geom_b, geom_c]
317 eq_pair(:, 3) = [geom_alpha, geom_beta]
318 eq_pair(:, 4) = [geom_beta, geom_gamma]
320 mask = comp_bx + comp_cy
322 mask = comp_cx + comp_cy
323 n_eq_rows = 1
324 eq_pair(:, 1) = [geom_a, geom_b]
326 CONTINUE
327 CASE DEFAULT
328 cpabort("Unknown cell symmetry_id")
329 END SELECT
330
331 END SUBROUTINE symmetry_constraint_rows
332
333! **************************************************************************************************
334!> \brief Identify the canonical crystal system preserved by a space group's point group.
335!> \param spgr space group with integer lattice rotations in rotations_subset
336!> \param cell symmetric start cell in the canonical frame
337!> \return symmetry_id of the invariant metric form, or cell_sym_triclinic when
338!> the setting adds no canonical cell constraints
339!> \note Averaging the metric G = hmat^T hmat over the point group produces the
340!> invariant metric form {G : R G R^T = G for all R}. Classifying the lengths
341!> and angles of this averaged metric maps the point group to the row sets of
342!> symmetry_constraint_rows. Non-canonical settings (such as a monoclinic
343!> unique axis along a or c) return cell_sym_triclinic and add zero cell rows.
344! **************************************************************************************************
345 FUNCTION spgr_point_group_symmetry_id(spgr, cell) RESULT(symmetry_id)
346 TYPE(spgr_type), INTENT(IN), POINTER :: spgr
347 TYPE(cell_type), POINTER :: cell
348 INTEGER :: symmetry_id
349
350 REAL(kind=dp), PARAMETER :: ang_120 = 2.0_dp*pi/3.0_dp, ang_60 = pi/3.0_dp, &
351 ang_90 = 0.5_dp*pi, eq_angle_tol = 1.0e-6_dp, rel_len_tol = 1.0e-6_dp, &
352 special_ang_tol = 1.0e-5_dp
353
354 INTEGER :: ir, n90, nop
355 REAL(kind=dp) :: ang(3), gsym(3, 3), len_tol, lens(3), &
356 metric(3, 3), rot(3, 3)
357
358 symmetry_id = cell_sym_triclinic
359 nop = spgr%n_operations_subset
360 IF (nop == 0) RETURN
361
362 metric = matmul(transpose(cell%hmat), cell%hmat)
363 gsym = 0.0_dp
364 DO ir = 1, nop
365 ! rotations_subset stores R_frac^T (r_out = rot^T r_in in spgr_apply_rotations_coord),
366 ! so R_frac^T G R_frac takes the form rot * metric * rot^T.
367 rot = real(spgr%rotations_subset(:, :, ir), dp)
368 gsym = gsym + matmul(rot, matmul(metric, transpose(rot)))
369 END DO
370 gsym = gsym/real(nop, dp)
371
372 lens = [sqrt(gsym(1, 1)), sqrt(gsym(2, 2)), sqrt(gsym(3, 3))]
373 IF (minval(lens) < min_cell_length) RETURN
374 len_tol = rel_len_tol*maxval(lens)
375 ang(1) = acos(max(-1.0_dp, min(1.0_dp, gsym(2, 3)/(lens(2)*lens(3)))))
376 ang(2) = acos(max(-1.0_dp, min(1.0_dp, gsym(1, 3)/(lens(1)*lens(3)))))
377 ang(3) = acos(max(-1.0_dp, min(1.0_dp, gsym(1, 2)/(lens(1)*lens(2)))))
378 n90 = count(abs(ang - ang_90) < special_ang_tol)
379
380 IF (n90 == 3) THEN
381 IF (abs(lens(1) - lens(2)) < len_tol .AND. abs(lens(2) - lens(3)) < len_tol) THEN
382 symmetry_id = cell_sym_cubic
383 ELSE IF (abs(lens(1) - lens(2)) < len_tol) THEN
384 symmetry_id = cell_sym_tetragonal_ab
385 ELSE IF (abs(lens(1) - lens(3)) < len_tol) THEN
386 symmetry_id = cell_sym_tetragonal_ac
387 ELSE IF (abs(lens(2) - lens(3)) < len_tol) THEN
388 symmetry_id = cell_sym_tetragonal_bc
389 ELSE
390 symmetry_id = cell_sym_orthorhombic
391 END IF
392 ELSE IF (n90 == 2) THEN
393 IF (abs(ang(2) - ang_90) >= special_ang_tol) THEN
394 ! CP2K monoclinic convention places the unique axis along b (beta /= 90 deg).
395 symmetry_id = cell_sym_monoclinic
396 ELSE IF (abs(ang(3) - ang_90) >= special_ang_tol .AND. &
397 abs(lens(1) - lens(2)) < len_tol) THEN
398 IF (abs(ang(3) - ang_120) < special_ang_tol) THEN
399 symmetry_id = cell_sym_hexagonal_gamma_120
400 ELSE IF (abs(ang(3) - ang_60) < special_ang_tol) THEN
401 symmetry_id = cell_sym_hexagonal_gamma_60
402 ELSE
403 symmetry_id = cell_sym_monoclinic_gamma_ab
404 END IF
405 END IF
406 ELSE
407 IF (abs(ang(1) - ang(2)) < eq_angle_tol .AND. abs(ang(2) - ang(3)) < eq_angle_tol .AND. &
408 abs(ang(1) - ang_90) >= special_ang_tol .AND. &
409 abs(lens(1) - lens(2)) < len_tol .AND. abs(lens(2) - lens(3)) < len_tol) THEN
410 symmetry_id = cell_sym_rhombohedral
411 END IF
412 END IF
413
415
416! **************************************************************************************************
417!> \brief Classify one CONSTRAINT token without aborting (decision half of the parser)
418!> \param token one upper-case token of the CONSTRAINT value line
419!> \param accepted .TRUE. when the token contributes a mask
420!> \param token_mask the constraint mask contributed by an accepted token
421!> \param reject_reason empty for accepted tokens, or the abort message otherwise
422!> \note parse_cell_constraint applies this classification and turns a rejection
423!> into a cp_abort. Keeping the decision here keeps it unit-testable:
424!> the unit test checks the classification table without triggering aborts.
425! **************************************************************************************************
426 PURE SUBROUTINE parse_token(token, accepted, token_mask, reject_reason)
427 CHARACTER(LEN=*), INTENT(IN) :: token
428 LOGICAL, INTENT(OUT) :: accepted
429 INTEGER, INTENT(OUT) :: token_mask
430 CHARACTER(LEN=default_string_length), INTENT(OUT) :: reject_reason
431
432 accepted = .true.
433 token_mask = 0
434 reject_reason = ""
435 SELECT CASE (token)
436 CASE ("A", "AX")
437 token_mask = mask_a
438 CASE ("B")
439 token_mask = mask_b
440 CASE ("BX")
441 token_mask = comp_bx
442 CASE ("BY")
443 token_mask = comp_by
444 CASE ("C", "Z")
445 token_mask = mask_c
446 CASE ("CX")
447 token_mask = comp_cx
448 CASE ("CY")
449 token_mask = comp_cy
450 CASE ("CZ")
451 token_mask = comp_cz
452 CASE ("X")
453 token_mask = mask_x
454 CASE ("Y")
455 token_mask = mask_y
456 CASE ("XY")
457 token_mask = mask_xy
458 CASE ("XZ")
459 token_mask = mask_xz
460 CASE ("YZ")
461 token_mask = mask_yz
462 CASE ("ALPHA")
463 token_mask = gfix_alpha
464 CASE ("BETA")
465 token_mask = gfix_beta
466 CASE ("GAMMA")
467 token_mask = gfix_gamma
468 CASE ("AY", "AZ", "BZ")
469 accepted = .false.
470 reject_reason = "CELL_OPT CONSTRAINT token "//trim(token)//" is always zero in "// &
471 "the cell convention (a lies along x, b lies in the xy plane) "// &
472 "and cannot be constrained."
473 CASE DEFAULT
474 accepted = .false.
475 reject_reason = "Unknown CELL_OPT CONSTRAINT token: "//trim(token)// &
476 ". Accepted tokens: NONE, the directions X, Y, Z,"// &
477 " XY, XZ, YZ, the vectors A, B, C, the components"// &
478 " AX, BX, BY, CX, CY, CZ, and the angles ALPHA, BETA, GAMMA."
479 END SELECT
480 END SUBROUTINE parse_token
481
482! **************************************************************************************************
483!> \brief Computes the derivatives for the cell
484!> \param gradient enthalpy gradient +d(E + pres_ext*V)/dq in the six canonical components
485!> \param av_ptens ...
486!> \param pres_ext ...
487!> \param cell ...
488!> \param mtrx ...
489!> \param pres_int ...
490!> \author Teodoro Laino [tlaino] - University of Zurich - 03.2008
491! **************************************************************************************************
492 SUBROUTINE get_dg_dh(gradient, av_ptens, pres_ext, cell, mtrx, pres_int)
493
494 REAL(kind=dp), DIMENSION(n_slot), INTENT(OUT) :: gradient
495 REAL(kind=dp), DIMENSION(3, 3), INTENT(IN) :: av_ptens
496 REAL(kind=dp), INTENT(IN) :: pres_ext
497 TYPE(cell_type), POINTER :: cell
498 REAL(kind=dp), DIMENSION(3, 3), INTENT(IN) :: mtrx
499 REAL(kind=dp), INTENT(OUT) :: pres_int
500
501 INTEGER :: i
502 REAL(kind=dp), DIMENSION(3, 3) :: correction, pten_hinv_old, ptens
503
504 gradient = 0.0_dp
505
506 ptens = av_ptens
507
508 ! Evaluating the internal pressure
509 pres_int = 0.0_dp
510 DO i = 1, 3
511 pres_int = pres_int + ptens(i, i)
512 END DO
513 pres_int = pres_int/3.0_dp
514
515 ptens(1, 1) = av_ptens(1, 1) - pres_ext
516 ptens(2, 2) = av_ptens(2, 2) - pres_ext
517 ptens(3, 3) = av_ptens(3, 3) - pres_ext
518
519 pten_hinv_old = cell%deth*matmul(cell%h_inv, ptens)
520 correction = matmul(mtrx, cell%hmat)
521
522 gradient(slot_ax) = pten_hinv_old(1, 1) - correction(1, 1)
523 gradient(slot_bx) = pten_hinv_old(2, 1) - correction(2, 1)
524 gradient(slot_by) = pten_hinv_old(2, 2) - correction(2, 2)
525 gradient(slot_cx) = pten_hinv_old(3, 1) - correction(3, 1)
526 gradient(slot_cy) = pten_hinv_old(3, 2) - correction(3, 2)
527 gradient(slot_cz) = pten_hinv_old(3, 3) - correction(3, 3)
528
529 gradient = -gradient
530
531 END SUBROUTINE get_dg_dh
532
533END MODULE cell_opt_utils
Reduced-coordinate parameterization of cell constraints for CELL_OPT.
integer, parameter, public comp_ax
integer, parameter, public comp_cx
integer, parameter, public geom_gamma
integer, parameter, public geom_beta
integer, parameter, public gfix_gamma
integer, parameter, public slot_cx
integer, parameter, public mask_a
integer, parameter, public slot_by
integer, parameter, public n_geom
integer, parameter, public n_slot
integer, parameter, public mask_yz
real(kind=dp), parameter, public min_cell_length
integer, parameter, public slot_ax
integer, parameter, public comp_by
integer, parameter, public mask_y
integer, parameter, public geom_a
integer, parameter, public mask_x
integer, parameter, public slot_cz
integer, parameter, public gfix_beta
integer, parameter, public mask_xy
integer, parameter, public mask_c
integer, parameter, public slot_bx
integer, parameter, public mask_b
integer, parameter, public mask_all
integer, parameter, public mask_xz
integer, parameter, public comp_cz
integer, parameter, public comp_bx
integer, parameter, public slot_cy
integer, parameter, public comp_cy
integer, parameter, public mask_z
integer, parameter, public geom_c
integer, parameter, public geom_alpha
integer, parameter, public gfix_alpha
integer, parameter, public geom_b
Parse CELL_OPT constraints, build symmetry constraint rows, and compute the cell enthalpy gradient.
subroutine, public parse_cell_constraint(constraint_tokens, cell, explicit, mask)
Parses the tokens of the CONSTRAINT keyword into a cell component mask.
subroutine, public read_external_press_tensor(geo_section, cell, pres_ext, mtrx, input_to_opt)
Reads the external pressure tensor.
subroutine, public symmetry_constraint_rows(symmetry_id, mask, lin_w, n_lin_rows, eq_pair, n_eq_rows)
Translate a crystal system into cell constraint rows.
integer function, public spgr_point_group_symmetry_id(spgr, cell)
Identify the canonical crystal system preserved by a space group's point group.
pure subroutine, public parse_token(token, accepted, token_mask, reject_reason)
Classify one CONSTRAINT token without aborting (decision half of the parser).
subroutine, public get_dg_dh(gradient, av_ptens, pres_ext, cell, mtrx, pres_int)
Computes the derivatives for the cell.
pure character(len=default_string_length) function, public cell_opt_constraint_label(mask)
Returns the label of the cell constraint mask.
Handles all functions related to the CELL.
Definition cell_types.F:15
integer, parameter, public cell_sym_monoclinic
Definition cell_types.F:29
integer, parameter, public cell_sym_triclinic
Definition cell_types.F:29
integer, parameter, public cell_sym_tetragonal_ab
Definition cell_types.F:29
integer, parameter, public cell_sym_rhombohedral
Definition cell_types.F:29
integer, parameter, public cell_sym_tetragonal_ac
Definition cell_types.F:29
integer, parameter, public cell_sym_hexagonal_gamma_60
Definition cell_types.F:29
integer, parameter, public cell_sym_orthorhombic
Definition cell_types.F:29
integer, parameter, public cell_sym_none
Definition cell_types.F:29
integer, parameter, public cell_sym_hexagonal_gamma_120
Definition cell_types.F:29
integer, parameter, public cell_sym_monoclinic_gamma_ab
Definition cell_types.F:29
integer, parameter, public cell_sym_cubic
Definition cell_types.F:29
integer, parameter, public cell_sym_tetragonal_bc
Definition cell_types.F:29
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public fix_none
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), parameter, public sqrt3
Space Group Symmetry Type Module (version 1.0, Ferbruary 12, 2021).
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60