airsspy.fullrelax#
Self-consistent CASTEP relaxation driver.
Replicates the behaviour of castep_relax.pl, performing iterative
fixed-NPW geometry optimisations with restart capability and optional
alternating cell constraints.
Module Contents#
Classes#
Self-consistent CASTEP relaxation with restart and state tracking. |
Functions#
Check whether the last geometry optimisation completed. |
|
Parse a CASTEP .geom file and return trajectory data. |
|
Convert the last configuration in a .geom file to cell blocks. |
Data#
API#
- airsspy.fullrelax.logger#
‘getLogger(…)’
- class airsspy.fullrelax.FullRelax(exe: str, struct_name: str, maxit: int, initial_cycle: int = 4, initial_length: int = 4, alter_cell_cons: bool = False)[source]#
Self-consistent CASTEP relaxation with restart and state tracking.
Performs iterative fixed-NPW geometry optimisations. Initial cycles use a short iteration count, then full-length cycles until two consecutive successful runs confirm convergence.
Initialization
Initialise a FullRelax instance.
Args: exe: CASTEP executable name/path. struct_name: Name of the structure to relax (without extension). maxit: Maximum geometry iterations (0 for single-point). initial_cycle: Number of initial short cycles. initial_length: Number of iterations in initial short cycles. alter_cell_cons: Alternate cell constraints on/off between cycles.
- airsspy.fullrelax.check_relax_status(dot_castep: str) tuple[bool, int][source]#
Check whether the last geometry optimisation completed.
Args: dot_castep: Path to the .castep file.
Returns: Tuple of (relaxation_succeeded, total_iterations).
- airsspy.fullrelax.parse_geom_text_output(out_lines: list[str]) dict[str, numpy.ndarray][source]#
Parse a CASTEP .geom file and return trajectory data.
Args: out_lines: Lines from the .geom file.
Returns: Dictionary with keys
cells,positions,forces,geom_energy,symbols, and optionallyvelocities. All arrays are in CASTEP atomic units, converted to Angstrom/eV.