//#include <med_misc.h>
}
-using namespace std;
-
//utils procedures
//************************************
-string i2a(const int &v)
+std::string i2a(const int &v)
{
- ostringstream ss;
+ std::ostringstream ss;
ss<<v;
return ss.str();
}
//class familles
//************************************
void familles::newfam(QString nom){
- //cout<<"newfam "<<nom<<endl;
+ //std::cout<<"newfam "<<nom<<std::endl;
if (fam.find(nom)!=fam.end()){
- cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
+ std::cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
//************************************
void familles::newgro(QString nom){
- //cout<<"newgro "<<nom<<endl;
+ //std::cout<<"newgro "<<nom<<std::endl;
if (gro.find(nom)!=gro.end()){
- cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
+ std::cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
int nbf=0,nbg=0;
for (it1=fam.begin(); it1!=fam.end(); ++it1){
nbf++;
- cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\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<<endl;
+ std::cout<<std::endl;
}
- if (nbf==0) cout<<"no families"<<endl;
+ if (nbf==0) std::cout<<"no families"<<std::endl;
for (it1=gro.begin(); it1!=gro.end(); ++it1){
nbg++;
- cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\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<<endl;
+ std::cout<<std::endl;
}
- if (nbg==0) cout<<"no groups"<<endl;
+ if (nbg==0) std::cout<<"no groups"<<std::endl;
}
//************************************
fagr::iterator it1;
fend::iterator it2;
int nb=0,nbf;
- string ss;
+ std::string ss;
xmlNodePtr res,node;
res=xmlNewNode(NULL, BAD_CAST "groups");
for (it1=gro.begin(); it1!=gro.end(); ++it1){
}
xmlNewProp(node, BAD_CAST "families_number", BAD_CAST i2a(nbf).c_str());
xmlNewProp(node, BAD_CAST "families", BAD_CAST ss.substr(1).c_str());
- //cout<<endl;
+ //std::cout<<std::endl;
}
xmlNewProp(res, BAD_CAST "number", BAD_CAST i2a(nb).c_str());
return res;
//************************************
void familles::add(QString nomfam, QString nomgro)
{
- //cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //std::cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
fagr::iterator it;
it=fam.find(nomfam);
if (it==fam.end()){
- //cout<<"add new family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //std::cout<<"add new family <"<<nomfam<<">\t<"<<nomgro<<">\n";
newfam(nomfam);
it=fam.find(nomfam);
}
(*it).second[nomgro]=0;
it=gro.find(nomgro);
if (it==gro.end()){
- //cout<<"***new*** "<<nomgro<<" non present\n";
+ //std::cout<<"***new*** "<<nomgro<<" non present\n";
newgro(nomgro);
it=gro.find(nomgro);
}
it=fam.find(nomfam);
if (it==fam.end()) {
*tmp=nomfam; *ires=ii;
- //cout<<"NewFamily Found<"<<*ires<<"><"<<*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"<<endl;
+ std::cerr<<"***get_number_of_new_family*** Problem new family not found"<<std::endl;
return false;
}
for (it1=fam.begin(); it1!=fam.end(); ++it1){
if (gb==(*it1).second){
ires=(*it1).first.toLong();
- //cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
+ //std::cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
// fam1<<"><"<<fam2<<">\n";
return ires;
}
}
- //cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<endl;
+ //std::cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<std::endl;
QString tmp;
//fam1 positive for nodes negative faces & mailles
bool oktmp=get_number_of_new_family(fam1,&ires,&tmp);
for (it=gb.begin(); it!=gb.end(); ++it){
this->add(tmp,(*it).first);
}
- //cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
+ //std::cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
return ires;
}
nom2=nom2.sprintf("%d",fam2);
it2=fam.find(nom2);
if ( (it1==fam.end())||(it2==fam.end()) ) {
- cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<endl;
+ std::cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<std::endl;
fend gb;
return gb; //empty
}
gb.insert((*it2).second.begin(),(*it2).second.end()); //other groups
return gb;
//for debug
- cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
+ std::cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
fend::iterator it;
for (it=gb.begin(); it!=gb.end(); ++it){
- cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
+ std::cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
}
- cout<<endl;
+ std::cout<<std::endl;
return gb;
}
CVWtab::CVWtab(long nb, med_int *pmint)
//constructor with pmint allocated yet with new
{
- //cout"***constructor med_int CVWtab***\n";
+ //std::cout"***constructor med_int CVWtab***\n";
size=nb;
type=1; //only tmint valide
tmint=pmint;
tmflo=NULL;
memoryuse=memoryuse+sizeof(med_int)*nb;
- //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
+ //std::cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
if (memoryuse>memorymax) {
- cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
- //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<endl;
+ std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
+ //std::cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<std::endl;
}
}
CVWtab::CVWtab(long nb, med_float *pmflo)
//constructor with pmflo allocated yet with new
{
- //cout<<"***constructor med_float CVWtab***\n";
+ //std::cout<<"***constructor med_float CVWtab***\n";
size=nb;
type=2; //only tmflo valide
tmint=NULL;
tmflo=pmflo;
memoryuse=memoryuse+sizeof(med_float)*nb;
- //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
+ //std::cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
if (memoryuse>memorymax) {
- cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
- //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<endl;
+ std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
+ //std::cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<std::endl;
}
}
CVWtab::~CVWtab()
{
bool ok;
- //cout<<" destructor CVWtab *** "<<this->filename<<endl;
+ //std::cout<<" destructor CVWtab *** "<<this->filename<<std::endl;
ok=this->CVWtab_deallocate();
//remove temporary file
if (this->filename!="_NO_FILE")
{
remove(this->filename.toLatin1().constData()); //#include <stdio.h>
- //cout<<this->filename<<" successfully deleted\n";
+ //std::cout<<this->filename<<" successfully deleted\n";
}
}
//************************************
bool CVWtab::CVWtab_deallocate()
{
- //cout<<" deallocate CVWtab*** "<<size<<endl;
+ //std::cout<<" deallocate CVWtab*** "<<size<<std::endl;
if (size <= 0) return false;
if (tmint)
{
memoryuse=memoryuse-sizeof(med_float)*size;
size=-size; //precaution
}
- if (memoryuse<0) cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<endl;
- if (memoryuse==0) cout<<"***CVWtab_deallocate*** memoryuse=0 "<<endl;
+ if (memoryuse<0) std::cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<std::endl;
+ if (memoryuse==0) std::cout<<"***CVWtab_deallocate*** memoryuse=0 "<<std::endl;
return true;
}
//************************************
bool CVWtab::is_equal(CVWtab *tab2)
{
- //cout<<"is_equal tab1 tab2 type="<<this->type<<" size="<<this->size<<" "<<tab2->size<<endl;
- //if (this->type==1) cout<<"med_int tab1[0]="<<this->tmint[0]<<endl;
- //if (this->type==2) cout<<"med_float tab1[0]="<<this->tmflo[0]<<endl;
+ //std::cout<<"is_equal tab1 tab2 type="<<this->type<<" size="<<this->size<<" "<<tab2->size<<std::endl;
+ //if (this->type==1) std::cout<<"med_int tab1[0]="<<this->tmint[0]<<std::endl;
+ //if (this->type==2) std::cout<<"med_float tab1[0]="<<this->tmflo[0]<<std::endl;
if (this->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="<<this->size<<endl;
+ { std::cout<<"***is_equal*** pb pointer NULL with tmint size="<<this->size<<std::endl;
return false;
}
for (long i=0; i < this->size; i++)
if (this->type==2)
{
if (!this->tmflo)
- { cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<endl;
+ { std::cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<std::endl;
return false;
}
for (long i=0; i < this->size; i++)
//verbose 1 for print vertices not equals
//verbose 2 for print also vertices equals (debug)
{
- //cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<endl;
+ //std::cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<std::endl;
bool ok=false;
med_float *p1,*p2;
//vertices indices from 1 not 0!
long di1=(i1-1)*3, di2=(i2-1)*3;
if (di1<0 || di1>=tab1->size)
{
- cerr<<"BadIndice tab1 in is_equal_vertices "<<
- di1<<" not in "<<tab1->size<<endl;
+ std::cerr<<"BadIndice tab1 in is_equal_vertices "<<
+ di1<<" not in "<<tab1->size<<std::endl;
return false;
}
if (di2<0 || di2>=tab2->size)
{
- cerr<<"BadIndice tab2 in is_equal_vertices "<<
- di2<<" not in "<<tab2->size<<endl;
+ std::cerr<<"BadIndice tab2 in is_equal_vertices "<<
+ di2<<" not in "<<tab2->size<<std::endl;
return false;
}
p1=(tab1->tmflo+di1);
}
//************************************
-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
{
}
else
{
- cerr<<"Problem line '"<<str<<"' not found in file\n"<<endl;
+ std::cerr<<"Problem line '"<<str<<"' not found in file\n"<<std::endl;
return false;
}
} while (1);
//no read of <receive> 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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
//Lit les donn�s :
if (!CVW_FindString("<neighbours count=",Ff,nbneighbour)) return false;
- if (verbose>2) cout<<"NeighboursCountDomain_"<<this->nofile<<"="<<nbneighbour<<endl;
+ if (verbose>2) std::cout<<"NeighboursCountDomain_"<<this->nofile<<"="<<nbneighbour<<std::endl;
for (i=1; i<=nbneighbour; i++)
{
if (!CVW_FindString("<neighbour indice=",Ff,ineighbour)) return false;
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld VE SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld ED SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld FA SE",this->nofile,ineighbour);
if (count>0){
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld EL SE",this->nofile,ineighbour);
//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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
//Lit les donn�s :
if (!CVW_FindString("<vertices count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloVerticesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloVerticesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld VE",this->nofile);
}
if (!CVW_FindString("<edges count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloEdgesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloEdgesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld ED",this->nofile);
}
if (!CVW_FindString("<faces count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloFacesCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloFacesCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld FA",this->nofile);
}
if (!CVW_FindString("<elements count=",Ff,count)) return false;
- if (verbose>3) cout<<"GloElementsCount="<<count<<endl;
+ if (verbose>3) std::cout<<"GloElementsCount="<<count<<std::endl;
if (count>0)
{
med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld EL",this->nofile);
//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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
}
else
{
- cerr<<"Problem on first line of file"<<endl;
+ std::cerr<<"Problem on first line of file"<<std::endl;
return false;
}
- if (verbose>3) cout<<"FacesNumberOfElements="<<nbelem<<endl;
+ if (verbose>3) std::cout<<"FacesNumberOfElements="<<nbelem<<std::endl;
med_int *tmint=new med_int[nbelem*7];
for (int i=0; i<nbelem*7; i=i+7)
{
Ff>>ntype;
if (ntype!=3) //only triangles
{
- cerr<<"Problem on ntype != 3"<<endl;
+ std::cerr<<"Problem on ntype != 3"<<std::endl;
return false;
}
for (int j=0; j<7; j++) Ff>>tmint[i+j];
- //for (int j=0; j<7; j++) cout<<tmint[i+j]<<' '; cout<<endl;
+ //for (int j=0; j<7; j++) std::cout<<tmint[i+j]<<' '; std::cout<<std::endl;
}
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<std::endl;
CVWtab *montab=new CVWtab(nbelem*7,tmint);
tmp=tmp.sprintf("FC%ld",this->nofile);
//(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 '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
//lit les donn�s :
Ff>>ne>>np>>npfixe;
if (verbose>3){
- cout<<"NoboiteNumberOfElements="<<ne<<endl;
- cout<<"NoboiteNumberOfVertices="<<np<<endl;
- cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<endl;
+ std::cout<<"NoboiteNumberOfElements="<<ne<<std::endl;
+ std::cout<<"NoboiteNumberOfVertices="<<np<<std::endl;
+ std::cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<std::endl;
}
for (int i=1; i<=17-3; i++) Ff>>reste;
//printf("reste %ld\n",reste);
med_int *tmint=new med_int[ne*4];
for (int i=0; i<ne*4; i++) Ff>>tmint[i];
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
CVWtab *montab=new CVWtab(ne*4,tmint);
tmp=tmp.sprintf("NB%ld EV",this->nofile);
med_float *tmflo=new med_float[np*3];
for (int i=0; i<np*3; i++) Ff>>tmflo[i];
- if (verbose>4) cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<endl;
+ if (verbose>4) std::cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<std::endl;
montab=new CVWtab(np*3,tmflo);
tmp=tmp.sprintf("NB%ld VC",this->nofile);
ok=this->insert_key(tmp,montab);
Ff>>subnumber;
- if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
+ if (verbose>2) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
//tmint=new med_int[subnumber*3];
tmint=new med_int[subnumber*3];
long onelong,maxint;
Ff>>onelong;
//pb from tepalv2
if (onelong<0) {
- if (isproblem && verbose>1) cout<<"There is one or more negative med_int value in NumberOfSubdomains "<<onelong<<endl;
+ if (isproblem && verbose>1) std::cout<<"There is one or more negative med_int value in NumberOfSubdomains "<<onelong<<std::endl;
isproblem=false;
onelong=-1;
}
if (onelong>maxint) {
- if (isproblem && verbose>1) cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<<onelong<<endl;
+ if (isproblem && verbose>1) std::cout<<"There is one or more truncated med_int value in NumberOfSubdomains "<<onelong<<std::endl;
isproblem=false;
onelong=-2;
}
tmint[i]=(int)onelong;
}
- if (verbose>4) cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<endl;
+ if (verbose>4) std::cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<std::endl;
montab=new CVWtab(subnumber*3,tmint);
tmp=tmp.sprintf("NB%ld SN",this->nofile);
{
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");
//=> 2*long(68) (68=17*4octets)
long r1[17+2];
if (!Ff){
- cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
//read datas :
fread(&r1,sizeof(long),17+2,Ff);
- for (long i=1; i<18; i++) cout<<"R1("<<i<<")="<<r1[i]<<endl;
+ for (long i=1; i<18; i++) std::cout<<"R1("<<i<<")="<<r1[i]<<std::endl;
if (r1[0]!=68){
- cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<endl;
+ std::cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<std::endl;
return false;
}
ne=r1[1];
np=r1[2];
npfixe=r1[3];
if (verbose>3){
- cout<<"NoboitebNumberOfElements="<<ne<<endl;
- cout<<"NoboitebNumberOfVertices="<<np<<endl;
- cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<endl;
+ std::cout<<"NoboitebNumberOfElements="<<ne<<std::endl;
+ std::cout<<"NoboitebNumberOfVertices="<<np<<std::endl;
+ std::cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<std::endl;
}
//etc...could be done if necessary not debugged
fread(&reste,sizeof(long),1,Ff);
fread(&reste,sizeof(long),1,Ff);
for (long i=0; i<ne*4; i++) tmint[i]=tlong[i];
delete tlong;
- if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<endl;
+ if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
CVWtab *montab=new CVWtab(ne*4,tmint);
tmp=tmp.sprintf("NB%ld EV",this->nofile);
ok=this->insert_key(tmp,montab);
fread(&reste,sizeof(long),1,Ff);
- //cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_float)<<endl;
+ //std::cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_float)<<std::endl;
float *tfloat=new float[np*3];
med_float *tmflo=new med_float[np*3];
fread(tfloat,sizeof(float),np*3,Ff);
fread(&reste,sizeof(long),1,Ff);
fread(&subnumber,sizeof(long),1,Ff);
fread(&reste,sizeof(long),1,Ff);
- if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
+ if (verbose>2) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
fread(&reste,sizeof(long),1,Ff);
tlong=new long[subnumber*3];
fread(tlong,sizeof(long),subnumber*3,Ff);
//qt3 ok=Ff.open(IO_ReadOnly|IO_Translate);
ok=Ff.open(QIODevice::ReadOnly|QIODevice::Text);
if (!ok){
- cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
+ std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
return false;
}
tmp=Ff.readLine(maxlen);
tmp=tmp.simplified();
nb=tmp.toLong(&ok);
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
- if (verbose>2) cout<<"NumberOfVertices="<<nb<<endl;
+ if (verbose>2) std::cout<<"NumberOfVertices="<<nb<<std::endl;
med_float *tmflo=new med_float[3*nb]; //coordinates
med_int *tmint=new med_int[nb]; //nrs (attribute of point)
long il3=0;
tmp=tmp.simplified();
for ( int j=0; j<3; j++ ){
tmflo[il3]=tmp.section(' ',j,j).toDouble(&ok);
- //cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<endl;
+ //std::cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<std::endl;
il3++;
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
}
//nrs is vertex attribute
tmint[il]=tmp.section(' ',3,3).toLong(&ok);
if (!ok){
- cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
+ std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
return false;
}
}
while ( it.hasNext() ) {
it.next();
QString nom = it.key().leftJustified(32,' ');
- cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<endl;
+ std::cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<std::endl;
}
return true;
}
it.next();
if (it.key().contains(rxp)) {
nbremove++;
- if (this->verbose>6) cout<<"remove key "<<it.key().toLatin1().constData()<<endl;
+ if (this->verbose>6) std::cout<<"remove key "<<it.key().toLatin1().constData()<<std::endl;
delete it.value();
it.remove();
}
long ghs3dprl_mesh_wrap::nb_key_mesh_wrap(const QRegExp &rxp)
{
long nbremove=0;
- //cout<<"nb_key_mesh_wrap on "<<endl;
+ //std::cout<<"nb_key_mesh_wrap on "<<std::endl;
QMutableHashIterator<QString,CVWtab*> it(this->mestab);
while ( it.hasNext() ){
it.next();
if (it.key().contains(rxp)) nbremove++;
}
- //cout<<"nb_key_mesh_wrap found "<<nbremove<<endl;
+ //std::cout<<"nb_key_mesh_wrap found "<<nbremove<<std::endl;
return nbremove;
}
fwrite(&taille,sizeof(taille),1,fichier);
if (tab->tmint){
if (verbose>3)
- cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
" SizeElement_med_int "<<sizeof(med_int)<<
- " TotalSizeBinary " <<taille*sizeof(med_int)<<endl;
+ " TotalSizeBinary " <<taille*sizeof(med_int)<<std::endl;
fwrite(tab->tmint,sizeof(med_int),taille,fichier);
//fread(&gagnants,sizeof(gagnants),1,fichier);
}
if (tab->tmflo){
if (verbose>3)
- cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
" SizeElement_med_float "<<sizeof(med_float)<<
- " TotalSizeBinary " <<taille*sizeof(med_float)<<endl;
+ " TotalSizeBinary " <<taille*sizeof(med_float)<<std::endl;
fwrite(tab->tmflo,sizeof(med_float),taille,fichier);
}
fclose(fichier);
}
else{
- if (verbose>3) cout<<"SwapOnFile in binary file done yet "<<
- tab->filename.toLatin1().constData()<<endl;
+ if (verbose>3) std::cout<<"SwapOnFile in binary file done yet "<<
+ tab->filename.toLatin1().constData()<<std::endl;
}
//deallocate because swap disk binary mode
tab->CVWtab_deallocate(); //free memory
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 "<<it.value()->size<<">"<<ifgreaterthan<<endl;
+ " size "<<it.value()->size<<">"<<ifgreaterthan<<std::endl;
//free memory
ok=SwapOnFile(it.key(),this->path,it.value(),this->verbose);
}
{
CVWtab *montab=this->mestab[key];
if (montab){
- //cout<<"key "<<key<<"trouvee -> size="<<montab->size<<endl;
+ //std::cout<<"key "<<key<<"trouvee -> size="<<montab->size<<std::endl;
if (montab->type==1)
for ( long i=0; i<montab->size; i++ )
- cout<<montab->tmint[i]<<" ";
+ std::cout<<montab->tmint[i]<<" ";
if (montab->type==2)
for ( long i=0; i<montab->size; i++ )
- cout<<montab->tmflo[i]<<" ";
- cout<<endl;
+ std::cout<<montab->tmflo[i]<<" ";
+ std::cout<<std::endl;
}
else
- cout<<"key "<<key.toLatin1().constData()<<" not found"<<endl;
+ std::cout<<"key "<<key.toLatin1().constData()<<" not found"<<std::endl;
return true;
}
{
bool ok;
if (verbose>4)
- cout<<"insert key "<<key.toLatin1().constData()<<
- " size="<<tab->size<<endl;
+ std::cout<<"insert key "<<key.toLatin1().constData()<<
+ " size="<<tab->size<<std::endl;
tab->filename="_NO_FILE";
if (this->nbelem_limit_swap<tab->size) {
- if (verbose>3) cout<<"insert key automatic SwapOnFile "<<
- key.toLatin1().constData()<<endl;
+ if (verbose>3) std::cout<<"insert key automatic SwapOnFile "<<
+ key.toLatin1().constData()<<std::endl;
ok=SwapOnFile(key,this->path,tab,this->verbose);
}
this->mestab.insert(key,tab);
{
CVWtab *tab=NULL;
tab=this->mestab[key];
- /*if (tab) cout<<" -> size in proc "<<tab->size<<endl;
- else cout<<" -> tab NULL\n";*/
+ /*if (tab) std::cout<<" -> size in proc "<<tab->size<<std::endl;
+ else std::cout<<" -> tab NULL\n";*/
if (!tab) //it is NOT a problem
{
- if (verbose>6) cout<<"restore key not found "<<key.toLatin1().constData()<<endl;
+ if (verbose>6) std::cout<<"restore key not found "<<key.toLatin1().constData()<<std::endl;
return NULL;
}
if (tab->size > 0){
- if (verbose>5) cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<endl;
+ if (verbose>5) std::cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<std::endl;
return tab;
}
//restore from binary file
if ((tab->type<1)||(tab->type>2)){
- cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
- " type unexpexted "<<tab->type<<endl;
+ std::cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ " type unexpexted "<<tab->type<<std::endl;
return NULL;
}
- //cout<<"restore_key from binary file "<<tab->filename<<endl;
+ //std::cout<<"restore_key from binary file "<<tab->filename<<std::endl;
//swap disque binaire
FILE *fichier=fopen(tab->filename.toLatin1().constData(),"rb");
long taille;
fread(&taille,sizeof(long),1,fichier);
if (taille!=-tab->size){
- cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
- " size unexpexted "<<taille<<" expected "<<-tab->size<<endl;
+ std::cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
+ " size unexpexted "<<taille<<" expected "<<-tab->size<<std::endl;
fclose(fichier);
return NULL;
}
if (tab->type==1){
if (verbose>5)
- cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
" size_element med_float "<<sizeof(med_float)<<
- " total_size_binary " <<taille*sizeof(med_float)<<endl;
+ " total_size_binary " <<taille*sizeof(med_float)<<std::endl;
//allocate because swap disque binaire
tab->tmint=new med_int[taille]; //allocate memory
}
if (tab->type==2){
if (verbose>5)
- cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
" size_element med_float "<<sizeof(med_float)<<
- " total_size_binary " <<taille*sizeof(med_float)<<endl;
+ " total_size_binary " <<taille*sizeof(med_float)<<std::endl;
//allocate because swap disque binaire
tab->tmflo=new med_float[taille]; //allocate memory
for (int i=0; i<taille ; i++) tab->tmflo[i]=-1e0;
fread(tab->tmflo,sizeof(med_float),taille,fichier);
- /*for (int i=0; i<taille ; i++) cout<<tab->tmflo[i]<<"/";
- cout<<endl;*/
+ /*for (int i=0; i<taille ; i++) std::cout<<tab->tmflo[i]<<"/";
+ std::cout<<std::endl;*/
}
fclose(fichier);
tab->size=-tab->size;
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 "<<key1<<" et key "<<key2<<endl;
+ //std::cout<<"key "<<key1<<" et key "<<key2<<std::endl;
tab1=this->restore_key(key1);
//tab1=this->mestab[key1];
tab2=this->restore_key(key2);
//tab2=this->mestab[key2];
- //cout<<"sortie key "<<key1<<" et key "<<key2<<endl;
+ //std::cout<<"sortie key "<<key1<<" et key "<<key2<<std::endl;
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
{
if (!tab2)
- { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
if (!tab1->is_equal(tab2))
- { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<std::endl;
ok=false;
}
}
tab2=this->restore_key(key2); //tab2=this->mestab[key2];
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
{
if (!tab2)
- { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
+ { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
ok=false;
}
else
if ((tab1->type!=tab2->type)||(tab1->size!=tab2->size))
- { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<endl;
+ { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<std::endl;
ok=false;
}
}
if (!tab1 && !tab2) continue; //cas non voisins
if (!tab1)
{
- cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<std::endl;
ok=false; continue;
}
if (!tab2)
{
- cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
- " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
+ " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<std::endl;
ok=false; continue;
}
if (tab1->size!=tab2->size)
{
- cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT same size"<<endl;
+ std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT same size"<<std::endl;
ok=false; continue;
}
if (ok)
//1 for print vertices not equals
if (!CVW_is_equal_vertices(tab11,i1,tab22,i2,1))
{
- cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<endl;
+ std::cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<std::endl;
ok=false; ok1=false;
}
}
if ((verbose>2)&&(ok1))
- cout<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<endl;
+ std::cout<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<std::endl;
if (!ok1)
- cerr<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<endl;
+ std::cerr<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<std::endl;
key11old=key11; key22old=key22;
}
}
cooskin=this->restore_key(QString("SKIN_VERTICES_COORDINATES"));
if (!cooskin) return false;
- if (verbose>4)cout<<"NumberVerticesSKIN="<<cooskin->size/3<<endl;
+ if (verbose>4)std::cout<<"NumberVerticesSKIN="<<cooskin->size/3<<std::endl;
//ici pourrait creer BBtree sur skin
for (int ifile=1; ifile<=this->nbfiles; ifile++)
{
key2=key2.sprintf("GL%ld VE",ifile);
glodom=this->restore_key(key2);
if (verbose>4)
- cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<endl;
+ std::cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<std::endl;
if (coodom->size!=glodom->size*3)
{
- cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<endl;
+ std::cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<std::endl;
ok=false; continue;
}
//test on equality of xyz_coordinates of commons vertices
i=0;
nb=0; //nb equals vertices
if (verbose>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"<<jd<<"\t"<<glodom->tmint[jd]<<endl;
- cout<<"\nresults: no i js iglo\n";
+ std::cout<<"\t"<<jd<<"\t"<<glodom->tmint[jd]<<std::endl;
+ std::cout<<"\nresults: no i js iglo\n";
for (jd=0; jd < coodom->size; jd=jd+3)
{
p2=(coodom->tmflo+jd);
p1=(cooskin->tmflo+js);
if (p1[0]==p2[0] && p1[1]==p2[1] && p1[2]==p2[2])
{
- cout<<"\t"<<nb<<"\t"<<i<<"\t"<<js/3<<"\t"<<glodom->tmint[i]-1<<
- key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<<endl;
+ std::cout<<"\t"<<nb<<"\t"<<i<<"\t"<<js/3<<"\t"<<glodom->tmint[i]-1<<
+ key2.sprintf("\t%13.5e%13.5e%13.5e",p1[0],p1[1],p1[2]).toLatin1().constData()<<std::endl;
tab[i]=js/3; nb++; continue;
}
}
tmp=tmp.sprintf("NB%ld GL_SKIN",ifile);
ok=this->insert_key(tmp,montab);
if (verbose>4){
- cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<endl;
+ std::cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<std::endl;
}
}
}
//precaution because casename->med_nomfinal no more 32 character
//if path, in this->path.
//20 preserve for add postfixes "_idom" etc...
- if (verbose>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)"<<endl;
+ std::cerr<<"CaseNameMed truncated (no more 20 characters)"<<std::endl;
medname.truncate(20);
}
tmp=path+medname+tmp.sprintf("_joints.med",idom);
charendnull(distfilename,tmp,MED_COMMENT_SIZE);
fidjoint=MEDfileOpen(distfilename,MED_ACC_CREAT);
- if (fidjoint<0) cerr<<"Problem MEDfileOpen "<<distfilename<<endl;
- if (verbose>0) cout<<"CreateMEDFile for all joints <"<<distfilename<<">\n";
+ if (fidjoint<0) std::cerr<<"Problem MEDfileOpen "<<distfilename<<std::endl;
+ if (verbose>0) std::cout<<"CreateMEDFile for all joints <"<<distfilename<<">\n";
//copy file source/GHS3DPRL_skin.med as destination/DOMAIN.skin.med
tmp=path+medname+"_skin.med";
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 = "<<cmd<<endl;
+ //std::cout<<"Copy skin.med Command = "<<cmd<<std::endl;
system(cmd.toLatin1().constData());
- if (verbose>0) cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n"; }
+ if (verbose>0) std::cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n"; }
else {
- if (verbose>0) cout<<"No CreateMEDFile <"<<tmp.toLatin1().constData()<<"> for initial skin because <"<<
+ if (verbose>0) std::cout<<"No CreateMEDFile <"<<tmp.toLatin1().constData()<<"> for initial skin because <"<<
cmd.toLatin1().constData()<<"> does not exist\n"; }
//define family 0 if not existing, no groups
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="<<nbfilestot<<endl;
+ if (verbose>6){std::cout<<"\nIntermediatesFamilies\n"; families.write();}
+ if (verbose>6) std::cout<<"\nNumber0fFiles="<<nbfilestot<<std::endl;
familles intermediatesfamilies=families;
//initialisations on all domains
nbtetrastotal=0;
tmp=path+medname+tmp.sprintf("_%d.med",idom);
charendnull(distfilename,tmp,MED_COMMENT_SIZE);
- //cout<<"<"<<distfilename<<">"<<endl;
+ //std::cout<<"<"<<distfilename<<">"<<std::endl;
fid=MEDfileOpen(distfilename,MED_ACC_CREAT);
- if (fid<0) {cerr<<"Problem MEDfileOpen "<<distfilename<<endl; goto erreur;}
+ if (fid<0) {std::cerr<<"Problem MEDfileOpen "<<distfilename<<std::endl; goto erreur;}
if (verbose>0){
- if (verbose>2) cout<<endl;
- cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\n";
+ if (verbose>2) std::cout<<std::endl;
+ std::cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\n";
}
//create mesh
tmp=tmp.sprintf("domain %d among %d",idom,nbfilestot);
charendnull(description,tmp,MED_COMMENT_SIZE);
- if (verbose>4) cout<<"Description : "<<description<<endl;
+ if (verbose>4) std::cout<<"Description : "<<description<<std::endl;
err=MEDmeshCr(fid,nomfinal,3,3,MED_UNSTRUCTURED_MESH,description,dtunit,MED_SORT_DTIT,MED_CARTESIAN,axisname,axisunit);
- if (err<0) {cerr<<"Problem MEDmeshCr"<<nomfinal<<endl; goto erreur;}
+ if (err<0) {std::cerr<<"Problem MEDmeshCr"<<nomfinal<<std::endl; goto erreur;}
- if (!idom_nodes()) {cerr<<"Problem on Nodes"<<endl; goto erreur;}
- if (!idom_edges()) {cerr<<"Problem on Edges"<<endl; goto erreur;}
- if (!idom_faces()) {cerr<<"Problem on Faces"<<endl; goto erreur;}
- if (!idom_tetras()) {cerr<<"Problem on tetrahedra"<<endl; goto erreur;}
- if (!idom_joints()) {cerr<<"Problem on Joints"<<endl; goto erreur;}
+ if (!idom_nodes()) {std::cerr<<"Problem on Nodes"<<std::endl; goto erreur;}
+ if (!idom_edges()) {std::cerr<<"Problem on Edges"<<std::endl; goto erreur;}
+ if (!idom_faces()) {std::cerr<<"Problem on Faces"<<std::endl; goto erreur;}
+ if (!idom_tetras()) {std::cerr<<"Problem on tetrahedra"<<std::endl; goto erreur;}
+ if (!idom_joints()) {std::cerr<<"Problem on Joints"<<std::endl; goto erreur;}
- if (verbose>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="<<nb<<endl;
+ if (verbose>5)std::cout<<"NumberOfFamiliesNodes="<<nb<<std::endl;
err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,famnodes);
if (verbose>8)
- cout<<"MEDmeshEntityFamilyNumberWr nodes "<<nbnodes<<":"<<
- famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr nodes "<<nbnodes<<":"<<
+ famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<std::endl;
delete[] famnodes;
- if (err<0) cerr<<"Problem MEDmeshEntityFamilyNumberWr nodes"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr nodes"<<std::endl;
//for others families
nb=create_families(fid,-1);
- if (verbose>5)cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<endl;
+ if (verbose>5)std::cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<std::endl;
err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3,famtria3);
if (verbose>8)
- cout<<"MEDmeshEntityFamilyNumberWr tria3 "<<nbtria3<<":"<<
- famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr tria3 "<<nbtria3<<":"<<
+ famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<std::endl;
delete[] famtria3;
- if (err<0) cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<std::endl;
err=MEDmeshEntityFamilyNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,nbtetra4,famtetra4);
if (verbose>8)
- cout<<"MEDmeshEntityFamilyNumberWr tetra4 "<<nbtetra4<<":"<<
- famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<endl;
+ std::cout<<"MEDmeshEntityFamilyNumberWr tetra4 "<<nbtetra4<<":"<<
+ famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<std::endl;
delete[] famtetra4;
- if (err<0) cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityFamilyNumberWr tria3"<<std::endl;
MEDfileClose(fid); //no error
//master.xml writings
}
MEDfileClose(fidjoint); //no error
- if (verbose>0)cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<endl;
+ if (verbose>0)std::cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<std::endl;
return ok;
}
xx=this->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"<<endl; return false;}
- if (verbose>4)cout<<"NumberOfNodes="<<nbnodes<<endl;
+ if (err<0) {std::cerr<<"Problem MEDmeshNodeCoordinateWr"<<std::endl; return false;}
+ if (verbose>4)std::cout<<"NumberOfNodes="<<nbnodes<<std::endl;
//writing indices of nodes
arrayi=new med_int[nbnodes];
for (i=0; i<nbnodes ; i++) arrayi[i]=i+1;
err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,arrayi);
delete[] arrayi;
- if (err<0) {cerr<<"Problem MEDmeshEntityNumberWr of nodes"<<endl; return false;}
+ if (err<0) {std::cerr<<"Problem MEDmeshEntityNumberWr of nodes"<<std::endl; return false;}
key1=key1.sprintf("GL%d VE",idom); //global numerotation
tab1=this->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 "<<tmp.toLatin1().constData()<<endl; return false;}
+ if (!ok) {std::cerr<<"Problem file "<<tmp.toLatin1().constData()<<std::endl; return false;}
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
if (!tab1) return false;
}
- if (nbnodes!=tab1->size){cerr<<"Problem size GLi VE!=nbnodes!"<<endl; return false;}
+ if (nbnodes!=tab1->size){std::cerr<<"Problem size GLi VE!=nbnodes!"<<std::endl; return false;}
key2=key2.sprintf("SKIN_VERTICES_FAMILIES",idom); //on global numerotation
tab2=this->restore_key(key2); //tab1=this->mestab[key1];
med_int nbskin=0;
if (tab2) med_int nbskin=tab2->size;
- //for (i=0; i<nbskin; i++) cout<<i<<" "<<tab2->tmint[i]<<endl;
+ //for (i=0; i<nbskin; i++) std::cout<<i<<" "<<tab2->tmint[i]<<std::endl;
//set families of nodes existing in GHS3DPRL_skin.med
med_int nb=nbnodes;
ok=set_one_more_family(famnodes,fammore,nb);
delete[] fammore;
- //cout<<"nodes loc "<<i<<" = gl "<<j<<"\t << "<<tab2->tmint[j]<<
+ //std::cout<<"nodes loc "<<i<<" = gl "<<j<<"\t << "<<tab2->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])<<endl;
+ // tab3->tmflo[i*3+1],tab3->tmflo[i*3+2])<<std::endl;
//writing nodes(vertices) global numbering
err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodes,tab1->tmint);
- if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr nodes"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr nodes"<<std::endl; return false;}
return ok;
}
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //cout<<"sur "<<i<<" en plus "<<more[i]<<endl;
+ //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
}
else { //intersection
if (fami[i]==more[i]) continue; //same families
morfam=more[i];
//create new family intersection if needed
newfam=families.find_family_on_groups(oldfam,morfam);
- //cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ //std::cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
fami[i]=newfam;
}
}
med_int *newfami;
nb_fam=families.fam.size(); //on families negative and positive
- //cout<<"size families "<<nb_fam<<endl;
+ //std::cout<<"size families "<<nb_fam<<std::endl;
if (nb_fam<=0) nb_fam=5; //precaution
i_zero=nb_fam*2; //offset for negative indices of families
nb_max=nb_fam*4;
- if (nb_fam>300) cout<<
- "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<endl;
+ if (nb_fam>300) std::cout<<
+ "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<std::endl;
nb_tot=nb_max*nb_max; //max oversizing *2 on families
//newfami is for speed (avoid calls find_family_on_groups)
//it is an array[nb_fam*4][nb_fam*4] implemented on vector[nb_max]
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //cout<<"sur "<<i<<" en plus "<<more[i]<<endl;
+ //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
}
else { //intersection
if (fami[i]==more[i]) continue; //same families
else {
if (nb_mess<3) {
nb_mess++;
- cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<endl;
+ std::cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<std::endl;
}
ii=-1;
newfam=0;
if (newfam==0) {
//create new family intersection if needed
newfam=families.find_family_on_groups(oldfam,morfam);
- //cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ //std::cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
if (ii>=0) newfami[ii]=newfam;
}
/*else {
- cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
+ std::cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
}*/
fami[i]=newfam;
}
if (!tab1) return false;
}
nbtria3=tab1->size/7;
- if (verbose>4) cout<<"NumberOfTriangles="<<nbtria3<<endl;
+ if (verbose>4) std::cout<<"NumberOfTriangles="<<nbtria3<<std::endl;
arrayi=new med_int[nbtria3*3];
ii=0,i=0 ;
for (j=0; j<nbtria3 ; j++){
}
err=MEDmeshElementConnectivityWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,nbtria3,arrayi);
delete[] arrayi; //need immediately more little array
- if (err<0){cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity"<<std::endl; return false;}
//writing indices of faces triangles of wrap
//caution!
for (i=0; i<nbtria3 ; i++) arrayi[i]=nbseg2+i+1;
err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3,arrayi);
delete[] arrayi;
- if (err<0){cerr<<"Problem MEDmeshEntityNumberWr of triangles"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshEntityNumberWr of triangles"<<std::endl; return false;}
//GLx FA=files.GLo FAces
key1=key1.sprintf("GL%d FA",idom);
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
- if (nbtria3!=tab1->size){cerr<<"Problem size GLi FA!=nbtria3!"<<endl; return false;}
+ if (nbtria3!=tab1->size){std::cerr<<"Problem size GLi FA!=nbtria3!"<<std::endl; return false;}
key2=key2.sprintf("SKIN_TRIA3_FAMILIES",idom); //on global numerotation
tab2=this->restore_key(key2); //tab1=this->mestab[key1];
//writing faces(triangles) global numbering
if (verbose>2)
- cout<<"CreateMEDglobalNumerotation_Faces "<<key1.toLatin1().constData()<<" "<<tab1->size<<endl;
+ std::cout<<"CreateMEDglobalNumerotation_Faces "<<key1.toLatin1().constData()<<" "<<tab1->size<<std::endl;
err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,tab1->size,tab1->tmint);
- if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr faces"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr faces"<<std::endl; return false;}
//xx=this->remove_key_mesh_wrap(QRegExp("FC*",true,true));
tmp=tmp.sprintf("GL%d FA",idom);
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 ";
tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".msg";
ok=this->ReadFileMSGnew(tmp);
if (!ok) {
- cerr<<"Problem in file "<<tmp.toLatin1().constData()<<endl;
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<std::endl;
return false;
}
}
if (idom==ineig) continue; //impossible
//!*************nodes
- //cout<<"\n nodes joints\n";
+ //std::cout<<"\n nodes joints\n";
key1=key1.sprintf("MS%d NE%d VE SE",idom,ineig); //SE or RE identicals
tab1=restore_key(key1);
if (!tab1) continue; //case (ifile,ineig) are not neighbours=>no joints
ok=this->ReadFileMSGnew(tmp);
this->nofile=idom; //restaure initial domain
if (!ok) {
- cerr<<"Problem in file "<<tmp.toLatin1().constData()<<endl;
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<std::endl;
continue;
}
tab2=this->restore_key(key1);
}
- if (!tab2) cerr<<"Problem existing nodes joint in domain "<<idom<<
- " with none in neighbourg "<<ineig<<" files .msg"<<endl;
+ if (!tab2) std::cerr<<"Problem existing nodes joint in domain "<<idom<<
+ " with none in neighbourg "<<ineig<<" files .msg"<<std::endl;
nb=tab1->size; nbnodesneig=tab2->size;
if (nb!=nbnodesneig) {
- cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
- " number of nodes of joint "<<idom<<"<->"<<ineig<<" not equals"<<endl;
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
+ " number of nodes of joint "<<idom<<"<->"<<ineig<<" not equals"<<std::endl;
continue;
}
nbjoints++; //one more joint for this domain
sjoints=sjoints+" "+i2a(ineig);
if (verbose>4)
- cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<endl;
+ std::cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
namejoint=namejoint.sprintf("JOINT_%d_%d_Nodes",idom,ineig);
strcpy(namejnt,namejoint.toLatin1().constData());
tmp=tmp.sprintf("JOINT_%d_%d among %d domains of ",idom,ineig,nbfilestot)+nomfinal;
tmp=medname+tmp.sprintf("_%d",ineig);
strcpy(namedist,tmp.toLatin1().constData());
err=MEDsubdomainJointCr(fid,nomfinal,namejnt,descjnt,ineig,namedist);
- if (err<0) cerr<<"Problem MEDsubdomainJointCr"<<endl;
+ if (err<0) std::cerr<<"Problem MEDsubdomainJointCr"<<std::endl;
famjoint=0;
if (namejoint.contains(deletegroups)==0){
err=MEDsubdomainCorrespondenceWr(fid,nomfinal,namejnt,MED_NO_DT,MED_NO_IT,
MED_NODE,MED_UNDEF_GEOMETRY_TYPE,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nb,arrayi);
- if (err<0) cerr<<"Problem MEDsubdomainCorrespondenceWr nodes"<<endl;
+ if (err<0) std::cerr<<"Problem MEDsubdomainCorrespondenceWr nodes"<<std::endl;
delete[] arrayi;
//!*************TRIA3
//writing correspondence triangles-triangles
- //cout<<"\n faces joints\n";
+ //std::cout<<"\n faces joints\n";
nbtria3neig=0;
key1=key1.sprintf("MS%d NE%d FA SE",idom,ineig); //SE or RE identicals
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
if (!tab1){
if (verbose>4)
- cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<endl;
+ std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<std::endl;
//continue; //case (ifile,ineig) are not neighbours=>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 "<<idom<<
- " with none in neighbourg "<<ineig<<" files .msg"<<endl;
+ if (!tab2) std::cerr<<"Problem existing triangles of joint in domain "<<idom<<
+ " with none in neighbourg "<<ineig<<" files .msg"<<std::endl;
nb=tab1->size; nbtria3neig=tab2->size;
if (nb!=nbtria3neig) {
- cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
- " number of triangles of joint "<<idom<<"<->"<<ineig<<" not equals"<<endl;
+ std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<
+ " number of triangles of joint "<<idom<<"<->"<<ineig<<" not equals"<<std::endl;
continue;
}
namejoint=namejoint.sprintf("JOINT_%d_%d_Faces",idom,ineig);
med_int nb=tab1->size; nbtria3neig=nb;
if (verbose>4)
- cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<endl;
+ std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
arrayi=new med_int[nb*2];
arrayfaces=new med_int[nbtria3neig*3]; //for file DOMAIN_join.med
fammore=new med_int[nbtria3];
fammore[tab1->tmint[i]-1]=famjoint;
//famtria3[tab1->tmint[i]-1]=famjoint;
arrayi[ii]=tab2->tmint[i]; ii++;
- //cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<endl;
+ //std::cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<std::endl;
k=(tab1->tmint[i]-1)*7; //indice of node connectivity
arrayfaces[jj]=inodes[tab->tmint[k]-1]+1; jj++;
arrayfaces[jj]=inodes[tab->tmint[k+1]-1]+1; jj++;
err=MEDsubdomainCorrespondenceWr(fid,nomfinal,namejnt,MED_NO_DT,MED_NO_IT,
MED_CELL,MED_TRIA3,MED_CELL,MED_TRIA3,nb,arrayi);
- if (err<0) cerr<<"Problem MEDsubdomainCorrespondenceWr triangles"<<endl;
+ if (err<0) std::cerr<<"Problem MEDsubdomainCorrespondenceWr triangles"<<std::endl;
delete[] arrayi;
}
tmp=tmp.sprintf("joint between %d and %d",idom,ineig);
charendnull(descjnt,tmp,MED_COMMENT_SIZE);
err=MEDmeshCr(fidjoint,namejnt,3,3,MED_UNSTRUCTURED_MESH,descjnt,dtunit,MED_SORT_DTIT,MED_CARTESIAN,axisname,axisunit);
- if (err<0) cerr<<"Problem MEDmeshCr "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshCr "<<namejnt<<std::endl;
//write nodes
err=MEDmeshNodeCoordinateWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,0.,MED_FULL_INTERLACE,nbnodesneig,arraynodes);
- if (err<0) cerr<<"Problem MEDmeshNodeCoordinateWr "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshNodeCoordinateWr "<<namejnt<<std::endl;
arrayi=new med_int[nbnodesneig];
for (i=0; i<nbnodesneig ; i++) arrayi[i]=i+1;
err=MEDmeshEntityNumberWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,MED_NODE,MED_UNDEF_GEOMETRY_TYPE,nbnodesneig,arrayi);
delete[] arrayi;
- if (err<0) cerr<<"Problem MEDmeshEntityNumberWr of nodes "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityNumberWr of nodes "<<namejnt<<std::endl;
//write tria3
if (nbtria3neig>0) {
- //for (i=0; i<nbtria3neig ; i++) cout<<i+1<<" "<<
- // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<endl;
+ //for (i=0; i<nbtria3neig ; i++) std::cout<<i+1<<" "<<
+ // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<std::endl;
err=MEDmeshElementConnectivityWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,0.,
MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,nbtria3neig,arrayfaces);
- if (err<0) cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshElementConnectivityWr for triangles connectivity "<<namejnt<<std::endl;
//writing indices of faces triangles of joint
arrayi=new med_int[nbtria3neig];
for (i=0; i<nbtria3neig ; i++) arrayi[i]=i+1;
err=MEDmeshEntityNumberWr(fidjoint,namejnt,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,nbtria3neig,arrayi);
delete[] arrayi;
- if (err<0) cerr<<"Problem MEDmeshEntityNumberWr of triangles "<<namejnt<<endl;
+ if (err<0) std::cerr<<"Problem MEDmeshEntityNumberWr of triangles "<<namejnt<<std::endl;
}
}
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
nbtetra4=tab1->size/4;
nbtetrastotal=nbtetrastotal + nbtetra4;
- if (verbose>5)cout<<"NumberOftetrahedra="<<nbtetra4<<endl;
+ if (verbose>5)std::cout<<"NumberOftetrahedra="<<nbtetra4<<std::endl;
err=MEDmeshElementConnectivityWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,0.,MED_CELL,MED_TETRA4,MED_NODAL,MED_FULL_INTERLACE,nbtetra4,tab1->tmint);
- if (err<0){cerr<<"Problem MEDmeshElementConnectivityWr for tetra connectivity"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshElementConnectivityWr for tetra connectivity"<<std::endl; return false;}
//writing indices of tetrahedra
arrayi=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) arrayi[i]=nbseg2+nbtria3+i+1;
- //for (i=0; i<nbtria3 ; i++) cout<<i<<" "<<arrayi[i]<<endl;
+ //for (i=0; i<nbtria3 ; i++) std::cout<<i<<" "<<arrayi[i]<<std::endl;
err=MEDmeshEntityNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,nbtetra4,arrayi);
delete[] arrayi;
- if (err<0){cerr<<"Problem MEDmeshEntityNumberWr of tetrahedra"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshEntityNumberWr of tetrahedra"<<std::endl; return false;}
famtetra4=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) famtetra4[i]=famnewtetra4;
}
if (tab1->size!=nbtetra4){
- cerr<<"Problem incorrect size of tetrahedra global numbering"<<endl; return false;}
+ std::cerr<<"Problem incorrect size of tetrahedra global numbering"<<std::endl; return false;}
if (verbose>2)
- cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<endl;
+ std::cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<std::endl;
err=MEDmeshGlobalNumberWr(fid,nomfinal,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TETRA4,tab1->size,tab1->tmint);
- if (err<0){cerr<<"Problem MEDmeshGlobalNumberWr tetrahedra"<<endl; return false;}
+ if (err<0){std::cerr<<"Problem MEDmeshGlobalNumberWr tetrahedra"<<std::endl; return false;}
tmp=tmp.sprintf("NB%d EV",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
//med_int natt=0;
ngro=(*it1).second.size();
if (verbose>5)
- cout<<"CreateFamilyInMEDFile <"<<nomfam<<">\tNbGroups="<<ngro;
+ std::cout<<"CreateFamilyInMEDFile <"<<nomfam<<">\tNbGroups="<<ngro;
gro=new char[MED_LNAME_SIZE*ngro+2];
gb=(*it1).second;
i=0;
for (it2=gb.begin(); it2!=gb.end(); ++it2){
charendnull(&gro[i*MED_LNAME_SIZE],(*it2).first,MED_LNAME_SIZE);
- if (verbose>5)cout<<" <"<<&gro[i*MED_LNAME_SIZE]<<"> ";
+ if (verbose>5)std::cout<<" <"<<&gro[i*MED_LNAME_SIZE]<<"> ";
i++;
}
- if (verbose>5)cout<<endl;
+ if (verbose>5)std::cout<<std::endl;
err=MEDfamilyCr(fid,nomfinal,nomfam,num,ngro,gro);
- if (err<0) cerr<<"Problem MEDfamilyCr"<<endl;
+ if (err<0) std::cerr<<"Problem MEDfamilyCr"<<std::endl;
delete[] gro;
- if (err<0) cerr<<"Problem MEDfamilyCr of "<<nomfam<<endl;
+ if (err<0) std::cerr<<"Problem MEDfamilyCr of "<<nomfam<<std::endl;
}
return ires;
}
//#include <med_misc.h>
}
-using namespace std;
-
//************************************
med_idt ouvre_fichier_MED(char *fichier,int verbose)
{
med_bool hdfok,medok;
ret = MEDfileCompatibility(fichier,&hdfok,&medok);
if (ret < 0){
- cerr<<"File "<<fichier<<" not MED or HDF V5 formatted\n";
+ std::cerr<<"File "<<fichier<<" not MED or HDF V5 formatted\n";
return fid;
}
//version qt3
char chaine[nomfilemed.length()+1];
strncpy(chaine,nomfilemed.toLatin1().constData(),nomfilemed.length()+1);
- //cout<<"*** ReadFileMED *** "<<chaine<<"\n";
+ //std::cout<<"*** ReadFileMED *** "<<chaine<<"\n";
fid=ouvre_fichier_MED(chaine,mymailw->verbose);
if (fid == 0) {
- cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
+ std::cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
return false;
}
nmaa = MEDnMesh(fid);
if (nmaa <= 0){
- cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
+ std::cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
ret = MEDfileClose(fid);
return false;
}
- if (nmaa > 1) cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
+ if (nmaa > 1) std::cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
ret = MEDmeshInfo(fid,numero,mymailw->nommaa,&sdim,&mdim,&type_maillage,mymailw->maillage_description,
dtunit,&sortingtype,&nstep,&axistype,axisname,axisunit);
if (ret < 0){
- cerr<<"Problem MEDmeshInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
+ std::cerr<<"Problem MEDmeshInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
ret = MEDfileClose(fid);
return false;
}
if (mdim != 3){
- cerr<<"Problem mesh dimension should be 3: "<<mdim<<"\n";
+ std::cerr<<"Problem mesh dimension should be 3: "<<mdim<<"\n";
ret = MEDfileClose(fid);
return false;
}
if (sdim != 3){
- cerr<<"Problem space dimension should be 3: "<<sdim<<"\n";
+ std::cerr<<"Problem space dimension should be 3: "<<sdim<<"\n";
ret = MEDfileClose(fid);
return false;
}
if (type_maillage != MED_UNSTRUCTURED_MESH){
- cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<endl;
+ std::cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<std::endl;
ret = MEDfileClose(fid);
return false;
}
MED_NODE,MED_NO_GEOTYPE,MED_COORDINATE,MED_NO_CMODE,&chan,&tran);
//(med_geometrie_element)0,(med_connectivite)0);
if (nnoe<1){
- cerr<<"Problem number of Vertices < 1\n";
+ std::cerr<<"Problem number of Vertices < 1\n";
ret = MEDfileClose(fid);
return false;
}
/*for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++){
nmailles[i]=MEDnEntMaa(fid,mymailw->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"<<nommai[i]<<"="<<nmailles[i]<<endl;
+ if (mymailw->verbose>6) std::cout<<"NumberOf"<<nommai[i]<<"="<<nmailles[i]<<std::endl;
}*/
nbtria3=MEDmeshnEntity(fid,mymailw->nommaa,MED_NO_DT,MED_NO_IT,
//combien de familles ?
nfam=MEDnFamily(fid,mymailw->nommaa);
if (mymailw->verbose>2) {
- cout<<"\nNumberOfFamilies="<<nfam<<endl;
- cout<<"NumberOfVertices="<<nnoe<<endl;
- cout<<"NumberOfMED_SEG2="<<nbseg2<<endl;
- cout<<"NumberOfMED_TRIA3="<<nbtria3<<"\n\n";
+ std::cout<<"\nNumberOfFamilies="<<nfam<<std::endl;
+ std::cout<<"NumberOfVertices="<<nnoe<<std::endl;
+ std::cout<<"NumberOfMED_SEG2="<<nbseg2<<std::endl;
+ std::cout<<"NumberOfMED_TRIA3="<<nbtria3<<"\n\n";
}
if (nbtria3<3){
- cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
+ std::cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
ret = MEDfileClose(fid);
return false;
}
//nombre de groupes
ngro = MEDnFamilyGroup(fid,mymailw->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;
}
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 "<<numfam<<" have "<<ngro<<" groups\n";
+ std::cout<<"Family "<<numfam<<" have "<<ngro<<" groups\n";
//affichage des resultats
for (j=0;j<ngro;j++) {
- if (j==0) cout<<" Groups :\n";
+ if (j==0) std::cout<<" Groups :\n";
strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
str2[MED_LNAME_SIZE] = '\0';
fprintf(stdout," name = %s\n",str2);
}
- if (i==nfam-1) cout<<endl;
+ if (i==nfam-1) std::cout<<std::endl;
}
QString sfam,sgro;
sfam=sfam.sprintf("%d",numfam);
str2[MED_LNAME_SIZE]='\0';
sgro=str2;
if (sgro.contains(mymailw->deletegroups)>0) {
- //cout<<"idelete++ "<<sgro<<endl;
+ //std::cout<<"idelete++ "<<sgro<<std::endl;
idelete++;
}
}
if (idelete==ngro && ngro>0) { //only delete family whith all delete groups
- //cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<endl;
+ //std::cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<std::endl;
famdelete[ifamdelete]=numfam;
ifamdelete++;
}
if (sgro.contains(qgroup)>0) {
sgro="Skin_"+sgro; //pas sur que ce soit pertinent
}
- if (mymailw->verbose>8) cout<<"families.add("<<sfam.toLatin1().constData()<<
+ if (mymailw->verbose>8) std::cout<<"families.add("<<sfam.toLatin1().constData()<<
","<<sgro.toLatin1().constData()<<")\n";
mymailw->families.add(sfam,sgro);
}
else {
//sgro="Skin_"+sgro; //pas sur que ce soit pertinent
- //cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
- if (mymailw->verbose>3) cout<<"--deletegroups matches \""<<
+ //std::cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
+ if (mymailw->verbose>3) std::cout<<"--deletegroups matches \""<<
sgro.toLatin1().constData()<<
- "\" in family "<<numfam<<endl;
+ "\" in family "<<numfam<<std::endl;
}
}
}
strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
str2[MED_LNAME_SIZE]='\0';
sgro=str2;
- //cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ //std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
if (sgro.contains(mymailw->deletegroups)==0){
//sgro="Skin_"+sgro; //pas sur que ce soit pertinent
- cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
mymailw->families.add(sfam,sgro);
}
else {
- cout<<"--deletegroups matches \""<<sgro<<"\"\n";
+ std::cout<<"--deletegroups matches \""<<sgro<<"\"\n";
famdelete[ifamdelete]=numfam
ifamdelete++;
}
}
}
-//cout<<"famdelete"; for (j=0;j<ifamdelete;j++) cout<<" "<<famdelete[j]; cout<<endl;
+//std::cout<<"famdelete"; for (j=0;j<ifamdelete;j++) std::cout<<" "<<famdelete[j]; std::cout<<std::endl;
if (mymailw->verbose>3){
- cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<endl;
+ std::cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<std::endl;
mymailw->families.write();
}
/* Allocations memoires */
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;i<nnoe*mdim;i=i+3) {
fprintf(stdout,"%5d %13.5e %13.5e %13.5e %5d \n",
(i/3+1), coo[i], coo[i+1], coo[i+2], famnodesskin[i/3]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
med_int *conn2=new med_int[nbseg2*2];
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;
}
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;i<nbseg2*2;i=i+2) {
fprintf(stdout,"%5d %5d %5d %5d \n",
(i/2+1), conn2[i], conn2[i+1], famseg2skin[i/2]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
med_int *conn3=new med_int[nbtria3*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;
}
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;i<nbtria3*3;i=i+3) {
fprintf(stdout,"%5d %5d %5d %5d %5d \n",
(i/3+1), conn3[i], conn3[i+1], conn3[i+2], famtria3skin[i/3]);
}
- cout<<endl;
+ std::cout<<std::endl;
}
/*liberation memoire?
delete[] nufano;*/
if (ifamdelete>0) {
- //cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<endl;
+ //std::cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<std::endl;
for (i=0;i<nnoe;i++) {
for (j=0;j<ifamdelete;j++) {
if (famnodesskin[i]==famdelete[j]) {
- //cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<endl;
+ //std::cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<std::endl;
famnodesskin[i]=0; }
}
}
ret = MEDfileClose(fid);
if (ret < 0){
- cerr<<"Problem closing "<<nomfilemed.toLatin1().constData()<<"\n";
+ std::cerr<<"Problem closing "<<nomfilemed.toLatin1().constData()<<"\n";
return false;
}
return true;
bool string2int(const string &s, int *v)
//string s=argv[1] ; int ii;
//ok=string2int(s,&ii);
-//cout<<"test "<<ii<<" "<<ok<<endl;
+//std::cout<<"test "<<ii<<" "<<ok<<std::endl;
{
string splus=s + " -1"; //evite conversion ok sur "+9truc" qui passe sinon
istringstream ss(splus);
bool string2float(const string &s, float *v)
//float ff;
//ok=string2float(s,&ff);
-//cout<<"test3 "<<ff<<" "<<ok<<endl;
+//std::cout<<"test3 "<<ff<<" "<<ok<<std::endl;
{
string splus=s + " -1"; //evite conversion ok sur "+9truc" qui passe sinon
istringstream ss(splus);
}
if (argc < 2 || chelp){
- cout<<"tepal2med "<<version.toLatin1().constData()<<" Available options:\n"
+ std::cout<<"tepal2med "<<version.toLatin1().constData()<<" Available options:\n"
" --help : produces this help message\n"<<
" --casename : path and name of input tepal2med files which are\n"<<
" - output files of tepal .msg .noboite .faces .points .glo\n"<<
" (try --deletegroups=\"(\\bJOINT)\"\n"<<
" (try --deletegroups=\"(\\bAll_Nodes|\\bAll_Faces)\"\n"<<
" (try --deletegroups=\"((\\bAll_|\\bNew_)(N|F|T))\"\n";
- cout<<"example:\n tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN "<<
+ std::cout<<"example:\n tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN "<<
"--limitswap=1000 --verbose=0 --test=yes --menu=no --launchtepal=no\n\n";
return 1; //no output files
}
if (!ccasename){
- cerr<<"--casename: a path/name is expected\n\n";
+ std::cerr<<"--casename: a path/name is expected\n\n";
return 1;
}
casename=ccasename;
if (!cnumber){
- cerr<<"--number: an integer is expected\n\n";
+ std::cerr<<"--number: an integer is expected\n\n";
return 1;
}
tmp=cnumber;
nbfiles=tmp.toLong(&ok,10);
if (!ok){
- cerr<<"--number: an integer is expected\n\n";
+ std::cerr<<"--number: an integer is expected\n\n";
return 1;
}
if (nbfiles<=0){
- cerr<<"--number: a positive integer is expected\n\n";
+ std::cerr<<"--number: a positive integer is expected\n\n";
return 1;
}
if (nbfiles>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;
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;
}
}
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;
}
}
m->show();
a.exec();
if ( m->result() == QDialog::Accepted ) {
- cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<endl;
+ std::cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<std::endl;
nbfiles=m->NbPart();
}
else {
path="./";
casenamemed=casenamemed.section('/',-1);
if (casenamemed.length()>20){
- cerr<<"--medname truncated (no more 20 characters)"<<endl;
+ std::cerr<<"--medname truncated (no more 20 characters)"<<std::endl;
casenamemed.truncate(20);
}
pathini="./";
casename=casename.section('/',-1);
if (casename.length()>20){
- cerr<<"--casename truncated (no more 20 characters)"<<endl;
+ std::cerr<<"--casename truncated (no more 20 characters)"<<std::endl;
casename.truncate(20);
}
- /*cout<<"CaseNameMed="<<casenamemed<<endl;
- cout<<"PathMed="<<path<<endl;*/
+ /*std::cout<<"CaseNameMed="<<casenamemed<<std::endl;
+ std::cout<<"PathMed="<<path<<std::endl;*/
deletegroups="(\\bxyz)"; //default improbable name
if (cdeletegroups){
//verbose=5;
if (verbose>0)
- cout<<"tepal2med "<<version.toLatin1().constData()<<" parameters:"<<
+ std::cout<<"tepal2med "<<version.toLatin1().constData()<<" parameters:"<<
"\n --casename="<<pathini.toLatin1().constData()<<casename.toLatin1().constData()<<
"\n --number="<<nbfiles<<
"\n --medname="<<path.toLatin1().constData()<<casenamemed.toLatin1().constData()<<
//tepal64.exe -f /home/wambeke/tmp/GHS3DPRL -n 5 --tetmesh_args "-c 0"
//cmd="tepal --tetmesh_args \"-c 0\" -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log";
cmd="tepal -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log";
- cout<<"\nlaunchtepal command: background="<<cbackground<<
- "\n "<<cmd.toLatin1().constData()<<endl;
+ std::cout<<"\nlaunchtepal command: background="<<cbackground<<
+ "\n "<<cmd.toLatin1().constData()<<std::endl;
system(cmd.toLatin1().constData()); // run
//sometimes it is better to wait flushing files on slow filesystem...
system("sleep 3");
//handler.verbose=true;
handler.mailw=mymailw;
mymailw->families.no=1;
- //cout<<"coucou1 "<<mymailw->families.no<<endl;
+ //std::cout<<"coucou1 "<<mymailw->families.no<<std::endl;
//mymailw->families.add(casename,casenamemed);
format=format.sprintf("%d",nbfiles);
int nbf=format.length();
if (ret >= 0) {
ok=ReadFileMED(fileskinmed,mymailw); }
else {
- if (verbose>0)cout<<"Initial skin file <"<<fileskinmed.toLatin1().constData()<<"> does not exist\n"; }
+ if (verbose>0)std::cout<<"Initial skin file <"<<fileskinmed.toLatin1().constData()<<"> 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
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileMSGnew(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
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="<<tmp<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp<<std::endl;
QFile File(tmp);
QXmlInputSource source(&File);
reader.parse(source);
File.close();
}
if (verbose>0)
- cout<<"NumberOfFilesMSGAcquired="<<mymailw->nbfiles<<"\n";
+ std::cout<<"NumberOfFilesMSGAcquired="<<mymailw->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;
}
}
//because <send> equals <receive>
nb=0;
nb=mymailw->remove_key_mesh_wrap(QRegExp("RE",Qt::CaseSensitive,QRegExp::RegExp));
- if (verbose>3) cout<<"NumberOfKeysRemoved="<<nb<<endl;
+ if (verbose>3) std::cout<<"NumberOfKeysRemoved="<<nb<<std::endl;
if (verbose>3) ok=mymailw->list_keys_mesh_wrap();
//test read files .noboiteb
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileNOBOITE(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->nbfiles<<"\n";
+ std::cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->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;
}
//}
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileFACES(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFilePOINTS(tmp);
}
if (verbose>0)
- cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles)
{
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
*/
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="<<tmp.toLatin1().constData()<<endl;
+ if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
ok=mymailw->ReadFileGLO(tmp);
//mymailw->SwapOutOfMemory_key_mesh_wrap(QRegExp("GL",true,false));
}
if (verbose>0)
- cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
+ std::cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
//test remove points (type 3)
//nb=mymailw->remove_key_mesh_wrap(QRegExp("PO",true,false));
- //cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<endl;
+ //std::cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<std::endl;
//ok=mymailw->list_keys_mesh_wrap();
ok=mymailw->Find_VerticesDomainToVerticesSkin();
ok=mymailw->Write_MEDfiles_v2(true); //deletekeys=true
nb=mymailw->remove_all_keys_mesh_wrap();
- if (verbose>3)cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
- if (verbose>0)cout<<endl<<"===end of "<<argv[0]<<"==="<<endl;
+ if (verbose>3)std::cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
+ if (verbose>0)std::cout<<std::endl<<"===end of "<<argv[0]<<"==="<<std::endl;
//for debug
//int res=dumpMED("/home/wambeke/tmp/DOMAIN_1.med",1);