diff --git a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp index 8d6cf217f93306e8a0f2810009679c4e62f94ca4..d265aa9d56a750cae246b04e4ecc8936feb5d138 100644 --- a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp +++ b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp @@ -28,7 +28,7 @@ using namespace Kernel; /// Constructor PawleyParameterFunction::PawleyParameterFunction() - : ParamFunction(), m_crystalSystem(PointGroup::Triclinic), + : ParamFunction(), m_crystalSystem(PointGroup::CrystalSystem::Triclinic), m_profileFunctionCenterParameterName() {} /** @@ -59,28 +59,28 @@ PointGroup::CrystalSystem PawleyParameterFunction::getCrystalSystem() const { /// Returns a UnitCell object constructed from the function's parameters. UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { switch (m_crystalSystem) { - case PointGroup::Cubic: { + case PointGroup::CrystalSystem::Cubic: { double a = getParameter("a"); double aErr = getError(0); UnitCell uc(a, a, a); uc.setError(aErr, aErr, aErr, 0.0, 0.0, 0.0); return uc; } - case PointGroup::Tetragonal: { + case PointGroup::CrystalSystem::Tetragonal: { double a = getParameter("a"); double aErr = getError(0); UnitCell uc(a, a, getParameter("c")); uc.setError(aErr, aErr, getError(1), 0.0, 0.0, 0.0); return uc; } - case PointGroup::Hexagonal: { + case PointGroup::CrystalSystem::Hexagonal: { double a = getParameter("a"); double aErr = getError(0); UnitCell uc(a, a, getParameter("c"), 90, 90, 120); uc.setError(aErr, aErr, getError(1), 0.0, 0.0, 0.0); return uc; } - case PointGroup::Trigonal: { + case PointGroup::CrystalSystem::Trigonal: { double a = getParameter("a"); double alpha = getParameter("Alpha"); double aErr = getError(0); @@ -89,18 +89,18 @@ UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { uc.setError(aErr, aErr, aErr, alphaErr, alphaErr, alphaErr); return uc; } - case PointGroup::Orthorhombic: { + case PointGroup::CrystalSystem::Orthorhombic: { UnitCell uc(getParameter("a"), getParameter("b"), getParameter("c")); uc.setError(getError(0), getError(1), getError(2), 0.0, 0.0, 0.0); return uc; } - case PointGroup::Monoclinic: { + case PointGroup::CrystalSystem::Monoclinic: { UnitCell uc(getParameter("a"), getParameter("b"), getParameter("c"), 90, getParameter("Beta"), 90); uc.setError(getError(0), getError(1), getError(2), 0.0, getError(3), 0.0); return uc; } - case PointGroup::Triclinic: { + case PointGroup::CrystalSystem::Triclinic: { UnitCell uc(getParameter("a"), getParameter("b"), getParameter("c"), getParameter("Alpha"), getParameter("Beta"), getParameter("Gamma")); @@ -217,20 +217,20 @@ void PawleyParameterFunction::createCrystalSystemParameters( clearAllParameters(); switch (crystalSystem) { - case PointGroup::Cubic: + case PointGroup::CrystalSystem::Cubic: declareParameter("a", 1.0); addLengthConstraint("a"); break; - case PointGroup::Hexagonal: - case PointGroup::Tetragonal: + case PointGroup::CrystalSystem::Hexagonal: + case PointGroup::CrystalSystem::Tetragonal: declareParameter("a", 1.0); declareParameter("c", 1.0); addLengthConstraint("a"); addLengthConstraint("c"); break; - case PointGroup::Orthorhombic: + case PointGroup::CrystalSystem::Orthorhombic: declareParameter("a", 1.0); declareParameter("b", 1.0); declareParameter("c", 1.0); @@ -239,7 +239,7 @@ void PawleyParameterFunction::createCrystalSystemParameters( addLengthConstraint("c"); break; - case PointGroup::Monoclinic: + case PointGroup::CrystalSystem::Monoclinic: declareParameter("a", 1.0); declareParameter("b", 1.0); declareParameter("c", 1.0); @@ -251,7 +251,7 @@ void PawleyParameterFunction::createCrystalSystemParameters( addAngleConstraint("Beta"); break; - case PointGroup::Trigonal: + case PointGroup::CrystalSystem::Trigonal: declareParameter("a", 1.0); declareParameter("Alpha", 90.0); addLengthConstraint("a"); diff --git a/Framework/CurveFitting/test/Functions/PawleyFunctionTest.h b/Framework/CurveFitting/test/Functions/PawleyFunctionTest.h index f746d52c86d2c82aa215978eafe8cb2ea0257b04..2c6b1f8a1c9de561e6fed97a589c7152d9af2f99 100644 --- a/Framework/CurveFitting/test/Functions/PawleyFunctionTest.h +++ b/Framework/CurveFitting/test/Functions/PawleyFunctionTest.h @@ -31,66 +31,81 @@ public: // Cubic, check case insensitivity TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "cubic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::CrystalSystem::Cubic); TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "Cubic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::CrystalSystem::Cubic); TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "CUBIC")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::CrystalSystem::Cubic); // Tetragonal TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "tetragonal")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Tetragonal); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "Tetragonal")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Tetragonal); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "TETRAGONAL")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Tetragonal); // Hexagonal TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "hexagonal")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Hexagonal); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "Hexagonal")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Hexagonal); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "HEXAGONAL")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Hexagonal); // Orthorhombic TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "orthorhombic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Orthorhombic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "Orthorhombic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Orthorhombic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "ORTHORHOMBIC")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Orthorhombic); // Monoclinic TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "monoclinic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Monoclinic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "Monoclinic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Monoclinic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "MONOCLINIC")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Monoclinic); // Triclinic TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "triclinic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Triclinic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "Triclinic")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Triclinic); TS_ASSERT_THROWS_NOTHING( fn.setAttributeValue("CrystalSystem", "TRICLINIC")); - TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), + PointGroup::CrystalSystem::Triclinic); // invalid string TS_ASSERT_THROWS(fn.setAttributeValue("CrystalSystem", "invalid"), diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h b/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h index 9c3bba0d673358f15dd35b16965b8deac2a5b65d..b5211f17919efc44521522230960145b9efd4960 100644 --- a/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h +++ b/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h @@ -24,7 +24,7 @@ namespace Geometry { */ class MANTID_GEOMETRY_DLL PointGroup : public Group { public: - enum CrystalSystem { + enum class CrystalSystem { Triclinic, Monoclinic, Orthorhombic, diff --git a/Framework/Geometry/src/Crystal/PointGroup.cpp b/Framework/Geometry/src/Crystal/PointGroup.cpp index 85ff7e7dee15c76c8aa5945cd10c4be0929577af..226d1aaba28fb0cdcafa73cb39e8ca97ed529767 100644 --- a/Framework/Geometry/src/Crystal/PointGroup.cpp +++ b/Framework/Geometry/src/Crystal/PointGroup.cpp @@ -131,31 +131,31 @@ PointGroup::CrystalSystem PointGroup::getCrystalSystemFromGroup() const { } if (symbolMap["3"].size() == 4) { - return Cubic; + return CrystalSystem::Cubic; } if (symbolMap["6"].size() == 1 || symbolMap["-6"].size() == 1) { - return Hexagonal; + return CrystalSystem::Hexagonal; } if (symbolMap["3"].size() == 1) { - return Trigonal; + return CrystalSystem::Trigonal; } if (symbolMap["4"].size() == 1 || symbolMap["-4"].size() == 1) { - return Tetragonal; + return CrystalSystem::Tetragonal; } if (symbolMap["2"].size() == 3 || (symbolMap["2"].size() == 1 && symbolMap["m"].size() == 2)) { - return Orthorhombic; + return CrystalSystem::Orthorhombic; } if (symbolMap["2"].size() == 1 || symbolMap["m"].size() == 1) { - return Monoclinic; + return CrystalSystem::Monoclinic; } - return Triclinic; + return CrystalSystem::Triclinic; } /** @return a vector with all possible PointGroup objects */ @@ -186,17 +186,17 @@ PointGroupCrystalSystemMap getPointGroupsByCrystalSystem() { std::string getCrystalSystemAsString(const PointGroup::CrystalSystem &crystalSystem) { switch (crystalSystem) { - case PointGroup::Cubic: + case PointGroup::CrystalSystem::Cubic: return "Cubic"; - case PointGroup::Tetragonal: + case PointGroup::CrystalSystem::Tetragonal: return "Tetragonal"; - case PointGroup::Hexagonal: + case PointGroup::CrystalSystem::Hexagonal: return "Hexagonal"; - case PointGroup::Trigonal: + case PointGroup::CrystalSystem::Trigonal: return "Trigonal"; - case PointGroup::Orthorhombic: + case PointGroup::CrystalSystem::Orthorhombic: return "Orthorhombic"; - case PointGroup::Monoclinic: + case PointGroup::CrystalSystem::Monoclinic: return "Monoclinic"; default: return "Triclinic"; @@ -208,19 +208,19 @@ getCrystalSystemFromString(const std::string &crystalSystem) { std::string crystalSystemLC = boost::algorithm::to_lower_copy(crystalSystem); if (crystalSystemLC == "cubic") { - return PointGroup::Cubic; + return PointGroup::CrystalSystem::Cubic; } else if (crystalSystemLC == "tetragonal") { - return PointGroup::Tetragonal; + return PointGroup::CrystalSystem::Tetragonal; } else if (crystalSystemLC == "hexagonal") { - return PointGroup::Hexagonal; + return PointGroup::CrystalSystem::Hexagonal; } else if (crystalSystemLC == "trigonal") { - return PointGroup::Trigonal; + return PointGroup::CrystalSystem::Trigonal; } else if (crystalSystemLC == "orthorhombic") { - return PointGroup::Orthorhombic; + return PointGroup::CrystalSystem::Orthorhombic; } else if (crystalSystemLC == "monoclinic") { - return PointGroup::Monoclinic; + return PointGroup::CrystalSystem::Monoclinic; } else if (crystalSystemLC == "triclinic") { - return PointGroup::Triclinic; + return PointGroup::CrystalSystem::Triclinic; } else { throw std::invalid_argument("Not a valid crystal system: '" + crystalSystem + "'."); diff --git a/Framework/Geometry/src/Crystal/PointGroupFactory.cpp b/Framework/Geometry/src/Crystal/PointGroupFactory.cpp index 908f84dde7d3152bc15ac9aff6a9df5637f601f7..e04b913c429074aa2de021a10329ca31ed9740a1 100644 --- a/Framework/Geometry/src/Crystal/PointGroupFactory.cpp +++ b/Framework/Geometry/src/Crystal/PointGroupFactory.cpp @@ -33,7 +33,7 @@ PointGroup_sptr PointGroupFactoryImpl::createPointGroupFromSpaceGroup( PointGroup_sptr pointGroup = createPointGroup(pointGroupSymbol); // If the crystal system is trigonal, we need to do more. - if (pointGroup->crystalSystem() == PointGroup::Trigonal) { + if (pointGroup->crystalSystem() == PointGroup::CrystalSystem::Trigonal) { throw std::invalid_argument( "Trigonal space groups need to be processed differently."); } diff --git a/Framework/Geometry/test/PointGroupFactoryTest.h b/Framework/Geometry/test/PointGroupFactoryTest.h index 0203852a6c2b6de4fede1ed507cf56204e909ee0..90df30f3ca934e7278d9bbf69c155485d0eeee23 100644 --- a/Framework/Geometry/test/PointGroupFactoryTest.h +++ b/Framework/Geometry/test/PointGroupFactoryTest.h @@ -67,14 +67,14 @@ public: void testGetAllPointGroupSymbolsCrystalSystems() { std::vector<std::string> cubic = PointGroupFactory::Instance().getPointGroupSymbols( - PointGroup::Monoclinic); + PointGroup::CrystalSystem::Monoclinic); TS_ASSERT_DIFFERS(findString(cubic, "monoclinicA"), cubic.end()); TS_ASSERT_DIFFERS(findString(cubic, "monoclinicB"), cubic.end()); std::vector<std::string> triclinic = PointGroupFactory::Instance().getPointGroupSymbols( - PointGroup::Triclinic); + PointGroup::CrystalSystem::Triclinic); TS_ASSERT_DIFFERS(findString(triclinic, "triclinic"), triclinic.end()); } diff --git a/Framework/Geometry/test/PointGroupTest.h b/Framework/Geometry/test/PointGroupTest.h index 406a4508cbeba6cf9e551d51dc3c80014c75b7ee..582319dae0dcec7c690644cda7131be3d968ca25 100644 --- a/Framework/Geometry/test/PointGroupTest.h +++ b/Framework/Geometry/test/PointGroupTest.h @@ -230,58 +230,58 @@ public: void testCrystalSystems() { std::map<std::string, PointGroup::CrystalSystem> crystalSystemsMap; - crystalSystemsMap["1"] = PointGroup::Triclinic; - crystalSystemsMap["-1"] = PointGroup::Triclinic; - - crystalSystemsMap["2"] = PointGroup::Monoclinic; - crystalSystemsMap["m"] = PointGroup::Monoclinic; - crystalSystemsMap["2/m"] = PointGroup::Monoclinic; - crystalSystemsMap["112/m"] = PointGroup::Monoclinic; - - crystalSystemsMap["222"] = PointGroup::Orthorhombic; - crystalSystemsMap["mm2"] = PointGroup::Orthorhombic; - crystalSystemsMap["mmm"] = PointGroup::Orthorhombic; - - crystalSystemsMap["4"] = PointGroup::Tetragonal; - crystalSystemsMap["-4"] = PointGroup::Tetragonal; - crystalSystemsMap["4/m"] = PointGroup::Tetragonal; - crystalSystemsMap["422"] = PointGroup::Tetragonal; - crystalSystemsMap["4mm"] = PointGroup::Tetragonal; - crystalSystemsMap["-42m"] = PointGroup::Tetragonal; - crystalSystemsMap["-4m2"] = PointGroup::Tetragonal; - crystalSystemsMap["4/mmm"] = PointGroup::Tetragonal; - - crystalSystemsMap["3"] = PointGroup::Trigonal; - crystalSystemsMap["-3"] = PointGroup::Trigonal; - crystalSystemsMap["321"] = PointGroup::Trigonal; - crystalSystemsMap["32"] = PointGroup::Trigonal; - crystalSystemsMap["312"] = PointGroup::Trigonal; - crystalSystemsMap["3m1"] = PointGroup::Trigonal; - crystalSystemsMap["3m"] = PointGroup::Trigonal; - crystalSystemsMap["31m"] = PointGroup::Trigonal; - crystalSystemsMap["-3m1"] = PointGroup::Trigonal; - crystalSystemsMap["-3m"] = PointGroup::Trigonal; - crystalSystemsMap["-31m"] = PointGroup::Trigonal; - crystalSystemsMap["3 r"] = PointGroup::Trigonal; - crystalSystemsMap["-3 r"] = PointGroup::Trigonal; - crystalSystemsMap["32 r"] = PointGroup::Trigonal; - crystalSystemsMap["3m r"] = PointGroup::Trigonal; - crystalSystemsMap["-3m r"] = PointGroup::Trigonal; - - crystalSystemsMap["6"] = PointGroup::Hexagonal; - crystalSystemsMap["-6"] = PointGroup::Hexagonal; - crystalSystemsMap["6/m"] = PointGroup::Hexagonal; - crystalSystemsMap["622"] = PointGroup::Hexagonal; - crystalSystemsMap["6mm"] = PointGroup::Hexagonal; - crystalSystemsMap["-62m"] = PointGroup::Hexagonal; - crystalSystemsMap["-6m2"] = PointGroup::Hexagonal; - crystalSystemsMap["6/mmm"] = PointGroup::Hexagonal; - - crystalSystemsMap["23"] = PointGroup::Cubic; - crystalSystemsMap["m-3"] = PointGroup::Cubic; - crystalSystemsMap["432"] = PointGroup::Cubic; - crystalSystemsMap["-43m"] = PointGroup::Cubic; - crystalSystemsMap["m-3m"] = PointGroup::Cubic; + crystalSystemsMap["1"] = PointGroup::CrystalSystem::Triclinic; + crystalSystemsMap["-1"] = PointGroup::CrystalSystem::Triclinic; + + crystalSystemsMap["2"] = PointGroup::CrystalSystem::Monoclinic; + crystalSystemsMap["m"] = PointGroup::CrystalSystem::Monoclinic; + crystalSystemsMap["2/m"] = PointGroup::CrystalSystem::Monoclinic; + crystalSystemsMap["112/m"] = PointGroup::CrystalSystem::Monoclinic; + + crystalSystemsMap["222"] = PointGroup::CrystalSystem::Orthorhombic; + crystalSystemsMap["mm2"] = PointGroup::CrystalSystem::Orthorhombic; + crystalSystemsMap["mmm"] = PointGroup::CrystalSystem::Orthorhombic; + + crystalSystemsMap["4"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["-4"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["4/m"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["422"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["4mm"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["-42m"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["-4m2"] = PointGroup::CrystalSystem::Tetragonal; + crystalSystemsMap["4/mmm"] = PointGroup::CrystalSystem::Tetragonal; + + crystalSystemsMap["3"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-3"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["321"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["32"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["312"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["3m1"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["3m"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["31m"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-3m1"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-3m"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-31m"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["3 r"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-3 r"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["32 r"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["3m r"] = PointGroup::CrystalSystem::Trigonal; + crystalSystemsMap["-3m r"] = PointGroup::CrystalSystem::Trigonal; + + crystalSystemsMap["6"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["-6"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["6/m"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["622"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["6mm"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["-62m"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["-6m2"] = PointGroup::CrystalSystem::Hexagonal; + crystalSystemsMap["6/mmm"] = PointGroup::CrystalSystem::Hexagonal; + + crystalSystemsMap["23"] = PointGroup::CrystalSystem::Cubic; + crystalSystemsMap["m-3"] = PointGroup::CrystalSystem::Cubic; + crystalSystemsMap["432"] = PointGroup::CrystalSystem::Cubic; + crystalSystemsMap["-43m"] = PointGroup::CrystalSystem::Cubic; + crystalSystemsMap["m-3m"] = PointGroup::CrystalSystem::Cubic; std::vector<PointGroup_sptr> pointgroups = getAllPointGroups(); @@ -299,17 +299,18 @@ public: TS_ASSERT_EQUALS(pointgroups.size(), pgMap.size()); - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Triclinic), 2); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Triclinic), 2); // 2/m with axis b and c, so one more - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Monoclinic), 3 + 1); - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Orthorhombic), 3); - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Tetragonal), 8); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Monoclinic), 3 + 1); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Orthorhombic), 3); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Tetragonal), 8); // 5 with rhombohedral axes and 8 with hexagonal and 3 for defaults - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Trigonal), 5 + 8 + 3); - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Hexagonal), 8); - TS_ASSERT_EQUALS(pgMap.count(PointGroup::Cubic), 5); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Trigonal), + 5 + 8 + 3); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Hexagonal), 8); + TS_ASSERT_EQUALS(pgMap.count(PointGroup::CrystalSystem::Cubic), 5); } void testPerformance() { @@ -318,48 +319,52 @@ public: } void testCrystalSystemNames() { - TS_ASSERT_EQUALS(getCrystalSystemFromString("Cubic"), PointGroup::Cubic); - TS_ASSERT_EQUALS(getCrystalSystemFromString("cubic"), PointGroup::Cubic); - TS_ASSERT_EQUALS(getCrystalSystemFromString("CUBIC"), PointGroup::Cubic); - TS_ASSERT_EQUALS(getCrystalSystemFromString("CuBiC"), PointGroup::Cubic); + TS_ASSERT_EQUALS(getCrystalSystemFromString("Cubic"), + PointGroup::CrystalSystem::Cubic); + TS_ASSERT_EQUALS(getCrystalSystemFromString("cubic"), + PointGroup::CrystalSystem::Cubic); + TS_ASSERT_EQUALS(getCrystalSystemFromString("CUBIC"), + PointGroup::CrystalSystem::Cubic); + TS_ASSERT_EQUALS(getCrystalSystemFromString("CuBiC"), + PointGroup::CrystalSystem::Cubic); TS_ASSERT_EQUALS(getCrystalSystemFromString("Tetragonal"), - PointGroup::Tetragonal); + PointGroup::CrystalSystem::Tetragonal); TS_ASSERT_EQUALS(getCrystalSystemFromString("Hexagonal"), - PointGroup::Hexagonal); + PointGroup::CrystalSystem::Hexagonal); TS_ASSERT_EQUALS(getCrystalSystemFromString("Trigonal"), - PointGroup::Trigonal); + PointGroup::CrystalSystem::Trigonal); TS_ASSERT_EQUALS(getCrystalSystemFromString("Orthorhombic"), - PointGroup::Orthorhombic); + PointGroup::CrystalSystem::Orthorhombic); TS_ASSERT_EQUALS(getCrystalSystemFromString("Monoclinic"), - PointGroup::Monoclinic); + PointGroup::CrystalSystem::Monoclinic); TS_ASSERT_EQUALS(getCrystalSystemFromString("Triclinic"), - PointGroup::Triclinic); + PointGroup::CrystalSystem::Triclinic); TS_ASSERT_THROWS(getCrystalSystemFromString("DoesNotExist"), std::invalid_argument); - TS_ASSERT_EQUALS( - getCrystalSystemFromString(getCrystalSystemAsString(PointGroup::Cubic)), - PointGroup::Cubic); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Tetragonal)), - PointGroup::Tetragonal); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Hexagonal)), - PointGroup::Hexagonal); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Trigonal)), - PointGroup::Trigonal); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Orthorhombic)), - PointGroup::Orthorhombic); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Monoclinic)), - PointGroup::Monoclinic); - TS_ASSERT_EQUALS(getCrystalSystemFromString( - getCrystalSystemAsString(PointGroup::Triclinic)), - PointGroup::Triclinic); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Cubic)), + PointGroup::CrystalSystem::Cubic); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Tetragonal)), + PointGroup::CrystalSystem::Tetragonal); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Hexagonal)), + PointGroup::CrystalSystem::Hexagonal); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Trigonal)), + PointGroup::CrystalSystem::Trigonal); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Orthorhombic)), + PointGroup::CrystalSystem::Orthorhombic); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Monoclinic)), + PointGroup::CrystalSystem::Monoclinic); + TS_ASSERT_EQUALS(getCrystalSystemFromString(getCrystalSystemAsString( + PointGroup::CrystalSystem::Triclinic)), + PointGroup::CrystalSystem::Triclinic); } private: diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp index 612397d3524a54e1a4bfbd7bcdccc5540e14b3d4..8256a44d7be988de96361e7b970120f321cba330 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp @@ -46,13 +46,13 @@ void export_PointGroup() { class_<PointGroup, boost::noncopyable>("PointGroup", no_init); enum_<PointGroup::CrystalSystem>("CrystalSystem") - .value("Triclinic", PointGroup::Triclinic) - .value("Monoclinic", PointGroup::Monoclinic) - .value("Orthorhombic", PointGroup::Orthorhombic) - .value("Tetragonal", PointGroup::Tetragonal) - .value("Hexagonal", PointGroup::Hexagonal) - .value("Trigonal", PointGroup::Trigonal) - .value("Cubic", PointGroup::Cubic); + .value("Triclinic", PointGroup::CrystalSystem::Triclinic) + .value("Monoclinic", PointGroup::CrystalSystem::Monoclinic) + .value("Orthorhombic", PointGroup::CrystalSystem::Orthorhombic) + .value("Tetragonal", PointGroup::CrystalSystem::Tetragonal) + .value("Hexagonal", PointGroup::CrystalSystem::Hexagonal) + .value("Trigonal", PointGroup::CrystalSystem::Trigonal) + .value("Cubic", PointGroup::CrystalSystem::Cubic); class_<PointGroup, boost::noncopyable, bases<Group>>("PointGroup", no_init) .def("getName", &PointGroup::getName, arg("self")) diff --git a/Framework/SINQ/src/PoldiCreatePeaksFromCell.cpp b/Framework/SINQ/src/PoldiCreatePeaksFromCell.cpp index 94b338277527b5254eac1e4259b9ecb2c2e197dd..357bed4bdde00b5e225d63f9d9f7872fced527c3 100644 --- a/Framework/SINQ/src/PoldiCreatePeaksFromCell.cpp +++ b/Framework/SINQ/src/PoldiCreatePeaksFromCell.cpp @@ -139,22 +139,22 @@ UnitCell PoldiCreatePeaksFromCell::getConstrainedUnitCell( const UnitCell &unitCell, const PointGroup::CrystalSystem &crystalSystem, const Group::CoordinateSystem &coordinateSystem) const { switch (crystalSystem) { - case PointGroup::Cubic: + case PointGroup::CrystalSystem::Cubic: return UnitCell(unitCell.a(), unitCell.a(), unitCell.a()); - case PointGroup::Tetragonal: + case PointGroup::CrystalSystem::Tetragonal: return UnitCell(unitCell.a(), unitCell.a(), unitCell.c()); - case PointGroup::Orthorhombic: + case PointGroup::CrystalSystem::Orthorhombic: return UnitCell(unitCell.a(), unitCell.b(), unitCell.c()); - case PointGroup::Monoclinic: + case PointGroup::CrystalSystem::Monoclinic: return UnitCell(unitCell.a(), unitCell.b(), unitCell.c(), 90.0, unitCell.beta(), 90.0); - case PointGroup::Trigonal: + case PointGroup::CrystalSystem::Trigonal: if (coordinateSystem == Group::Orthogonal) { return UnitCell(unitCell.a(), unitCell.a(), unitCell.a(), unitCell.alpha(), unitCell.alpha(), unitCell.alpha()); } // fall through to hexagonal. - case PointGroup::Hexagonal: + case PointGroup::CrystalSystem::Hexagonal: return UnitCell(unitCell.a(), unitCell.a(), unitCell.c(), 90.0, 90.0, 120.0); default: diff --git a/Framework/SINQ/src/PoldiFitPeaks2D.cpp b/Framework/SINQ/src/PoldiFitPeaks2D.cpp index dc9755d28fbc0efb9ba8f4463e93b03d0c66e3dc..a2a1ed2ba2e2f36c30e493904c791591c41ea195 100644 --- a/Framework/SINQ/src/PoldiFitPeaks2D.cpp +++ b/Framework/SINQ/src/PoldiFitPeaks2D.cpp @@ -593,10 +593,10 @@ std::string PoldiFitPeaks2D::getCrystalSystemFromPointGroup( PointGroup::CrystalSystem crystalSystem = pointGroup->crystalSystem(); - if (crystalSystem == PointGroup::Trigonal) { + if (crystalSystem == PointGroup::CrystalSystem::Trigonal) { if (pointGroup->getCoordinateSystem() == Group::CoordinateSystem::Hexagonal) { - return getCrystalSystemAsString(PointGroup::Hexagonal); + return getCrystalSystemAsString(PointGroup::CrystalSystem::Hexagonal); } } diff --git a/Framework/SINQ/test/PoldiCreatePeaksFromCellTest.h b/Framework/SINQ/test/PoldiCreatePeaksFromCellTest.h index 5bb7cd606b7635195dd720862562e1243c3b5277..dff18bbb8749e0fc9648efb4cd775d73ff0591e7 100644 --- a/Framework/SINQ/test/PoldiCreatePeaksFromCellTest.h +++ b/Framework/SINQ/test/PoldiCreatePeaksFromCellTest.h @@ -142,37 +142,38 @@ public: UnitCell rawCell(2.0, 3.0, 4.0, 91.0, 92.0, 93.0); checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Cubic), 2.0, 2.0, 2.0, - 90.0, 90.0, 90.0, "Cubic"); + alg.getConstrainedUnitCell(rawCell, PointGroup::CrystalSystem::Cubic), + 2.0, 2.0, 2.0, 90.0, 90.0, 90.0, "Cubic"); - checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Tetragonal), 2.0, 2.0, - 4.0, 90.0, 90.0, 90.0, "Tetragonal"); + checkUnitCellParameters(alg.getConstrainedUnitCell( + rawCell, PointGroup::CrystalSystem::Tetragonal), + 2.0, 2.0, 4.0, 90.0, 90.0, 90.0, "Tetragonal"); checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Orthorhombic), 2.0, 3.0, - 4.0, 90.0, 90.0, 90.0, "Orthorhombic"); + alg.getConstrainedUnitCell(rawCell, + PointGroup::CrystalSystem::Orthorhombic), + 2.0, 3.0, 4.0, 90.0, 90.0, 90.0, "Orthorhombic"); - checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Monoclinic), 2.0, 3.0, - 4.0, 90.0, 92.0, 90.0, "Monoclinic"); + checkUnitCellParameters(alg.getConstrainedUnitCell( + rawCell, PointGroup::CrystalSystem::Monoclinic), + 2.0, 3.0, 4.0, 90.0, 92.0, 90.0, "Monoclinic"); - checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Triclinic), 2.0, 3.0, - 4.0, 91.0, 92.0, 93.0, "Triclinic"); + checkUnitCellParameters(alg.getConstrainedUnitCell( + rawCell, PointGroup::CrystalSystem::Triclinic), + 2.0, 3.0, 4.0, 91.0, 92.0, 93.0, "Triclinic"); - checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Hexagonal), 2.0, 2.0, - 4.0, 90.0, 90.0, 120.0, "Hexagonal"); + checkUnitCellParameters(alg.getConstrainedUnitCell( + rawCell, PointGroup::CrystalSystem::Hexagonal), + 2.0, 2.0, 4.0, 90.0, 90.0, 120.0, "Hexagonal"); - checkUnitCellParameters( - alg.getConstrainedUnitCell(rawCell, PointGroup::Trigonal), 2.0, 2.0, - 2.0, 91.0, 91.0, 91.0, "Trigonal"); + checkUnitCellParameters(alg.getConstrainedUnitCell( + rawCell, PointGroup::CrystalSystem::Trigonal), + 2.0, 2.0, 2.0, 91.0, 91.0, 91.0, "Trigonal"); - checkUnitCellParameters(alg.getConstrainedUnitCell(rawCell, - PointGroup::Trigonal, - Group::Hexagonal), - 2.0, 2.0, 4.0, 90.0, 90.0, 120.0, "Trigonal"); + checkUnitCellParameters( + alg.getConstrainedUnitCell(rawCell, PointGroup::CrystalSystem::Trigonal, + Group::Hexagonal), + 2.0, 2.0, 4.0, 90.0, 90.0, 120.0, "Trigonal"); } private: