src/IntRank2/CartMx2A.cc
/* This attempts to perform the conversion of the current Cartesian tensor into
   a GAMMA spherical tensor. It is separated from other routiens and private
   because it uses the current class settings which will dictate how the 
   conversion process will be attempted.                                     */
This attempts to perform the conversion of the current Cartesian tensor into
a GAMMA spherical tensor. It is separated from other routiens and private
because it uses the current class settings which will dictate how the
conversion process will be attempted.
This attempts to perform the conversion of the current Cartesian tensor into a GAMMA spherical tensor . It is separated from other routiens and private because it uses the current class settings which will dictate how the conversion process will be attempted .
bool CartMx2A::Convert(int warn)
  {
  TrackConv(0);				
  bool T = true;
  if(A.is_zero()) return T;		
  AisoDelzEta();			
  if(!PASDelzz) return T;		
  if(!EtaVal) 				
    {					
    if(A.is_diagonal()) 		
      { DiagSymCartEA(); return T; }	
    else				
      { SymCartEA();     return T; }	
    }
  else					
    {					
    if(A.is_diagonal())			
     { if(DiagASymCartEA()) return T; }	
    else if(OffDiagonals())		
      { 				
      if(ASymCartODZEA(warn?1:0)) 	
         return T;			
      if(warn)				
        {				
        C2Aerror(60,1);			
        if(warn>2) C2Afatal(61);	
        else       C2Aerror(61,1);	
        }
      return false;
      }
    else if(SymOffDiags())		
      {					
      if(ASymCartODSEA(warn?1:0)) 	
        return T;
else
return false;
      }
    if(ASymCartEA()) {      return T; }	
    if(warn)				
      {					
      C2Aerror(35,1);			
      if(warn > 2) C2Afatal(39);	
      else         C2Aerror(39,1);	
      }
    }
  return false;
  }
bool CartMx2A :: Convert ( int warn ) { TrackConv ( 0 ) ; bool T = true ; if ( A . is_zero ( ) ) return T ; AisoDelzEta ( ) ; if ( ! PASDelzz ) return T ; if ( ! EtaVal ) { if ( A . is_diagonal ( ) ) { DiagSymCartEA ( ) ; return T ; } else { SymCartEA ( ) ; return T ; } } else { if ( A . is_diagonal ( ) ) { if ( DiagASymCartEA ( ) ) return T ; } else if ( OffDiagonals ( ) ) { if ( ASymCartODZEA ( warn ? 1 : 0 ) ) return T ; if ( warn ) { C2Aerror ( 60 , 1 ) ; if ( warn > 2 ) C2Afatal ( 61 ) ; else C2Aerror ( 61 , 1 ) ; } return false ; } else if ( SymOffDiags ( ) ) { if ( ASymCartODSEA ( warn ? 1 : 0 ) ) return T ; else return false ; } if ( ASymCartEA ( ) ) { return T ; } if ( warn ) { C2Aerror ( 35 , 1 ) ; if ( warn > 2 ) C2Afatal ( 39 ) ; else C2Aerror ( 39 , 1 ) ; } } return false ; }
This attempts to perform the conversion of the current Cartesian tensor into
a GAMMA spherical tensor.
This attempts to perform the conversion of the current Cartesian tensor into a GAMMA spherical tensor .
// Track conversion process (if needed) // If no A, we are done.... // Set Aiso, delzz, & eta // If no anisotropy, were done // If symmetric tensor, simple  // function for getting angles //   If diagonal, either in PAS //   or simple rotation & were done //   If not diagonal, still easy //   to get Euler angles & were done // If asymmetric, maybe some // structure we can use to simplify //   Asymmetric but diagonal, maybe //   a simple way to Euler angles //   Asymmetric not diagonal, maybe //   some off-diagonal zeros? //     If OK just return, we have //     found the Euler angles //     If not OK issue warnings //     if desired //       Cannot handle array //       A with some off diagonals //       (done in ASymCartODZEA) //   Asymmetric not diagonal, maybe //   symmetry in off-diagonals? //     If OK just return, we have //cout << "\n\tTrying Generic Conversion.."; // Nope, try hard way by fitting // Failed! What should we do? If // warnings are desired then we //   Conversion Failure //     If desired, exit //     else just issue warning