-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial attempt to enforce unit cell molecules to have fractional cen…
…troids in the gamma point for occ cg
- Loading branch information
1 parent
ea50fe0
commit 10c12dd
Showing
5 changed files
with
119 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
#include <occ/io/load_geometry.h> | ||
#include <occ/io/cifparser.h> | ||
#include <occ/io/dftb_gen.h> | ||
#include <occ/io/load_geometry.h> | ||
#include <occ/io/xyz.h> | ||
#include <occ/io/cifparser.h> | ||
|
||
namespace occ::io { | ||
|
||
occ::crystal::Crystal load_crystal(const std::string &filename) { | ||
if(CifParser::is_likely_cif_filename(filename)) { | ||
occ::io::CifParser parser; | ||
return parser.parse_crystal(filename).value(); | ||
} | ||
else if(DftbGenFormat::is_likely_gen_filename(filename)) { | ||
DftbGenFormat parser; | ||
parser.parse(filename); | ||
return parser.crystal().value(); | ||
} | ||
else throw std::runtime_error( | ||
fmt::format("Unknown filetype when reading crystal from '{}'", filename) | ||
); | ||
if (CifParser::is_likely_cif_filename(filename)) { | ||
occ::io::CifParser parser; | ||
return parser.parse_crystal(filename).value(); | ||
} else if (DftbGenFormat::is_likely_gen_filename(filename)) { | ||
DftbGenFormat parser; | ||
parser.parse(filename); | ||
return parser.crystal().value(); | ||
} else | ||
throw std::runtime_error(fmt::format( | ||
"Unknown filetype when reading crystal from '{}'", filename)); | ||
} | ||
|
||
occ::core::Molecule load_molecule(const std::string &filename) { | ||
if(XyzFileReader::is_likely_xyz_filename(filename)) { | ||
return molecule_from_xyz_file(filename); | ||
} | ||
else if(DftbGenFormat::is_likely_gen_filename(filename)) { | ||
DftbGenFormat parser; | ||
parser.parse(filename); | ||
return parser.molecule().value(); | ||
} | ||
else throw std::runtime_error( | ||
fmt::format("Unknown filetype when reading molecule from '{}'", filename) | ||
); | ||
|
||
if (XyzFileReader::is_likely_xyz_filename(filename)) { | ||
return molecule_from_xyz_file(filename); | ||
} else if (DftbGenFormat::is_likely_gen_filename(filename)) { | ||
DftbGenFormat parser; | ||
parser.parse(filename); | ||
return parser.molecule().value(); | ||
} else | ||
throw std::runtime_error(fmt::format( | ||
"Unknown filetype when reading molecule from '{}'", filename)); | ||
} | ||
|
||
} | ||
} // namespace occ::io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters