diff --git a/LatticeDehomogenization/src/ErrorCodes.h b/LatticeDehomogenization/src/ErrorCodes.h index cb9c6385cd54e41cc7537721d02f2136434f0dfd..04674e10aa47bebd219f58553eec8f793ea63351 100644 --- a/LatticeDehomogenization/src/ErrorCodes.h +++ b/LatticeDehomogenization/src/ErrorCodes.h @@ -10,6 +10,7 @@ enum ErrorCodes { FileNotFound, DirectoryNotFound, InvalidExtension, CellSizeNotDefined, StrutRadiusNotDefined, + UnrecognisedUnitCell, CantDetermineLatticeType, LatticeTypeNotDefined, InvalidArgument, diff --git a/LatticeDehomogenization/src/unitcells/UnitCellTypes.h b/LatticeDehomogenization/src/unitcells/UnitCellTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..85a13043df5b66aa03609a3f6308d35b4d0339d3 --- /dev/null +++ b/LatticeDehomogenization/src/unitcells/UnitCellTypes.h @@ -0,0 +1,34 @@ +#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); + } +}