ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
relax_history.h File Reference

Shared formatting of per-step convergence history for the running log. More...

#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
Include dependency graph for relax_history.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string format_relax_history (const std::vector< double > &hist, const int per_line=5, const int max_full=100, const int keep=10)
 Format a per-step history for the running log.

Detailed Description

Shared formatting of per-step convergence history for the running log.

Both relaxation paths (Relax in relax_sync.cpp and IonCellOptimizer in relax_nsync.cpp) record the largest force / stress of each step and print a summary when relaxation finishes. This free function keeps that summary layout identical across the two paths.

Function Documentation

◆ format_relax_history()

std::string format_relax_history ( const std::vector< double > & hist,
const int per_line = 5,
const int max_full = 100,
const int keep = 10 )
inline

Format a per-step history for the running log.

Layout rules:

  • Up to max_full entries are printed in full, per_line values per line.
  • Beyond max_full, only the first and last keep entries are shown, with an omission marker in between, so very long runs stay readable.
Here is the caller graph for this function: