src/IntRank2/CartMx2A.cc
/* This function will assume that the irreducible Cartesian spatial tensor
   array A (symmetric) has no asymmetry and is diagonal. That is, eta = 0 for A
   and A contains no non-zero off-diagonal elements. It will return three Euler
   angles EA:{alpha,beta,gamma} that relate to the tensor PAS to the input 
   array axes. In this case, i.e. eta=0 & A diagonal, either the tensor is
   already in its PAS or only a simple rotation is needed to switch diagonal
   element ordering so it matches the PAS.  Here are the possible Euler angles:

         EA = {0,0,0}            EA = {0,90,0}            EA = {90,90,0}

     1      [ -1  0  0 ]      1      [  2  0  0 ]      1      [ -1  0  0 ]
     - del  |  0 -1  0 |      - del  |  0 -1  0 |      - del  |  0  2  0 |
     2   zz [  0  0  2 ]      2   zz [  0  0 -1 ]      2   zz [  0  0 -1 ]  */
This function will assume that the irreducible Cartesian spatial tensor
array A (symmetric) has no asymmetry and is diagonal. That is, eta = 0 for A
and A contains no non-zero off-diagonal elements. It will return three Euler
angles EA:{alpha,beta,gamma} that relate to the tensor PAS to the input
array axes.




This function will assume that the irreducible Cartesian spatial tensor array A ( symmetric ) has no asymmetry and is diagonal . That is eta = 0 for A and A contains no non - zero off - diagonal elements . It will return three Euler angles EA : { alpha beta gamma } that relate to the tensor PAS to the input array axes .
void CartMx2A::DiagSymCartEA()
  {
  string fct("DiagSymCartEA");				
  ConvMeth = 1;						
  TrackConv(ConvMeth);					
  if(EtaVal)
    {
    C2Aerror(25, 1);					
    C2Aerror(26, fct, 1);				
    C2Afatal(30);					
    }
  if(A.is_zero())					
    {
    C2Aerror(17, 1);					
    C2Aerror(26, fct, 1);				
    C2Afatal(30);					
    }
  if(!PASDelzz)
    {
    C2Aerror(18, 1);					
    C2Aerror(26, fct, 1);				
    C2Afatal(30);					
    }
  if(!A.is_diagonal())					
    {
    C2Aerror(19, 1);					
    C2Aerror(26, fct, 1);				
    C2Afatal(30);					
    }
  double axx = A.getRe(0,0) - AisoVal;
  double ayy = A.getRe(1,1) - AisoVal;
  double azz = A.getRe(2,2) - AisoVal;
  if(fabs(azz - PASDelzz) < DifCut) { EA = EAngles(0,      0     , 0); return; }
  if(fabs(axx - PASDelzz) < DifCut) { EA = EAngles(0,      PI/2.0, 0); return; }
  if(fabs(ayy - PASDelzz) < DifCut) { EA = EAngles(PI/2.0, PI/2.0, 0); return; }
  TrackConv(16);					
  }
void CartMx2A :: DiagSymCartEA ( ) { string fct ( " " ) ; ConvMeth = 1 ; TrackConv ( ConvMeth ) ; if ( EtaVal ) { C2Aerror ( 25 , 1 ) ; C2Aerror ( 26 , fct , 1 ) ; C2Afatal ( 30 ) ; } if ( A . is_zero ( ) ) { C2Aerror ( 17 , 1 ) ; C2Aerror ( 26 , fct , 1 ) ; C2Afatal ( 30 ) ; } if ( ! PASDelzz ) { C2Aerror ( 18 , 1 ) ; C2Aerror ( 26 , fct , 1 ) ; C2Afatal ( 30 ) ; } if ( ! A . is_diagonal ( ) ) { C2Aerror ( 19 , 1 ) ; C2Aerror ( 26 , fct , 1 ) ; C2Afatal ( 30 ) ; } double axx = A . getRe ( 0 , 0 ) - AisoVal ; double ayy = A . getRe ( 1 , 1 ) - AisoVal ; double azz = A . getRe ( 2 , 2 ) - AisoVal ; if ( fabs ( azz - PASDelzz ) < DifCut ) { EA = EAngles ( 0 , 0 , 0 ) ; return ; } if ( fabs ( axx - PASDelzz ) < DifCut ) { EA = EAngles ( 0 , PI / 2.0 , 0 ) ; return ; } if ( fabs ( ayy - PASDelzz ) < DifCut ) { EA = EAngles ( PI / 2.0 , PI / 2.0 , 0 ) ; return ; } TrackConv ( 16 ) ; }
This function will assume that the irreducible Cartesian spatial tensor
array A (symmetric) has no asymmetry and is diagonal.
This function will assume that the irreducible Cartesian spatial tensor array A ( symmetric ) has no asymmetry and is diagonal .
// Our function name // Our conversion type // Track conv. process // Eta is not zero // Bad function call // Cant get EA // Zero array // Cartesian array 0 // Bad function call // Cant get EA // Anisotropy 0 // Bad function call // Cant get EA // Array not diagonal // Non-diag. array // Bad function call // Cant get EA // Track conv. process