CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ScelDatabaseTools_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_ScelDatabaseTools_impl
2 #define CASM_ScelDatabaseTools_impl
3 
5 
6 namespace CASM {
7 
8 namespace DB {
9 
15 template <typename EnumeratorType>
16 std::pair<Database<Supercell>::iterator, bool> make_canonical_and_insert(
17  EnumeratorType const &enumerator, Supercell const &supercell,
18  Database<Supercell> &supercell_db) {
19  if (is_guaranteed_for_database_insert(enumerator)) {
20  return supercell_db.insert(supercell);
21  } else {
22  return make_canonical_and_insert(supercell.shared_prim(),
23  supercell.lattice(), supercell_db);
24  }
25 }
26 } // namespace DB
27 } // namespace CASM
28 
29 #endif
std::pair< iterator, bool > insert(const Supercell &obj) override
Definition: ScelDatabase.cc:18
Represents a supercell of the primitive parent crystal structure.
Definition: Supercell.hh:51
const Lattice & lattice() const
The super lattice.
Definition: Supercell.cc:239
std::shared_ptr< Structure const > const & shared_prim() const
Definition: Supercell.cc:115
bool is_guaranteed_for_database_insert(ConfigEnumAllOccupations const &enumerator)
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.
Main CASM namespace.
Definition: APICommand.hh:8