Skip to content
Snippets Groups Projects
Commit bbc46c69 authored by samuel.hayden's avatar samuel.hayden
Browse files

Added header to for all supported unit cells.

Also adds functionality to determine the cell type from a string and check if it is supported
parent 76f8e77a
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ enum ErrorCodes {
FileNotFound, DirectoryNotFound, InvalidExtension,
CellSizeNotDefined, StrutRadiusNotDefined,
UnrecognisedUnitCell,
CantDetermineLatticeType, LatticeTypeNotDefined,
InvalidArgument,
......
#pragma once
#include <unordered_map>
#include "UnitCellBCC.h"
#include "UnitCellF2CCZ.h"
enum UnitCells
{
BCC = 0,
F2CCZ,
};
namespace SupportedCells
{
typedef std::unordered_map<std::string, UnitCells> SupportedCellsMap;
static const SupportedCellsMap s_cellMap = {
{ "bcc", BCC },
{ "f2ccz", F2CCZ },
{ "f2cc,z", F2CCZ },
};
inline const bool isSupportedCell(const std::string& cellstr)
{
if (s_cellMap.find(cellstr) == s_cellMap.end())
return false;
return true;
}
inline const UnitCells getCellType(const std::string & cellstr)
{
return s_cellMap.at(cellstr);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment