1 #ifndef CASM_DirectoryStructure
2 #define CASM_DirectoryStructure
18 template<
typename DataObject>
30 if(fs::is_directory(dir / casmroot))
32 dir = dir.parent_path();
44 while(dir != casmroot) {
45 dir = dir.parent_path();
62 _init(fs::absolute(_root));
106 return m_root /
"prim.json";
143 template<
typename DataObject>
180 return bset_dir(bset) /
"bspecs.json";
185 return bset_dir(bset) /
"clust.json";
190 return bset_dir(bset) /
"basis.json";
200 return bset_dir(bset) / (project +
"_Clexulator.cc");
205 return bset_dir(bset) / (project +
"_Clexulator.o");
210 return bset_dir(bset) / (project +
"_Clexulator.so");
289 return casm_dir() /
"composition_axes.json";
294 return ref_dir(calctype, ref) /
"chemical_reference.json";
312 return eci_dir(property, calctype, ref, bset, eci) /
"eci.json";
325 return bset_dir(bset) /
"FCLUST.json";
332 return eci_dir(property, calctype, ref, bset, eci) /
"eci.out";
344 return std::string(
"bset.") +
bset;
348 return std::string(
"calctype.") +
calctype;
352 return std::string(
"ref.") +
ref;
356 return std::string(
"clex.") +
property;
360 return std::string(
"eci.") +
eci;
364 return std::string(
"properties.ref_state.") +
std::to_string(index) +
".json";
382 std::vector<std::string> all;
387 if(!fs::exists(location)) {
390 fs::directory_iterator it(location);
391 fs::directory_iterator end_it;
392 for(; it != end_it; ++it) {
393 if(fs::is_directory(*it)) {
394 dir = it->path().filename().string();
395 if(dir.substr(0, pattern.size()) == pattern) {
396 all.push_back(dir.substr(pattern.size(), dir.size()));
401 std::sort(all.begin(), all.end());
fs::path eci(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci.json.
fs::path CSPECS(std::string bset) const
Return cluster specs (CSPECS) file path.
std::string _property(std::string property) const
fs::path composition_axes() const
Return composition axes file path.
fs::path SCEL() const
Return SCEL path.
Specification of CASM project directory structure.
fs::path calculated_properties(std::string configname, std::string calctype) const
Return calculated properties file path.
fs::path query_alias() const
Query aliases file.
fs::path calc_settings_dir(std::string calctype) const
Return calculation settings directory path, for global settings.
fs::path supercell_calc_settings_dir(std::string scelname, std::string calctype) const
Return calculation settings directory path, for supercell specific settings.
fs::path configuration_calc_settings_dir(std::string configname, std::string calctype) const
Return calculation settings directory path, for configuration specific settings.
std::vector< std::string > _all_settings(std::string pattern, fs::path location) const
Find all directories at 'location' that match 'pattern.something' and return a std::vector of the 'so...
std::string _bset(std::string bset) const
fs::path configuration_calc_dir(std::string configname, std::string calctype) const
Return calculated properties file path.
std::string to_string(ENUM val)
Return string representation of enum class.
fs::path prim() const
Return prim.json path.
fs::path relative_casmroot(const fs::path &cwd)
std::vector< std::string > all_eci(std::string property, std::string calctype, std::string ref, std::string bset) const
Check filesystem directory structure and return list of all eci names.
std::string _calctype(std::string calctype) const
std::vector< std::string > all_property() const
Check filesystem directory structure and return list of all property names.
fs::path ref_dir(std::string calctype, std::string ref) const
Return calculation reference settings directory path, for global settings.
fs::path find_casmroot(const fs::path &cwd)
fs::path enumerator_plugins() const
Return enumerators plugin dir.
fs::path bspecs(std::string bset) const
Return basis function specs (bspecs.json) file path.
std::string _ref_state(int index) const
fs::path crystal_point_group() const
Return crystal_point_group.json path.
fs::path clex_dir(std::string property) const
Returns path to eci directory.
fs::path project_settings() const
Return project_settings.json path.
fs::path configuration_dir(std::string configname) const
Return configuration directory path (configname has format SCELV_A_B_C_D_E_F/I)
fs::path clexulator_so(std::string project, std::string bset) const
Returns path to global clexulator so file.
fs::path clust(std::string bset) const
fs::path eci_out(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci.out.
fs::path clexulator_src(std::string project, std::string bset) const
Returns path to global clexulator source file.
fs::path basis(std::string bset) const
fs::path root_dir() const
Return casm project directory path.
fs::path PRIM() const
Return PRIM path.
void recurs_rm_files(fs::path p, bool dry_run, Log &log)
Remove files recursively.
fs::path FCLUST(std::string bset) const
std::string _ref(std::string ref) const
fs::path supercell_dir(std::string scelname) const
Return supercell directory path (scelname has format SCELV_A_B_C_D_E_F)
fs::path casm_dir() const
Return hidden .casm dir path.
std::string _eci(std::string eci) const
fs::path calc_status(std::string configname, std::string calctype) const
Return calculation status file path.
fs::path lattice_point_group() const
Return lattice_point_group.json path.
fs::path scel_list(std::string scelname) const
Return master scel_list.json path.
fs::path corr_in(std::string bset) const
Returns path to corr.in, in bset directory.
fs::path POS(std::string configname) const
Return path to POS file.
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
fs::path config_list() const
Return master config_list.json file path.
fs::path bset_dir(std::string bset) const
Return path to directory contain basis set info.
fs::path eci_in(std::string bset) const
Returns path to eci.in, in bset directory.
fs::path clexulator_o(std::string project, std::string bset) const
Returns path to global clexulator o file.
fs::path symmetry_dir() const
Return symmetry directory path.
fs::path query_plugins() const
Return enumerators plugin dir.
std::vector< std::string > all_calctype() const
Check filesystem directory structure and return list of all calctype names.
fs::path eci_dir(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci directory.
fs::path clexulator_dir(std::string bset) const
Returns path to directory containing global clexulator.
ConfigIO::GenericConfigFormatter< std::string > scelname()
fs::path factor_group() const
Return factor_group.json path.
std::vector< std::string > all_bset() const
Check filesystem directory structure and return list of all basis set names.
fs::path chemical_reference(std::string calctype, std::string ref) const
Return chemical reference file path.
DirectoryStructure(const fs::path _root)
std::vector< std::string > all_ref(std::string calctype) const
Check filesystem directory structure and return list of all ref names for a given calctype...
fs::path training_data() const
Return 'training_data' directorty path.
void _init(const fs::path &_root)