From: vsr Date: Sun, 11 Mar 2012 09:12:48 +0000 (+0000) Subject: Remove 'using namespace' clause X-Git-Tag: V6_5_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2a1b071f8003c9612ca7836e0cfb32d938f67fa;p=plugins%2Fghs3dprlplugin.git Remove 'using namespace' clause --- diff --git a/src/tepal2med/ghs3dprl_mesh_wrap.cxx b/src/tepal2med/ghs3dprl_mesh_wrap.cxx index 3b9b50b..cd9f61a 100755 --- a/src/tepal2med/ghs3dprl_mesh_wrap.cxx +++ b/src/tepal2med/ghs3dprl_mesh_wrap.cxx @@ -45,14 +45,12 @@ extern "C" { //#include } -using namespace std; - //utils procedures //************************************ -string i2a(const int &v) +std::string i2a(const int &v) { - ostringstream ss; + std::ostringstream ss; ss<\tGroups="; + std::cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\tGroups="; gb=(*it1).second; for (it2=gb.begin(); it2!=gb.end(); ++it2){ - cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; + std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; } - cout<\tFamilies="; + std::cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\tFamilies="; gb=(*it1).second; for (it2=gb.begin(); it2!=gb.end(); ++it2){ - cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; + std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> "; } - cout<\t<"<\n"; + //std::cout<<"add family <"<\t<"<\n"; fagr::iterator it; it=fam.find(nomfam); if (it==fam.end()){ - //cout<<"add new family <"<\t<"<\n"; + //std::cout<<"add new family <"<\t<"<\n"; newfam(nomfam); it=fam.find(nomfam); } @@ -175,7 +173,7 @@ void charendnull(char *p, QString deb, int lg) (*it).second[nomgro]=0; it=gro.find(nomgro); if (it==gro.end()){ - //cout<<"***new*** "<<"<<*tmp<<">\n"; + //std::cout<<"NewFamily Found<"<<*ires<<"><"<<*tmp<<">\n"; return true; } ii=ii+pas; } - cerr<<"***get_number_of_new_family*** Problem new family not found"< from <"<< + //std::cout<<"find_family_on_groups old <"< from <"<< // fam1<<"><"<\n"; return ires; } } - //cout<<"no family found!!! - groups of "<add(tmp,(*it).first); } - //cout<<"new family <"< intersection of <"<<"<\n"; + //std::cout<<"new family <"< intersection of <"<<"<\n"; return ires; } @@ -251,7 +249,7 @@ bool familles::get_number_of_new_family(int sign, med_int *ires, QString *tmp) nom2=nom2.sprintf("%d",fam2); it2=fam.find(nom2); if ( (it1==fam.end())||(it2==fam.end()) ) { - cerr<<"***fuse_goups*** non existing family "< "; + std::cout<<"<"<<(*it).first.toLatin1().constData()<<"> "; } - cout<memorymax) { - cout<<"***WARNING*** memory max reached "<memorymax) { - cout<<"***WARNING*** memory max reached "<filename<filename<CVWtab_deallocate(); //remove temporary file if (this->filename!="_NO_FILE") { remove(this->filename.toLatin1().constData()); //#include - //cout<filename<<" successfully deleted\n"; + //std::cout<filename<<" successfully deleted\n"; } } @@ -323,7 +321,7 @@ CVWtab::~CVWtab() //************************************ bool CVWtab::CVWtab_deallocate() { - //cout<<" deallocate CVWtab*** "<size<type==1) cout<<"med_int tab1[0]="<tmint[0]<type==2) cout<<"med_float tab1[0]="<tmflo[0]<size<type==1) std::cout<<"med_int tab1[0]="<tmint[0]<type==2) std::cout<<"med_float tab1[0]="<tmflo[0]<size!=tab2->size) return false; if (this->type!=tab2->type) return false; if (this->type==1) { if (!this->tmint) - { cout<<"***is_equal*** pb pointer NULL with tmint size="<size<size<size<=tab1->size) { - cerr<<"BadIndice tab1 in is_equal_vertices "<< - di1<<" not in "<size<size<=tab2->size) { - cerr<<"BadIndice tab2 in is_equal_vertices "<< - di2<<" not in "<size<size<tmflo+di1); @@ -409,11 +407,11 @@ bool CVW_is_equal_vertices(CVWtab *tab1, long i1, } //************************************ -bool CVW_FindString(const string &str,fstream &Ff, long &count) +bool CVW_FindString(const std::string &str,std::fstream &Ff, long &count) //find in file first line with string str in first position of line //converts count value expected after "='" in line found { - string line; + std::string line; QString tmp; do { @@ -432,7 +430,7 @@ bool CVW_FindString(const string &str,fstream &Ff, long &count) } else { - cerr<<"Problem line '"< for speed (and so no test) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long i,count,nbneighbour,ineighbour; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<nofile<<"="<2) std::cout<<"NeighboursCountDomain_"<nofile<<"="<4) std::cout<<"Vertices "<nofile,ineighbour); @@ -476,7 +474,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Edges "<4) std::cout<<"Edges "<nofile,ineighbour); @@ -486,7 +484,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Faces "<4) std::cout<<"Faces "<nofile,ineighbour); @@ -496,7 +494,7 @@ bool ghs3dprl_mesh_wrap::ReadFileMSGnew(const QString FileName) if (count>0){ med_int *tmint=new med_int[count]; for (int i=0; i>tmint[i]; - if (verbose>4) cout<<"Elements "<4) std::cout<<"Elements "<nofile,ineighbour); @@ -515,25 +513,25 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) //read file .glo with no parser xml because big file (volume) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long count; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<4) std::cout<<"Elements "<nofile); @@ -541,12 +539,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -554,12 +552,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -567,12 +565,12 @@ bool ghs3dprl_mesh_wrap::ReadFileGLO(const QString FileName) } if (!CVW_FindString("4) std::cout<<"Elements "<nofile); @@ -589,14 +587,14 @@ bool ghs3dprl_mesh_wrap::ReadFileFACES(const QString FileName) //read file .faces (wrap) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); - string line; + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); + std::string line; long nbelem,ntype; bool ok; if (!Ff.is_open()) { - cerr<<"Problem File '"<3) cout<<"FacesNumberOfElements="<3) std::cout<<"FacesNumberOfElements="<>ntype; if (ntype!=3) //only triangles { - cerr<<"Problem on ntype != 3"<>tmint[i+j]; - //for (int j=0; j<7; j++) cout<4) cout<<"Elements "<4) std::cout<<"Elements "<nofile); @@ -643,28 +641,28 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITE(const QString FileName) //(parameter option of ghs3d but NOT tepal) { QString tmp; - fstream Ff(FileName.toLatin1().constData(),ios_base::in); + std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in); long ne,np,npfixe,subnumber,reste; bool ok; if (!Ff.is_open()){ - cerr<<"Problem File '"<>ne>>np>>npfixe; if (verbose>3){ - cout<<"NoboiteNumberOfElements="<>tmint[i]; - if (verbose>4) cout<<"Elements "<4) std::cout<<"Elements "<nofile); @@ -672,14 +670,14 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITE(const QString FileName) med_float *tmflo=new med_float[np*3]; for (int i=0; i>tmflo[i]; - if (verbose>4) cout<<"Vertices "<4) std::cout<<"Vertices "<nofile); ok=this->insert_key(tmp,montab); Ff>>subnumber; - if (verbose>2) cout<<"NumberOfSubdomains="<2) std::cout<<"NumberOfSubdomains="<>onelong; //pb from tepalv2 if (onelong<0) { - if (isproblem && verbose>1) cout<<"There is one or more negative med_int value in NumberOfSubdomains "<1) std::cout<<"There is one or more negative med_int value in NumberOfSubdomains "<maxint) { - if (isproblem && verbose>1) cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<1) std::cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<4) cout<<"Subdomains "<4) std::cout<<"Subdomains "<nofile); @@ -727,7 +725,7 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITEB(const QString FileName) { bool ok; QString tmp; - cerr<<"Problem function ReadFileNOBOITEB\n" + std::cerr<<"Problem function ReadFileNOBOITEB\n" <<"(no FORTRAN binary format files in tepal)\n\n"; //file binary FILE *Ff=fopen(FileName.toLatin1().constData(),"rb"); @@ -738,24 +736,24 @@ bool ghs3dprl_mesh_wrap::ReadFileNOBOITEB(const QString FileName) //=> 2*long(68) (68=17*4octets) long r1[17+2]; if (!Ff){ - cerr<<"Problem File '"<3){ - cout<<"NoboitebNumberOfElements="<4) std::cout<<"Elements "<nofile); ok=this->insert_key(tmp,montab); fread(&reste,sizeof(long),1,Ff); - //cout<<"info "<2) cout<<"NumberOfSubdomains="<2) std::cout<<"NumberOfSubdomains="<2) cout<<"NumberOfVertices="<2) std::cout<<"NumberOfVertices="< size="<size< size="<size<verbose>6) cout<<"remove key "<verbose>6) std::cout<<"remove key "< it(this->mestab); while ( it.hasNext() ){ it.next(); if (it.key().contains(rxp)) nbremove++; } - //cout<<"nb_key_mesh_wrap found "<tmint){ if (verbose>3) - cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< + std::cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< " NbElements "<tmint,sizeof(med_int),taille,fichier); //fread(&gagnants,sizeof(gagnants),1,fichier); } if (tab->tmflo){ if (verbose>3) - cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< + std::cout<<"SwapOnFile_binary "<filename.toLatin1().constData()<< " NbElements "<tmflo,sizeof(med_float),taille,fichier); } fclose(fichier); } else{ - if (verbose>3) cout<<"SwapOnFile in binary file done yet "<< - tab->filename.toLatin1().constData()<3) std::cout<<"SwapOnFile in binary file done yet "<< + tab->filename.toLatin1().constData()<CVWtab_deallocate(); //free memory @@ -985,9 +983,9 @@ long ghs3dprl_mesh_wrap::SwapOutOfMemory_key_mesh_wrap(const QRegExp &rxp, nb++; if ((it.value()->size>0)&&(it.value()->size>ifgreaterthan)){ if (verbose>3) - cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<< + std::cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<< it.key().toLatin1().constData()<< - " size "<size<<">"<size<<">"<path,it.value(),this->verbose); } @@ -1000,17 +998,17 @@ bool ghs3dprl_mesh_wrap::list_onekey_mesh_wrap(const QString &key) { CVWtab *montab=this->mestab[key]; if (montab){ - //cout<<"key "< size="<size< size="<size<type==1) for ( long i=0; isize; i++ ) - cout<tmint[i]<<" "; + std::cout<tmint[i]<<" "; if (montab->type==2) for ( long i=0; isize; i++ ) - cout<tmflo[i]<<" "; - cout<tmflo[i]<<" "; + std::cout<4) - cout<<"insert key "<nbelem_limit_swapsize) { - if (verbose>3) cout<<"insert key automatic SwapOnFile "<< - key.toLatin1().constData()<3) std::cout<<"insert key automatic SwapOnFile "<< + key.toLatin1().constData()<path,tab,this->verbose); } this->mestab.insert(key,tab); @@ -1042,41 +1040,41 @@ CVWtab* ghs3dprl_mesh_wrap::restore_key(const QString &key) { CVWtab *tab=NULL; tab=this->mestab[key]; - /*if (tab) cout<<" -> size in proc "<size< tab NULL\n";*/ + /*if (tab) std::cout<<" -> size in proc "<size< tab NULL\n";*/ if (!tab) //it is NOT a problem { - if (verbose>6) cout<<"restore key not found "<6) std::cout<<"restore key not found "<size > 0){ - if (verbose>5) cout<<"restore key direct from memory "<filename.toLatin1().constData()<< - " type unexpexted "<type<filename.toLatin1().constData()<< + " type unexpexted "<type<filename<filename<filename.toLatin1().constData(),"rb"); long taille; fread(&taille,sizeof(long),1,fichier); if (taille!=-tab->size){ - cerr<<"Problem restore_key from binary file "<filename.toLatin1().constData()<< - " size unexpexted "<size<filename.toLatin1().constData()<< + " size unexpexted "<size<type==1){ if (verbose>5) - cout<<"restore key from binary file "<filename.toLatin1().constData()<< + std::cout<<"restore key from binary file "<filename.toLatin1().constData()<< " number of elements "<tmint=new med_int[taille]; //allocate memory @@ -1084,16 +1082,16 @@ CVWtab* ghs3dprl_mesh_wrap::restore_key(const QString &key) } if (tab->type==2){ if (verbose>5) - cout<<"restore key from binary file "<filename.toLatin1().constData()<< + std::cout<<"restore key from binary file "<filename.toLatin1().constData()<< " number of elements "<tmflo=new med_float[taille]; //allocate memory for (int i=0; itmflo[i]=-1e0; fread(tab->tmflo,sizeof(med_float),taille,fichier); - /*for (int i=0; itmflo[i]<<"/"; - cout<tmflo[i]<<"/"; + std::cout<size=-tab->size; @@ -1117,26 +1115,26 @@ bool ghs3dprl_mesh_wrap::test_msg_wrap() if (ifile==ineig) continue; //impossible key1=key1.sprintf("MS%ld NE%ld ",ifile,ineig)+typ.section(' ',i,i)+" SE"; key2=key2.sprintf("MS%ld NE%ld ",ifile,ineig)+typ.section(' ',i,i)+" RE"; - //cout<<"key "<restore_key(key1); //tab1=this->mestab[key1]; tab2=this->restore_key(key2); //tab2=this->mestab[key2]; - //cout<<"sortie key "<is_equal(tab2)) - { cout<<"key "<restore_key(key2); //tab2=this->mestab[key2]; if (!tab1 && !tab2) continue; //case not neighbours if (!tab1) - { cout<<"key "<type!=tab2->type)||(tab1->size!=tab2->size)) - { cout<<"key "<size!=tab2->size) { - cerr<<"TestEqualityCoordinates key "<2)&&(ok1)) - cout<<"TestEqualityCoordinates "<size<< - " Vertices "<size<< + " Vertices "<size<< - " Vertices "<size<< + " Vertices "<restore_key(QString("SKIN_VERTICES_COORDINATES")); if (!cooskin) return false; - if (verbose>4)cout<<"NumberVerticesSKIN="<size/3<4)std::cout<<"NumberVerticesSKIN="<size/3<nbfiles; ifile++) { @@ -1293,11 +1291,11 @@ bool ghs3dprl_mesh_wrap::Find_VerticesDomainToVerticesSkin() key2=key2.sprintf("GL%ld VE",ifile); glodom=this->restore_key(key2); if (verbose>4) - cout<<"NumberVerticesDOMAIN_"<size<8){ - cout<<"\nglobal numbering nodes: no iglo\n"; + std::cout<<"\nglobal numbering nodes: no iglo\n"; for (jd=0; jd < glodom->size; jd++) - cout<<"\t"<tmint[jd]<tmint[jd]<size; jd=jd+3) { p2=(coodom->tmflo+jd); @@ -1319,8 +1317,8 @@ bool ghs3dprl_mesh_wrap::Find_VerticesDomainToVerticesSkin() p1=(cooskin->tmflo+js); if (p1[0]==p2[0] && p1[1]==p2[1] && p1[2]==p2[2]) { - cout<<"\t"<tmint[i]-1<< - key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<tmint[i]-1<< + key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<insert_key(tmp,montab); if (verbose>4){ - cout<<"NumberOfEqualsVerticesDOMAIN_"<0)cout<<"\nWrite_MEDfiles_v2\n"; - if (verbose>6){cout<<"\nInitialFamilies\n"; families.write();} + if (verbose>0)std::cout<<"\nWrite_MEDfiles_v2\n"; + if (verbose>6){std::cout<<"\nInitialFamilies\n"; families.write();} medname=medname.section('/',-1); if (medname.length()>20) { - cerr<<"CaseNameMed truncated (no more 20 characters)"<0) cout<<"CreateMEDFile for all joints <"<\n"; + if (fidjoint<0) std::cerr<<"Problem MEDfileOpen "<0) std::cout<<"CreateMEDFile for all joints <"<\n"; //copy file source/GHS3DPRL_skin.med as destination/DOMAIN.skin.med tmp=path+medname+"_skin.med"; @@ -1492,11 +1490,11 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys) int ret = access(cmd.toLatin1().constData(),F_OK); //on regarde si le fichier existe if (ret >= 0) { cmd="cp "+pathini+casename+"_skin.med "+tmp; - //cout<<"Copy skin.med Command = "<\n"; } + if (verbose>0) std::cout<<"CreateMEDFile for initial skin <"<\n"; } else { - if (verbose>0) cout<<"No CreateMEDFile <"< for initial skin because <"<< + if (verbose>0) std::cout<<"No CreateMEDFile <"< for initial skin because <"<< cmd.toLatin1().constData()<<"> does not exist\n"; } //define family 0 if not existing, no groups @@ -1507,45 +1505,45 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys) oktmp=families.get_number_of_new_family(1,&famallnodes,&tmp); families.add(tmp,"All_Nodes"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Nodes\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Nodes\"\n"; famalltria3=0; if (QString("All_Faces").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famalltria3,&tmp); families.add(tmp,"All_Faces"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Faces\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Faces\"\n"; famalltetra4=0; if (QString("All_Tetrahedra").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famalltetra4,&tmp); families.add(tmp,"All_Tetrahedra"); } - else if (verbose>3) cout<<"--deletegroups matches \"All_Tetrahedra\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"All_Tetrahedra\"\n"; famnewnodes=0; if (QString("New_Nodes").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(1,&famnewnodes,&tmp); families.add(tmp,"New_Nodes"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Nodes\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Nodes\"\n"; famnewtria3=0; if (QString("New_Faces").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famnewtria3,&tmp); families.add(tmp,"New_Faces"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Faces\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Faces\"\n"; famnewtetra4=0; if (QString("New_Tetrahedra").contains(deletegroups)==0){ oktmp=families.get_number_of_new_family(-1,&famnewtetra4,&tmp); families.add(tmp,"New_Tetrahedra"); } - else if (verbose>3) cout<<"--deletegroups matches \"New_Tetrahedra\"\n"; + else if (verbose>3) std::cout<<"--deletegroups matches \"New_Tetrahedra\"\n"; - if (verbose>6){cout<<"\nIntermediatesFamilies\n"; families.write();} - if (verbose>6) cout<<"\nNumber0fFiles="<6){std::cout<<"\nIntermediatesFamilies\n"; families.write();} + if (verbose>6) std::cout<<"\nNumber0fFiles="<"<"<0){ - if (verbose>2) cout<\n"; + if (verbose>2) std::cout<\n"; } //create mesh @@ -1575,45 +1573,45 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys) tmp=tmp.sprintf("domain %d among %d",idom,nbfilestot); charendnull(description,tmp,MED_COMMENT_SIZE); - if (verbose>4) cout<<"Description : "<4) std::cout<<"Description : "<6){cout<<"\nFinalsFamilies\n"; families.write();} + if (verbose>6){std::cout<<"\nFinalsFamilies\n"; families.write();} //for nodes families nb=create_families(fid,1); - if (verbose>5)cout<<"NumberOfFamiliesNodes="<5)std::cout<<"NumberOfFamiliesNodes="<8) - cout<<"MEDmeshEntityFamilyNumberWr nodes "<5)cout<<"NumberOfFamiliesFacesAndEdgesEtc="<5)std::cout<<"NumberOfFamiliesFacesAndEdgesEtc="<8) - cout<<"MEDmeshEntityFamilyNumberWr tria3 "<8) - cout<<"MEDmeshEntityFamilyNumberWr tetra4 "<0)cout<<"\nTotalNumberOftetrahedra="<0)std::cout<<"\nTotalNumberOftetrahedra="<remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp)); nbnodes=tab->size/3; err=MEDmeshNodeCoordinateWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_FULL_INTERLACE,nbnodes,tab->tmflo); - if (err<0) {cerr<<"Problem MEDmeshNodeCoordinateWr"<4)cout<<"NumberOfNodes="<4)std::cout<<"NumberOfNodes="<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1) { tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".glo"; ok=this->ReadFileGLO(tmp); - if (!ok) {cerr<<"Problem file "<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1) return false; } - if (nbnodes!=tab1->size){cerr<<"Problem size GLi VE!=nbnodes!"<size){std::cerr<<"Problem size GLi VE!=nbnodes!"<restore_key(key2); //tab1=this->mestab[key1]; med_int nbskin=0; if (tab2) med_int nbskin=tab2->size; - //for (i=0; itmint[i]<tmint[i]<tmint[j]<< + //std::cout<<"nodes loc "<tmint[j]<< // tmp.sprintf("\t%23.15e%23.15e%23.15e",tab3->tmflo[i*3], - // tab3->tmflo[i*3+1],tab3->tmflo[i*3+2])<tmflo[i*3+1],tab3->tmflo[i*3+2])<tmint); - if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr nodes"< newfam "< newfam "<300) cout<< - "***set_one_more_family*** warning many initial families could decrease speed "<300) std::cout<< + "***set_one_more_family*** warning many initial families could decrease speed "< newfam "< newfam "<=0) newfami[ii]=newfam; } /*else { - cout<<"!!! oldfam "< newfam "< newfam "<size/7; - if (verbose>4) cout<<"NumberOfTriangles="<4) std::cout<<"NumberOfTriangles="<restore_key(key1); //tab1=this->mestab[key1]; - if (nbtria3!=tab1->size){cerr<<"Problem size GLi FA!=nbtria3!"<size){std::cerr<<"Problem size GLi FA!=nbtria3!"<restore_key(key2); //tab1=this->mestab[key1]; @@ -1880,9 +1878,9 @@ bool ghs3dprl_mesh_wrap::idom_faces() //writing faces(triangles) global numbering if (verbose>2) - cout<<"CreateMEDglobalNumerotation_Faces "<size<size<size,tab1->tmint); - if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr faces"<remove_key_mesh_wrap(QRegExp("FC*",true,true)); tmp=tmp.sprintf("GL%d FA",idom); @@ -1909,7 +1907,7 @@ bool ghs3dprl_mesh_wrap::idom_joints() med_int numfam_ini_wrap=100; joints_node=xmlNewNode(NULL, BAD_CAST "joints"); //masterfile.xml med_int nbjoints=0,nbnodesneig,nbtria3neig; - string sjoints=""; //which domains are neighbourg + std::string sjoints=""; //which domains are neighbourg int xx; char dtunit[MED_SNAME_SIZE+1]="_NO_UNIT"; char axisname[MED_SNAME_SIZE*3+1]="x y z "; @@ -1933,7 +1931,7 @@ bool ghs3dprl_mesh_wrap::idom_joints() tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".msg"; ok=this->ReadFileMSGnew(tmp); if (!ok) { - cerr<<"Problem in file "<no joints @@ -1956,24 +1954,24 @@ bool ghs3dprl_mesh_wrap::idom_joints() ok=this->ReadFileMSGnew(tmp); this->nofile=idom; //restaure initial domain if (!ok) { - cerr<<"Problem in file "<restore_key(key1); } - if (!tab2) cerr<<"Problem existing nodes joint in domain "<size; nbnodesneig=tab2->size; if (nb!=nbnodesneig) { - cerr<<"Problem in file "<"<"<4) - cout<<"NumberOfNodesOfJoint_"<restore_key(key1); //tab1=this->mestab[key1]; if (!tab1){ if (verbose>4) - cout<<"NumberOfTrianglesOfJoint_"<no joints } else //have to set xml may be no faces but nodes in a joint! { key1=key1.sprintf("MS%d NE%d FA SE",ineig,idom); //SE or RE identicals tab2=this->restore_key(key1); - if (!tab2) cerr<<"Problem existing triangles of joint in domain "<size; nbtria3neig=tab2->size; if (nb!=nbtria3neig) { - cerr<<"Problem in file "<"<"<size; nbtria3neig=nb; if (verbose>4) - cout<<"NumberOfTrianglesOfJoint_"<0) { - //for (i=0; irestore_key(key1); //tab1=this->mestab[key1]; nbtetra4=tab1->size/4; nbtetrastotal=nbtetrastotal + nbtetra4; - if (verbose>5)cout<<"NumberOftetrahedra="<5)std::cout<<"NumberOftetrahedra="<tmint); - if (err<0){cerr<<"Problem MEDmeshElementConnectivityWr for tetra connectivity"<size!=nbtetra4){ - cerr<<"Problem incorrect size of tetrahedra global numbering"<2) - cout<<"CreateMEDglobalNumerotation_tetrahedra "<size<size<size,tab1->tmint); - if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr tetrahedra"<remove_key_mesh_wrap(QRegExp(tmp,true,true)); @@ -2233,20 +2231,20 @@ med_int ghs3dprl_mesh_wrap::create_families(med_idt fid, int sign) //med_int natt=0; ngro=(*it1).second.size(); if (verbose>5) - cout<<"CreateFamilyInMEDFile <"<\tNbGroups="<\tNbGroups="<5)cout<<" <"<<&gro[i*MED_LNAME_SIZE]<<"> "; + if (verbose>5)std::cout<<" <"<<&gro[i*MED_LNAME_SIZE]<<"> "; i++; } - if (verbose>5)cout<5)std::cout< } -using namespace std; - //************************************ med_idt ouvre_fichier_MED(char *fichier,int verbose) { @@ -70,7 +68,7 @@ med_idt ouvre_fichier_MED(char *fichier,int verbose) med_bool hdfok,medok; ret = MEDfileCompatibility(fichier,&hdfok,&medok); if (ret < 0){ - cerr<<"File "<verbose); if (fid == 0) { - cerr<<"Problem opening file "< 1) cout<<"More than one mesh in "< 1) std::cout<<"More than one mesh in "<nommaa,&sdim,&mdim,&type_maillage,mymailw->maillage_description, dtunit,&sortingtype,&nstep,&axistype,axisname,axisunit); if (ret < 0){ - cerr<<"Problem MEDmeshInfo in "<nommaa,MED_CONN,MED_MAILLE,typmai[i],typ_con); //lecture_nombre_mailles_standards(fid,nommaa,typmai[i],typ_con,i); - if (mymailw->verbose>6) cout<<"NumberOf"<verbose>6) std::cout<<"NumberOf"<nommaa,MED_NO_DT,MED_NO_IT, @@ -190,13 +188,13 @@ bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw) //combien de familles ? nfam=MEDnFamily(fid,mymailw->nommaa); if (mymailw->verbose>2) { - cout<<"\nNumberOfFamilies="<nommaa,i+1); if (ngro < 0){ - cerr<<"Problem reading number of groups of family\n"; + std::cerr<<"Problem reading number of groups of family\n"; continue; } @@ -227,20 +225,20 @@ med_int famdelete[nfam],ifamdelete=0,idelete; ret = MEDfamilyInfo(fid,mymailw->nommaa,i+1,nomfam,&numfam,gro); if (ret < 0){ - cerr<<"Problem reading informations of family\n"; + std::cerr<<"Problem reading informations of family\n"; continue; } if (mymailw->verbose>8) { - cout<<"Family "<deletegroups)>0) { - //cout<<"idelete++ "<0) { //only delete family whith all delete groups - //cout<<"famdelete++ "<0) { sgro="Skin_"+sgro; //pas sur que ce soit pertinent } - if (mymailw->verbose>8) cout<<"families.add("<verbose>8) std::cout<<"families.add("<families.add(sfam,sgro); } else { //sgro="Skin_"+sgro; //pas sur que ce soit pertinent - //cout<<"--deletegroups matches \""<verbose>3) cout<<"--deletegroups matches \""<< + //std::cout<<"--deletegroups matches \""<verbose>3) std::cout<<"--deletegroups matches \""<< sgro.toLatin1().constData()<< - "\" in family "<deletegroups)==0){ //sgro="Skin_"+sgro; //pas sur que ce soit pertinent - cout<<"families.add("<families.add(sfam,sgro); } else { - cout<<"--deletegroups matches \""<verbose>3){ - cout<<"\nFamiliesAndGroupsOf "<families.write(); } /* Allocations memoires */ @@ -323,24 +321,24 @@ if (mymailw->verbose>3){ ret=MEDmeshNodeCoordinateRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_FULL_INTERLACE,coo); //mdim,coo,mode_coo,MED_ALL,pfltab,0,&rep,mymailw->nomcoo,mymailw->unicoo); if (ret < 0){ - cerr<<"Problem reading nodes\n"; + std::cerr<<"Problem reading nodes\n"; ret = MEDfileClose(fid); //return false; } ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_NODE,MED_NONE,famnodesskin); //famnodesskin,nnoe,MED_NOEUD,(med_geometrie_element) 0); if (ret < 0){ - cerr<<"Problem reading families of nodes\n"; + std::cerr<<"Problem reading families of nodes\n"; ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nVertices: no x y z family\n"; + std::cout<<"\nVertices: no x y z family\n"; for (i=0;iverbose>3){ MED_CELL,MED_SEG2,MED_NODAL,MED_FULL_INTERLACE,conn2); //mdim,conn2,mode_coo,pfltab,0,MED_MAILLE,MED_SEG2,MED_NOD); if (ret < 0){ - cerr<<"Problem reading MED_SEG2\n"; + std::cerr<<"Problem reading MED_SEG2\n"; ret = MEDfileClose(fid); //return false; } @@ -356,17 +354,17 @@ if (mymailw->verbose>3){ ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_CELL,MED_SEG2,famseg2skin); //MEDfamLire(fid,mymailw->nommaa,famseg2skin,nbseg2,MED_MAILLE,MED_SEG2); if (ret < 0){ - cerr<<"Problem reading families of MED_SEG2\n"; + std::cerr<<"Problem reading families of MED_SEG2\n"; ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nConnectivity MED_SEG2: no node1 node2 family\n"; + std::cout<<"\nConnectivity MED_SEG2: no node1 node2 family\n"; for (i=0;iverbose>3){ MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,pfltab); //MEDconnLire(fid,mymailw->nommaa,mdim,conn3,mode_coo,pfltab,0,MED_MAILLE,MED_TRIA3,MED_NOD); if (ret < 0){ - cerr<<"Problem reading MED_TRIA3\n"; + std::cerr<<"Problem reading MED_TRIA3\n"; ret = MEDfileClose(fid); //return false; } @@ -382,17 +380,17 @@ if (mymailw->verbose>3){ ret=MEDmeshEntityFamilyNumberRd(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,famtria3skin); //MEDfamLire(fid,mymailw->nommaa,famtria3skin,nbtria3,MED_MAILLE,MED_TRIA3); if (ret < 0){ - cerr<<"Problem reading families of MED_TRIA3\n"; + std::cerr<<"Problem reading families of MED_TRIA3\n"; ret = MEDfileClose(fid); return false; } if (mymailw->verbose>9) { - cout<<"\nConnectivity MED_TRIA3: no node1 node2 node3 family\n"; + std::cout<<"\nConnectivity MED_TRIA3: no node1 node2 node3 family\n"; for (i=0;iverbose>3){ delete[] nufano;*/ if (ifamdelete>0) { - //cout<<"!!!!!!!!nodes "<verbose>3){ ret = MEDfileClose(fid); if (ret < 0){ - cerr<<"Problem closing "<2048){ //delirium in 2008 - cerr<<"--number: a positive integer <= 2048 is expected\n\n"; + std::cerr<<"--number: a positive integer <= 2048 is expected\n\n"; return 1; } if (!cmedname) cmedname=ccasename; @@ -602,11 +600,11 @@ int main(int argc, char *argv[]) tmp=climitswap; limit_swap=tmp.toLong(&ok,10); if (!ok){ - cerr<<"--limitswap: an integer is expected. try 1000\n\n"; + std::cerr<<"--limitswap: an integer is expected. try 1000\n\n"; return 1; } if (limit_swap<1 || limit_swap>32000){ - cerr<<"--limitswap: [1->32000] expected. try 1000\n\n"; + std::cerr<<"--limitswap: [1->32000] expected. try 1000\n\n"; return 1; } } @@ -619,11 +617,11 @@ int main(int argc, char *argv[]) tmp=cverbose; verbose=tmp.toLong(&ok,10); if (!ok){ - cerr<<"--verbose: an integer is expected\n\n"; + std::cerr<<"--verbose: an integer is expected\n\n"; return 1; } if (verbose<0){ - cerr<<"--verbose: a positive integer is expected\n\n"; + std::cerr<<"--verbose: a positive integer is expected\n\n"; return 1; } } @@ -661,7 +659,7 @@ int main(int argc, char *argv[]) m->show(); a.exec(); if ( m->result() == QDialog::Accepted ) { - cout<<"parameters "<KeepFiles()<<" "<NbPart()<KeepFiles()<<" "<NbPart()<NbPart(); } else { @@ -677,7 +675,7 @@ int main(int argc, char *argv[]) path="./"; casenamemed=casenamemed.section('/',-1); if (casenamemed.length()>20){ - cerr<<"--medname truncated (no more 20 characters)"<20){ - cerr<<"--casename truncated (no more 20 characters)"<0) - cout<<"tepal2med "< "+path+"tepal.log"; cmd="tepal -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log"; - cout<<"\nlaunchtepal command: background="<families.no=1; - //cout<<"coucou1 "<families.no<families.no<families.add(casename,casenamemed); format=format.sprintf("%d",nbfiles); int nbf=format.length(); @@ -775,12 +773,12 @@ int main(int argc, char *argv[]) if (ret >= 0) { ok=ReadFileMED(fileskinmed,mymailw); } else { - if (verbose>0)cout<<"Initial skin file <"< does not exist\n"; } + if (verbose>0)std::cout<<"Initial skin file <"< does not exist\n"; } //if test read all files before (only small files) if (test=="yes"){ - if (verbose>0) cout<<"\nReading output files of tepal as input files of tepal2med...\n"; + if (verbose>0) std::cout<<"\nReading output files of tepal as input files of tepal2med...\n"; //read files .msg //supposed big files big arrays so don't read with parser @@ -788,13 +786,13 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".msg"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileMSGnew(tmp); } if (verbose>0) - cout<<"NumberOfFilesMSGacquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesMSGacquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -807,26 +805,26 @@ int main(int argc, char *argv[]) mymailw->nofile=i; //tmp=casename+tmp.sprintf(".%d.%d.msg",nbfiles,i); tmp=pathini+casename+tmp.sprintf(format,nbfiles,i)+".msg"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<0) - cout<<"NumberOfFilesMSGAcquired="<nbfiles<<"\n"; + std::cout<<"NumberOfFilesMSGAcquired="<nbfiles<<"\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n"; + std::cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n"; return 1; } if (test=="yes"){ ok=mymailw->test_msg_wrap(); if (ok){ - if (verbose>0) cout<<"\nResult_test_msg_wrap=ok\n\n"; + if (verbose>0) std::cout<<"\nResult_test_msg_wrap=ok\n\n"; } else{ - cerr<<"\nResult_test_msg_wrap=NO_OK!\n\n"; + std::cerr<<"\nResult_test_msg_wrap=NO_OK!\n\n"; return 1; } } @@ -843,7 +841,7 @@ int main(int argc, char *argv[]) //because equals nb=0; nb=mymailw->remove_key_mesh_wrap(QRegExp("RE",Qt::CaseSensitive,QRegExp::RegExp)); - if (verbose>3) cout<<"NumberOfKeysRemoved="<3) std::cout<<"NumberOfKeysRemoved="<3) ok=mymailw->list_keys_mesh_wrap(); //test read files .noboiteb @@ -856,23 +854,23 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".noboite"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileNOBOITE(tmp); } if (verbose>0) - cout<<"NumberOfFilesNOBOITEAcquired="<nbfiles<<"\n"; + std::cout<<"NumberOfFilesNOBOITEAcquired="<nbfiles<<"\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n"; return 1; } //if (test=="yes"){ ok=mymailw->test_vertices_wrap(); if (ok){ - if (verbose>0) cout<<"\nResult_test_vertices_wrap=ok\n\n"; + if (verbose>0) std::cout<<"\nResult_test_vertices_wrap=ok\n\n"; } else{ - cerr<<"\nResult_test_vertices_wrap=NO_OK!\n\n"; + std::cerr<<"\nResult_test_vertices_wrap=NO_OK!\n\n"; return 1; } //} @@ -882,13 +880,13 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".faces"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileFACES(tmp); } if (verbose>0) - cout<<"NumberOfFilesFACESAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesFACESAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -898,14 +896,14 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".points"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFilePOINTS(tmp); } if (verbose>0) - cout<<"NumberOfFilesPOINTSAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesPOINTSAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles) { - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } */ @@ -916,14 +914,14 @@ int main(int argc, char *argv[]) for (int i=1; i<=nbfiles; i++){ mymailw->nofile=i; tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfiles,i)+".glo"; - if (verbose>0) cout<<"FileName="<0) std::cout<<"FileName="<ReadFileGLO(tmp); //mymailw->SwapOutOfMemory_key_mesh_wrap(QRegExp("GL",true,false)); } if (verbose>0) - cout<<"NumberOfFilesGLOAcquired="<nbfiles<<"\n\n"; + std::cout<<"NumberOfFilesGLOAcquired="<nbfiles<<"\n\n"; if (mymailw->nbfiles != nbfiles){ - cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; + std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n"; return 1; } @@ -943,7 +941,7 @@ int main(int argc, char *argv[]) //test remove points (type 3) //nb=mymailw->remove_key_mesh_wrap(QRegExp("PO",true,false)); - //cout<<"***remove_key_mesh_wrap*** remove nb="<0)cout<3)std::cout<<"***remove_all_key_mesh_wrap*** "<0)std::cout<