Class CreateInput¶
Defined in File create_input.h
Class Documentation¶
-
class CreateInput¶
System for creating Gaussian input files from XYZ coordinate files.
Provides functionality to process XYZ files, read coordinates, and generate Gaussian input files for various types of calculations. Supports parallel processing with resource management integration.
Features¶
Multiple calculation types (SP, OPT+FREQ, TS, etc.)
Configurable functionals and basis sets
Solvent model support
Multi-threaded processing
Resource-aware operation
Detailed reporting and error handling
Support for complex multi-section inputs
Usage¶
The class processes XYZ files and creates corresponding Gaussian input files with appropriate route sections, molecular specifications, and coordinate data.
Public Functions
Constructor.
- Parameters:
ctx – Shared pointer to processing context
quiet – Enable quiet mode (suppress non-essential output)
Constructor with parameter file.
- Parameters:
ctx – Shared pointer to processing context
param_file – Path to parameter file
quiet – Enable quiet mode (suppress non-essential output)
-
bool loadParameters(const std::string ¶m_file)¶
Load parameters from a parameter file.
- Parameters:
param_file – Path to parameter file
- Returns:
true if successful, false otherwise
-
std::string generate_checkpoint_section(const std::string &isomer_name)¶
Generate checkpoint section for input file.
- Parameters:
isomer_name – Name of the isomer
- Returns:
Checkpoint section string
-
std::string generate_title()¶
Generate title for current calculation type.
- Returns:
Title string
-
std::string generate_title(CalculationType calc_type)¶
Overload Generate title for current calculation type.
- Returns:
Title string
-
std::string select_basis_for_calculation() const¶
Smartly select the appropriate basis set based on calculation type.
- Returns:
The selected basis set string
-
bool is_gen_basis(const std::string &basis_str) const¶
Check if the given basis string is GEN or GENECP (case insensitive)
- Parameters:
basis_str – The basis string to check
- Returns:
true if it’s GEN/GENECP, false otherwise
-
void validate_gen_basis_requirements() const¶
Validates requirements for calculations with GEN/GENECP basis.
- Throws:
std::runtime_error – if requirements are not met
-
void validate_modre_requirements() const¶
**
Validates requirements for MODRE_TS_FREQ and OSS_TS_FREQ calculations
- Throws:
std::runtime_error – if neither freeze_atoms nor modre is provided
-
void validate_solvent_tail_requirements() const¶
Validates requirements for solvent with Generic and Read keywords.
- Throws:
std::runtime_error – if tail is empty when solvent contains Generic and Read
-
CreateSummary create_inputs(const std::vector<std::string> &xyz_files)¶
Main method to create input files from XYZ files.
- Parameters:
xyz_files – List of XYZ files to process
- Returns:
Summary of the creation operation
-
void set_calculation_type(CalculationType type)¶
Set calculation type.
- Parameters:
type – The calculation type to use
-
void set_functional(const std::string &functional)¶
Set DFT functional.
- Parameters:
functional – The functional name (e.g., “UWB97XD”)
-
void set_basis(const std::string &basis)¶
Set basis set.
- Parameters:
basis – The basis set name (e.g., “Def2SVPP”)
-
void set_large_basis(const std::string &large_basis)¶
Set large basis set for high-level calculations.
- Parameters:
large_basis – The larger basis set name
-
void set_solvent(const std::string &solvent, const std::string &model = "smd")¶
Set solvent parameters.
- Parameters:
solvent – Solvent name (empty for gas phase)
model – Solvent model (default: “smd”)
-
void set_print_level(const std::string &print_level)¶
Set pound sign for route section.
- Parameters:
print_level – The pound sign (“”, “P”, “T”, etc.)
-
void set_extra_keywords(const std::string &keywords)¶
Set extra keywords.
- Parameters:
keywords – Extra keywords string
-
void set_extra_keyword_section(const std::string §ion)¶
Set extra keyword section.
- Parameters:
section – Extra keyword section string
-
void set_molecular_specs(int charge = 0, int mult = 1)¶
Set molecular charge and multiplicity.
- Parameters:
charge – Molecular charge (default: 0)
mult – Multiplicity (default: 1)
-
void set_tail(const std::string &tail)¶
Set tail text for input file.
- Parameters:
tail – Additional text at end of input
-
void set_modre(const std::string &modre)¶
Set modredundant text for TS calculations.
- Parameters:
modre – Modredundant text to replace frozen bond line
-
void set_extension(const std::string &extension)¶
Set file extension for output.
- Parameters:
extension – File extension (default: “.gau”)
-
void set_tschk_path(const std::string &path)¶
Set TS checkpoint path for high-level calculations.
- Parameters:
path – Path to TS checkpoint file
-
void set_freeze_atoms(int atom1, int atom2)¶
Set atoms to freeze for OSS TS calculations.
- Parameters:
atom1 – First atom index (1-based)
atom2 – Second atom index (1-based)
-
void set_scf_maxcycle(int maxcycle)¶
Set SCF maxcycle override.
- Parameters:
maxcycle – SCF maxcycle value (-1 for default)
-
void set_opt_maxcycles(int maxcycles)¶
Set OPT maxcycles override.
- Parameters:
maxcycles – OPT maxcycles value (-1 for default)
-
void set_irc_maxpoints(int maxpoints)¶
Set IRC maxpoints override.
- Parameters:
maxpoints – IRC maxpoints value (-1 for default)
-
void set_irc_recalc(int recalc)¶
Set IRC recalc override.
- Parameters:
recalc – IRC recalc value (-1 for default)
-
void set_irc_maxcycle(int maxcycle)¶
Set IRC maxcycle override.
- Parameters:
maxcycle – IRC maxcycle value (-1 for default)
-
void set_irc_stepsize(int stepsize)¶
Set IRC stepsize override.
- Parameters:
stepsize – IRC stepsize value (-1 for default)
-
void print_summary(const CreateSummary &summary, const std::string &operation)¶
Print summary of creation operation.
- Parameters:
summary – Summary to print
operation – Description of operation