CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB Namespace Reference

Namespaces

 ConfigIO
 

Classes

class  Selection
 
struct  ConstructImpl
 
class  InterfaceData
 
class  Database
 
class  Selected
 Returns true if configuration is specified in given selection (default: MASTER) More...
 
class  ValDatabase
 Generic interface for database of a particular CASM type. More...
 
class  Remove< Supercell >
 
class  DatabaseIterator
 Wrapper class for specializations DatabaseIteratorBase. More...
 
class  Cache
 Store data in JSON. More...
 
struct  TypeTag
 
class  ConfigData
 
class  StructureMap
 
class  Database< Configuration >
 
class  StructureMap< Configuration >
 
class  Import< Configuration >
 Configuration-specialized Import. More...
 
class  Update< Configuration >
 Configuration-specialized Import. More...
 
class  DatabaseBase
 Fully generic database interface for use by DatabaseHandler. More...
 
class  DatabaseIteratorBase
 
class  DatabaseHandler
 Provides access to all databases. More...
 
class  DatabaseNameIterator
 DatabaseIterator for implementations using std::map<std::string, ObjIterator> More...
 
class  DatabaseSetIterator
 DatabaseIterator for implementations using std::set<ValueType> More...
 
struct  ImportSettings
 Struct with optional parameters for Config/Data Import Specifies default parameters for all values, in order to simplify parsing from JSON. More...
 
class  ImportT
 Generic ConfigType-dependent part of Import. More...
 
class  Import
 
class  jsonDatabase
 
struct  jsonDB
 
class  jsonDatabase< Supercell >
 
class  jsonDatabase< Configuration >
 
class  jsonPropertiesDatabaseIterator
 
class  jsonPropertiesDatabase
 An implementation of PropertiesDatabase for reading/writing JSON. More...
 
class  Named
 
class  Indexed
 
class  PropertiesDatabaseIteratorBase
 
class  PropertiesDatabaseIterator
 Wrapper class for specializations PropertiesDatabaseIteratorBase. More...
 
class  PropertiesDatabase
 
class  RemoveT
 Generic ConfigType-dependent part of Remove. More...
 
class  Remove
 
class  Database< Supercell >
 
class  SelectionIterator
 
class  UpdateT
 Generic ConfigType-dependent part of Import. More...
 
class  Update
 
struct  EraseScelConfigsBase
 Helper struct base class. More...
 
struct  EraseScelConfigs
 
struct  EraseDataScelConfigs
 
struct  EraseAllScelConfigs
 

Typedefs

typedef std::tuple< BOOST_PP_SEQ_ENUM(CASM_DB_TYPES)> DataObjectTypeTuple
 
typedef std::tuple< BOOST_PP_SEQ_ENUM(CASM_DB_CONFIG_TYPES)> ConfigTypeTuple
 
template<typename T >
using IfConfigType = std::enable_if< CASM_TMP::has_type< T, ConfigTypeTuple >::value, T >
 
template<typename T >
using IfNotConfigType = std::enable_if<!CASM_TMP::has_type< T, ConfigTypeTuple >::value, T >
 

Enumerations

enum class  SELECTION_TYPE {
  MASTER , ALL , NONE , EMPTY ,
  CALCULATED
}
 

Functions

std::string create_report_dir (std::string report_dir)
 Create a new report directory to avoid overwriting existing results. More...
 
Configuration in_canonical_supercell (Configuration const &configuration, Database< Supercell > &supercell_db)
 Returns the canonical form Configuration in the canonical Supercell. More...
 
ConfigInsertResult make_canonical_and_insert (Configuration const &configuration, Database< Supercell > &supercell_db, Database< Configuration > &configuration_db, bool primitive_only)
 Insert this configuration (in primitive & canonical form) in the database. More...
 
template<typename EnumeratorType >
ConfigInsertResult make_canonical_and_insert (EnumeratorType const &enumerator, Configuration const &configuration, Database< Supercell > &supercell_db, Database< Configuration > &configuration_db, bool primitive_only)
 Insert this configuration (in primitive & canonical form) in the database. More...
 
template<typename F >
void for_each_type (F f)
 
template<typename F >
void for_type (std::string name, F f)
 
template<typename F >
void for_type_short (std::string short_name, F f)
 
const std::set< std::string > & types ()
 std::set of all QueryTraits<DataObject>::name More...
 
const std::set< std::string > & types_short ()
 std::set of all QueryTraits<DataObject>::short_name More...
 
template<typename F >
void for_each_config_type (F f)
 
template<typename F >
void for_config_type (std::string name, F f)
 
template<typename F >
void for_config_type_short (std::string short_name, F f)
 
const std::set< std::string > & config_types ()
 std::set of all QueryTraits<ConfigType>::name More...
 
const std::set< std::string > & config_types_short ()
 std::set of all QueryTraits<ConfigType>::short_name More...
 
Index config_count (std::string scelname, const PrimClex &primclex)
 Total number of configs of all types in a supercell. More...
 
Index config_count (std::string configtype, std::string scelname, const PrimClex &primclex)
 Total number of configs of a specific type in a supercell. More...
 
Index config_calculated_count (std::string scelname, const PrimClex &primclex)
 Total number of calculated configs of all types in a supercell. More...
 
Index config_calculated_count (std::string configtype, std::string scelname, const PrimClex &primclex)
 Total number of calculated configs of a specific type in a supercell. More...
 
Index config_data_count (std::string scelname, const PrimClex &primclex)
 Total number of configs w/ data or files of all types in a supercell. More...
 
Index config_data_count (std::string configtype, std::string scelname, const PrimClex &primclex)
 Total number of configs w/ data or files of a specific type in a supercell. More...
 
template<typename OutputIterator >
std::pair< OutputIterator, int > construct_pos_paths (const PrimClex &primclex, const Completer::ImportOption &import_opt, OutputIterator result)
 Construct pos_paths from input args –pos && –batch. More...
 
jsonParserto_json (ImportSettings const &_set, jsonParser &_json)
 
jsonParser const & from_json (ImportSettings &_set, jsonParser const &_json)
 
template<typename DataObject >
DB::Selection< DataObject > make_selection (DB::Database< DataObject > &db, const jsonParser &kwargs, std::string name_key, std::string sel_key, OnError on_error=OnError::THROW)
 Make a DB::Selection from JSON input. More...
 
template<typename DataObject >
Selection< DataObject > make_selection (Database< DataObject > &db, const jsonParser &kwargs, std::string name_key, std::string sel_key, OnError on_error)
 Make a Selection from JSON input. More...
 
Supercell const & canonical_supercell (Supercell const &supercell, Database< Supercell > &supercell_db)
 
std::pair< Database< Supercell >::iterator, bool > make_canonical_and_insert (std::shared_ptr< Structure const > const &shared_prim, Lattice const &super_lattice, Database< Supercell > &supercell_db)
 Make canonical supercell and insert into supercell database. More...
 
std::pair< Database< Supercell >::iterator, bool > make_canonical_and_insert (std::shared_ptr< Structure const > const &shared_prim, Eigen::Matrix3l const &transformation_matrix_to_super, Database< Supercell > &supercell_db)
 Make canonical supercell and insert into supercell database. More...
 
std::pair< Database< Supercell >::iterator, bool > make_canonical_and_insert (Supercell const &supercell, Database< Supercell > &supercell_db)
 Make canonical supercell and insert into supercell database. More...
 
template<typename EnumeratorType >
std::pair< Database< Supercell >::iterator, bool > make_canonical_and_insert (EnumeratorType const &enumerator, Supercell const &supercell, Database< Supercell > &supercell_db)
 
template std::pair< vector_path_back_inserter, int > construct_pos_paths< vector_path_back_inserter > (const PrimClex &primclex, const Completer::ImportOption &import_opt, vector_path_back_inserter result)
 
template std::pair< set_path_inserter, int > construct_pos_paths< set_path_inserter > (const PrimClex &primclex, const Completer::ImportOption &import_opt, set_path_inserter result)
 

Typedef Documentation

◆ ConfigTypeTuple

typedef std::tuple<BOOST_PP_SEQ_ENUM(CASM_DB_CONFIG_TYPES)> CASM::DB::ConfigTypeTuple

Definition at line 35 of file DatabaseTypes.hh.

◆ DataObjectTypeTuple

typedef std::tuple<BOOST_PP_SEQ_ENUM(CASM_DB_TYPES)> CASM::DB::DataObjectTypeTuple

Definition at line 31 of file DatabaseTypes.hh.

◆ IfConfigType

template<typename T >
using CASM::DB::IfConfigType = typedef std::enable_if<CASM_TMP::has_type<T, ConfigTypeTuple>::value, T>

Definition at line 40 of file DatabaseTypes.hh.

◆ IfNotConfigType

template<typename T >
using CASM::DB::IfNotConfigType = typedef std::enable_if<!CASM_TMP::has_type<T, ConfigTypeTuple>::value, T>

Definition at line 44 of file DatabaseTypes.hh.

Enumeration Type Documentation

◆ SELECTION_TYPE

Enumerator
MASTER 
ALL 
NONE 
EMPTY 
CALCULATED 

Definition at line 16 of file Selection.hh.

Function Documentation

◆ canonical_supercell()

Supercell const & CASM::DB::canonical_supercell ( Supercell const &  supercell,
Database< Supercell > &  supercell_db 
)

Return const reference to canonical equivalent supercell in the supercell database

Return const reference to canonical equivalent supercell in the supercell database

Note:

  • Will insert the canonical supercell into "supercell_db"
  • The resulting Supercell may not have a PrimClex const* (this is preferred if possible)

Definition at line 58 of file ScelDatabaseTools.cc.

◆ config_calculated_count() [1/2]

Index CASM::DB::config_calculated_count ( std::string  configtype,
std::string  scelname,
const PrimClex primclex 
)

Total number of calculated configs of a specific type in a supercell.

Definition at line 141 of file DatabaseTypes.cc.

◆ config_calculated_count() [2/2]

Index CASM::DB::config_calculated_count ( std::string  scelname,
const PrimClex primclex 
)

Total number of calculated configs of all types in a supercell.

Definition at line 132 of file DatabaseTypes.cc.

◆ config_count() [1/2]

Index CASM::DB::config_count ( std::string  configtype,
std::string  scelname,
const PrimClex primclex 
)

Total number of configs of a specific type in a supercell.

Definition at line 122 of file DatabaseTypes.cc.

◆ config_count() [2/2]

Index CASM::DB::config_count ( std::string  scelname,
const PrimClex primclex 
)

Total number of configs of all types in a supercell.

Definition at line 113 of file DatabaseTypes.cc.

◆ config_data_count() [1/2]

Index CASM::DB::config_data_count ( std::string  configtype,
std::string  scelname,
const PrimClex primclex 
)

Total number of configs w/ data or files of a specific type in a supercell.

Definition at line 160 of file DatabaseTypes.cc.

◆ config_data_count() [2/2]

Index CASM::DB::config_data_count ( std::string  scelname,
const PrimClex primclex 
)

Total number of configs w/ data or files of all types in a supercell.

Definition at line 151 of file DatabaseTypes.cc.

◆ config_types()

const std::set< std::string > & CASM::DB::config_types ( )

std::set of all QueryTraits<ConfigType>::name

Definition at line 96 of file DatabaseTypes.cc.

◆ config_types_short()

const std::set< std::string > & CASM::DB::config_types_short ( )

std::set of all QueryTraits<ConfigType>::short_name

Definition at line 104 of file DatabaseTypes.cc.

◆ construct_pos_paths()

template<typename OutputIterator >
std::pair< OutputIterator, int > CASM::DB::construct_pos_paths ( const PrimClex primclex,
const Completer::ImportOption import_opt,
OutputIterator  result 
)

Construct pos_paths from input args –pos && –batch.

Construct pos_paths from input args

Returns
pair of OutputIterator, returncode

Definition at line 22 of file Import_impl.hh.

◆ construct_pos_paths< set_path_inserter >()

template std::pair<set_path_inserter, int> CASM::DB::construct_pos_paths< set_path_inserter > ( const PrimClex primclex,
const Completer::ImportOption import_opt,
set_path_inserter  result 
)

◆ construct_pos_paths< vector_path_back_inserter >()

template std::pair<vector_path_back_inserter, int> CASM::DB::construct_pos_paths< vector_path_back_inserter > ( const PrimClex primclex,
const Completer::ImportOption import_opt,
vector_path_back_inserter  result 
)

◆ create_report_dir()

std::string CASM::DB::create_report_dir ( std::string  report_dir)

Create a new report directory to avoid overwriting existing results.

Definition at line 58 of file ConfigData.cc.

◆ for_config_type()

template<typename F >
void CASM::DB::for_config_type ( std::string  name,
f 
)

Definition at line 76 of file DatabaseTypes.hh.

◆ for_config_type_short()

template<typename F >
void CASM::DB::for_config_type_short ( std::string  short_name,
f 
)

Definition at line 81 of file DatabaseTypes.hh.

◆ for_each_config_type()

template<typename F >
void CASM::DB::for_each_config_type ( f)

Definition at line 71 of file DatabaseTypes.hh.

◆ for_each_type()

template<typename F >
void CASM::DB::for_each_type ( f)

Definition at line 50 of file DatabaseTypes.hh.

◆ for_type()

template<typename F >
void CASM::DB::for_type ( std::string  name,
f 
)

Definition at line 55 of file DatabaseTypes.hh.

◆ for_type_short()

template<typename F >
void CASM::DB::for_type_short ( std::string  short_name,
f 
)

Definition at line 60 of file DatabaseTypes.hh.

◆ from_json()

jsonParser const & CASM::DB::from_json ( ImportSettings _set,
jsonParser const &  _json 
)

Definition at line 18 of file Import.cc.

◆ in_canonical_supercell()

Configuration CASM::DB::in_canonical_supercell ( Configuration const &  configuration,
Database< Supercell > &  supercell_db 
)

Returns the canonical form Configuration in the canonical Supercell.

Returns the canonical form Configuration in the canonical Supercell

Note:

  • The canonical Supercell will be inserted in the "supercell_db"
  • The canonical Supercell will not have a PrimClex const* (this is preferred if possible)

Definition at line 95 of file ConfigDatabaseTools.cc.

◆ make_canonical_and_insert() [1/6]

ConfigInsertResult CASM::DB::make_canonical_and_insert ( Configuration const &  configuration,
Database< Supercell > &  supercell_db,
Database< Configuration > &  configuration_db,
bool  primitive_only 
)

Insert this configuration (in primitive & canonical form) in the database.

Insert this configuration (in primitive & canonical form) in the database

Parameters
primitive_onlyIf true, only the primitive Configuration is inserted.

Note:

  • By convention, the primitive canonical form of a configuration must always be saved in the config list.
  • Supercells are inserted in the Supercell database as necessary
  • If "configuration" is already known to be primitive & canonical, can use configuration_db.insert(configuration) directly.
  • The canonical Supercell will not have a PrimClex const* (this is preferred if possible)

Definition at line 120 of file ConfigDatabaseTools.cc.

◆ make_canonical_and_insert() [2/6]

template<typename EnumeratorType >
ConfigInsertResult CASM::DB::make_canonical_and_insert ( EnumeratorType const &  enumerator,
Configuration const &  configuration,
Database< Supercell > &  supercell_db,
Database< Configuration > &  configuration_db,
bool  primitive_only 
)

Insert this configuration (in primitive & canonical form) in the database.

Insert this configuration (in primitive & canonical form) in the database

  • This version checks is_guaranteed_for_database_insert(enumerator) and either inserts directly or makes canonical and then inserts

Definition at line 18 of file ConfigDatabaseTools_impl.hh.

◆ make_canonical_and_insert() [3/6]

template<typename EnumeratorType >
std::pair< Database< Supercell >::iterator, bool > CASM::DB::make_canonical_and_insert ( EnumeratorType const &  enumerator,
Supercell const &  supercell,
Database< Supercell > &  supercell_db 
)

Make canonical supercell and insert into supercell database

  • This version checks is_guaranteed_for_database_insert(enumerator) and either inserts directly or makes canonical and then inserts

Definition at line 16 of file ScelDatabaseTools_impl.hh.

◆ make_canonical_and_insert() [4/6]

std::pair< Database< Supercell >::iterator, bool > CASM::DB::make_canonical_and_insert ( std::shared_ptr< Structure const > const &  shared_prim,
Eigen::Matrix3l const &  transformation_matrix_to_super,
Database< Supercell > &  supercell_db 
)

Make canonical supercell and insert into supercell database.

Definition at line 78 of file ScelDatabaseTools.cc.

◆ make_canonical_and_insert() [5/6]

std::pair< Database< Supercell >::iterator, bool > CASM::DB::make_canonical_and_insert ( std::shared_ptr< Structure const > const &  shared_prim,
Lattice const &  super_lattice,
Database< Supercell > &  supercell_db 
)

Make canonical supercell and insert into supercell database.

Definition at line 67 of file ScelDatabaseTools.cc.

◆ make_canonical_and_insert() [6/6]

std::pair< Database< Supercell >::iterator, bool > CASM::DB::make_canonical_and_insert ( Supercell const &  supercell,
Database< Supercell > &  supercell_db 
)

Make canonical supercell and insert into supercell database.

Definition at line 88 of file ScelDatabaseTools.cc.

◆ make_selection() [1/2]

template<typename DataObject >
Selection<DataObject> CASM::DB::make_selection ( Database< DataObject > &  db,
const jsonParser kwargs,
std::string  name_key,
std::string  sel_key,
OnError  on_error 
)

Make a Selection from JSON input.

Make a DB::Selection from JSON input.

Parameters
dbThe database to generate the selection from
kwargsjsonParser with JSON input
name_keyRead object names from kwargs[name_key]. Expects array of string.
sel_keyRead selection name for kwargs[sel_key]. Expect string.
on_errorIndicates how to handle names that do not exist in database. OnError::WARN is not allowed and treated as OnError::THROW.

Notes:

  • Reads selection from 'sel_key' first, using "NONE" if 'sel_key' does not exist. Then reads names from 'name_key' array and adds them to the selection.
  • If 'name_key' and 'sel_key' do not exist return "NONE" selection.

Definition at line 30 of file json_io_impl.hh.

◆ make_selection() [2/2]

template<typename DataObject >
DB::Selection<DataObject> CASM::DB::make_selection ( Database< DataObject > &  db,
const jsonParser kwargs,
std::string  name_key,
std::string  sel_key,
OnError  on_error 
)

Make a DB::Selection from JSON input.

Make a DB::Selection from JSON input.

Parameters
dbThe database to generate the selection from
kwargsjsonParser with JSON input
name_keyRead object names from kwargs[name_key]. Expects array of string.
sel_keyRead selection name for kwargs[sel_key]. Expect string.
on_errorIndicates how to handle names that do not exist in database. OnError::WARN is not allowed and treated as OnError::THROW.

Notes:

  • Reads selection from 'sel_key' first, using "NONE" if 'sel_key' does not exist. Then reads names from 'name_key' array and adds them to the selection.
  • If 'name_key' and 'sel_key' do not exist return "NONE" selection.

Definition at line 30 of file json_io_impl.hh.

◆ to_json()

jsonParser & CASM::DB::to_json ( ImportSettings const &  _set,
jsonParser _json 
)

Definition at line 10 of file Import.cc.

◆ types()

const std::set< std::string > & CASM::DB::types ( )

std::set of all QueryTraits<DataObject>::name

Definition at line 80 of file DatabaseTypes.cc.

◆ types_short()

const std::set< std::string > & CASM::DB::types_short ( )

std::set of all QueryTraits<DataObject>::short_name

Definition at line 88 of file DatabaseTypes.cc.