Loading...
Searching...
No Matches
Parameters Class Reference

#include <Parameters.h>

Classes

struct  constants_t
struct  main_options_t
struct  potential_options_t
struct  ams_options_t
struct  xtb_options_t
struct  zbl_options_t
struct  socket_nwchem_options_t
struct  rgpot_options_t
struct  structure_comparison_options_t
struct  process_search_options_t
struct  saddle_search_options_t
struct  optimizer_options_t
struct  dimer_options_t
struct  gpr_dimer_options_t
struct  gp_surrogate_options_t
struct  catlearn_options_t
struct  ase_orca_options_t
struct  ase_nwchem_options_t
struct  metatomic_options_t
struct  lanczos_options_t
struct  davidson_options_t
struct  prefactor_options_t
struct  hessian_options_t
struct  neb_options_t
struct  dynamics_options_t
struct  parallel_replica_options_t
struct  tad_options_t
struct  thermostat_options_t
struct  replica_exchange_options_t
struct  hyperdynamics_options_t
struct  basin_hopping_options_t
struct  global_optimization_options_t
struct  monte_carlo_options_t
struct  bgsd_options_t
struct  serve_options_t
struct  artn_options_t
struct  ira_options_t
struct  debug_options_t
struct  oh_tst_options_t

Public Member Functions

 Parameters ()
 Parameters (const Parameters &)=default
 ~Parameters ()=default
int load (std::string filename)
int load (FILE *file)
int load_json (const std::string &json_str)
std::string to_json () const

Public Attributes

struct eonc::Parameters::constants_t constants
struct eonc::Parameters::main_options_t main_options
struct eonc::Parameters::potential_options_t potential_options
struct eonc::Parameters::ams_options_t ams_options
struct eonc::Parameters::xtb_options_t xtb_options
struct eonc::Parameters::zbl_options_t zbl_options
struct eonc::Parameters::socket_nwchem_options_t socket_nwchem_options
struct eonc::Parameters::rgpot_options_t rgpot_options
struct eonc::Parameters::structure_comparison_options_t structure_comparison_options
struct eonc::Parameters::process_search_options_t process_search_options
struct eonc::Parameters::saddle_search_options_t saddle_search_options
struct eonc::Parameters::optimizer_options_t optimizer_options
struct eonc::Parameters::dimer_options_t dimer_options
struct eonc::Parameters::gpr_dimer_options_t gpr_dimer_options
struct eonc::Parameters::gp_surrogate_options_t gp_surrogate_options
struct eonc::Parameters::catlearn_options_t catlearn_options
struct eonc::Parameters::ase_orca_options_t ase_orca_options
struct eonc::Parameters::ase_nwchem_options_t ase_nwchem_options
struct eonc::Parameters::metatomic_options_t metatomic_options
struct eonc::Parameters::lanczos_options_t lanczos_options
struct eonc::Parameters::davidson_options_t davidson_options
struct eonc::Parameters::prefactor_options_t prefactor_options
struct eonc::Parameters::hessian_options_t hessian_options
struct eonc::Parameters::neb_options_t neb_options
struct eonc::Parameters::dynamics_options_t dynamics_options
struct eonc::Parameters::parallel_replica_options_t parallel_replica_options
struct eonc::Parameters::tad_options_t tad_options
struct eonc::Parameters::thermostat_options_t thermostat_options
struct eonc::Parameters::replica_exchange_options_t replica_exchange_options
struct eonc::Parameters::hyperdynamics_options_t hyperdynamics_options
struct eonc::Parameters::basin_hopping_options_t basin_hopping_options
struct eonc::Parameters::global_optimization_options_t global_optimization_options
struct eonc::Parameters::monte_carlo_options_t monte_carlo_options
struct eonc::Parameters::bgsd_options_t bgsd_options
struct eonc::Parameters::serve_options_t serve_options
struct eonc::Parameters::artn_options_t artn_options
struct eonc::Parameters::ira_options_t ira_options
struct eonc::Parameters::debug_options_t debug_options
struct eonc::Parameters::oh_tst_options_t oh_tst_options

Detailed Description

Definition at line 28 of file Parameters.h.

Constructor & Destructor Documentation

◆ Parameters() [1/2]

Definition at line 26 of file Parameters.cpp.

26 {
27 // Covered groups: defaults originate from schema/eon_params.capnp via
28 // apply_ssot_defaults (codegen). Uncovered groups still use NSDMI.
30 // Resolve computed fields via validate_and_link.
32}
void apply_ssot_defaults(Parameters &p)
Apply SSoT defaults for covered groups (Main, Potential, Optimizer, Structure Comparison,...
void validate_and_link(Parameters &params)
Resolve cross-group defaults and time unit conversions.

◆ Parameters() [2/2]

◆ ~Parameters()

Member Function Documentation

◆ load() [1/2]

int Parameters::load ( FILE * file)

Definition at line 84 of file Parameters.cpp.

84 {
85 // Legacy FILE* overload: read into string buffer, use INIReader buffer ctor
86 fseek(file, 0, SEEK_END);
87 long size = ftell(file);
88 fseek(file, 0, SEEK_SET);
89
90 std::string buffer(size, '\0');
91 fread(buffer.data(), 1, size, file);
92
93 INIReader ini(buffer.c_str(), buffer.size());
94 if (ini.ParseError() < 0) {
95 EONC_LOG_ERROR("Couldn't parse the ini file from FILE*");
96 return 1;
97 }
98
99 int error = eonc::config::load_ini(ini, *this);
100 // Same validation as the filename overload
101 // (duplicated intentionally for now; will be extracted to validate())
102 if (parallel_replica_options.state_check_interval > dynamics_options.time &&
103 magic_enum::enum_name<JobType>(main_options.job) == "parallel_replica") {
104 EONC_LOG_ERROR("[Parallel Replica] state_check_interval must be <= time");
105 error = 1;
106 }
107 if (saddle_search_options.dynamics.record_interval_input >
108 saddle_search_options.dynamics.state_check_interval_input) {
109 EONC_LOG_ERROR("[Saddle Search] dynamics_record_interval must be <= "
110 "dynamics_state_check_interval");
111 error = 1;
112 }
113 return error;
114}
#define EONC_LOG_ERROR(...)
Definition EonLogger.h:262
struct eonc::Parameters::saddle_search_options_t saddle_search_options
struct eonc::Parameters::dynamics_options_t dynamics_options
struct eonc::Parameters::main_options_t main_options
struct eonc::Parameters::parallel_replica_options_t parallel_replica_options
int load_ini(INIReader &ini, Parameters &params)
Parse all INI sections into the Parameters struct.
std::string error()
Definition DynLib.h:82

◆ load() [2/2]

int Parameters::load ( std::string filename)

Definition at line 34 of file Parameters.cpp.

34 {
35 INIReader ini(filename);
36 if (ini.ParseError() < 0) {
37 EONC_LOG_ERROR("Can't load INI file: {}", filename);
38 return 1;
39 }
40
41 int error = eonc::config::load_ini(ini, *this);
42
43 // Sanity Checks
44 if (parallel_replica_options.state_check_interval > dynamics_options.time &&
45 magic_enum::enum_name<JobType>(main_options.job) == "parallel_replica") {
46 EONC_LOG_ERROR("[Parallel Replica] state_check_interval must be <= time");
47 error = 1;
48 }
49
50 if (!neb_options.initialization.input_path.empty() &&
51 neb_options.initialization.method == NEBInit::LINEAR) {
53 "[Nudged Elastic Band] 'initial_path_in' is provided, but "
54 "'initializer' defaults to linear. "
55 "Ensure this is intentional, as the loaded path will not be "
56 "used without initializer set to file.");
57 }
58
59 if (saddle_search_options.dynamics.record_interval_input >
60 saddle_search_options.dynamics.state_check_interval_input) {
61 EONC_LOG_ERROR("[Saddle Search] dynamics_record_interval must be <= "
62 "dynamics_state_check_interval");
63 error = 1;
64 }
65
66 if (potential_options.potential == PotType::AMS ||
68 if (ams_options.forcefield.empty() && ams_options.model.empty() &&
69 ams_options.xc.empty()) {
70 EONC_LOG_ERROR("[AMS] Must provide atleast forcefield or model or xc");
71 error = 1;
72 }
73
74 if (!ams_options.forcefield.empty() && !ams_options.model.empty() &&
75 !ams_options.xc.empty()) {
76 EONC_LOG_ERROR("[AMS] Must provide either forcefield or model");
77 error = 1;
78 }
79 }
80
81 return error;
82}
#define EONC_LOG_WARNING(...)
Definition EonLogger.h:256
struct eonc::Parameters::neb_options_t neb_options
struct eonc::Parameters::potential_options_t potential_options
struct eonc::Parameters::ams_options_t ams_options

◆ load_json()

int Parameters::load_json ( const std::string & json_str)

Definition at line 116 of file Parameters.cpp.

116 {
117 return eonc::config::load_json(json_str, *this);
118}
int load_json(const std::string &json_str, Parameters &params)
Load Parameters from a JSON string. Returns 0 on success.

◆ to_json()

std::string Parameters::to_json ( ) const

Definition at line 120 of file Parameters.cpp.

120 {
121 return eonc::config::to_json(*this).dump(2);
122}
json to_json(const Parameters &p)
Serialize all Parameters to JSON.

Member Data Documentation

◆ ams_options

◆ artn_options

◆ ase_nwchem_options

◆ ase_orca_options

◆ basin_hopping_options

◆ bgsd_options

◆ catlearn_options

◆ constants

◆ davidson_options

◆ debug_options

◆ dimer_options

◆ dynamics_options

◆ global_optimization_options

◆ gp_surrogate_options

◆ gpr_dimer_options

◆ hessian_options

◆ hyperdynamics_options

◆ ira_options

◆ lanczos_options

◆ main_options

◆ metatomic_options

◆ monte_carlo_options

◆ neb_options

◆ oh_tst_options

◆ optimizer_options

◆ parallel_replica_options

◆ potential_options

◆ prefactor_options

◆ process_search_options

◆ replica_exchange_options

◆ rgpot_options

◆ saddle_search_options

◆ serve_options

◆ socket_nwchem_options

◆ structure_comparison_options

◆ tad_options

◆ thermostat_options

◆ xtb_options

◆ zbl_options


The documentation for this class was generated from the following files: