airsspy.gulptools#

GULP calculation utilities.

Provides tools for monitoring GULP geometry optimisation progress, checking calculation health, and running GULP with automatic termination on divergence.

Module Contents#

Functions#

geom_opt_progress

Parse geometry optimisation info from a GULP output file.

check_gulp

Check if a GULP calculation is progressing well.

guarded_gulp

Run GULP with automatic termination on divergence.

Data#

API#

airsspy.gulptools.Ginfo#

‘namedtuple(…)’

airsspy.gulptools.GEOM_LINE_PATTERN#

‘compile(…)’

airsspy.gulptools.geom_opt_progress(gfile: Union[str, collections.abc.Iterable[str]]) list[airsspy.gulptools.Ginfo][source]#

Parse geometry optimisation info from a GULP output file.

Args: gfile: Path to the GULP output file, or an iterable of lines.

Returns: A list of Ginfo namedtuples (cycle, energy, gnorm, cpu).

airsspy.gulptools.check_gulp(gfile: Union[str, collections.abc.Iterable[str]]) bool[source]#

Check if a GULP calculation is progressing well.

Returns False if energy or Gnorm fields contain overflow markers (*), or if the Gnorm diverges beyond 10 and keeps increasing.

Args: gfile: Path to the GULP output file, or an iterable of lines.

Returns: True if the calculation appears healthy.

airsspy.gulptools.guarded_gulp(exe: str = 'gulp') bool[source]#

Run GULP with automatic termination on divergence.

Monitors GULP stdout in real time and terminates the process if the energy or Gnorm overflows.

Args: exe: Name or path of the GULP executable.

Returns: True if GULP completed successfully, False if terminated.