Documentation for module qs_cdft_scf_utils

Auxiliary routines for performing a constrained DFT SCF run with Quickstep.

source: qs_cdft_scf_utils.F
Loading...

public Subroutines/Functions:

Builds a strictly diagonal inverse Jacobian from MD/SCF history.
Creates a temporary logger for redirecting output to a new file
Checks if the inverse Jacobian should be calculated and initializes the calculation
Prepares the finite difference stencil for computing the Jacobian. The constraints are re-evaluated by perturbing each constraint.
Prints the finite difference inverse Jacobian to file
Restarts the finite difference inverse Jacobian.

SUBROUTINEbuild_diagonal_jacobian(qs_env, used_history)

Builds a strictly diagonal inverse Jacobian from MD/SCF history.

Arguments:
POINTER
:: qs_env the qs_environment_type where to compute the Jacobian
LOGICAL
:: used_history flag that determines if history was actually used to prepare the Jacobian

SUBROUTINEcreate_tmp_logger(para_env, project_name, suffix, output_unit, tmp_logger)

Creates a temporary logger for redirecting output to a new file

Arguments:
POINTER
:: para_env the para_env
CHARACTER(*)
:: project_name the project basename
CHARACTER(*)
:: suffix the suffix
INTEGER,
INTENT(out)
:: output_unit the default unit number for the newly created temporary logger
INTENT(out),
POINTER
:: tmp_logger pointer to the newly created temporary logger

SUBROUTINEinitialize_inverse_jacobian(scf_control, scf_env, explicit_jacobian, should_build, used_history)

Checks if the inverse Jacobian should be calculated and initializes the calculation

Arguments:
POINTER
:: scf_control the scf_control that holds the Jacobian settings
POINTER
:: scf_env the scf_env that holds the CDFT iteration information
LOGICAL
:: explicit_jacobian flag that determines if the finite difference Jacobian is needed
LOGICAL
:: should_build flag that determines if the Jacobian should be built
LOGICAL
:: used_history flag that determines if SCF history has been used to build a Jacobian

SUBROUTINEprepare_jacobian_stencil(qs_env, output_unit, nwork, pwork, coeff, step_multiplier, dh)

Prepares the finite difference stencil for computing the Jacobian. The constraints are re-evaluated by perturbing each constraint.

Arguments:
POINTER
:: qs_env the qs_env where to build the Jacobian
INTEGER
:: output_unit the output unit number
INTEGER
:: nwork the number of perturbations to take in the negative direction
INTEGER
:: pwork the number of perturbations to take in the positive direction
REAL(dp),
ALLOCATABLE
:: coeff(:) list of coefficients that determine how to sum up the various perturbations
REAL(dp),
ALLOCATABLE
:: step_multiplier(:) list of values that determine how large steps to take for each perturbatio
REAL(dp)
:: dh total length of the interval to use for computing the finite difference derivatives

SUBROUTINErestart_inverse_jacobian(qs_env)

Restarts the finite difference inverse Jacobian.

Arguments:
POINTER
:: qs_env the qs_environment_type where to compute the Jacobian