CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::ProjectSettings Class Reference

#include <ProjectSettings.hh>

+ Inheritance diagram for CASM::ProjectSettings:

Detailed Description

Read/modify settings of an already existing CASM project.

  • Use ProjectBuilder to create a new CASM project
  • Only allows modifying settings if the appropriate directories exist

Definition at line 92 of file ProjectSettings.hh.

Public Member Functions

 ProjectSettings ()
 Default constructor. More...
 
 ProjectSettings (fs::path root, std::string name, const Logging &logging=Logging())
 Construct CASM project settings for a new project. More...
 
 ProjectSettings (fs::path root, const Logging &logging=Logging())
 Construct CASM project settings from existing project. More...
 
std::string name () const
 Get project name. More...
 
const DirectoryStructuredir () const
 
const std::vector< std::string > & properties () const
 Get current properties. More...
 
const std::map< std::string,
ClexDescription > & 
cluster_expansions () const
 
bool has_clex (std::string name) const
 
const ClexDescriptionclex (std::string name) const
 
const ClexDescriptiondefault_clex () const
 
bool new_clex (const ClexDescription &desc)
 
bool erase_clex (const ClexDescription &desc)
 
bool set_default_clex (const std::string &clex_name)
 
bool set_default_clex (const ClexDescription &desc)
 Will overwrite existing ClexDescription with same name. More...
 
Eigen::Matrix3l nlist_weight_matrix () const
 Get neighbor list weight matrix. More...
 
const std::set< int > & nlist_sublat_indices () const
 Get set of sublattice indices to include in neighbor lists. More...
 
std::pair< std::string,
std::string > 
cxx () const
 Get c++ compiler. More...
 
std::pair< std::string,
std::string > 
cxxflags () const
 Get c++ compiler options. More...
 
std::pair< std::string,
std::string > 
soflags () const
 Get shared object options. More...
 
std::pair< fs::path, std::string > casm_includedir () const
 Get casm includedir. More...
 
std::pair< fs::path, std::string > casm_libdir () const
 Get casm libdir. More...
 
std::pair< fs::path, std::string > boost_includedir () const
 Get boost includedir. More...
 
std::pair< fs::path, std::string > boost_libdir () const
 Get boost libdir. More...
 
std::string compile_options () const
 Get current compilation options string. More...
 
std::string so_options () const
 Get current shared library options string. More...
 
std::string view_command () const
 Get current command used by 'casm view'. More...
 
double crystallography_tol () const
 Get current project crystallography tolerance. More...
 
double lin_alg_tol () const
 Get current project linear algebra tolerance. More...
 
EnumeratorHandlerenumerator_handler ()
 
const EnumeratorHandlerenumerator_handler () const
 
template<typename DataObject >
QueryHandler< DataObject > & query_handler ()
 
template<typename DataObject >
const QueryHandler< DataObject > & query_handler () const
 
std::string clexulator () const
 
bool new_casm_dir () const
 Create new project data directory. More...
 
bool new_symmetry_dir () const
 Create new symmetry directory. More...
 
bool new_bset_dir (std::string bset) const
 Add a basis set directory. More...
 
bool new_clex_dir (std::string clex) const
 Add a cluster expansion directory. More...
 
bool new_calc_settings_dir (std::string calctype) const
 Add calculation settings directory path. More...
 
bool new_supercell_calc_settings_dir (std::string scelname, std::string calctype) const
 Add calculation settings directory path, for supercell specific settings. More...
 
bool new_configuration_calc_settings_dir (std::string configname, std::string calctype) const
 Add calculation settings directory path, for configuration specific settings. More...
 
bool new_ref_dir (std::string calctype, std::string ref) const
 Add a ref directory. More...
 
bool new_eci_dir (std::string clex, std::string calctype, std::string ref, std::string bset, std::string eci) const
 Add an eci directory. More...
 
std::vector< std::string > & properties ()
 Access current properties. More...
 
bool set_nlist_weight_matrix (Eigen::Matrix3l M)
 Set neighbor list weight matrix (will delete existing Clexulator source and compiled code) More...
 
template<typename SublatIterator >
bool set_nlist_sublat_indices (SublatIterator begin, SublatIterator end)
 Set range of sublattice indices to include in neighbor lists (will delete existing Clexulator source and compiled code) More...
 
bool set_cxx (std::string opt)
 Set c++ compiler (empty string to use default) More...
 
bool set_cxxflags (std::string opt)
 Set c++ compiler options (empty string to use default) More...
 
bool set_soflags (std::string opt)
 Set shared object options (empty string to use default) More...
 
bool set_casm_prefix (fs::path dir)
 Set casm prefix (empty string to use default) More...
 
bool set_casm_includedir (fs::path dir)
 Set casm includedir (empty string to use default) More...
 
bool set_casm_libdir (fs::path dir)
 Set casm libdir (empty string to use default) More...
 
bool set_boost_prefix (fs::path dir)
 Set boost prefix (empty string to use default) More...
 
bool set_boost_includedir (fs::path dir)
 Set boost includedir (empty string to use default) More...
 
bool set_boost_libdir (fs::path dir)
 Set boost libdir (empty string to use default) More...
 
bool set_view_command (std::string opt)
 Set command used by 'casm view'. More...
 
bool set_crystallography_tol (double _tol)
 Set crystallography tolerance. More...
 
bool set_lin_alg_tol (double _tol)
 Set linear algebra tolerance. More...
 
void commit () const
 Save settings to project settings file. More...
 
jsonParserto_json (jsonParser &json) const
 Output as JSON. More...
 
void print_compiler_settings_summary (Log &log) const
 Print summary of compiler settings, as for 'casm settings -l'. More...
 
void print_summary (Log &log) const
 Print summary of ProjectSettings, as for 'casm settings -l'. More...
 
bool set_compile_options (std::string opt)
 (deprecated) Set compile options to 'opt' (empty string to use default) More...
 
bool set_so_options (std::string opt)
 (deprecated) Set shared library options to 'opt' (empty string to use default) More...
 
Loglog () const
 
Logdebug_log () const
 
Logerr_log () const
 

Static Public Member Functions

static Logging null ()
 

Private Member Functions

void _reset_clexulators ()
 Changing the neighbor list properties requires updating Clexulator source code. More...
 
void _load_default_options ()
 initialize default compiler options More...
 

Private Attributes

DirectoryStructure m_dir
 
std::string m_name
 
notstd::cloneable_ptr
< EnumeratorHandler
m_enumerator_handler
 
std::map< std::string,
notstd::cloneable_ptr
< notstd::Cloneable > > 
m_query_handler
 
std::map< std::string,
ClexDescription
m_clex
 
std::string m_default_clex
 
Eigen::Matrix3l m_nlist_weight_matrix
 
std::set< int > m_nlist_sublat_indices
 
std::vector< std::string > m_properties
 
std::pair< std::string,
std::string > 
m_cxx
 
std::pair< std::string,
std::string > 
m_cxxflags
 
std::pair< std::string,
std::string > 
m_soflags
 
std::pair< fs::path, std::string > m_casm_includedir
 
std::pair< fs::path, std::string > m_casm_libdir
 
std::pair< fs::path, std::string > m_boost_includedir
 
std::pair< fs::path, std::string > m_boost_libdir
 
std::string m_depr_compile_options
 
std::string m_depr_so_options
 
std::string m_view_command
 
double m_crystallography_tol
 
double m_lin_alg_tol
 

Constructor & Destructor Documentation

CASM::ProjectSettings::ProjectSettings ( )
inline

Default constructor.

Definition at line 97 of file ProjectSettings.hh.

CASM::ProjectSettings::ProjectSettings ( fs::path  root,
std::string  name,
const Logging logging = Logging() 
)
explicit

Construct CASM project settings for a new project.

Parameters
rootPath to new CASM project directory
nameName of new CASM project. Use a short title suitable for prepending to file names.

Definition at line 88 of file ProjectSettings.cc.

CASM::ProjectSettings::ProjectSettings ( fs::path  root,
const Logging logging = Logging() 
)
explicit

Construct CASM project settings from existing project.

Parameters
rootPath to existing CASM project directory. Project settings will be read.

Definition at line 116 of file ProjectSettings.cc.

Member Function Documentation

void CASM::ProjectSettings::_load_default_options ( )
private

initialize default compiler options

Definition at line 611 of file ProjectSettings.cc.

void CASM::ProjectSettings::_reset_clexulators ( )
private

Changing the neighbor list properties requires updating Clexulator source code.

Changing the neighbor list properties requires updating Clexulator source code. This will remove existing source/compiled files.

Definition at line 602 of file ProjectSettings.cc.

std::pair< fs::path, std::string > CASM::ProjectSettings::boost_includedir ( ) const

Get boost includedir.

Definition at line 365 of file ProjectSettings.cc.

std::pair< fs::path, std::string > CASM::ProjectSettings::boost_libdir ( ) const

Get boost libdir.

Definition at line 370 of file ProjectSettings.cc.

std::pair< fs::path, std::string > CASM::ProjectSettings::casm_includedir ( ) const

Get casm includedir.

Definition at line 355 of file ProjectSettings.cc.

std::pair< fs::path, std::string > CASM::ProjectSettings::casm_libdir ( ) const

Get casm libdir.

Definition at line 360 of file ProjectSettings.cc.

const ClexDescription & CASM::ProjectSettings::clex ( std::string  name) const

Definition at line 280 of file ProjectSettings.cc.

std::string CASM::ProjectSettings::clexulator ( ) const

Definition at line 419 of file ProjectSettings.cc.

const std::map< std::string, ClexDescription > & CASM::ProjectSettings::cluster_expansions ( ) const

Definition at line 272 of file ProjectSettings.cc.

void CASM::ProjectSettings::commit ( ) const

Save settings to project settings file.

Save settings to file.

re-throw exceptions

Definition at line 583 of file ProjectSettings.cc.

std::string CASM::ProjectSettings::compile_options ( ) const

Get current compilation options string.

Definition at line 375 of file ProjectSettings.cc.

double CASM::ProjectSettings::crystallography_tol ( ) const

Get current project crystallography tolerance.

Definition at line 407 of file ProjectSettings.cc.

std::pair< std::string, std::string > CASM::ProjectSettings::cxx ( ) const

Get c++ compiler.

Definition at line 340 of file ProjectSettings.cc.

std::pair< std::string, std::string > CASM::ProjectSettings::cxxflags ( ) const

Get c++ compiler options.

Definition at line 345 of file ProjectSettings.cc.

Log& CASM::Logging::debug_log ( ) const
inlineinherited

Definition at line 259 of file Log.hh.

const ClexDescription & CASM::ProjectSettings::default_clex ( ) const

Definition at line 309 of file ProjectSettings.cc.

const DirectoryStructure& CASM::ProjectSettings::dir ( ) const
inline

Definition at line 116 of file ProjectSettings.hh.

EnumeratorHandler& CASM::ProjectSettings::enumerator_handler ( )
inline

Definition at line 186 of file ProjectSettings.hh.

const EnumeratorHandler& CASM::ProjectSettings::enumerator_handler ( ) const
inline

Definition at line 193 of file ProjectSettings.hh.

bool CASM::ProjectSettings::erase_clex ( const ClexDescription desc)

Definition at line 292 of file ProjectSettings.cc.

Log& CASM::Logging::err_log ( ) const
inlineinherited

Definition at line 263 of file Log.hh.

bool CASM::ProjectSettings::has_clex ( std::string  name) const

Definition at line 276 of file ProjectSettings.cc.

double CASM::ProjectSettings::lin_alg_tol ( ) const

Get current project linear algebra tolerance.

Definition at line 412 of file ProjectSettings.cc.

Log& CASM::Logging::log ( ) const
inlineinherited

Definition at line 255 of file Log.hh.

std::string CASM::ProjectSettings::name ( ) const

Get project name.

Definition at line 262 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_bset_dir ( std::string  bset) const

Add a basis set directory.

Definition at line 437 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_calc_settings_dir ( std::string  calctype) const

Add calculation settings directory path.

Definition at line 448 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_casm_dir ( ) const

Create new project data directory.

Definition at line 427 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_clex ( const ClexDescription desc)

Definition at line 284 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_clex_dir ( std::string  clex) const

Add a cluster expansion directory.

Definition at line 442 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_configuration_calc_settings_dir ( std::string  configname,
std::string  calctype 
) const

Add calculation settings directory path, for configuration specific settings.

Definition at line 458 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_eci_dir ( std::string  clex,
std::string  calctype,
std::string  ref,
std::string  bset,
std::string  eci 
) const

Add an eci directory.

Definition at line 469 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_ref_dir ( std::string  calctype,
std::string  ref 
) const

Add a ref directory.

Definition at line 464 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_supercell_calc_settings_dir ( std::string  scelname,
std::string  calctype 
) const

Add calculation settings directory path, for supercell specific settings.

Definition at line 453 of file ProjectSettings.cc.

bool CASM::ProjectSettings::new_symmetry_dir ( ) const

Create new symmetry directory.

Definition at line 432 of file ProjectSettings.cc.

const std::set< int > & CASM::ProjectSettings::nlist_sublat_indices ( ) const

Get set of sublattice indices to include in neighbor lists.

Definition at line 335 of file ProjectSettings.cc.

Eigen::Matrix3l CASM::ProjectSettings::nlist_weight_matrix ( ) const

Get neighbor list weight matrix.

Definition at line 330 of file ProjectSettings.cc.

static Logging CASM::Logging::null ( )
inlinestaticinherited

Definition at line 267 of file Log.hh.

void CASM::ProjectSettings::print_compiler_settings_summary ( Log log) const

Print summary of compiler settings, as for 'casm settings -l'.

Definition at line 669 of file ProjectSettings.cc.

void CASM::ProjectSettings::print_summary ( Log log) const

Print summary of ProjectSettings, as for 'casm settings -l'.

Definition at line 698 of file ProjectSettings.cc.

const std::vector< std::string > & CASM::ProjectSettings::properties ( ) const

Get current properties.

const Access current properties

Definition at line 477 of file ProjectSettings.cc.

std::vector< std::string > & CASM::ProjectSettings::properties ( )

Access current properties.

Definition at line 267 of file ProjectSettings.cc.

template<typename DataObject >
QueryHandler<DataObject>& CASM::ProjectSettings::query_handler ( )
inline

Definition at line 200 of file ProjectSettings.hh.

template<typename DataObject >
const QueryHandler<DataObject>& CASM::ProjectSettings::query_handler ( ) const
inline

Definition at line 214 of file ProjectSettings.hh.

bool CASM::ProjectSettings::set_boost_includedir ( fs::path  dir)

Set boost includedir (empty string to use default)

Definition at line 540 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_boost_libdir ( fs::path  dir)

Set boost libdir (empty string to use default)

Definition at line 546 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_boost_prefix ( fs::path  dir)

Set boost prefix (empty string to use default)

Definition at line 533 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_casm_includedir ( fs::path  dir)

Set casm includedir (empty string to use default)

Definition at line 521 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_casm_libdir ( fs::path  dir)

Set casm libdir (empty string to use default)

Definition at line 527 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_casm_prefix ( fs::path  dir)

Set casm prefix (empty string to use default)

Definition at line 514 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_compile_options ( std::string  opt)

(deprecated) Set compile options to 'opt' (empty string to use default)

Definition at line 552 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_crystallography_tol ( double  _tol)

Set crystallography tolerance.

Definition at line 571 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_cxx ( std::string  opt)

Set c++ compiler (empty string to use default)

Definition at line 496 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_cxxflags ( std::string  opt)

Set c++ compiler options (empty string to use default)

Definition at line 502 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_default_clex ( const std::string &  clex_name)

Definition at line 313 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_default_clex ( const ClexDescription desc)

Will overwrite existing ClexDescription with same name.

Definition at line 322 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_lin_alg_tol ( double  _tol)

Set linear algebra tolerance.

Definition at line 577 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_nlist_weight_matrix ( Eigen::Matrix3l  M)

Set neighbor list weight matrix (will delete existing Clexulator source and compiled code)

Definition at line 484 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_so_options ( std::string  opt)

(deprecated) Set shared library options to 'opt' (empty string to use default)

Definition at line 558 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_soflags ( std::string  opt)

Set shared object options (empty string to use default)

Definition at line 508 of file ProjectSettings.cc.

bool CASM::ProjectSettings::set_view_command ( std::string  opt)

Set command used by 'casm view'.

Definition at line 565 of file ProjectSettings.cc.

std::string CASM::ProjectSettings::so_options ( ) const

Get current shared library options string.

Definition at line 388 of file ProjectSettings.cc.

std::pair< std::string, std::string > CASM::ProjectSettings::soflags ( ) const

Get shared object options.

Definition at line 350 of file ProjectSettings.cc.

jsonParser & CASM::ProjectSettings::to_json ( jsonParser json) const

Output as JSON.

Definition at line 621 of file ProjectSettings.cc.

std::string CASM::ProjectSettings::view_command ( ) const

Get current command used by 'casm view'.

Definition at line 402 of file ProjectSettings.cc.

Member Data Documentation

std::pair<fs::path, std::string> CASM::ProjectSettings::m_boost_includedir
private

Definition at line 370 of file ProjectSettings.hh.

std::pair<fs::path, std::string> CASM::ProjectSettings::m_boost_libdir
private

Definition at line 371 of file ProjectSettings.hh.

std::pair<fs::path, std::string> CASM::ProjectSettings::m_casm_includedir
private

Definition at line 368 of file ProjectSettings.hh.

std::pair<fs::path, std::string> CASM::ProjectSettings::m_casm_libdir
private

Definition at line 369 of file ProjectSettings.hh.

std::map<std::string, ClexDescription> CASM::ProjectSettings::m_clex
private

Definition at line 352 of file ProjectSettings.hh.

double CASM::ProjectSettings::m_crystallography_tol
private

Definition at line 382 of file ProjectSettings.hh.

std::pair<std::string, std::string> CASM::ProjectSettings::m_cxx
private

Definition at line 365 of file ProjectSettings.hh.

std::pair<std::string, std::string> CASM::ProjectSettings::m_cxxflags
private

Definition at line 366 of file ProjectSettings.hh.

std::string CASM::ProjectSettings::m_default_clex
private

Definition at line 355 of file ProjectSettings.hh.

std::string CASM::ProjectSettings::m_depr_compile_options
private

Definition at line 374 of file ProjectSettings.hh.

std::string CASM::ProjectSettings::m_depr_so_options
private

Definition at line 376 of file ProjectSettings.hh.

DirectoryStructure CASM::ProjectSettings::m_dir
private

Definition at line 342 of file ProjectSettings.hh.

notstd::cloneable_ptr<EnumeratorHandler> CASM::ProjectSettings::m_enumerator_handler
private

Definition at line 346 of file ProjectSettings.hh.

double CASM::ProjectSettings::m_lin_alg_tol
private

Definition at line 385 of file ProjectSettings.hh.

std::string CASM::ProjectSettings::m_name
private

Definition at line 344 of file ProjectSettings.hh.

std::set<int> CASM::ProjectSettings::m_nlist_sublat_indices
private

Definition at line 359 of file ProjectSettings.hh.

Eigen::Matrix3l CASM::ProjectSettings::m_nlist_weight_matrix
private

Definition at line 358 of file ProjectSettings.hh.

std::vector<std::string> CASM::ProjectSettings::m_properties
private

Definition at line 362 of file ProjectSettings.hh.

std::map<std::string, notstd::cloneable_ptr<notstd::Cloneable> > CASM::ProjectSettings::m_query_handler
private

Definition at line 347 of file ProjectSettings.hh.

std::pair<std::string, std::string> CASM::ProjectSettings::m_soflags
private

Definition at line 367 of file ProjectSettings.hh.

std::string CASM::ProjectSettings::m_view_command
private

Definition at line 379 of file ProjectSettings.hh.


The documentation for this class was generated from the following files: