src/ESRLib/SpinSpace.cc
// ----------------------------------------------------------------------------
//      Functions To Output Spin System To ASCII From A Parameter Set
// ----------------------------------------------------------------------------
Functions To Output Spin System To ASCII From A Parameter Set
Functions To Output Spin System To ASCII From A Parameter Set
int SpinSpace::write(const string &filename, int idx, int warn) const
  {
  if(!spins()) return 1;		
  ofstream ofstr(filename.c_str());	
  int w2 = 0;                           
  if(warn) w2 = 1;
  if(!write(ofstr, idx, w2))            
    {
    if(warn)
      {  
      error(1, filename);		
      if(warn>1) fatality(5);		
      }  
    return 0;
    }
  ofstr.close();                        
  return 1;
  }
int SpinSpace :: write ( const string & filename , int idx , int warn ) const { if ( ! spins ( ) ) return 1 ; ofstream ofstr ( filename . c_str ( ) ) ; int w2 = 0 ; if ( warn ) w2 = 1 ; if ( ! write ( ofstr , idx , w2 ) ) { if ( warn ) { error ( 1 , filename ) ; if ( warn > 1 ) fatality ( 5 ) ; } return 0 ; } ofstr . close ( ) ; return 1 ; }
Functions To Output Spin System To ASCII From A Parameter Set
Functions To Output Spin System To ASCII From A Parameter Set
// Input		ss	: Spin system (base) //                      filename: Output file name //                      idx     : Parameter index value used for //                                prefix [#] in output names //                      warn    : Warning level // Output		none	: Spin system is written as a  //				  parameter set to file filename // Nothing if no spins // Open filename for input // Added warning level // If file bad then exit // Problems with file // Fatal error // Close it now