CASM
AClustersApproachtoStatisticalMechanics
|
Relates to the CASM API.
All primary CASM functionality is included in the CASM library 'libcasm'.
The CASM API refers to the actions that can be performed by passing string commands through the extern "C" function casm_capi which in turn calls functions in libcasm. The casm_capi function and a limited set of others that allow for constructing PrimClex objects and input/output streams are available in the library 'libccasm'.
The CASM API is primarily intended to be used via the command line executable 'casm', which provides documentation of the allowed options, or the 'casm' Python package, but can be also be accessed directly to enable integration with other software.
Classes | |
struct | CASM::CommandArgs |
Data structure holding basic CASM command info. More... | |
Macros | |
#define | ERR_INVALID_ARG 1 |
#define | ERR_UNKNOWN 2 |
#define | ERR_NO_PROJ 3 |
#define | ERR_INVALID_INPUT_FILE 4 |
#define | ERR_MISSING_INPUT_FILE 5 |
#define | ERR_EXISTING_FILE 6 |
#define | ERR_MISSING_DEPENDS 7 |
#define | ERR_OTHER_PROJ 8 |
Typedefs | |
typedef std::function< int(const CommandArgs &)> | CASM::Command |
typedef std::map< std::string, Command > | CASM::CommandMap |
Functions | |
CommandMap & | CASM::command_map () |
Return static CommandMap containing all CASM API commands. More... | |
int | CASM::casm_api (const CommandArgs &args) |
Executes CASM commands specified by args. More... | |
PrimClex & | CASM::make_primclex_if_not (const CommandArgs &args, std::unique_ptr< PrimClex > &uniq_primclex) |
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or constructed PrimClex. More... | |
PrimClex & | CASM::make_primclex_if_not (const CommandArgs &args, std::unique_ptr< PrimClex > &uniq_primclex, Log &status_log) |
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or constructed PrimClex. More... | |
std::ostream & | CASM::make_ostream_if (bool output, std::ostream &sout, std::unique_ptr< std::ostream > &fout, fs::path out_path, bool gzip) |
Return a reference to proper std::ostream. More... | |
int | CASM::help_command (const CommandArgs &args) |
Print CASM help info to args.log. More... | |
int | CASM::bset_command (const CommandArgs &args) |
int | CASM::composition_command (const CommandArgs &args) |
int | CASM::enum_command (const CommandArgs &args) |
int | CASM::files_command (const CommandArgs &args) |
int | CASM::format_command (const CommandArgs &args) |
int | CASM::import_command (const CommandArgs &args) |
int | CASM::init_command (const CommandArgs &args) |
int | CASM::monte_command (const CommandArgs &args) |
int | CASM::perturb_command (const CommandArgs &args) |
int | CASM::query_command (const CommandArgs &args) |
int | CASM::ref_command (const CommandArgs &args) |
int | CASM::rm_command (const CommandArgs &args) |
int | CASM::run_command (const CommandArgs &args) |
int | CASM::select_command (const CommandArgs &args) |
int | CASM::settings_command (const CommandArgs &args) |
int | CASM::status_command (const CommandArgs &args) |
int | CASM::super_command (const CommandArgs &args) |
int | CASM::sym_command (const CommandArgs &args) |
int | CASM::update_command (const CommandArgs &args) |
int | CASM::version_command (const CommandArgs &args) |
int | CASM::view_command (const CommandArgs &args) |
typedef struct cPrimClex | cPrimClex |
For CASM::PrimClex*. More... | |
typedef struct costream | costream |
For std::ostream*. More... | |
costream * | casm_STDOUT () |
costream * | casm_STDERR () |
costream * | casm_nullstream_new () |
costream * | casm_ostringstream_new () |
void | casm_ostringstream_delete (costream *ptr) |
unsigned long | casm_ostringstream_size (costream *ptr) |
char * | casm_ostringstream_strcpy (costream *ptr, char *c_str) |
cPrimClex * | casm_primclex_null () |
cPrimClex * | casm_primclex_new (char *path, costream *log, costream *debug_log, costream *err_log) |
void | casm_primclex_delete (cPrimClex *ptr) |
void | casm_primclex_refresh (cPrimClex *ptr, bool read_settings, bool read_composition, bool read_chem_ref, bool read_configs, bool clear_clex) |
void | casm_command_list (costream *ostringstream_log) |
int | casm_capi (char *args, cPrimClex *primclex, char *root, costream *log, costream *debug_log, costream *err_log) |
#define ERR_EXISTING_FILE 6 |
Definition at line 45 of file casm_functions.hh.
#define ERR_INVALID_ARG 1 |
Definition at line 30 of file casm_functions.hh.
#define ERR_INVALID_INPUT_FILE 4 |
Definition at line 39 of file casm_functions.hh.
#define ERR_MISSING_DEPENDS 7 |
Definition at line 49 of file casm_functions.hh.
#define ERR_MISSING_INPUT_FILE 5 |
Definition at line 42 of file casm_functions.hh.
#define ERR_NO_PROJ 3 |
Definition at line 36 of file casm_functions.hh.
#define ERR_OTHER_PROJ 8 |
Definition at line 52 of file casm_functions.hh.
#define ERR_UNKNOWN 2 |
Definition at line 33 of file casm_functions.hh.
typedef std::function<int (const CommandArgs &)> CASM::Command |
Definition at line 135 of file casm_functions.hh.
typedef std::map<std::string, Command> CASM::CommandMap |
Definition at line 136 of file casm_functions.hh.
For CASM::PrimClex*.
int CASM::bset_command | ( | const CommandArgs & | args | ) |
int CASM::casm_api | ( | const CommandArgs & | args | ) |
Executes CASM commands specified by args.
Definition at line 199 of file casm_functions.cc.
costream* casm_nullstream_new | ( | ) |
char* casm_ostringstream_strcpy | ( | costream * | ptr, |
char * | c_str | ||
) |
void casm_primclex_refresh | ( | cPrimClex * | ptr, |
bool | read_settings, | ||
bool | read_composition, | ||
bool | read_chem_ref, | ||
bool | read_configs, | ||
bool | clear_clex | ||
) |
CommandMap & CASM::command_map | ( | ) |
Return static CommandMap containing all CASM API commands.
Definition at line 111 of file casm_functions.cc.
int CASM::composition_command | ( | const CommandArgs & | args | ) |
int CASM::enum_command | ( | const CommandArgs & | args | ) |
int CASM::files_command | ( | const CommandArgs & | args | ) |
int CASM::format_command | ( | const CommandArgs & | args | ) |
int CASM::help_command | ( | const CommandArgs & | args | ) |
Print CASM help info to args.log.
Definition at line 311 of file casm_functions.cc.
int CASM::import_command | ( | const CommandArgs & | args | ) |
Import proceeds in two steps. 1) read each file, map it onto a Configuration of the PrimClex
2) If data import was requested, iterate over each import record and do the following:
Set command line options using boost program_options
–help option
Set command line options using boost program_options
–help option
int CASM::init_command | ( | const CommandArgs & | args | ) |
Set command line options using boost program_options
–help option
Check if PRIM is primitive
Check that the PRIM is in reduced form:
Set command line options using boost program_options
–help option
Check if PRIM is primitive
Check that the PRIM is in reduced form:
std::ostream & CASM::make_ostream_if | ( | bool | output, |
std::ostream & | sout, | ||
std::unique_ptr< std::ostream > & | fout, | ||
fs::path | out_path, | ||
bool | gzip | ||
) |
Return a reference to proper std::ostream.
output | Output mode: False: use 'sout', True: check 'out_path' and 'gzip' to decide |
sout | stream to use if not writing to file |
fout | will be given an open file if writing to file |
out_path,where | to write if 'output': if "STDOUT", use 'sout'; otherwise filename |
gzip | if true, write to gzip file |
Definition at line 287 of file casm_functions.cc.
PrimClex & CASM::make_primclex_if_not | ( | const CommandArgs & | args, |
std::unique_ptr< PrimClex > & | uniq_primclex | ||
) |
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or constructed PrimClex.
args | CommandArgs reference |
uniq_primclex | Reference to null std::unique_ptr<PrimClex> to manage PrimClex, if it is constructed |
Definition at line 255 of file casm_functions.cc.
PrimClex & CASM::make_primclex_if_not | ( | const CommandArgs & | args, |
std::unique_ptr< PrimClex > & | uniq_primclex, | ||
Log & | status_log | ||
) |
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or constructed PrimClex.
args | CommandArgs reference |
uniq_primclex | Reference to null std::unique_ptr<PrimClex> to manage PrimClex, if it is constructed |
status_log | where to print PrimClex construction messages |
Definition at line 269 of file casm_functions.cc.
int CASM::monte_command | ( | const CommandArgs & | args | ) |
int CASM::perturb_command | ( | const CommandArgs & | args | ) |
Set command line options using boost program_options
–help option
Set command line options using boost program_options
–help option
Definition at line 35 of file perturb.cc.
int CASM::query_command | ( | const CommandArgs & | args | ) |
int CASM::ref_command | ( | const CommandArgs & | args | ) |
int CASM::rm_command | ( | const CommandArgs & | args | ) |
int CASM::run_command | ( | const CommandArgs & | args | ) |
int CASM::select_command | ( | const CommandArgs & | args | ) |
int CASM::settings_command | ( | const CommandArgs & | args | ) |
Set command line options using boost program_options
Set command line options using boost program_options
Definition at line 257 of file settings.cc.
int CASM::status_command | ( | const CommandArgs & | args | ) |
Set command line options using boost program_options
–help option
1) Check if a project exists
2) Composition axes
3) Configuration generation
4) Calculate configuration properties
5) Choose chemical reference
6) Generate basis functions:
7) Fit effective cluster interactions (ECI):
7) Monte Carlo
Set command line options using boost program_options
–help option
1) Check if a project exists
2) Composition axes
3) Configuration generation
4) Calculate configuration properties
5) Choose chemical reference
6) Generate basis functions:
7) Fit effective cluster interactions (ECI):
7) Monte Carlo
int CASM::super_command | ( | const CommandArgs & | args | ) |
int CASM::sym_command | ( | const CommandArgs & | args | ) |
int CASM::update_command | ( | const CommandArgs & | args | ) |
–help option
Read properties.calc.json file containing externally calculated properties location: casmroot/supercells/SCEL_NAME/CONFIG_ID/CURR_CALCTYPE/properties.calc.json
Will read as many curr_property as found in properties.calc.json
properties.calc.json: contains calculated properties Currently only loading those properties that have references
–help option
Read properties.calc.json file containing externally calculated properties location: casmroot/supercells/SCEL_NAME/CONFIG_ID/CURR_CALCTYPE/properties.calc.json
Will read as many curr_property as found in properties.calc.json
properties.calc.json: contains calculated properties Currently only loading those properties that have references
int CASM::version_command | ( | const CommandArgs & | args | ) |
Definition at line 339 of file casm_functions.cc.