CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ProjectIO

Detailed Description

Relates to CASM project input/output.

Classes

struct  CASM::CompositionAxes
 

Functions

BasicStructure< Site > CASM::read_prim (fs::path filename)
 
BasicStructure< Site > CASM::read_prim (const jsonParser &json)
 Read prim.json. More...
 
void CASM::write_prim (const BasicStructure< Site > &prim, fs::path filename, COORD_TYPE mode)
 Write prim.json to file. More...
 
void CASM::write_prim (const BasicStructure< Site > &prim, jsonParser &json, COORD_TYPE mode)
 Write prim.json as JSON. More...
 
void CASM::write_symop (const SymGroup &grp, Index i, jsonParser &j)
 
void CASM::write_symgroup (const SymGroup &grp, jsonParser &json)
 
ChemicalReference CASM::read_chemical_reference (fs::path filename, const Structure &prim, double tol)
 Read chemical reference states from JSON file. More...
 
ChemicalReference CASM::read_chemical_reference (const jsonParser &json, const Structure &prim, double tol)
 Read chemical reference states from JSON. More...
 
void CASM::write_chemical_reference (const ChemicalReference &chem_ref, fs::path filename)
 
void CASM::write_chemical_reference (const ChemicalReference &chem_ref, jsonParser &json)
 
template<typename OutputIterator >
OutputIterator CASM::read_composition_axes (OutputIterator result, const jsonParser &json)
 Read standard axes from JSON, and output to std::map<std::string, CompositionConverter> More...
 
void CASM::write_basis (const SiteOrbitree &tree, const Structure &prim, jsonParser &json, double tol)
 Write summary of basis functions. More...
 
jsonParser & CASM::to_json (const ChemicalReferenceState &ref_state, jsonParser &json)
 Write ChemicalReferenceState to: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'. More...
 
template<>
ChemicalReferenceState CASM::from_json< ChemicalReferenceState > (const jsonParser &json)
 Read ChemicalReferenceState from: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'. More...
 
void CASM::from_json (ChemicalReferenceState &ref_state, const jsonParser &json)
 Read ChemicalReferenceState from: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'. More...
 
jsonParser & CASM::to_json (const HyperPlaneReference &ref, jsonParser &json)
 
void CASM::from_json (HyperPlaneReference &ref, const jsonParser &json, HyperPlaneReference::InputFunction f)
 
jsonParser & CASM::to_json (const ChemicalReference &ref, jsonParser &json)
 Write chemical reference. More...
 
std::pair< Eigen::VectorXd,
std::vector
< ChemicalReferenceState > > 
CASM::one_chemical_reference_from_json (const Structure &prim, const jsonParser &json)
 Read chemical reference from one of 3 alternative forms. More...
 
void CASM::from_json (ChemicalReference &ref, const jsonParser &json, const Structure &prim, double tol=1e-14)
 Read chemical reference from JSON. More...
 

Function Documentation

void CASM::from_json ( ChemicalReferenceState &  ref_state,
const jsonParser &  json 
)

Read ChemicalReferenceState from: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'.

Definition at line 44 of file clex.cc.

void CASM::from_json ( HyperPlaneReference &  ref,
const jsonParser &  json,
HyperPlaneReference::InputFunction  f 
)

Definition at line 69 of file clex.cc.

void CASM::from_json ( ChemicalReference &  ref,
const jsonParser &  json,
const Structure &  prim,
double  tol = 1e-14 
)

Read chemical reference from JSON.

Definition at line 297 of file clex.cc.

template<>
ChemicalReferenceState CASM::from_json< ChemicalReferenceState > ( const jsonParser &  json)

Read ChemicalReferenceState from: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'.

std::pair< Eigen::VectorXd, std::vector< ChemicalReferenceState > > CASM::one_chemical_reference_from_json ( const Structure &  prim,
const jsonParser &  json 
)

Read chemical reference from one of 3 alternative forms.

This function returns a pair with only one element initialized. If alternative 1, then the vector is set. If alternative 2 or 3, then the Eigen::VectorXd is set.

Expected input form: 1)

[
{"A": 3.4, "C": 2.0, "energy_per_species": 2.0},
{"B": 2.0, "energy_per_species": 4.0},
{"C": 1.0, "energy_per_species": 3.0}
]

2) Expects all species in prim, except vacancy:

{"A": X, "C": X, "D": X}

3) Expects one element for each species in prim, including 0.0 for vacancy:

[X, X, X, X]

Definition at line 180 of file clex.cc.

ChemicalReference CASM::read_chemical_reference ( fs::path  filename,
const Structure &  prim,
double  tol 
)

Read chemical reference states from JSON file.

See documentation in related function for expected form of the JSON

re-throw exceptions

re-throw exceptions

Definition at line 212 of file AppIO.cc.

ChemicalReference CASM::read_chemical_reference ( const jsonParser &  json,
const Structure &  prim,
double  tol 
)

Read chemical reference states from JSON.

Example expected form:

{
"chemical_reference" : {
"global" : ...,
"supercell": {
"SCELX": ...,
"SCELY": ...
},
"config": {
"SCELX/I": ...,
"SCELY/J": ...
}
}
}

See one_chemical_reference_from_json for documentation of the

{...}

expected form.

Definition at line 246 of file AppIO.cc.

template<typename OutputIterator >
OutputIterator CASM::read_composition_axes ( OutputIterator  result,
const jsonParser &  json 
)

Read standard axes from JSON, and output to std::map<std::string, CompositionConverter>

  • json Format: {"standard_axes": {"key0" : {CompositionConverter}, ... more axes ...}, "custom_axes": {"key0" : {CompositionConverter}, ... more axes ...}, "current_axes": "key"}
    • "axes_type" is either "standard_axes" or "custom_axes"
    • "key" is a string indicating which composition axes in the "standard_axes" or "custom_axes" JSON object
  • This read json["standard_axes"] or json["custom_axes"]

Definition at line 121 of file AppIO.hh.

BasicStructure< Site > CASM::read_prim ( fs::path  filename)

re-throw exceptions

re-throw exceptions

Definition at line 11 of file AppIO.cc.

BasicStructure< Site > CASM::read_prim ( const jsonParser &  json)

Read prim.json.

re-throw exceptions

re-throw exceptions

Definition at line 25 of file AppIO.cc.

jsonParser & CASM::to_json ( const ChemicalReferenceState &  ref_state,
jsonParser &  json 
)

Write ChemicalReferenceState to: '{"A" : X, "B" : X, ..., "energy_per_species" : X }'.

Definition at line 12 of file clex.cc.

jsonParser & CASM::to_json ( const HyperPlaneReference &  ref,
jsonParser &  json 
)

Definition at line 51 of file clex.cc.

jsonParser & CASM::to_json ( const ChemicalReference &  ref,
jsonParser &  json 
)

Write chemical reference.

Write ChemicalReference.

Example form:

{
"chemical_reference" : {
"global" : ...,
"supercell": {
"SCELX": ...,
"SCELY": ...
},
"config": {
"SCELX/I": ...,
"SCELY/J": ...
}
}
}

Each individual reference is a vector,

[X, X, X, X]

giving the hyperplane of the reference (each element is the reference value for pure Configurations of a given Molecule).

Definition at line 104 of file clex.cc.

void CASM::write_basis ( const SiteOrbitree &  tree,
const Structure &  prim,
jsonParser &  json,
double  tol 
)

Write summary of basis functions.

Format:

{
"site_functions":[
{
"asym_unit": X,
"sublat_indices: [2, 3],
"phi_b_0": {"Va":0.0, "O":1.0},
"phi_b_1": {"Va":0.0, "O":1.0},
...
},
...
],
"cluster_functions":[
{
"eci": X.XXXXX,
"prototype_function": "\phi_b_i(s_j)...",
"orbit": [branch_index, orbit_index],
"linear_orbit_index": I,
"mult": X,
"prototype": [
[b, i, j, k],
...
]
},
...
]
}

Definition at line 474 of file AppIO.cc.

void CASM::write_chemical_reference ( const ChemicalReference &  chem_ref,
fs::path  filename 
)

Definition at line 258 of file AppIO.cc.

void CASM::write_chemical_reference ( const ChemicalReference &  chem_ref,
jsonParser &  json 
)

Definition at line 269 of file AppIO.cc.

void CASM::write_prim ( const BasicStructure< Site > &  prim,
fs::path  filename,
COORD_TYPE  mode 
)

Write prim.json to file.

Definition at line 107 of file AppIO.cc.

void CASM::write_prim ( const BasicStructure< Site > &  prim,
jsonParser &  json,
COORD_TYPE  mode 
)

Write prim.json as JSON.

Definition at line 120 of file AppIO.cc.

void CASM::write_symgroup ( const SymGroup &  grp,
jsonParser &  json 
)

Definition at line 183 of file AppIO.cc.

void CASM::write_symop ( const SymGroup &  grp,
Index  i,
jsonParser &  j 
)

Definition at line 166 of file AppIO.cc.