MADNESS 0.10.1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
madness::RestartMetadata Struct Reference

#include <Restart.h>

Collaboration diagram for madness::RestartMetadata:
Collaboration graph
[legend]

Public Member Functions

bool is_converged_to (const double thresh, const double dconv) const
 true if these orbitals are at least as converged as the request
 
std::string print_to_string () const
 
template<typename Archive >
void read (Archive &ar)
 
bool representation_matches (const Representation wanted) const
 
template<typename Archive >
void write (Archive &ar) const
 write the header at the current archive position, always at CURRENT_VERSION
 

Public Attributes

double converged_for_dconv = 1.e10
 
double converged_for_thresh = 1.e10
 
double current_energy = 1.e10
 
double eprec = 0.0
 
int k = 0
 
double L = 0.0
 
std::string localize
 
std::string madness_version
 MADNESS version that wrote the archive, for provenance in bug reports.
 
Molecule molecule
 
std::string ncf
 
Representation representation = Representation::unknown
 what the stored functions are; see Representation
 
bool spin_restricted = true
 
unsigned int version = CURRENT_VERSION
 version of the archive this was read from, or CURRENT_VERSION for a fresh one
 
std::string xc
 

Static Public Attributes

static constexpr unsigned int CURRENT_VERSION = 5
 

Detailed Description

the header of a <prefix>.restartdata archive

This is the single definition of that header. Before it existed the layout was open-coded in four places – SCF::save_mos, SCF::load_mos, MolecularOrbitals::{save,read}_restartdata, and two response tools – which had to be kept in field order by hand.

The orbitals follow the header in the archive, one block per spin (see MolecularOrbitals::{save,load}_mos). Everything needed to decide whether an archive is usable lives in the header, so it can be inspected without reading a single MRA coefficient – see peek_restartdata().

Versioning

Version 5 appends to version 4 rather than reordering it, so the v4 layout is a strict prefix of v5. read() therefore dispatches on the stored version and reads the tail only when it is there; v4 archives written by any earlier MADNESS remain loadable, and the fields they lack take the defaults below. write() always emits the current version.

If you add a field: append it, bump CURRENT_VERSION, and give it a default that means "unknown" so a v4 archive stays meaningful. Do NOT reorder.

Member Function Documentation

◆ is_converged_to()

bool madness::RestartMetadata::is_converged_to ( const double  thresh,
const double  dconv 
) const
inline

true if these orbitals are at least as converged as the request

References converged_for_dconv, converged_for_thresh, madness::nonlinear_vector_solver(), and thresh.

Referenced by madness::plan_restart().

◆ print_to_string()

std::string madness::RestartMetadata::print_to_string ( ) const
inline

◆ read()

template<typename Archive >
void madness::RestartMetadata::read ( Archive ar)
inline

read the header from the current archive position

Accepts version 4 and 5. Throws on anything else, since the field order would be unknown and the archive position left wrong for the orbitals.

References converged_for_dconv, converged_for_thresh, current_energy, eprec, k, L, localize, MADNESS_CHECK_THROW, madness_version, molecule, madness::nonlinear_vector_solver(), representation, madness::representation_from_int(), spin_restricted, version, and xc.

Referenced by madness::SCF::load_mos(), madness::peek_restartdata(), and madness::MolecularOrbitals< T, NDIM >::read_restartdata().

◆ representation_matches()

bool madness::RestartMetadata::representation_matches ( const Representation  wanted) const
inline

true if the stored functions are what the asking engine expects

A v4 archive records no representation; treat that as compatible rather than rejecting every pre-existing archive, and rely on the geometry and convergence checks instead.

References madness::nonlinear_vector_solver(), representation, and madness::unknown.

Referenced by madness::SCF::load_mos(), and madness::plan_restart().

◆ write()

template<typename Archive >
void madness::RestartMetadata::write ( Archive ar) const
inline

Member Data Documentation

◆ converged_for_dconv

double madness::RestartMetadata::converged_for_dconv = 1.e10

density convergence the orbitals were converged to. Not stored by v4, so a v4 archive reads back as "unconverged" on this axis rather than claiming a convergence it never recorded.

Referenced by is_converged_to(), madness::SCF::load_mos(), madness::plan_restart(), print_to_string(), read(), madness::SCF::save_mos(), and write().

◆ converged_for_thresh

double madness::RestartMetadata::converged_for_thresh = 1.e10

◆ current_energy

double madness::RestartMetadata::current_energy = 1.e10

◆ CURRENT_VERSION

constexpr unsigned int madness::RestartMetadata::CURRENT_VERSION = 5
staticconstexpr

◆ eprec

double madness::RestartMetadata::eprec = 0.0

molecular smoothing parameter. Changes the nuclear potential, so orbitals from a different eprec solve a different Hamiltonian and are not the same solution – unlike k or thresh, this cannot be repaired by reprojecting.

Referenced by main(), read(), madness::SCF::save_mos(), madness::MolecularOrbitals< T, NDIM >::save_restartdata(), and write().

◆ k

int madness::RestartMetadata::k = 0

◆ L

double madness::RestartMetadata::L = 0.0

◆ localize

std::string madness::RestartMetadata::localize

◆ madness_version

std::string madness::RestartMetadata::madness_version

MADNESS version that wrote the archive, for provenance in bug reports.

Referenced by main(), read(), madness::SCF::save_mos(), madness::MolecularOrbitals< T, NDIM >::save_restartdata(), and write().

◆ molecule

Molecule madness::RestartMetadata::molecule

◆ ncf

std::string madness::RestartMetadata::ncf

nuclear correlation factor, e.g. "slater:2.0". Meaningful for nemo/znemo only; an empty string means none was recorded.

Referenced by print_to_string(), and madness::SCF::save_mos().

◆ representation

Representation madness::RestartMetadata::representation = Representation::unknown

◆ spin_restricted

bool madness::RestartMetadata::spin_restricted = true

◆ version

unsigned int madness::RestartMetadata::version = CURRENT_VERSION

version of the archive this was read from, or CURRENT_VERSION for a fresh one

Referenced by print_to_string(), and read().

◆ xc

std::string madness::RestartMetadata::xc

The documentation for this struct was generated from the following file: