20 std::cerr <<
"Attempting to create a casm project here: " <<
m_root << std::endl;
21 std::cerr <<
"Found existing casm project here: " << test_root << std::endl;
22 throw std::runtime_error(
23 std::string(
"Error in 'ProjectBuilder::build()'.\n") +
24 " Already in a casm project: " + test_root.string());
30 if(!fs::is_regular_file(dir.
prim())) {
31 throw std::runtime_error(
32 std::string(
"Error in 'ProjectBuilder::build()'.\n") +
33 " No prim.json file found at: " + dir.
prim().string());
48 auto exc = [ = ](std::string type) {
49 throw std::runtime_error(
50 std::string(
"Error in 'ProjectBuilder::build()'.\n") +
51 " Could not set " + type);
56 ClexDescription desc(
"formation_energy",
"formation_energy",
"default",
"default",
"default",
"default");
61 exc(
"crystallography_tol");
72 fs::ifstream primfile(dir.
prim());
85 prim.set_site_internals();
101 fs::ofstream outfile;
111 fs::ofstream outfile;
124 std::vector<CompositionConverter> v;
126 for(
int i = 0; i < v.size(); i++) {
134 std::cerr <<
"Uncaught exception in ProjectBuilder::build()" << std::endl;
Specifies a particular cluster expansion.
void commit() const
Save settings to project settings file.
std::map< std::string, CompositionConverter > standard
fs::path composition_axes() const
Return composition axes file path.
void generate_point_group(SymGroup &point_group, double pg_tol=TOL) const
Populate.
Specification of CASM project directory structure.
Structure specifies the lattice and atomic basis of a crystal.
void write_symgroup(const SymGroup &grp, jsonParser &json)
bool set_default_clex(const std::string &clex_name)
std::string to_string(ENUM val)
Return string representation of enum class.
bool new_eci_dir(std::string clex, std::string calctype, std::string ref, std::string bset, std::string eci) const
Add an eci directory.
fs::path prim() const
Return prim.json path.
bool new_casm_dir() const
Create new project data directory.
bool new_ref_dir(std::string calctype, std::string ref) const
Add a ref directory.
fs::path find_casmroot(const fs::path &cwd)
BasicStructure< Site > read_prim(fs::path filename)
void print(std::ostream &stream, unsigned int indent=2, unsigned int prec=12) const
Print json to stream.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
fs::path crystal_point_group() const
Return crystal_point_group.json path.
bool set_crystallography_tol(double _tol)
Set crystallography tolerance.
const std::vector< std::string > & properties() const
Get current properties.
Read/modify settings of an already existing CASM project.
const Array< std::complex< double > >::X2 & character_table() const
bool new_symmetry_dir() const
Create new symmetry directory.
bool new_bset_dir(std::string bset) const
Add a basis set directory.
void build() const
Builds a new CASM project.
fs::path lattice_point_group() const
Return lattice_point_group.json path.
const Lattice & lattice() const
bool set_lin_alg_tol(double _tol)
Set linear algebra tolerance.
OutputIterator standard_composition_axes(const Structure &prim, OutputIterator result)
Generate CompositionConverter specifying standard composition axes for a prim Structure.
bool new_calc_settings_dir(std::string calctype) const
Add calculation settings directory path.
void write(fs::path _filename)
Write CompositionAxes to file.
bool new_clex(const ClexDescription &desc)
fs::path factor_group() const
Return factor_group.json path.
double m_crystallography_tol