Skip to content
Permalink
Browse files

Space group number to laue ops instance. (#928)

* Adding method that is given a space group number and converts it to the appropriate laue ops instance.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>

* Updating algorithm to add fixes for PR comments.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
  • Loading branch information
joeykleingers committed Feb 10, 2020
1 parent 638f250 commit 3de46b689360ae3c014154ae8040190aa411cacc
Showing with 53 additions and 1 deletion.
  1. +47 −1 Source/OrientationLib/LaueOps/LaueOps.cpp
  2. +6 −0 Source/OrientationLib/LaueOps/LaueOps.h
@@ -43,7 +43,7 @@
#include "SIMPLib/Math/SIMPLibRandom.h"
#include "SIMPLib/Utilities/ColorTable.h"


#include "EbsdLib/EbsdConstants.h"

#include "OrientationLib/LaueOps/CubicLowOps.h"
#include "OrientationLib/LaueOps/CubicOps.h"
@@ -394,6 +394,52 @@ std::vector<LaueOps::Pointer> LaueOps::getOrientationOpsVector()
return m_OrientationOps;
}

// -----------------------------------------------------------------------------
LaueOps::Pointer LaueOps::getOrientationOpsFromSpaceGroupNumber(size_t sgNumber)
{
std::array<size_t, 32> sgpg = {1, 2, 3, 6, 10, 16, 25, 47, 75, 81, 83, 89, 99, 111, 123, 143, 147, 149, 156, 162, 168, 174, 175, 177, 183, 187, 191, 195, 200, 207, 215, 221};
std::array<size_t, 32> pgLaue = {1, 1, 2, 2, 2, 22, 22, 22, 4, 4, 4, 42, 42, 42, 42, 3, 3, 32, 32, 32, 6, 6, 6, 62, 62, 62, 62, 23, 23, 43, 43, 43};

size_t pgNumber = 0;
for(size_t i = 0; i < sgpg.size(); i++)
{
if(sgpg[i] > sgNumber)
{
pgNumber = i;
break;
}
}

size_t value = pgLaue.at(pgNumber);
switch(value)
{
case 1:
return TriclinicOps::New();
case 2:
return MonoclinicOps::New();
case 22:
return OrthoRhombicOps::New();
case 4:
return TetragonalLowOps::New();
case 42:
return TetragonalOps::New();
case 3:
return TrigonalLowOps::New();
case 32:
return TrigonalOps::New();
case 6:
return HexagonalLowOps::New();
case 62:
return HexagonalOps::New();
case 23:
return CubicLowOps::New();
case 43:
return CubicOps::New();
default:
return LaueOps::NullPointer();
}
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
@@ -92,6 +92,12 @@ class OrientationLib_EXPORT LaueOps
*/
static std::vector<LaueOps::Pointer> getOrientationOpsVector();

/**
* @brief getOrientationOpsFromSpaceGroupNumber
* @param sgNumber
* @return
*/
static Pointer getOrientationOpsFromSpaceGroupNumber(size_t sgNumber);

/**
* @brief GetLaueNames Returns the names of the Laue Classes

0 comments on commit 3de46b6

Please sign in to comment.
You can’t perform that action at this time.