renumLinearMolecule.cpp

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <vector>
00003 #include <sstream>
00004 #include <fstream>
00005 #include <iostream>
00006 //
00007 #include "Atoms.h"
00008 #include "tools.h"
00009 //
00010 void usage()
00011 {
00012   std::cout << "Wrong number of arguments " << std::endl 
00013             << "renumLinearPartition qciFileName qciOutFile "<< std::endl
00014             <<std::endl;
00015   exit(1) ;
00016 }
00017 //
00018 //  Le programme principal
00019 //
00020 int main(int argc, char* argv[] ){
00021   //
00022   if(argc != 3 )
00023     { usage() ; }
00024   std::ifstream qciFile ;
00025   std::ofstream outFile,infoFile;
00026   std::string qciFileName(argv[1]), outName(argv[2]);
00027   //
00028   setOfAtoms      atoms ;
00029   //
00030   // Ouverture des fichiers
00031   //
00032   qciFile.open(qciFileName.c_str()) ;
00033   if(  ! qciFile  ) {
00034     std::cerr <<" Le fichier "<<qciFileName << " n'existe pas. " <<std::endl;
00035     exit(1) ;}
00036   //
00037   std::cout <<" Debut de la lecture de "<<qciFileName <<std::endl;
00038   atoms.readQCIFile(qciFile) ; 
00039   qciFile.close();
00040   std::cout <<" Fin de la lecture de "<<qciFileName <<std::endl;
00041   //
00042   // Renumerotation
00043   //
00044   std::vector<int> newNumerotation(atoms.getNumberOfAtoms());
00045   //
00046   renumLinear(atoms, newNumerotation ) ;
00047   //
00048   std::string FF(outName); 
00049   outFile.open(FF.c_str()) ;
00050   std::cout <<" Ecriture dans " << outName <<std::endl;
00051 
00052   atoms.writeQCIFile(outFile);
00053 
00054   outFile.close() ;
00055   //
00056   std::cout << "end of program RenumLinearMolecule"<<std::endl ;
00057   //
00058   return true ;
00059 }

Generated on Sat Jan 28 21:07:30 2006 for QC++ by  doxygen 1.4.4