#include "ghs3dprl_mesh_wrap.h"
+#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <QFile>
#include <QRegExp>
+using namespace std;
+using namespace med_2_2;
+
//utils procedures
//************************************
-std::string i2a(const int &v)
+string i2a(const int &v)
{
- std::ostringstream ss;
+ ostringstream ss;
ss<<v;
return ss.str();
}
//************************************
QString endspace(QString deb,int lg)
-//better fill by spaces for char unicoo[3*med_2_2::MED_TAILLE_PNOM+1]; etc...
+//better fill by spaces for char unicoo[3*MED_TAILLE_PNOM+1]; etc...
{
QString fin,spa;
//spa.fill(' ',lg);
//class familles
//************************************
void familles::newfam(QString nom){
- //std::cout<<"newfam "<<nom<<std::endl;
+ //cout<<"newfam "<<nom<<endl;
if (fam.find(nom)!=fam.end()){
- std::cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
+ cout<<"***newfam*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
//************************************
void familles::newgro(QString nom){
- //std::cout<<"newgro "<<nom<<std::endl;
+ //cout<<"newgro "<<nom<<endl;
if (gro.find(nom)!=gro.end()){
- std::cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
+ cout<<"***newgro*** "<<nom.toLatin1().constData()<<" deja present\n";
return;
}
fend gb;
fend gb;
fagr::iterator it1;
fend::iterator it2;
- //std::cout<<"\n***familles.write()***\n";
+ //cout<<"\n***familles.write()***\n";
for (it1=fam.begin(); it1!=fam.end(); ++it1){
- std::cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\tGroups=";
+ cout<<"Family=<"<<(*it1).first.toLatin1().constData()<<">\tGroups=";
gb=(*it1).second;
for (it2=gb.begin(); it2!=gb.end(); ++it2){
- std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> ";
+ cout<<"<"<<(*it2).first.toLatin1().constData()<<"> ";
}
- std::cout<<std::endl;
+ cout<<endl;
}
for (it1=gro.begin(); it1!=gro.end(); ++it1){
- std::cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\tFamilies=";
+ cout<<"Group=<"<<(*it1).first.toLatin1().constData()<<">\tFamilies=";
gb=(*it1).second;
for (it2=gb.begin(); it2!=gb.end(); ++it2){
- std::cout<<"<"<<(*it2).first.toLatin1().constData()<<"> ";
+ cout<<"<"<<(*it2).first.toLatin1().constData()<<"> ";
}
- std::cout<<std::endl;
+ cout<<endl;
}
}
fagr::iterator it1;
fend::iterator it2;
int nb=0,nbf;
- std::string ss;
+ 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());
- //std::cout<<std::endl;
+ //cout<<endl;
}
xmlNewProp(res, BAD_CAST "number", BAD_CAST i2a(nb).c_str());
return res;
//************************************
void familles::add(QString nomfam, QString nomgro)
{
- //std::cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //cout<<"add family <"<<nomfam<<">\t<"<<nomgro<<">\n";
fagr::iterator it;
it=fam.find(nomfam);
if (it==fam.end()){
- //std::cout<<"add new family <"<<nomfam<<">\t<"<<nomgro<<">\n";
+ //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()){
- //std::cout<<"***new*** "<<nomgro<<" non present\n";
+ //cout<<"***new*** "<<nomgro<<" non present\n";
newgro(nomgro);
it=gro.find(nomgro);
}
//************************************
-bool familles::get_number_of_new_family(int sign, med_2_2::med_int *ires, QString *tmp)
+bool familles::get_number_of_new_family(int sign, med_int *ires, QString *tmp)
//if sign < 0 families faces or tria3 etc...
//if sign >= 0 family zero and family nodes
//outputs in *ires and *tmp
it=fam.find(nomfam);
if (it==fam.end()) {
*tmp=nomfam; *ires=ii;
- //std::cout<<"NewFamily Found<"<<*ires<<"><"<<*tmp<<">\n";
+ //cout<<"NewFamily Found<"<<*ires<<"><"<<*tmp<<">\n";
return true;
}
ii=ii+pas;
}
- std::cerr<<"***get_number_of_new_family*** Problem new family not found"<<std::endl;
+ cerr<<"***get_number_of_new_family*** Problem new family not found"<<endl;
return false;
}
//************************************
- med_2_2::med_int familles::find_family_on_groups(med_2_2::med_int fam1, med_2_2::med_int fam2)
+ med_int familles::find_family_on_groups(med_int fam1, med_int fam2)
{
- med_2_2::med_int ires=0;
+ med_int ires=0;
if (fam1==fam2) {ires=fam1; return ires;}
//find one family whith groups of fam1 and groups of fam2
fend gb=fuse_goups(fam1,fam2);
for (it1=fam.begin(); it1!=fam.end(); ++it1){
if (gb==(*it1).second){
ires=(*it1).first.toLong();
- //std::cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
+ //cout<<"find_family_on_groups old <"<<ires<<"> from <"<<
// fam1<<"><"<<fam2<<">\n";
return ires;
}
}
- //std::cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<std::endl;
+ //cout<<"no family found!!! - groups of "<<fam1<<" and "<<fam2<<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);
}
- //std::cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
+ //cout<<"new family <"<<ires<<"> intersection of <"<<fam1<<"><"<<fam2<<">\n";
return ires;
}
//************************************
- fend familles::fuse_goups(med_2_2::med_int fam1, med_2_2::med_int fam2)
+ fend familles::fuse_goups(med_int fam1, med_int fam2)
//concatenation/fusion deux map groupes
{
QString nom1,nom2;
nom2=nom2.sprintf("%d",fam2);
it2=fam.find(nom2);
if ( (it1==fam.end())||(it2==fam.end()) ) {
- std::cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<std::endl;
+ cerr<<"***fuse_goups*** non existing family "<<fam1<<" or "<<fam2<<endl;
fend gb;
return gb; //empty
}
gb.insert((*it2).second.begin(),(*it2).second.end()); //other groups
return gb;
//for debug
- std::cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
+ cout<<"fuse_goups "<<fam1<<" "<<fam2<<" ";
fend::iterator it;
for (it=gb.begin(); it!=gb.end(); ++it){
- std::cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
+ cout<<"<"<<(*it).first.toLatin1().constData()<<"> ";
}
- std::cout<<std::endl;
+ cout<<endl;
return gb;
}
long CVWtab::memorymax=1000*1000000; //static
//************************************
-CVWtab::CVWtab(long nb, med_2_2::med_int *pmint)
+CVWtab::CVWtab(long nb, med_int *pmint)
//constructor with pmint allocated yet with new
{
- //std::cout"***constructor med_2_2::med_int CVWtab***\n";
+ //cout"***constructor med_int CVWtab***\n";
size=nb;
type=1; //only tmint valide
tmint=pmint;
tmflo=NULL;
- memoryuse=memoryuse+sizeof(med_2_2::med_int)*nb;
- //std::cout<<"memoryuse int "<<sizeof(med_2_2::med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
+ memoryuse=memoryuse+sizeof(med_int)*nb;
+ //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
if (memoryuse>memorymax) {
- std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
- //std::cout<<"memoryuse int "<<sizeof(med_2_2::med_int)<<" "<<nb<<" "<<memoryuse<<std::endl;
+ cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
+ //cout<<"memoryuse int "<<sizeof(med_int)<<" "<<nb<<" "<<memoryuse<<endl;
}
}
//************************************
-CVWtab::CVWtab(long nb, med_2_2::med_float *pmflo)
+CVWtab::CVWtab(long nb, med_float *pmflo)
//constructor with pmflo allocated yet with new
{
- //std::cout<<"***constructor med_2_2::med_float CVWtab***\n";
+ //cout<<"***constructor med_float CVWtab***\n";
size=nb;
type=2; //only tmflo valide
tmint=NULL;
tmflo=pmflo;
- memoryuse=memoryuse+sizeof(med_2_2::med_float)*nb;
- //std::cout<<"memoryuse float "<<sizeof(med_2_2::med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<std::endl;
+ memoryuse=memoryuse+sizeof(med_float)*nb;
+ //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<" "<<memorymax<<endl;
if (memoryuse>memorymax) {
- std::cout<<"***WARNING*** memory max reached "<<memorymax<<std::endl;
- //std::cout<<"memoryuse float "<<sizeof(med_2_2::med_float)<<" "<<nb<<" "<<memoryuse<<std::endl;
+ cout<<"***WARNING*** memory max reached "<<memorymax<<endl;
+ //cout<<"memoryuse float "<<sizeof(med_float)<<" "<<nb<<" "<<memoryuse<<endl;
}
}
CVWtab::~CVWtab()
{
bool ok;
- //std::cout<<" destructor CVWtab *** "<<this->filename<<std::endl;
+ //cout<<" destructor CVWtab *** "<<this->filename<<endl;
ok=this->CVWtab_deallocate();
//remove temporary file
if (this->filename!="_NO_FILE")
{
remove(this->filename.toLatin1().constData()); //#include <stdio.h>
- //std::cout<<this->filename<<" successfully deleted\n";
+ //cout<<this->filename<<" successfully deleted\n";
}
}
//************************************
bool CVWtab::CVWtab_deallocate()
{
- //std::cout<<" deallocate CVWtab*** "<<size<<std::endl;
+ //cout<<" deallocate CVWtab*** "<<size<<endl;
if (size <= 0) return false;
if (tmint)
{
delete[] tmint;
- memoryuse=memoryuse-sizeof(med_2_2::med_int)*size;
+ memoryuse=memoryuse-sizeof(med_int)*size;
size=-size; //precaution
}
if (tmflo)
{
delete[] tmflo;
- memoryuse=memoryuse-sizeof(med_2_2::med_float)*size;
+ memoryuse=memoryuse-sizeof(med_float)*size;
size=-size; //precaution
}
- if (memoryuse<0) std::cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<std::endl;
- if (memoryuse==0) std::cout<<"***CVWtab_deallocate*** memoryuse=0 "<<std::endl;
+ if (memoryuse<0) cout<<"***WARNING*** memoryuse <0 "<<memoryuse<<endl;
+ if (memoryuse==0) cout<<"***CVWtab_deallocate*** memoryuse=0 "<<endl;
return true;
}
//************************************
bool CVWtab::is_equal(CVWtab *tab2)
{
- //std::cout<<"is_equal tab1 tab2 type="<<this->type<<" size="<<this->size<<" "<<tab2->size<<std::endl;
- //if (this->type==1) std::cout<<"med_2_2::med_int tab1[0]="<<this->tmint[0]<<std::endl;
- //if (this->type==2) std::cout<<"med_2_2::med_float tab1[0]="<<this->tmflo[0]<<std::endl;
+ //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;
if (this->size!=tab2->size) return false;
if (this->type!=tab2->type) return false;
if (this->type==1)
{
if (!this->tmint)
- { std::cout<<"***is_equal*** pb pointer NULL with tmint size="<<this->size<<std::endl;
+ { cout<<"***is_equal*** pb pointer NULL with tmint size="<<this->size<<endl;
return false;
}
for (long i=0; i < this->size; i++)
if (this->type==2)
{
if (!this->tmflo)
- { std::cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<std::endl;
+ { cout<<"***is_equal*** pb pointer NULL with tmflo size="<<this->size<<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)
{
- //std::cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<std::endl;
+ //cout<<"is_equal_vertice size="<<tab1->size<<" "<<tab2->size<<endl;
bool ok=false;
- med_2_2::med_float *p1,*p2;
+ 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)
{
- std::cerr<<"BadIndice tab1 in is_equal_vertices "<<
- di1<<" not in "<<tab1->size<<std::endl;
+ cerr<<"BadIndice tab1 in is_equal_vertices "<<
+ di1<<" not in "<<tab1->size<<endl;
return false;
}
if (di2<0 || di2>=tab2->size)
{
- std::cerr<<"BadIndice tab2 in is_equal_vertices "<<
- di2<<" not in "<<tab2->size<<std::endl;
+ cerr<<"BadIndice tab2 in is_equal_vertices "<<
+ di2<<" not in "<<tab2->size<<endl;
return false;
}
p1=(tab1->tmflo+di1);
}
//************************************
-bool CVW_FindString(const std::string &str,std::fstream &Ff, long &count)
+bool CVW_FindString(const string &str,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
{
- std::string line;
+ string line;
QString tmp;
do
{
}
else
{
- std::cerr<<"Problem line '"<<str<<"' not found in file\n"<<std::endl;
+ cerr<<"Problem line '"<<str<<"' not found in file\n"<<endl;
return false;
}
} while (1);
//no read of <receive> for speed (and so no test)
{
QString tmp;
- std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in);
- std::string line;
+ fstream Ff(FileName.toLatin1().constData(),ios_base::in);
+ string line;
long i,count,nbneighbour,ineighbour;
bool ok;
if (!Ff.is_open())
{
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
- //Lit les données :
+ //Lit les donn�s :
if (!CVW_FindString("<neighbours count=",Ff,nbneighbour)) return false;
- if (verbose>2) std::cout<<"NeighboursCount="<<nbneighbour<<std::endl;
+ if (verbose>2) cout<<"NeighboursCountDomain_"<<this->nofile<<"="<<nbneighbour<<endl;
for (i=1; i<=nbneighbour; i++)
{
if (!CVW_FindString("<neighbour indice=",Ff,ineighbour)) return false;
if (!CVW_FindString("<vertices count=",Ff,count)) return false;
if (count>0){
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Vertices "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld VE SE",this->nofile,ineighbour);
}
if (!CVW_FindString("<edges count=",Ff,count)) return false;
if (count>0){
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Edges "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld ED SE",this->nofile,ineighbour);
}
if (!CVW_FindString("<faces count=",Ff,count)) return false;
if (count>0){
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Faces "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("MS%ld NE%ld FA SE",this->nofile,ineighbour);
}
if (!CVW_FindString("<elements count=",Ff,count)) return false;
if (count>0){
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<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;
- std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in);
- std::string line;
+ fstream Ff(FileName.toLatin1().constData(),ios_base::in);
+ string line;
long count;
bool ok;
if (!Ff.is_open())
{
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
- //Lit les données :
+ //Lit les donn�s :
if (!CVW_FindString("<vertices count=",Ff,count)) return false;
- if (verbose>3) std::cout<<"GloVerticesCount="<<count<<std::endl;
+ if (verbose>3) cout<<"GloVerticesCount="<<count<<endl;
if (count>0)
{
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<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) std::cout<<"GloEdgesCount="<<count<<std::endl;
+ if (verbose>3) cout<<"GloEdgesCount="<<count<<endl;
if (count>0)
{
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<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) std::cout<<"GloFacesCount="<<count<<std::endl;
+ if (verbose>3) cout<<"GloFacesCount="<<count<<endl;
if (count>0)
{
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<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) std::cout<<"GloElementsCount="<<count<<std::endl;
+ if (verbose>3) cout<<"GloElementsCount="<<count<<endl;
if (count>0)
{
- med_2_2::med_int *tmint=new med_2_2::med_int[count];
+ med_int *tmint=new med_int[count];
for (int i=0; i<count; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[count-1]<<endl;
CVWtab *montab=new CVWtab(count,tmint);
tmp=tmp.sprintf("GL%ld EL",this->nofile);
//read file .faces (wrap)
{
QString tmp;
- std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in);
- std::string line;
+ fstream Ff(FileName.toLatin1().constData(),ios_base::in);
+ string line;
long nbelem,ntype;
bool ok;
if (!Ff.is_open())
{
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
- //Lit les données :
- //Replace le pointeur de fichier au début :f.seekg(0);
+ //Lit les donn�s :
+ //Replace le pointeur de fichier au d�ut :f.seekg(0);
if (getline(Ff,line))
{
tmp=line.c_str();
}
else
{
- std::cerr<<"Problem on first line of file"<<std::endl;
+ cerr<<"Problem on first line of file"<<endl;
return false;
}
- if (verbose>3) std::cout<<"FacesNumberOfElements="<<nbelem<<std::endl;
- med_2_2::med_int *tmint=new med_2_2::med_int[nbelem*7];
+ if (verbose>3) cout<<"FacesNumberOfElements="<<nbelem<<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
{
- std::cerr<<"Problem on ntype != 3"<<std::endl;
+ cerr<<"Problem on ntype != 3"<<endl;
return false;
}
for (int j=0; j<7; j++) Ff>>tmint[i+j];
- //for (int j=0; j<7; j++) std::cout<<tmint[i+j]<<' '; std::cout<<std::endl;
+ //for (int j=0; j<7; j++) cout<<tmint[i+j]<<' '; cout<<endl;
}
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[nbelem*7-1]<<endl;
CVWtab *montab=new CVWtab(nbelem*7,tmint);
tmp=tmp.sprintf("FC%ld",this->nofile);
//(parameter option of ghs3d but NOT tepal)
{
QString tmp;
- std::fstream Ff(FileName.toLatin1().constData(),std::ios_base::in);
+ fstream Ff(FileName.toLatin1().constData(),ios_base::in);
long ne,np,npfixe,subnumber,reste;
bool ok;
if (!Ff.is_open()){
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
- //lit les données :
+ //lit les donn�s :
Ff>>ne>>np>>npfixe;
if (verbose>3){
- std::cout<<"NoboiteNumberOfElements="<<ne<<std::endl;
- std::cout<<"NoboiteNumberOfVertices="<<np<<std::endl;
- std::cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<std::endl;
+ cout<<"NoboiteNumberOfElements="<<ne<<endl;
+ cout<<"NoboiteNumberOfVertices="<<np<<endl;
+ cout<<"NoboiteNumberOfSpecifiedPoints="<<npfixe<<endl;
}
for (int i=1; i<=17-3; i++) Ff>>reste;
//printf("reste %ld\n",reste);
- med_2_2::med_int *tmint=new med_2_2::med_int[ne*4];
+ med_int *tmint=new med_int[ne*4];
for (int i=0; i<ne*4; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<endl;
CVWtab *montab=new CVWtab(ne*4,tmint);
tmp=tmp.sprintf("NB%ld EV",this->nofile);
ok=this->insert_key(tmp,montab);
- med_2_2::med_float *tmflo=new med_2_2::med_float[np*3];
+ med_float *tmflo=new med_float[np*3];
for (int i=0; i<np*3; i++) Ff>>tmflo[i];
- if (verbose>4) std::cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<std::endl;
+ if (verbose>4) cout<<"Vertices "<<tmflo[0]<<" "<<tmflo[1]<<"... "<<tmflo[np*3-1]<<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) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
- tmint=new med_2_2::med_int[subnumber*3];
+ if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
+ tmint=new med_int[subnumber*3];
for (int i=0; i<subnumber*3; i++) Ff>>tmint[i];
- if (verbose>4) std::cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<std::endl;
+ if (verbose>4) cout<<"Subdomains "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[subnumber*3-1]<<endl;
montab=new CVWtab(subnumber*3,tmint);
tmp=tmp.sprintf("NB%ld SN",this->nofile);
{
bool ok;
QString tmp;
- std::cerr<<"Problem function ReadFileNOBOITEB\n"
+ 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){
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
//read datas :
fread(&r1,sizeof(long),17+2,Ff);
- for (long i=1; i<18; i++) std::cout<<"R1("<<i<<")="<<r1[i]<<std::endl;
+ for (long i=1; i<18; i++) cout<<"R1("<<i<<")="<<r1[i]<<endl;
if (r1[0]!=68){
- std::cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<std::endl;
+ cerr<<"First FORTRAN record of File '"<<FileName.toLatin1().constData()<<"' not length 17*long"<<endl;
return false;
}
ne=r1[1];
np=r1[2];
npfixe=r1[3];
if (verbose>3){
- std::cout<<"NoboitebNumberOfElements="<<ne<<std::endl;
- std::cout<<"NoboitebNumberOfVertices="<<np<<std::endl;
- std::cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<std::endl;
+ cout<<"NoboitebNumberOfElements="<<ne<<endl;
+ cout<<"NoboitebNumberOfVertices="<<np<<endl;
+ cout<<"NoboitebNumberOfSpecifiedPoints="<<npfixe<<endl;
}
//etc...could be done if necessary not debugged
fread(&reste,sizeof(long),1,Ff);
long *tlong=new long[ne*4];
- med_2_2::med_int *tmint=new med_2_2::med_int[ne*4];
+ med_int *tmint=new med_int[ne*4];
fread(tlong,sizeof(long),ne*4,Ff);
fread(&reste,sizeof(long),1,Ff);
for (long i=0; i<ne*4; i++) tmint[i]=tlong[i];
delete tlong;
- if (verbose>4) std::cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<std::endl;
+ if (verbose>4) cout<<"Elements "<<tmint[0]<<" "<<tmint[1]<<"... "<<tmint[ne*4-1]<<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);
- //std::cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_2_2::med_float)<<std::endl;
+ //cout<<"info "<<reste<<" "<<np*3<<" "<<sizeof(med_float)<<endl;
float *tfloat=new float[np*3];
- med_2_2::med_float *tmflo=new med_2_2::med_float[np*3];
+ med_float *tmflo=new med_float[np*3];
fread(tfloat,sizeof(float),np*3,Ff);
fread(&reste,sizeof(long),1,Ff);
for (long i=0; i<np*3; i++) tmflo[i]=tfloat[i];
fread(&reste,sizeof(long),1,Ff);
fread(&subnumber,sizeof(long),1,Ff);
fread(&reste,sizeof(long),1,Ff);
- if (verbose>2) std::cout<<"NumberOfSubdomains="<<subnumber<<std::endl;
+ if (verbose>2) cout<<"NumberOfSubdomains="<<subnumber<<endl;
fread(&reste,sizeof(long),1,Ff);
tlong=new long[subnumber*3];
fread(tlong,sizeof(long),subnumber*3,Ff);
fread(&reste,sizeof(long),1,Ff);
if (verbose>4) printf("Subdomains %ld %ld ... %ld \n",tlong[0],tlong[1],tlong[subnumber*3-1]);
- tmint=new med_2_2::med_int[subnumber*3];
+ tmint=new med_int[subnumber*3];
for (long i=0; i<subnumber*3; i++) tmint[i]=tlong[i];
delete tlong;
montab=new CVWtab(subnumber*3,tmint);
long maxlen=128;
bool ok=true;
- //Lit les données :
+ //Lit les donn�s :
QFile Ff(FileName);
//NOT Raw because Raw=non-buffered file access
//qt3 ok=Ff.open(IO_ReadOnly|IO_Translate);
ok=Ff.open(QIODevice::ReadOnly|QIODevice::Text);
if (!ok){
- std::cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<std::endl;
+ cerr<<"Problem File '"<<FileName.toLatin1().constData()<<"' not open\n"<<endl;
return false;
}
tmp=Ff.readLine(maxlen);
tmp=tmp.simplified();
nb=tmp.toLong(&ok);
if (!ok){
- std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
+ cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
return false;
}
- if (verbose>2) std::cout<<"NumberOfVertices="<<nb<<std::endl;
- med_2_2::med_float *tmflo=new med_2_2::med_float[3*nb]; //coordinates
- med_2_2::med_int *tmint=new med_2_2::med_int[nb]; //nrs (attribute of point)
+ if (verbose>2) cout<<"NumberOfVertices="<<nb<<endl;
+ med_float *tmflo=new med_float[3*nb]; //coordinates
+ med_int *tmint=new med_int[nb]; //nrs (attribute of point)
long il3=0;
for ( long il=0; il<nb; il++ ){
tmp=Ff.readLine(maxlen);
tmp=tmp.simplified();
for ( int j=0; j<3; j++ ){
tmflo[il3]=tmp.section(' ',j,j).toDouble(&ok);
- //std::cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<std::endl;
+ //cout<<"cv '"<<tmflo[il3]<<"' "<<il3<<endl;
il3++;
if (!ok){
- std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
+ cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
return false;
}
}
//nrs is vertex attribute
tmint[il]=tmp.section(' ',3,3).toLong(&ok);
if (!ok){
- std::cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<std::endl;
+ cerr<<"Problem conversion File '"<<FileName.toLatin1().constData()<<"\n"<<endl;
return false;
}
}
while ( it.hasNext() ) {
it.next();
QString nom = it.key().leftJustified(32,' ');
- std::cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<std::endl;
+ cout<<nom.toLatin1().constData()<<"-> size="<<it.value()->size<<endl;
}
return true;
}
it.next();
if (it.key().contains(rxp)) {
nbremove++;
- if (this->verbose>6) std::cout<<"remove key "<<it.key().toLatin1().constData()<<std::endl;
+ if (this->verbose>6) cout<<"remove key "<<it.key().toLatin1().constData()<<endl;
delete it.value();
it.remove();
}
long ghs3dprl_mesh_wrap::nb_key_mesh_wrap(const QRegExp &rxp)
{
long nbremove=0;
- //std::cout<<"nb_key_mesh_wrap on "<<std::endl;
+ //cout<<"nb_key_mesh_wrap on "<<endl;
QMutableHashIterator<QString,CVWtab*> it(this->mestab);
while ( it.hasNext() ){
it.next();
if (it.key().contains(rxp)) nbremove++;
}
- //std::cout<<"nb_key_mesh_wrap found "<<nbremove<<std::endl;
+ //cout<<"nb_key_mesh_wrap found "<<nbremove<<endl;
return nbremove;
}
fwrite(&taille,sizeof(taille),1,fichier);
if (tab->tmint){
if (verbose>3)
- std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
- " SizeElement_med_2_2::med_int "<<sizeof(med_2_2::med_int)<<
- " TotalSizeBinary " <<taille*sizeof(med_2_2::med_int)<<std::endl;
- fwrite(tab->tmint,sizeof(med_2_2::med_int),taille,fichier);
+ " SizeElement_med_int "<<sizeof(med_int)<<
+ " TotalSizeBinary " <<taille*sizeof(med_int)<<endl;
+ fwrite(tab->tmint,sizeof(med_int),taille,fichier);
//fread(&gagnants,sizeof(gagnants),1,fichier);
}
if (tab->tmflo){
if (verbose>3)
- std::cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
+ cout<<"SwapOnFile_binary "<<tab->filename.toLatin1().constData()<<
" NbElements "<<taille<<
- " SizeElement_med_2_2::med_float "<<sizeof(med_2_2::med_float)<<
- " TotalSizeBinary " <<taille*sizeof(med_2_2::med_float)<<std::endl;
- fwrite(tab->tmflo,sizeof(med_2_2::med_float),taille,fichier);
+ " SizeElement_med_float "<<sizeof(med_float)<<
+ " TotalSizeBinary " <<taille*sizeof(med_float)<<endl;
+ fwrite(tab->tmflo,sizeof(med_float),taille,fichier);
}
fclose(fichier);
}
else{
- if (verbose>3) std::cout<<"SwapOnFile in binary file done yet "<<
- tab->filename.toLatin1().constData()<<std::endl;
+ if (verbose>3) cout<<"SwapOnFile in binary file done yet "<<
+ tab->filename.toLatin1().constData()<<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)
- std::cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<<
+ cout<<"SwapOutOfMemory_key_mesh_wrap on demand "<<
it.key().toLatin1().constData()<<
- " size "<<it.value()->size<<">"<<ifgreaterthan<<std::endl;
+ " size "<<it.value()->size<<">"<<ifgreaterthan<<endl;
//free memory
ok=SwapOnFile(it.key(),this->path,it.value(),this->verbose);
}
{
CVWtab *montab=this->mestab[key];
if (montab){
- //std::cout<<"key "<<key<<"trouvee -> size="<<montab->size<<std::endl;
+ //cout<<"key "<<key<<"trouvee -> size="<<montab->size<<endl;
if (montab->type==1)
for ( long i=0; i<montab->size; i++ )
- std::cout<<montab->tmint[i]<<" ";
+ cout<<montab->tmint[i]<<" ";
if (montab->type==2)
for ( long i=0; i<montab->size; i++ )
- std::cout<<montab->tmflo[i]<<" ";
- std::cout<<std::endl;
+ cout<<montab->tmflo[i]<<" ";
+ cout<<endl;
}
else
- std::cout<<"key "<<key.toLatin1().constData()<<" not found"<<std::endl;
+ cout<<"key "<<key.toLatin1().constData()<<" not found"<<endl;
return true;
}
//************************************
bool ghs3dprl_mesh_wrap::insert_key(const QString &key,CVWtab *tab)
-//insertion conditionnée par limite this->nbelem_limit_swap
+//insertion conditionn� par limite this->nbelem_limit_swap
//si tableaux contenus on dimension superieure
//alors swap disque dans getenv(tmp) fichier temporaire binaire
{
bool ok;
if (verbose>4)
- std::cout<<"insert key "<<key.toLatin1().constData()<<
- " size="<<tab->size<<std::endl;
+ cout<<"insert key "<<key.toLatin1().constData()<<
+ " size="<<tab->size<<endl;
tab->filename="_NO_FILE";
if (this->nbelem_limit_swap<tab->size) {
- if (verbose>3) std::cout<<"insert key automatic SwapOnFile "<<
- key.toLatin1().constData()<<std::endl;
+ if (verbose>3) cout<<"insert key automatic SwapOnFile "<<
+ key.toLatin1().constData()<<endl;
ok=SwapOnFile(key,this->path,tab,this->verbose);
}
this->mestab.insert(key,tab);
}
//************************************
CVWtab* ghs3dprl_mesh_wrap::restore_key(const QString &key)
-//retauration conditionnée par limite nbelem
+//retauration conditionn� par limite nbelem
//si tableaux contenus on dimension superieure a nbelem
//alors swap disque dans getenv(tmp) fichier temporaire
//alors lecture du fichier (et reallocate memory)
{
CVWtab *tab=NULL;
tab=this->mestab[key];
- /*if (tab) std::cout<<" -> size in proc "<<tab->size<<std::endl;
- else std::cout<<" -> tab NULL\n";*/
+ /*if (tab) cout<<" -> size in proc "<<tab->size<<endl;
+ else cout<<" -> tab NULL\n";*/
if (!tab) //it is NOT a problem
{
- if (verbose>6) std::cout<<"restore key not found "<<key.toLatin1().constData()<<std::endl;
+ if (verbose>6) cout<<"restore key not found "<<key.toLatin1().constData()<<endl;
return NULL;
}
if (tab->size > 0){
- if (verbose>5) std::cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<std::endl;
+ if (verbose>5) cout<<"restore key direct from memory "<<key.toLatin1().constData()<<" size="<<tab->size<<endl;
return tab;
}
//restore from binary file
if ((tab->type<1)||(tab->type>2)){
- std::cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
- " type unexpexted "<<tab->type<<std::endl;
+ cerr<<"Problem restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ " type unexpexted "<<tab->type<<endl;
return NULL;
}
- //std::cout<<"restore_key from binary file "<<tab->filename<<std::endl;
+ //cout<<"restore_key from binary file "<<tab->filename<<endl;
//swap disque binaire
FILE *fichier=fopen(tab->filename.toLatin1().constData(),"rb");
long taille;
fread(&taille,sizeof(long),1,fichier);
if (taille!=-tab->size){
- std::cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
- " size unexpexted "<<taille<<" expected "<<-tab->size<<std::endl;
+ cerr<<"Problem restore_key from binary file "<<tab->filename.toLatin1().constData()<<
+ " size unexpexted "<<taille<<" expected "<<-tab->size<<endl;
fclose(fichier);
return NULL;
}
if (tab->type==1){
if (verbose>5)
- std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
- " size_element med_2_2::med_float "<<sizeof(med_2_2::med_float)<<
- " total_size_binary " <<taille*sizeof(med_2_2::med_float)<<std::endl;
+ " size_element med_float "<<sizeof(med_float)<<
+ " total_size_binary " <<taille*sizeof(med_float)<<endl;
//allocate because swap disque binaire
- tab->tmint=new med_2_2::med_int[taille]; //allocate memory
- fread(tab->tmint,sizeof(med_2_2::med_int),taille,fichier);
+ tab->tmint=new med_int[taille]; //allocate memory
+ fread(tab->tmint,sizeof(med_int),taille,fichier);
}
if (tab->type==2){
if (verbose>5)
- std::cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
+ cout<<"restore key from binary file "<<tab->filename.toLatin1().constData()<<
" number of elements "<<taille<<
- " size_element med_2_2::med_float "<<sizeof(med_2_2::med_float)<<
- " total_size_binary " <<taille*sizeof(med_2_2::med_float)<<std::endl;
+ " size_element med_float "<<sizeof(med_float)<<
+ " total_size_binary " <<taille*sizeof(med_float)<<endl;
//allocate because swap disque binaire
- tab->tmflo=new med_2_2::med_float[taille]; //allocate memory
+ tab->tmflo=new med_float[taille]; //allocate memory
for (int i=0; i<taille ; i++) tab->tmflo[i]=-1e0;
- fread(tab->tmflo,sizeof(med_2_2::med_float),taille,fichier);
- /*for (int i=0; i<taille ; i++) std::cout<<tab->tmflo[i]<<"/";
- std::cout<<std::endl;*/
+ fread(tab->tmflo,sizeof(med_float),taille,fichier);
+ /*for (int i=0; i<taille ; i++) cout<<tab->tmflo[i]<<"/";
+ cout<<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";
- //std::cout<<"key "<<key1<<" et key "<<key2<<std::endl;
+ //cout<<"key "<<key1<<" et key "<<key2<<endl;
tab1=this->restore_key(key1);
//tab1=this->mestab[key1];
tab2=this->restore_key(key2);
//tab2=this->mestab[key2];
- //std::cout<<"sortie key "<<key1<<" et key "<<key2<<std::endl;
+ //cout<<"sortie key "<<key1<<" et key "<<key2<<endl;
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
+ { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
ok=false;
}
else
{
if (!tab2)
- { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
+ { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
ok=false;
}
else
if (!tab1->is_equal(tab2))
- { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<std::endl;
+ { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de contenu differents"<<endl;
ok=false;
}
}
tab2=this->restore_key(key2); //tab2=this->mestab[key2];
if (!tab1 && !tab2) continue; //case not neighbours
if (!tab1)
- { std::cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<std::endl;
+ { cout<<"key "<<key1.toLatin1().constData()<<" inexistante avec key "<<key2.toLatin1().constData()<<" existante"<<endl;
ok=false;
}
else
{
if (!tab2)
- { std::cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<std::endl;
+ { cout<<"key "<<key2.toLatin1().constData()<<" inexistante avec key "<<key1.toLatin1().constData()<<" existante"<<endl;
ok=false;
}
else
if ((tab1->type!=tab2->type)||(tab1->size!=tab2->size))
- { std::cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<std::endl;
+ { cout<<"key "<<key1.toLatin1().constData()<<" et key "<<key2.toLatin1().constData()<<" de type ou tailles differents"<<endl;
ok=false;
}
}
if (!tab1 && !tab2) continue; //cas non voisins
if (!tab1)
{
- std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<std::endl;
+ cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " NOT existing but key "<<key2.toLatin1().constData()<<" existing"<<endl;
ok=false; continue;
}
if (!tab2)
{
- std::cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
- " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<std::endl;
+ cerr<<"TestEqualityCoordinates key "<<key2.toLatin1().constData()<<
+ " NOT existing but key "<<key1.toLatin1().constData()<<" existing"<<endl;
ok=false; continue;
}
if (tab1->size!=tab2->size)
{
- std::cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT same size"<<std::endl;
+ cerr<<"TestEqualityCoordinates key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT same size"<<endl;
ok=false; continue;
}
if (ok)
//1 for print vertices not equals
if (!CVW_is_equal_vertices(tab11,i1,tab22,i2,1))
{
- std::cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<std::endl;
+ cerr<<j<<" Vertice "<<i1<<" != Vertice "<<i2<<"\n"<<endl;
ok=false; ok1=false;
}
}
if ((verbose>2)&&(ok1))
- std::cout<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<std::endl;
+ cout<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" ok"<<endl;
if (!ok1)
- std::cerr<<"TestEqualityCoordinates "<<tab1->size<<
- " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<std::endl;
+ cerr<<"TestEqualityCoordinates "<<tab1->size<<
+ " Vertices "<<key1.toLatin1().constData()<<" and "<<key2.toLatin1().constData()<<" NO_OK"<<endl;
key11old=key11; key22old=key22;
}
}
//************************************
bool ghs3dprl_mesh_wrap::Find_VerticesDomainToVerticesSkin()
//initialise correspondances vertice skin et vertices locaux pour chaque domaine
-//calcule un med_2_2::med_int new tab[nb_vertices_of_domain]
+//calcule un med_int new tab[nb_vertices_of_domain]
//avec nieme vertice of skin=tab[ieme vertice de domain]
//apres verification tepal garde bien dans la global numbering "GLi VE"
//les indices initiaux des noeuds (attention: de 1 a nbNodes)
QString key1,key2,tmp;
CVWtab *cooskin,*coodom,*glodom,*montab;
bool ok=true;
- med_2_2::med_float *p1,*p2;
- med_2_2::med_int i,nb,jd,js;
+ med_float *p1,*p2;
+ med_int i,nb,jd,js;
cooskin=this->restore_key(QString("SKIN_VERTICES_COORDINATES"));
- if (verbose>4)std::cout<<"NumberVerticesSKIN="<<cooskin->size/3<<std::endl;
if (!cooskin) return false;
+ if (verbose>4)cout<<"NumberVerticesSKIN="<<cooskin->size/3<<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)
- std::cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<std::endl;
+ cout<<"NumberVerticesDOMAIN_"<<ifile<<"="<<glodom->size<<endl;
if (coodom->size!=glodom->size*3)
{
- std::cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
- " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<std::endl;
+ cerr<<"Find_VerticesDomainToVerticesSkin key "<<key1.toLatin1().constData()<<
+ " and key "<<key2.toLatin1().constData()<<" NOT coherent sizes"<<endl;
ok=false; continue;
}
//test on equality of xyz_coordinates of commons vertices
- med_2_2::med_int *tab=new med_2_2::med_int[glodom->size];
+ med_int *tab=new med_int[glodom->size];
i=0;
nb=0; //nb equals vertices
if (verbose>8){
- std::cout<<"\nglobal numbering nodes: no iglo\n";
+ cout<<"\nglobal numbering nodes: no iglo\n";
for (jd=0; jd < glodom->size; jd++)
- std::cout<<"\t"<<jd<<"\t"<<glodom->tmint[jd]<<std::endl;
- std::cout<<"\nresults: no i js iglo\n";
+ cout<<"\t"<<jd<<"\t"<<glodom->tmint[jd]<<endl;
+ 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])
{
- 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;
+ 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;
tab[i]=js/3; nb++; continue;
}
}
tmp=tmp.sprintf("NB%ld GL_SKIN",ifile);
ok=this->insert_key(tmp,montab);
if (verbose>4){
- std::cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<std::endl;
+ cout<<"NumberOfEqualsVerticesDOMAIN_"<<ifile<<"="<<nb<<endl;
}
}
}
//Creating child nodes
//Version tag
- med_2_2::med_int majeur,mineur,release;
- //Quelle version de MED est utilisée
- med_2_2::MEDversionDonner(&majeur,&mineur,&release);
+ med_int majeur,mineur,release;
+ //Quelle version de MED est utilis�
+ MEDversionDonner(&majeur,&mineur,&release);
if (verbose>0) fprintf(stdout,"Files write with MED V%d.%d.%d\n",majeur,mineur,release);
node = xmlNewChild(root_node, 0, BAD_CAST "version",0);
//xmlNewProp(node, BAD_CAST "maj", BAD_CAST int2string2(majeur).c_str());
bool ok=true,oktmp;
QString tmp,cmd;
char description[MED_TAILLE_DESC];
- med_2_2::med_int nb;
+ med_int nb;
//remove path
//precaution because casename->med_nomfinal no more 32 character
//if path, in this->path.
//20 preserve for add postfixes "_idom" etc...
- if (verbose>0)std::cout<<"\nWrite_MEDfiles_v2\n";
- if (verbose>6){std::cout<<"\nInitialFamilies\n"; families.write();}
+ if (verbose>0)cout<<"\nWrite_MEDfiles_v2\n";
+ if (verbose>6){cout<<"\nInitialFamilies\n"; families.write();}
medname=medname.section('/',-1);
if (medname.length()>20) {
- std::cerr<<"CaseNameMed truncated (no more 20 characters)"<<std::endl;
+ cerr<<"CaseNameMed truncated (no more 20 characters)"<<endl;
medname.truncate(20);
}
//create file resume DOMAIN.joints.med of all joints for quick display (...may be...)
tmp=path+medname+tmp.sprintf("_joints.med",idom);
charendnull(distfilename,tmp,MED_TAILLE_DESC);
- fidjoint=med_2_2::MEDouvrir(distfilename,med_2_2::MED_CREATION);
- if (fidjoint<0) std::cerr<<"Problem MEDouvrir "<<distfilename<<std::endl;
- if (verbose>0) std::cout<<"CreateMEDFile for all joints <"<<distfilename<<">\n";
+ fidjoint=MEDouvrir(distfilename,MED_CREATION);
+ if (fidjoint<0) cerr<<"Problem MEDouvrir "<<distfilename<<endl;
+ if (verbose>0) cout<<"CreateMEDFile for all joints <"<<distfilename<<">\n";
//copy file source/GHS3DPRL_skin.med as destination/DOMAIN.skin.med
tmp=path+medname+"_skin.med";
- cmd="cp "+pathini+casename+"_skin.med "+tmp;
- //std::cout<<"Copy skin.med Command = "<<cmd<<std::endl;
- system(cmd.toLatin1().constData());
- if (verbose>0)std::cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n";
+ cmd=pathini+casename+"_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;
+ system(cmd.toLatin1().constData());
+ if (verbose>0) cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n"; }
+ else {
+ if (verbose>0) 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
families.add("0","");
oktmp=families.get_number_of_new_family(1,&famallnodes,&tmp);
families.add(tmp,"All_Nodes");
}
- else if (verbose>3) std::cout<<"--deletegroups matches \"All_Nodes\"\n";
+ else if (verbose>3) 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) std::cout<<"--deletegroups matches \"All_Faces\"\n";
+ else if (verbose>3) 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) std::cout<<"--deletegroups matches \"All_Tetrahedra\"\n";
+ else if (verbose>3) 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) std::cout<<"--deletegroups matches \"New_Nodes\"\n";
+ else if (verbose>3) 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) std::cout<<"--deletegroups matches \"New_Faces\"\n";
+ else if (verbose>3) 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) std::cout<<"--deletegroups matches \"New_Tetrahedra\"\n";
+ else if (verbose>3) cout<<"--deletegroups matches \"New_Tetrahedra\"\n";
- if (verbose>6){std::cout<<"\nIntermediatesFamilies\n"; families.write();}
- if (verbose>6) std::cout<<"\nNumber0fFiles="<<nbfilestot<<std::endl;
+ if (verbose>6){cout<<"\nIntermediatesFamilies\n"; families.write();}
+ if (verbose>6) cout<<"\nNumber0fFiles="<<nbfilestot<<endl;
familles intermediatesfamilies=families;
//initialisations on all domains
nbtetrastotal=0;
tmp=path+medname+tmp.sprintf("_%d.med",idom);
charendnull(distfilename,tmp,MED_TAILLE_DESC);
- //std::cout<<"<"<<distfilename<<">"<<std::endl;
- fid=med_2_2::MEDouvrir(distfilename,med_2_2::MED_CREATION);
- if (fid<0) {std::cerr<<"Problem MEDouvrir "<<distfilename<<std::endl; goto erreur;}
+ //cout<<"<"<<distfilename<<">"<<endl;
+ fid=MEDouvrir(distfilename,MED_CREATION);
+ if (fid<0) {cerr<<"Problem MEDouvrir "<<distfilename<<endl; goto erreur;}
if (verbose>0){
- if (verbose>2) std::cout<<std::endl;
- std::cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\n";
+ if (verbose>2) cout<<endl;
+ cout<<"CreateMEDFile "<<idom<<" <"<<distfilename<<">\n";
}
//create mesh
tmp=tmp.sprintf("domain %d among %d",idom,nbfilestot);
charendnull(description,tmp,MED_TAILLE_DESC);
- if (verbose>4) std::cout<<"Description : "<<description<<std::endl;
- err=med_2_2::MEDmaaCr(fid,nomfinal,3,med_2_2::MED_NON_STRUCTURE,description);
- if (err<0) {std::cerr<<"Problem MEDmaaCr"<<nomfinal<<std::endl; goto erreur;}
+ if (verbose>4) cout<<"Description : "<<description<<endl;
+ err=MEDmaaCr(fid,nomfinal,3,MED_NON_STRUCTURE,description);
+ if (err<0) {cerr<<"Problem MEDmaaCr"<<nomfinal<<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 (!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 (verbose>6){std::cout<<"\nFinalsFamilies\n"; families.write();}
+ if (verbose>6){cout<<"\nFinalsFamilies\n"; families.write();}
//for nodes families
nb=create_families(fid,1);
- if (verbose>5)std::cout<<"NumberOfFamiliesNodes="<<nb<<std::endl;
+ if (verbose>5)cout<<"NumberOfFamiliesNodes="<<nb<<endl;
- err=med_2_2::MEDfamEcr(fid,nomfinal,famnodes,nbnodes,med_2_2::MED_NOEUD,med_2_2::MED_NONE);
+ err=MEDfamEcr(fid,nomfinal,famnodes,nbnodes,MED_NOEUD,MED_NONE);
if (verbose>8)
- std::cout<<"MEDfamEcr nodes "<<nbnodes<<":"<<
- famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<std::endl;
+ cout<<"MEDfamEcr nodes "<<nbnodes<<":"<<
+ famnodes[0]<<"..."<<famnodes[nbnodes-1]<<" "<<endl;
delete[] famnodes;
- if (err<0) std::cerr<<"Problem MEDfamEcr nodes"<<std::endl;
+ if (err<0) cerr<<"Problem MEDfamEcr nodes"<<endl;
//for others families
nb=create_families(fid,-1);
- if (verbose>5)std::cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<std::endl;
+ if (verbose>5)cout<<"NumberOfFamiliesFacesAndEdgesEtc="<<nb<<endl;
- err=med_2_2::MEDfamEcr(fid,nomfinal,famtria3,nbtria3,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
+ err=MEDfamEcr(fid,nomfinal,famtria3,nbtria3,MED_MAILLE,MED_TRIA3);
if (verbose>8)
- std::cout<<"MEDfamEcr tria3 "<<nbtria3<<":"<<
- famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<std::endl;
+ cout<<"MEDfamEcr tria3 "<<nbtria3<<":"<<
+ famtria3[0]<<"..."<<famtria3[nbtria3-1]<<" "<<endl;
delete[] famtria3;
- if (err<0) std::cerr<<"Problem MEDfamEcr tria3"<<std::endl;
+ if (err<0) cerr<<"Problem MEDfamEcr tria3"<<endl;
- err=med_2_2::MEDfamEcr(fid,nomfinal,famtetra4,nbtetra4,med_2_2::MED_MAILLE,med_2_2::MED_TETRA4);
+ err=MEDfamEcr(fid,nomfinal,famtetra4,nbtetra4,MED_MAILLE,MED_TETRA4);
if (verbose>8)
- std::cout<<"MEDfamEcr tetra4 "<<nbtetra4<<":"<<
- famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<std::endl;
+ cout<<"MEDfamEcr tetra4 "<<nbtetra4<<":"<<
+ famtetra4[0]<<"..."<<famtetra4[nbtria3-1]<<" "<<endl;
delete[] famtetra4;
- if (err<0) std::cerr<<"Problem MEDfamEcr tria3"<<std::endl;
+ if (err<0) cerr<<"Problem MEDfamEcr tria3"<<endl;
- med_2_2::MEDfermer(fid); //no error
+ MEDfermer(fid); //no error
//master.xml writings
oktmp=Write_masterxmlMEDfile();
continue; //and loop on others domains
erreur: //error
ok=false;
- med_2_2::MEDfermer(fid); //but loop on others domains
+ MEDfermer(fid); //but loop on others domains
}
- med_2_2::MEDfermer(fidjoint); //no error
- if (verbose>0)std::cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<std::endl;
+ MEDfermer(fidjoint); //no error
+ if (verbose>0)cout<<"\nTotalNumberOftetrahedra="<<nbtetrastotal<<endl;
return ok;
}
bool ok=true;
QString tmp,key,key1,key2,key3;
CVWtab *tab,*tab1,*tab2,*tab3;
- med_2_2::med_int i,j,*arrayi;
+ med_int i,j,*arrayi;
int xx;
//writing node(vertices) coordinates
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp));
nbnodes=tab->size/3;
- err=med_2_2::MEDcoordEcr(fid,nomfinal,3,tab->tmflo,med_2_2::MED_FULL_INTERLACE,
- nbnodes,med_2_2::MED_CART,nomcoo,unicoo);
- if (err<0) {std::cerr<<"Problem MEDcoordEcr"<<std::endl; return false;}
- if (verbose>4)std::cout<<"NumberOfNodes="<<nbnodes<<std::endl;
+ err=MEDcoordEcr(fid,nomfinal,3,tab->tmflo,MED_FULL_INTERLACE,
+ nbnodes,MED_CART,nomcoo,unicoo);
+ if (err<0) {cerr<<"Problem MEDcoordEcr"<<endl; return false;}
+ if (verbose>4)cout<<"NumberOfNodes="<<nbnodes<<endl;
//writing indices of nodes
- arrayi=new med_2_2::med_int[nbnodes];
+ arrayi=new med_int[nbnodes];
for (i=0; i<nbnodes ; i++) arrayi[i]=i+1;
- err=med_2_2::MEDnumEcr(fid,nomfinal,arrayi,nbnodes,med_2_2::MED_NOEUD,med_2_2::MED_NONE);
+ err=MEDnumEcr(fid,nomfinal,arrayi,nbnodes,MED_NOEUD,MED_NONE);
delete[] arrayi;
- if (err<0) {std::cerr<<"Problem MEDnumEcr of nodes"<<std::endl; return false;}
+ if (err<0) {cerr<<"Problem MEDnumEcr of nodes"<<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) {std::cerr<<"Problem file "<<tmp.toLatin1().constData()<<std::endl; return false;}
+ if (!ok) {cerr<<"Problem file "<<tmp.toLatin1().constData()<<endl; return false;}
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
if (!tab1) return false;
}
- if (nbnodes!=tab1->size){std::cerr<<"Problem size GLi VE!=nbnodes!"<<std::endl; return false;}
+ if (nbnodes!=tab1->size){cerr<<"Problem size GLi VE!=nbnodes!"<<endl; return false;}
key2=key2.sprintf("SKIN_VERTICES_FAMILIES",idom); //on global numerotation
tab2=this->restore_key(key2); //tab1=this->mestab[key1];
- med_2_2::med_int nbskin=tab2->size;
- //for (i=0; i<nbskin; i++) std::cout<<i<<" "<<tab2->tmint[i]<<std::endl;
+ med_int nbskin=0;
+ if (tab2) med_int nbskin=tab2->size;
+ //for (i=0; i<nbskin; i++) cout<<i<<" "<<tab2->tmint[i]<<endl;
//set families of nodes existing in GHS3DPRL_skin.med
- med_2_2::med_int nb=nbnodes;
- famnodes=new med_2_2::med_int[nb];
+ med_int nb=nbnodes;
+ famnodes=new med_int[nb];
for (i=0; i<nb ; i++) famnodes[i]=famallnodes;
- med_2_2::med_int * fammore=new med_2_2::med_int[nb];
+ med_int * fammore=new med_int[nb];
for (i=0; i<nb ; i++) fammore[i]=famnewnodes;
//set families of nodes of skin
ok=set_one_more_family(famnodes,fammore,nb);
delete[] fammore;
- //std::cout<<"nodes loc "<<i<<" = gl "<<j<<"\t << "<<tab2->tmint[j]<<
+ //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])<<std::endl;
+ // tab3->tmflo[i*3+1],tab3->tmflo[i*3+2])<<endl;
//writing nodes(vertices) global numbering
- err=med_2_2::MEDglobalNumEcr(fid,nomfinal,tab1->tmint,nbnodes,med_2_2::MED_NOEUD,med_2_2::MED_NONE);
- if (err<0){std::cerr<<"Problem MEDglobalNumEcr nodes"<<std::endl; return false;}
+ err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,nbnodes,MED_NOEUD,MED_NONE);
+ if (err<0){cerr<<"Problem MEDglobalNumEcr nodes"<<endl; return false;}
return ok;
}
/*
//************************************
-bool ghs3dprl_mesh_wrap::set_one_more_family_old(med_2_2::med_int *fami, med_2_2::med_int *more, med_2_2::med_int nb)
-//fuse array of med_2_2::med_int families more et fami as kind of groups
+bool ghs3dprl_mesh_wrap::set_one_more_family_old(med_int *fami, med_int *more, med_int nb)
+//fuse array of med_int families more et fami as kind of groups
//because there are possibilities of intersections
{
QString tmp;
- med_2_2::med_int i,newfam,morfam,oldfam;
+ med_int i,newfam,morfam,oldfam;
for (i=0; i<nb ; i++) {
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
+ //cout<<"sur "<<i<<" en plus "<<more[i]<<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);
- //std::cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
+ //cout<<"oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
fami[i]=newfam;
}
}
}*/
//************************************
-bool ghs3dprl_mesh_wrap::set_one_more_family(med_2_2::med_int *fami, med_2_2::med_int *more, med_2_2::med_int nb)
-//fuse array of med_2_2::med_int families more et fami as kind of groups
+bool ghs3dprl_mesh_wrap::set_one_more_family(med_int *fami, med_int *more, med_int nb)
+//fuse array of med_int families more et fami as kind of groups
//because there are possibilities of intersections
{
QString tmp;
- med_2_2::med_int i,ii,j,newfam,morfam,oldfam,morfami,oldfami,i_zero,nb_fam,nb_max,nb_tot,nb_mess;
- med_2_2::med_int *newfami;
+ med_int i,ii,j,newfam,morfam,oldfam,morfami,oldfami,i_zero,nb_fam,nb_max,nb_tot,nb_mess;
+ med_int *newfami;
nb_fam=families.fam.size(); //on families negative and positive
- //std::cout<<"size families "<<nb_fam<<std::endl;
+ //cout<<"size families "<<nb_fam<<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) std::cout<<
- "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<std::endl;
+ if (nb_fam>300) cout<<
+ "***set_one_more_family*** warning many initial families could decrease speed "<<nb_fam<<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]
//to memorize newfam in array[oldfam][morfam]
- newfami=new med_2_2::med_int[nb_tot];
+ newfami=new med_int[nb_tot];
for (i=0; i<nb_tot ; i++) newfami[i]=0; //not yet met!
nb_mess=0;
if (more[i]==0) continue;
if (fami[i]==0) {
fami[i]=more[i];
- //std::cout<<"sur "<<i<<" en plus "<<more[i]<<std::endl;
+ //cout<<"sur "<<i<<" en plus "<<more[i]<<endl;
}
else { //intersection
if (fami[i]==more[i]) continue; //same families
else {
if (nb_mess<3) {
nb_mess++;
- std::cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<std::endl;
+ cout<<"***set_one_more_family*** warning many new families decrease speed "<<nb_fam<<endl;
}
ii=-1;
newfam=0;
if (newfam==0) {
//create new family intersection if needed
newfam=families.find_family_on_groups(oldfam,morfam);
- //std::cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
+ //cout<<"new oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
if (ii>=0) newfami[ii]=newfam;
}
/*else {
- std::cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<std::endl;
+ cout<<"!!! oldfam "<<oldfam<<" morfam "<<morfam<<" -> newfam "<<newfam<<endl;
}*/
fami[i]=newfam;
}
bool ok=true;
QString tmp,key,key1,key2,key3;
CVWtab *tab,*tab1,*tab2,*tab3;
- med_2_2::med_int ii,i,j,*arrayi;
+ med_int ii,i,j,*arrayi;
int xx;
//writing connectivity of faces triangles of wrap by nodes
if (!tab1) return false;
}
nbtria3=tab1->size/7;
- if (verbose>4) std::cout<<"NumberOfTriangles="<<nbtria3<<std::endl;
- arrayi=new med_2_2::med_int[nbtria3*3];
+ if (verbose>4) cout<<"NumberOfTriangles="<<nbtria3<<endl;
+ arrayi=new med_int[nbtria3*3];
ii=0,i=0 ;
for (j=0; j<nbtria3 ; j++){
arrayi[ii]=tab1->tmint[i]; ii++;
arrayi[ii]=tab1->tmint[i+2]; ii++;
i=i+7;
}
- err=med_2_2::MEDconnEcr(fid,nomfinal,3,arrayi,med_2_2::MED_FULL_INTERLACE,nbtria3,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3,med_2_2::MED_NOD);
+ err=MEDconnEcr(fid,nomfinal,3,arrayi,MED_FULL_INTERLACE,nbtria3,MED_MAILLE,MED_TRIA3,MED_NOD);
delete[] arrayi; //need immediately more little array
- if (err<0){std::cerr<<"Problem MEDconnEcr for triangles connectivity"<<std::endl; return false;}
+ if (err<0){cerr<<"Problem MEDconnEcr for triangles connectivity"<<endl; return false;}
//writing indices of faces triangles of wrap
//caution!
//generate "overlapping of numbers of elements" in "import med file" in salome
//if not in "//writing indices of tetrahedra" -> arrayi[i]=!NBFACES!+i+1
- arrayi=new med_2_2::med_int[nbtria3];
+ arrayi=new med_int[nbtria3];
for (i=0; i<nbtria3 ; i++) arrayi[i]=nbseg2+i+1;
- err=med_2_2::MEDnumEcr(fid,nomfinal,arrayi,nbtria3,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
+ err=MEDnumEcr(fid,nomfinal,arrayi,nbtria3,MED_MAILLE,MED_TRIA3);
delete[] arrayi;
- if (err<0){std::cerr<<"Problem MEDnumEcr of triangles"<<std::endl; return false;}
+ if (err<0){cerr<<"Problem MEDnumEcr of triangles"<<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){std::cerr<<"Problem size GLi FA!=nbtria3!"<<std::endl; return false;}
+ if (nbtria3!=tab1->size){cerr<<"Problem size GLi FA!=nbtria3!"<<endl; return false;}
key2=key2.sprintf("SKIN_TRIA3_FAMILIES",idom); //on global numerotation
tab2=this->restore_key(key2); //tab1=this->mestab[key1];
- med_2_2::med_int nbskin=tab2->size;
-
+ med_int nbskin=0;
+ if (tab2) med_int nbskin=tab2->size;
+
//set families of faces existing in GHS3DPRL_skin.med
- med_2_2::med_int nb=nbtria3;
- famtria3=new med_2_2::med_int[nb];
+ med_int nb=nbtria3;
+ famtria3=new med_int[nb];
for (i=0; i<nb ; i++) famtria3[i]=famalltria3;
- med_2_2::med_int * fammore=new med_2_2::med_int[nb];
+ med_int * fammore=new med_int[nb];
for (i=0; i<nb ; i++) fammore[i]=famnewtria3;
//set families of faces of skin
delete[] fammore;
//writing faces(triangles) global numbering
- //if (verbose>2)
- // std::cout<<"CreateMEDglobalNumerotation_Faces "<<key1<<" "<<tab1->size<<std::endl;
- err=med_2_2::MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
- if (err<0){std::cerr<<"Problem MEDglobalNumEcr faces"<<std::endl; return false;}
+ if (verbose>2)
+ cout<<"CreateMEDglobalNumerotation_Faces "<<key1.toLatin1().constData()<<" "<<tab1->size<<endl;
+ err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,MED_MAILLE,MED_TRIA3);
+ if (err<0){cerr<<"Problem MEDglobalNumEcr faces"<<endl; return false;}
//xx=this->remove_key_mesh_wrap(QRegExp("FC*",true,true));
tmp=tmp.sprintf("GL%d FA",idom);
bool ok=true;
QString tmp,namejoint,key,key1,key2;
CVWtab *tab,*tab1,*tab2;
- med_2_2::med_int ineig,ii,jj,i,j,k,*arrayi,nb,famjoint,*fammore,*inodes,*arrayfaces;
- med_2_2::med_float *arraynodes;
+ med_int ineig,ii,jj,i,j,k,*arrayi,nb,famjoint,*fammore,*inodes,*arrayfaces;
+ med_float *arraynodes;
char namejnt[MED_TAILLE_NOM+1]; //no more 32
char namedist[MED_TAILLE_NOM+1];
char descjnt[MED_TAILLE_DESC+1];
- med_2_2::med_int numfam_ini_wrap=100;
+ med_int numfam_ini_wrap=100;
joints_node=xmlNewNode(NULL, BAD_CAST "joints"); //masterfile.xml
- med_2_2::med_int nbjoints=0,nbnodesneig,nbtria3neig;
- std::string sjoints=""; //which domains are neighbourg
+ med_int nbjoints=0,nbnodesneig,nbtria3neig;
+ string sjoints=""; //which domains are neighbourg
int xx;
tmp=tmp.sprintf("MS%d *",idom);
tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,idom)+".msg";
ok=this->ReadFileMSGnew(tmp);
if (!ok) {
- std::cerr<<"Problem in file "<<tmp.toLatin1().constData()<<std::endl;
+ cerr<<"Problem in file "<<tmp.toLatin1().constData()<<endl;
return false;
}
}
if (idom==ineig) continue; //impossible
//!*************nodes
- //std::cout<<"\n nodes joints\n";
- key1=key1.sprintf("MS%d NE%d VE SE",idom,ineig); //SE or RE?
+ //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
- key1=key1.sprintf("MS%d NE%d VE RE",idom,ineig); //SE or RE
- tab2=tab1; //tab2=this->restore_key(key1); //no need because <send> equals <receive>
- if (!tab2) std::cerr<<"Problem nodes joint <send> with no <receive> in file .msg"<<std::endl;
- nb=tab1->size; nbnodesneig=nb;
+ key1=key1.sprintf("MS%d NE%d VE SE",ineig,idom); //SE or RE identicals
+ tab2=this->restore_key(key1);
+ //if not yet loaded (first time) try to load necessary file msg of neighbourg
+ if (!tab2) {
+ tmp=pathini+casename+tmp.sprintf(format.toLatin1().constData(),nbfilestot,ineig)+".msg";
+ this->nofile=ineig; //neighbourg file
+ ok=this->ReadFileMSGnew(tmp);
+ this->nofile=idom; //restaure initial domain
+ if (!ok) {
+ cerr<<"Problem in file "<<tmp.toLatin1().constData()<<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;
+ 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;
+ continue;
+ }
nbjoints++; //one more joint for this domain
sjoints=sjoints+" "+i2a(ineig);
if (verbose>4)
- std::cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
+ cout<<"NumberOfNodesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<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;
strcpy(descjnt,tmp.toLatin1().constData());
tmp=medname+tmp.sprintf("_%d",ineig);
strcpy(namedist,tmp.toLatin1().constData());
- err=med_2_2::MEDjointCr(fid,nomfinal,namejnt,descjnt,ineig,namedist);
- if (err<0) std::cerr<<"Problem MEDjointCr"<<std::endl;
+ err=MEDjointCr(fid,nomfinal,namejnt,descjnt,ineig,namedist);
+ if (err<0) cerr<<"Problem MEDjointCr"<<endl;
- ok=families.get_number_of_new_family(1,&famjoint,&tmp);
- families.add(tmp,namejoint);
+ famjoint=0;
+ if (namejoint.contains(deletegroups)==0){
+ ok=families.get_number_of_new_family(1,&famjoint,&tmp);
+ families.add(tmp,namejoint);
+ }
key=key.sprintf("NB%d VC",idom); //files.NoBoite Vertex Coordinates
tab=this->restore_key(key); //tab1=this->mestab[key1];
//writing correspondence nodes-nodes
//two indices for one correspondence
- arrayi=new med_2_2::med_int[nb*2];
- arraynodes=new med_2_2::med_float[nbnodesneig*3]; //for file DOMAIN_join.med
- inodes=new med_2_2::med_int[nbnodes]; //for file DOMAIN_join.med
- med_2_2::med_int * fammore=new med_2_2::med_int[nbnodes];
+ arrayi=new med_int[nb*2];
+ arraynodes=new med_float[nbnodesneig*3]; //for file DOMAIN_join.med
+ inodes=new med_int[nbnodes]; //for file DOMAIN_join.med
+ med_int * fammore=new med_int[nbnodes];
for (i=0; i<nbnodes ; i++) {fammore[i]=0; inodes[i]=-1;}
ii=0; jj=0; k=0;
for (i=0; i<nb ; i++){
arrayi[ii]=tab1->tmint[i]; ii++;
arrayi[ii]=tab2->tmint[i]; ii++;
}
- ok=set_one_more_family(famnodes,fammore,nbnodes);
+ if (namejoint.contains(deletegroups)==0){
+ ok=set_one_more_family(famnodes,fammore,nbnodes);
+ }
delete[] fammore;
- err=med_2_2::MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb,
- med_2_2::MED_NOEUD,med_2_2::MED_NONE,med_2_2::MED_NOEUD,med_2_2::MED_NONE);
- if (err<0) std::cerr<<"Problem MEDjointEcr nodes"<<std::endl;
+ err=MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb,
+ MED_NOEUD,MED_NONE,MED_NOEUD,MED_NONE);
+ if (err<0) cerr<<"Problem MEDjointEcr nodes"<<endl;
delete[] arrayi;
//!*************TRIA3
//writing correspondence triangles-triangles
- //std::cout<<"\n faces joints\n";
+ //cout<<"\n faces joints\n";
nbtria3neig=0;
- key1=key1.sprintf("MS%d NE%d FA SE",idom,ineig); //SE or RE?
+ 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)
- std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<std::endl;
+ cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"=0"<<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 RE",idom,ineig); //SE or RE?
- tab2=tab1; //tab2=this->restore_key(key1); //no need because <send> equals <receive>
- if (!tab2) std::cerr<<"Problem triangles joint send with no receive"<<std::endl;
+ 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;
+ 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;
+ continue;
+ }
namejoint=namejoint.sprintf("JOINT_%d_%d_Faces",idom,ineig);
- ok=families.get_number_of_new_family(-1,&famjoint,&tmp);
- families.add(tmp,namejoint);
+ famjoint=0;
+ if (namejoint.contains(deletegroups)==0){
+ ok=families.get_number_of_new_family(-1,&famjoint,&tmp);
+ families.add(tmp,namejoint);
+ }
key=key.sprintf("FC%d",idom); //files.FaCes faces (wrap and triangles only)
tab=this->restore_key(key); //tab1=this->mestab[key1];
- med_2_2::med_int nb=tab1->size; nbtria3neig=nb;
+ med_int nb=tab1->size; nbtria3neig=nb;
if (verbose>4)
- std::cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<std::endl;
- arrayi=new med_2_2::med_int[nb*2];
- arrayfaces=new med_2_2::med_int[nbtria3neig*3]; //for file DOMAIN_join.med
- fammore=new med_2_2::med_int[nbtria3];
+ cout<<"NumberOfTrianglesOfJoint_"<<idom<<"_"<<ineig<<"="<<nb<<endl;
+ arrayi=new med_int[nb*2];
+ arrayfaces=new med_int[nbtria3neig*3]; //for file DOMAIN_join.med
+ fammore=new med_int[nbtria3];
for (i=0; i<nbtria3 ; i++) fammore[i]=0;
ii=0; jj=0;
for (i=0; i<nb ; i++){
- //no need because <send> equals <receive> tab1->tmint[i]==tab2->tmint[i]
arrayi[ii]=tab1->tmint[i]; ii++;
fammore[tab1->tmint[i]-1]=famjoint;
//famtria3[tab1->tmint[i]-1]=famjoint;
arrayi[ii]=tab2->tmint[i]; ii++;
- //std::cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<std::endl;
+ //cout<<arrayi[ii-1]<<"="<<arrayi[ii-2]<<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++;
arrayfaces[jj]=inodes[tab->tmint[k+2]-1]+1; jj++;
}
- ok=set_one_more_family(famtria3,fammore,nbtria3);
+ if (namejoint.contains(deletegroups)==0){
+ ok=set_one_more_family(famtria3,fammore,nbtria3);
+ }
delete[] fammore;
- err=med_2_2::MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
- if (err<0) std::cerr<<"Problem MEDjointEcr triangles"<<std::endl;
+ err=MEDjointEcr(fid,nomfinal,namejnt,arrayi,nb,MED_MAILLE,MED_TRIA3,MED_MAILLE,MED_TRIA3);
+ if (err<0) cerr<<"Problem MEDjointEcr triangles"<<endl;
delete[] arrayi;
}
charendnull(namejnt,namejoint,MED_TAILLE_NOM);
tmp=tmp.sprintf("joint between %d and %d",idom,ineig);
charendnull(descjnt,tmp,MED_TAILLE_DESC);
- err=med_2_2::MEDmaaCr(fidjoint,namejnt,3,med_2_2::MED_NON_STRUCTURE,descjnt);
- if (err<0) std::cerr<<"Problem MEDmaaCr "<<namejnt<<std::endl;
+ err=MEDmaaCr(fidjoint,namejnt,3,MED_NON_STRUCTURE,descjnt);
+ if (err<0) cerr<<"Problem MEDmaaCr "<<namejnt<<endl;
//write nodes
- err=med_2_2::MEDcoordEcr(fidjoint,namejnt,3,arraynodes,med_2_2::MED_FULL_INTERLACE,
- nbnodesneig,med_2_2::MED_CART,nomcoo,unicoo);
- if (err<0) std::cerr<<"Problem MEDcoordEcr "<<namejnt<<std::endl;
- arrayi=new med_2_2::med_int[nbnodesneig];
+ err=MEDcoordEcr(fidjoint,namejnt,3,arraynodes,MED_FULL_INTERLACE,
+ nbnodesneig,MED_CART,nomcoo,unicoo);
+ if (err<0) cerr<<"Problem MEDcoordEcr "<<namejnt<<endl;
+ arrayi=new med_int[nbnodesneig];
for (i=0; i<nbnodesneig ; i++) arrayi[i]=i+1;
- err=med_2_2::MEDnumEcr(fidjoint,namejnt,arrayi,nbnodesneig,med_2_2::MED_NOEUD,med_2_2::MED_NONE);
+ err=MEDnumEcr(fidjoint,namejnt,arrayi,nbnodesneig,MED_NOEUD,MED_NONE);
delete[] arrayi;
- if (err<0) std::cerr<<"Problem MEDnumEcr of nodes "<<namejnt<<std::endl;
+ if (err<0) cerr<<"Problem MEDnumEcr of nodes "<<namejnt<<endl;
//write tria3
if (nbtria3neig>0) {
- //for (i=0; i<nbtria3neig ; i++) std::cout<<i+1<<" "<<
- // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<std::endl;
- err=med_2_2::MEDconnEcr(fidjoint,namejnt,3,arrayfaces,med_2_2::MED_FULL_INTERLACE,
- nbtria3neig,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3,med_2_2::MED_NOD);
- if (err<0) std::cerr<<"Problem MEDconnEcr for triangles connectivity "<<namejnt<<std::endl;
+ //for (i=0; i<nbtria3neig ; i++) cout<<i+1<<" "<<
+ // arrayfaces[i*3]<<" "<<arrayfaces[i*3+1]<<" "<<arrayfaces[i*3+2]<<endl;
+ err=MEDconnEcr(fidjoint,namejnt,3,arrayfaces,MED_FULL_INTERLACE,
+ nbtria3neig,MED_MAILLE,MED_TRIA3,MED_NOD);
+ if (err<0) cerr<<"Problem MEDconnEcr for triangles connectivity "<<namejnt<<endl;
//writing indices of faces triangles of joint
- arrayi=new med_2_2::med_int[nbtria3neig];
+ arrayi=new med_int[nbtria3neig];
for (i=0; i<nbtria3neig ; i++) arrayi[i]=i+1;
- err=med_2_2::MEDnumEcr(fidjoint,namejnt,arrayi,nbtria3neig,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
+ err=MEDnumEcr(fidjoint,namejnt,arrayi,nbtria3neig,MED_MAILLE,MED_TRIA3);
delete[] arrayi;
- if (err<0) std::cerr<<"Problem MEDnumEcr of triangles "<<namejnt<<std::endl;
+ if (err<0) cerr<<"Problem MEDnumEcr of triangles "<<namejnt<<endl;
}
}
tmp=tmp.sprintf("NB%d VC",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp));
- tmp=tmp.sprintf("MS%d NE*",idom);
+ //tmp=tmp.sprintf("MS%d NE*",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
- xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp));
+ //xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp));
tmp=tmp.sprintf("FC%d",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
xx=this->remove_key_mesh_wrap(QRegExp(tmp,Qt::CaseSensitive,QRegExp::RegExp));
bool ok=true;
QString tmp,key1;
CVWtab *tab1;
- med_2_2::med_int i,*arrayi;
+ med_int i,*arrayi;
int xx;
//writing connectivity of tetrahedra by nodes
tab1=this->restore_key(key1); //tab1=this->mestab[key1];
nbtetra4=tab1->size/4;
nbtetrastotal=nbtetrastotal + nbtetra4;
- if (verbose>5)std::cout<<"NumberOftetrahedra="<<nbtetra4<<std::endl;
- err=med_2_2::MEDconnEcr(fid,nomfinal,3,tab1->tmint,med_2_2::MED_FULL_INTERLACE,nbtetra4,med_2_2::MED_MAILLE,med_2_2::MED_TETRA4,med_2_2::MED_NOD);
- if (err<0){std::cerr<<"Problem MEDconnEcr for tetra connectivity"<<std::endl; return false;}
+ if (verbose>5)cout<<"NumberOftetrahedra="<<nbtetra4<<endl;
+ err=MEDconnEcr(fid,nomfinal,3,tab1->tmint,MED_FULL_INTERLACE,nbtetra4,MED_MAILLE,MED_TETRA4,MED_NOD);
+ if (err<0){cerr<<"Problem MEDconnEcr for tetra connectivity"<<endl; return false;}
//writing indices of tetrahedra
- arrayi=new med_2_2::med_int[nbtetra4];
+ arrayi=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) arrayi[i]=nbseg2+nbtria3+i+1;
- //for (i=0; i<nbtria3 ; i++) std::cout<<i<<" "<<arrayi[i]<<std::endl;
- err=med_2_2::MEDnumEcr(fid,nomfinal,arrayi,nbtetra4,med_2_2::MED_MAILLE,med_2_2::MED_TETRA4);
+ //for (i=0; i<nbtria3 ; i++) cout<<i<<" "<<arrayi[i]<<endl;
+ err=MEDnumEcr(fid,nomfinal,arrayi,nbtetra4,MED_MAILLE,MED_TETRA4);
delete[] arrayi;
- if (err<0){std::cerr<<"Problem MEDnumEcr of tetrahedra"<<std::endl; return false;}
+ if (err<0){cerr<<"Problem MEDnumEcr of tetrahedra"<<endl; return false;}
- famtetra4=new med_2_2::med_int[nbtetra4];
+ famtetra4=new med_int[nbtetra4];
for (i=0; i<nbtetra4 ; i++) famtetra4[i]=famnewtetra4;
//writing tetrahedra global numbering
}
if (tab1->size!=nbtetra4){
- std::cerr<<"Problem incorrect size of tetrahedra global numbering"<<std::endl; return false;}
+ cerr<<"Problem incorrect size of tetrahedra global numbering"<<endl; return false;}
if (verbose>2)
- std::cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<std::endl;
- err=med_2_2::MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,med_2_2::MED_MAILLE,med_2_2::MED_TETRA4);
- if (err<0){std::cerr<<"Problem MEDglobalNumEcr tetrahedra"<<std::endl; return false;}
+ cout<<"CreateMEDglobalNumerotation_tetrahedra "<<key1.toLatin1().constData()<<" "<<tab1->size<<endl;
+ err=MEDglobalNumEcr(fid,nomfinal,tab1->tmint,tab1->size,MED_MAILLE,MED_TETRA4);
+ if (err<0){cerr<<"Problem MEDglobalNumEcr tetrahedra"<<endl; return false;}
tmp=tmp.sprintf("NB%d EV",idom);
//qt3 xx=this->remove_key_mesh_wrap(QRegExp(tmp,true,true));
}
//************************************
-med_2_2::med_int ghs3dprl_mesh_wrap::create_families(med_2_2::med_idt fid, int sign)
+med_int ghs3dprl_mesh_wrap::create_families(med_idt fid, int sign)
//if sign < 0 families faces or tria3 etc...
//if sign >= 0 family zero and family nodes
{
- med_2_2::med_int pas,ires;
+ med_int pas,ires;
char nomfam[MED_TAILLE_NOM+1]; //it.current()->name;
char attdes[MED_TAILLE_DESC+1]="_NO_DESCRIPTION";
char *gro;
- med_2_2::med_int i,attide=1,attval=1,natt=1,num,ngro;
+ med_int i,attide=1,attval=1,natt=1,num,ngro;
if (sign>=0) pas=1; else pas=-1;
ires=0;
if ((pas== 1) && (num< 0)) continue; //not good families
charendnull(nomfam,(*it1).first,MED_TAILLE_NOM);
ires++;
- //med_2_2::med_int natt=0;
+ //med_int natt=0;
ngro=(*it1).second.size();
if (verbose>5)
- std::cout<<"CreateFamilyInMEDFile <"<<nomfam<<">\tNbGroups="<<ngro;
+ cout<<"CreateFamilyInMEDFile <"<<nomfam<<">\tNbGroups="<<ngro;
gro=new char[MED_TAILLE_LNOM*ngro+2];
gb=(*it1).second;
i=0;
for (it2=gb.begin(); it2!=gb.end(); ++it2){
charendnull(&gro[i*MED_TAILLE_LNOM],(*it2).first,MED_TAILLE_LNOM);
- if (verbose>5)std::cout<<" <"<<&gro[i*MED_TAILLE_LNOM]<<"> ";
+ if (verbose>5)cout<<" <"<<&gro[i*MED_TAILLE_LNOM]<<"> ";
i++;
}
- if (verbose>5)std::cout<<std::endl;
- err=med_2_2::MEDfamCr(fid,nomfinal,nomfam,num,NULL,NULL,NULL,0,gro,ngro);
+ if (verbose>5)cout<<endl;
+ err=MEDfamCr(fid,nomfinal,nomfam,num,NULL,NULL,NULL,0,gro,ngro);
//&attide,&attval,attdes,natt,gro,ngro);
- if (err<0) std::cerr<<"Problem MEDfamCr"<<std::endl;
+ if (err<0) cerr<<"Problem MEDfamCr"<<endl;
delete[] gro;
- if (err<0) std::cerr<<"Problem MEDfamCr of "<<nomfam<<std::endl;
+ if (err<0) cerr<<"Problem MEDfamCr of "<<nomfam<<endl;
}
return ires;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// ---
-//
// File : tepal2med.cxx
// Author : Christian VAN WAMBEKE (CEA)
-//
// ---
/*
#include <sstream>
#include <fstream>
-#include <QString>
+#include <qstring.h>
#include <QXmlSimpleReader>
#include <QXmlInputSource>
#include <QApplication>
#include <stdlib.h>
}
+using namespace std;
+using namespace med_2_2;
+
//************************************
-med_2_2::med_idt ouvre_fichier_MED(char *fichier,int verbose)
+med_idt ouvre_fichier_MED(char *fichier,int verbose)
{
- med_2_2::med_idt fid = 0;
- med_2_2::med_err ret = 0;
- med_2_2::med_int majeur,mineur,release;
+ med_idt fid = 0;
+ med_err ret = 0;
+ med_int majeur,mineur,release;
/* on regarde si le fichier existe */
ret = (int) access(fichier,F_OK);
if (ret < 0) return fid;
/* on regarde s'il s'agit d'un fichier au format HDF5 */
- ret = med_2_2::MEDformatConforme(fichier);
+ ret = MEDformatConforme(fichier);
if (ret < 0){
- std::cerr<<"File "<<fichier<<" not HDF V5 formatted\n";
+ cerr<<"File "<<fichier<<" not HDF V5 formatted\n";
return fid;
}
/* Quelle version de MED est utilise par mdump ? */
- med_2_2::MEDversionDonner(&majeur,&mineur,&release);
+ MEDversionDonner(&majeur,&mineur,&release);
if (verbose>0)fprintf(stdout,"\nReading %s with MED V%d.%d.%d",
fichier,majeur,mineur,release);
/* Ouverture du fichier MED en lecture seule */
- fid = med_2_2::MEDouvrir(fichier,med_2_2::MED_LECTURE);
+ fid = MEDouvrir(fichier,MED_LECTURE);
if (ret < 0) return fid;
- med_2_2::MEDversionLire(fid, &majeur, &mineur, &release);
+ MEDversionLire(fid, &majeur, &mineur, &release);
if (majeur < 2 || majeur == 2 && mineur < 2) {
fprintf(stderr,"File %s from MED V%d.%d.%d not assumed\n",
fichier,majeur,mineur,release);
- //" version est antérieure à la version 2.2";
- ret = med_2_2::MEDfermer(fid);
+ //" version est ant�ieure �la version 2.2";
+ ret = MEDfermer(fid);
fid=0; }
else {
if (verbose>0)fprintf(stdout,", file from MED V%d.%d.%d\n",majeur,mineur,release); }
//************************************
bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw)
{
- med_2_2::med_err ret;
- med_2_2::med_idt fid=0;
- med_2_2::med_int i,j,mdim,nmaa,edim,majeur_lu,mineur_lu,release_lu,nprofils;
- med_2_2::med_maillage type_maillage;
+ med_err ret;
+ med_idt fid=0;
+ med_int i,j,mdim,nmaa,edim,majeur_lu,mineur_lu,release_lu,nprofils;
+ med_maillage type_maillage;
int numero=1;
- med_2_2::med_connectivite typ_con=med_2_2::MED_NOD;
+ med_connectivite typ_con=MED_NOD;
QString key,tmp;
//version qt3
char chaine[nomfilemed.length()+1];
strncpy(chaine,nomfilemed.toLatin1().constData(),nomfilemed.length()+1);
- //std::cout<<"*** ReadFileMED *** "<<chaine<<"\n";
+ //cout<<"*** ReadFileMED *** "<<chaine<<"\n";
/*version qt4
char chaine[nomfilemed.length() + 1];
strncpy(chaine, nomfilemed.toStdString().c_str(), nomfilemed.length());
//?chaine[nomfilemed.length()]= '\0';
- std::cout<<"fichier "<<chaine<<"\n";*/
+ cout<<"fichier "<<chaine<<"\n";*/
//char *pt=chaine;
fid=ouvre_fichier_MED(chaine,mymailw->verbose);
if (fid == 0) {
- std::cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
+ cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
//ret = MEDfermer(fid);
return false;
}
- nmaa = med_2_2::MEDnMaa(fid);
+ nmaa = MEDnMaa(fid);
if (nmaa <= 0){
- std::cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"No meshes in "<<nomfilemed.toLatin1().constData()<<"\n";
+ ret = MEDfermer(fid);
return false;
}
- if (nmaa > 1) std::cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
- ret = med_2_2::MEDmaaInfo(fid,numero,mymailw->nommaa,&mdim,&type_maillage,
+ if (nmaa > 1) cout<<"More than one mesh in "<<nomfilemed.toLatin1().constData()<<", first one taken\n";
+ ret = MEDmaaInfo(fid,numero,mymailw->nommaa,&mdim,&type_maillage,
mymailw->maillage_description);
if (ret < 0){
- std::cerr<<"Problem MEDmaaInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem MEDmaaInfo in "<<nomfilemed.toLatin1().constData()<<"\n";
+ ret = MEDfermer(fid);
return false;
}
if (mdim != 3){
- std::cerr<<"Problem dimension mesh should be 3: "<<mdim<<"\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem dimension mesh should be 3: "<<mdim<<"\n";
+ ret = MEDfermer(fid);
return false;
}
- edim = med_2_2::MEDdimEspaceLire(fid,mymailw->nommaa);
+ edim = MEDdimEspaceLire(fid,mymailw->nommaa);
if (!((edim == 3)||(edim == -1))){
- std::cerr<<"Problem dimension Espace should be 3 or -1: "<<edim<<"\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem dimension Espace should be 3 or -1: "<<edim<<"\n";
+ ret = MEDfermer(fid);
return false;
}
- if (type_maillage != med_2_2::MED_NON_STRUCTURE){
- std::cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<std::endl;
- ret = med_2_2::MEDfermer(fid);
+ if (type_maillage != MED_NON_STRUCTURE){
+ cerr<<"Problem type mesh should be MED_NON_STRUCTURE: "<<type_maillage<<endl;
+ ret = MEDfermer(fid);
return false;
}
//lecture nb de noeuds
- med_2_2::med_int nnoe=med_2_2::MEDnEntMaa(fid,mymailw->nommaa,med_2_2::MED_COOR,med_2_2::MED_NOEUD,
- (med_2_2::med_geometrie_element)0,(med_2_2::med_connectivite)0);
+ med_int nnoe=MEDnEntMaa(fid,mymailw->nommaa,MED_COOR,MED_NOEUD,
+ (med_geometrie_element)0,(med_connectivite)0);
if (nnoe<1){
- std::cerr<<"Problem number of Vertices < 1\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem number of Vertices < 1\n";
+ ret = MEDfermer(fid);
return false;
}
//nombre d'objets MED : mailles, faces, aretes , ...
- med_2_2::med_int nmailles[MED_NBR_GEOMETRIE_MAILLE],nbtria3;
- med_2_2::med_int nfaces[MED_NBR_GEOMETRIE_FACE];
- med_2_2::med_int naretes[MED_NBR_GEOMETRIE_ARETE],nbseg2;
+ med_int nmailles[MED_NBR_GEOMETRIE_MAILLE],nbtria3;
+ med_int nfaces[MED_NBR_GEOMETRIE_FACE];
+ med_int naretes[MED_NBR_GEOMETRIE_ARETE],nbseg2;
//polygones et polyedres familles equivalences joints
- med_2_2::med_int nmpolygones,npolyedres,nfpolygones,nfam,nequ,njnt;
+ med_int nmpolygones,npolyedres,nfpolygones,nfam,nequ,njnt;
//Combien de mailles, faces ou aretes pour chaque type geometrique ?
/*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) std::cout<<"NumberOf"<<nommai[i]<<"="<<nmailles[i]<<std::endl;
+ if (mymailw->verbose>6) cout<<"NumberOf"<<nommai[i]<<"="<<nmailles[i]<<endl;
}*/
- nbtria3=med_2_2::MEDnEntMaa(fid,mymailw->nommaa,med_2_2::MED_CONN,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3,typ_con);
- nbseg2=med_2_2::MEDnEntMaa(fid,mymailw->nommaa,med_2_2::MED_CONN,med_2_2::MED_MAILLE,med_2_2::MED_SEG2,typ_con);
+ nbtria3=MEDnEntMaa(fid,mymailw->nommaa,MED_CONN,MED_MAILLE,MED_TRIA3,typ_con);
+ nbseg2=MEDnEntMaa(fid,mymailw->nommaa,MED_CONN,MED_MAILLE,MED_SEG2,typ_con);
//Combien de mailles polygones quelconques ?
//nmpolygones = lecture_nombre_mailles_polygones(fid,nommaa,typ_con);
//npolyedres = lecture_nombre_mailles_polyedres(fid,nommaa,typ_con);
//combien de familles ?
- nfam=med_2_2::MEDnFam(fid,mymailw->nommaa);
+ nfam=MEDnFam(fid,mymailw->nommaa);
if (mymailw->verbose>2) {
- 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";
+ cout<<"\nNumberOfFamilies="<<nfam<<endl;
+ cout<<"NumberOfVertices="<<nnoe<<endl;
+ cout<<"NumberOfMED_SEG2="<<nbseg2<<endl;
+ cout<<"NumberOfMED_TRIA3="<<nbtria3<<"\n\n";
}
if (nbtria3<3){
- std::cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem number of MED_TRIA3 < 3, not a skin of a volume\n";
+ ret = MEDfermer(fid);
return false;
}
-med_2_2::med_int famdelete[nfam],ifamdelete=0,idelete;
+med_int famdelete[nfam],ifamdelete=0,idelete;
{
- med_2_2::med_int natt,ngro;
+ med_int natt,ngro;
char *attdes,*gro;
- med_2_2::med_int *attval,*attide;
+ med_int *attval,*attide;
char nomfam[MED_TAILLE_NOM+1];
- med_2_2::med_int numfam;
+ med_int numfam;
char str1[MED_TAILLE_DESC+1];
char str2[MED_TAILLE_LNOM+1];
- med_2_2::med_err ret = 0;
+ med_err ret = 0;
for (i=0;i<nfam;i++) famdelete[i]=0;
for (i=0;i<nfam;i++) {
//nombre de groupes
- ngro = med_2_2::MEDnGroupe(fid,mymailw->nommaa,i+1);
+ ngro = MEDnGroupe(fid,mymailw->nommaa,i+1);
if (ngro < 0){
- std::cerr<<"Problem reading number of groups of family\n";
+ cerr<<"Problem reading number of groups of family\n";
continue;
}
//nombre d'attributs
- natt = med_2_2::MEDnAttribut(fid,mymailw->nommaa,i+1);
+ natt = MEDnAttribut(fid,mymailw->nommaa,i+1);
if (natt < 0){
- std::cerr<<"Problem reading number of attributes of family\n";
+ cerr<<"Problem reading number of attributes of family\n";
continue;
}
//nom,numero,attributs,groupes
//allocation memoire par exces
- attide = (med_2_2::med_int*) malloc(sizeof(med_2_2::med_int)*(natt+1));
- attval = (med_2_2::med_int*) malloc(sizeof(med_2_2::med_int)*(natt+1));
+ attide = (med_int*) malloc(sizeof(med_int)*(natt+1));
+ attval = (med_int*) malloc(sizeof(med_int)*(natt+1));
attdes = (char *) malloc(MED_TAILLE_DESC*(natt+1));
gro = (char*) malloc(MED_TAILLE_LNOM*(ngro+1));
- ret = med_2_2::MEDfamInfo(fid,mymailw->nommaa,i+1,nomfam,&numfam,attide,attval,
- attdes,&natt,gro,&ngro);
+ ret = MEDfamInfo(fid,mymailw->nommaa,i+1,nomfam,&numfam,attide,attval,
+ attdes,&natt,gro,&ngro);
if (ret < 0){
- std::cerr<<"Problem reading informations of family\n";
+ cerr<<"Problem reading informations of family\n";
continue;
}
if (mymailw->verbose>8) {
- std::cout<<"Family "<<numfam<<" have "<<natt<<" attributes and "<<ngro<<" groups\n";
+ cout<<"Family "<<numfam<<" have "<<natt<<" attributes and "<<ngro<<" groups\n";
//affichage des resultats
for (j=0;j<natt;j++) {
- if (j==0) std::cout<<" Attributes :\n";
+ if (j==0) cout<<" Attributes :\n";
strncpy(str1,attdes+j*MED_TAILLE_DESC,MED_TAILLE_DESC);
str1[MED_TAILLE_DESC] = '\0';
fprintf(stdout," ident = %d\t value = %d\t description = %s\n",
*(attide+j),*(attval+j),str1);
}
for (j=0;j<ngro;j++) {
- if (j==0) std::cout<<" Groups :\n";
+ if (j==0) cout<<" Groups :\n";
strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
str2[MED_TAILLE_LNOM] = '\0';
fprintf(stdout," name = %s\n",str2);
}
- if (i==nfam-1) std::cout<<std::endl;
+ if (i==nfam-1) cout<<endl;
}
QString sfam,sgro;
sfam=sfam.sprintf("%d",numfam);
str2[MED_TAILLE_LNOM]='\0';
sgro=str2;
if (sgro.contains(mymailw->deletegroups)>0) {
- //std::cout<<"idelete++ "<<sgro<<std::endl;
+ //cout<<"idelete++ "<<sgro<<endl;
idelete++;
}
}
if (idelete==ngro && ngro>0) { //only delete family whith all delete groups
- //std::cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<std::endl;
+ //cout<<"famdelete++ "<<numfam<<" "<<ifamdelete<<" "<<ngro<<endl;
famdelete[ifamdelete]=numfam;
ifamdelete++;
}
if (sgro.contains(qgroup)>0) {
sgro="Skin_"+sgro; //pas sur que ce soit pertinent
}
- if (mymailw->verbose>8) std::cout<<"families.add("<<sfam.toLatin1().constData()<<
+ if (mymailw->verbose>8) 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
- //std::cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
- if (mymailw->verbose>3) std::cout<<"--deletegroups matches \""<<
+ //cout<<"--deletegroups matches \""<<sfam<<","<<sgro<<"\"\n";
+ if (mymailw->verbose>3) cout<<"--deletegroups matches \""<<
sgro.toLatin1().constData()<<
- "\" in family "<<numfam<<std::endl;
+ "\" in family "<<numfam<<endl;
}
}
}
strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
str2[MED_TAILLE_LNOM]='\0';
sgro=str2;
- //std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ //cout<<"families.add("<<sfam<<","<<sgro<<")\n";
if (sgro.contains(mymailw->deletegroups)==0){
//sgro="Skin_"+sgro; //pas sur que ce soit pertinent
- std::cout<<"families.add("<<sfam<<","<<sgro<<")\n";
+ cout<<"families.add("<<sfam<<","<<sgro<<")\n";
mymailw->families.add(sfam,sgro);
}
else {
- std::cout<<"--deletegroups matches \""<<sgro<<"\"\n";
+ cout<<"--deletegroups matches \""<<sgro<<"\"\n";
famdelete[ifamdelete]=numfam
ifamdelete++;
}
}
}
-//std::cout<<"famdelete"; for (j=0;j<ifamdelete;j++) std::cout<<" "<<famdelete[j]; std::cout<<std::endl;
+//cout<<"famdelete"; for (j=0;j<ifamdelete;j++) cout<<" "<<famdelete[j]; cout<<endl;
if (mymailw->verbose>3){
- std::cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<std::endl;
+ cout<<"\nFamiliesAndGroupsOf "<<nomfilemed.toLatin1().constData()<<endl;
mymailw->families.write();
}
- med_2_2::med_repere rep;
- med_2_2::med_mode_switch mode_coo=med_2_2::MED_FULL_INTERLACE;
+ med_repere rep;
+ med_mode_switch mode_coo=MED_FULL_INTERLACE;
/* Allocations memoires */
/* table des coordonnees profil : (dimension * nombre de noeuds ) */
- med_2_2::med_float *coo=new med_2_2::med_float[nnoe*mdim];
+ med_float *coo=new med_float[nnoe*mdim];
/* table des numeros de familles des noeuds profil : (nombre de noeuds) */
- med_2_2::med_int *famnodesskin=new med_2_2::med_int[nnoe];
- med_2_2::med_int *pfltab=new med_2_2::med_int[1]; //inutilise car on lit tout
+ med_int *famnodesskin=new med_int[nnoe];
+ med_int *pfltab=new med_int[1]; //inutilise car on lit tout
//lecture des noeuds : coordonnees
- ret=med_2_2::MEDcoordLire(fid,mymailw->nommaa,mdim,coo,
+ ret=MEDcoordLire(fid,mymailw->nommaa,mdim,coo,
mode_coo,MED_ALL,
pfltab,0,&rep,mymailw->nomcoo,mymailw->unicoo);
if (ret < 0){
- std::cerr<<"Problem reading nodes\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading nodes\n";
+ ret = MEDfermer(fid);
//return false;
}
- ret=med_2_2::MEDfamLire(fid,mymailw->nommaa,famnodesskin,nnoe,med_2_2::MED_NOEUD,(med_2_2::med_geometrie_element) 0);
+ ret=MEDfamLire(fid,mymailw->nommaa,famnodesskin,nnoe,MED_NOEUD,(med_geometrie_element) 0);
if (ret < 0){
- std::cerr<<"Problem reading families of nodes\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading families of nodes\n";
+ ret = MEDfermer(fid);
return false;
}
if (mymailw->verbose>9) {
- std::cout<<"\nVertices: no x y z family\n";
+ 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]);
}
- std::cout<<std::endl;
+ cout<<endl;
}
- med_2_2::med_int *conn2=new med_2_2::med_int[nbseg2*2];
- ret=med_2_2::MEDconnLire(fid,mymailw->nommaa,mdim,conn2,mode_coo,
- pfltab,0,med_2_2::MED_MAILLE,med_2_2::MED_SEG2,med_2_2::MED_NOD);
+ med_int *conn2=new med_int[nbseg2*2];
+ ret=MEDconnLire(fid,mymailw->nommaa,mdim,conn2,mode_coo,
+ pfltab,0,MED_MAILLE,MED_SEG2,MED_NOD);
if (ret < 0){
- std::cerr<<"Problem reading MED_SEG2\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading MED_SEG2\n";
+ ret = MEDfermer(fid);
//return false;
}
- med_2_2::med_int *famseg2skin=new med_2_2::med_int[nbseg2];
- ret=med_2_2::MEDfamLire(fid,mymailw->nommaa,famseg2skin,nbseg2,med_2_2::MED_MAILLE,med_2_2::MED_SEG2);
+ med_int *famseg2skin=new med_int[nbseg2];
+ ret=MEDfamLire(fid,mymailw->nommaa,famseg2skin,nbseg2,MED_MAILLE,MED_SEG2);
if (ret < 0){
- std::cerr<<"Problem reading families of MED_SEG2\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading families of MED_SEG2\n";
+ ret = MEDfermer(fid);
return false;
}
if (mymailw->verbose>9) {
- std::cout<<"\nConnectivity MED_SEG2: no node1 node2 family\n";
+ 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]);
}
- std::cout<<std::endl;
+ cout<<endl;
}
- med_2_2::med_int *conn3=new med_2_2::med_int[nbtria3*3];
- ret=med_2_2::MEDconnLire(fid,mymailw->nommaa,mdim,conn3,mode_coo,
- pfltab,0,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3,med_2_2::MED_NOD);
+ med_int *conn3=new med_int[nbtria3*3];
+ ret=MEDconnLire(fid,mymailw->nommaa,mdim,conn3,mode_coo,
+ pfltab,0,MED_MAILLE,MED_TRIA3,MED_NOD);
if (ret < 0){
- std::cerr<<"Problem reading MED_TRIA3\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading MED_TRIA3\n";
+ ret = MEDfermer(fid);
//return false;
}
- med_2_2::med_int *famtria3skin=new med_2_2::med_int[nbtria3];
- ret=med_2_2::MEDfamLire(fid,mymailw->nommaa,famtria3skin,nbtria3,med_2_2::MED_MAILLE,med_2_2::MED_TRIA3);
+ med_int *famtria3skin=new med_int[nbtria3];
+ ret=MEDfamLire(fid,mymailw->nommaa,famtria3skin,nbtria3,MED_MAILLE,MED_TRIA3);
if (ret < 0){
- std::cerr<<"Problem reading families of MED_TRIA3\n";
- ret = med_2_2::MEDfermer(fid);
+ cerr<<"Problem reading families of MED_TRIA3\n";
+ ret = MEDfermer(fid);
return false;
}
if (mymailw->verbose>9) {
- std::cout<<"\nConnectivity MED_TRIA3: no node1 node2 node3 family\n";
+ 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]);
}
- std::cout<<std::endl;
+ cout<<endl;
}
/*liberation memoire?
delete[] nufano;*/
if (ifamdelete>0) {
- //std::cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<std::endl;
+ //cout<<"!!!!!!!!nodes "<<famnodesskin[0]<<" "<<nnoe<<famdelete[1]<<endl;
for (i=0;i<nnoe;i++) {
for (j=0;j<ifamdelete;j++) {
if (famnodesskin[i]==famdelete[j]) {
- //std::cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<std::endl;
+ //cout<<"nodes "<<famnodesskin[i]<<" "<<i<<" "<<famdelete[j]<<endl;
famnodesskin[i]=0; }
}
}
//if (mymailw->verbose>6) ok=mymailw->list_keys_mesh_wrap();
- ret = med_2_2::MEDfermer(fid);
+ ret = MEDfermer(fid);
if (ret < 0){
- std::cerr<<"Problem closing "<<nomfilemed.toLatin1().constData()<<"\n";
+ 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);
-//std::cout<<"test "<<ii<<" "<<ok<<std::endl;
+//cout<<"test "<<ii<<" "<<ok<<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);
-//std::cout<<"test3 "<<ff<<" "<<ok<<std::endl;
+//cout<<"test3 "<<ff<<" "<<ok<<endl;
{
string splus=s + " -1"; //evite conversion ok sur "+9truc" qui passe sinon
istringstream ss(splus);
int i,nb,nbfiles,limit_swap,nbelem_limit_swap,limit_swap_defaut,verbose;
QString path,pathini,casename,casenamemed,fileskinmed,
tmp,cmd,format,
- test,menu,launchtepal,background,meshholes,deletegroups,
- version="V1.4";
+ test,menu,launchtepal,background,deletegroups,
+ version="V1.5";
char *chelp=NULL,
*ccasename=NULL,
*cmenu=NULL,
*claunchtepal=NULL,
*cbackground=NULL,
- *cmeshholes=NULL,
*cdeletegroups=NULL;
for (i = 0; i < argc; i++){
else if (!strncmp (argv[i], "--menu=", sizeof ("--menu"))) cmenu = &(argv[i][sizeof ("--menu")]);
else if (!strncmp (argv[i], "--launchtepal=", sizeof ("--launchtepal"))) claunchtepal = &(argv[i][sizeof ("--launchtepal")]);
else if (!strncmp (argv[i], "--background=", sizeof ("--background"))) cbackground = &(argv[i][sizeof ("--background")]);
- else if (!strncmp (argv[i], "--meshholes=", sizeof ("--meshholes"))) cmeshholes = &(argv[i][sizeof ("--meshholes")]);
else if (!strncmp (argv[i], "--deletegroups=", sizeof ("--deletegroups"))) cdeletegroups = &(argv[i][sizeof ("--deletegroups")]);
}
if (argc < 2 || chelp){
- std::cout<<"Available options:\n"
+ cout<<"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"<<
" --menu : a GUI menu for option number\n"<<
" --launchtepal : also launch tepal on files casename.faces and casename.points and option number\n"<<
" --background : force background mode from launch tepal and generation of final MED files (big meshes)\n"<<
- " --meshholes : force parameter component of tetmesh-ghs3d to mesh holes\n"<<
" --deletegroups : regular expression (see QRegExp) which matches unwanted groups in final MED files\n"<<
+ " (try --deletegroups=\"(\\bJOINT)\"\n"<<
" (try --deletegroups=\"(\\bAll_Nodes|\\bAll_Faces)\"\n"<<
" (try --deletegroups=\"((\\bAll_|\\bNew_)(N|F|T))\"\n";
- std::cout<<"example:\n"<<
- " tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN\n"<<
- " --limitswap=1000 --verbose=0 --test=yes --menu=no --launchtepal=no\n\n";
+ 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){
- std::cerr<<"--casename: a path/name is expected\n\n";
+ cerr<<"--casename: a path/name is expected\n\n";
return 1;
}
casename=ccasename;
if (!cnumber){
- std::cerr<<"--number: an integer is expected\n\n";
+ cerr<<"--number: an integer is expected\n\n";
return 1;
}
tmp=cnumber;
nbfiles=tmp.toLong(&ok,10);
if (!ok){
- std::cerr<<"--number: an integer is expected\n\n";
+ cerr<<"--number: an integer is expected\n\n";
return 1;
}
if (nbfiles<=0){
- std::cerr<<"--number: a positive integer is expected\n\n";
+ cerr<<"--number: a positive integer is expected\n\n";
return 1;
}
if (nbfiles>2048){ //delirium in 2008
- std::cerr<<"--number: a positive integer <= 2048 is expected\n\n";
+ 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){
- std::cerr<<"--limitswap: an integer is expected. try 1000\n\n";
+ cerr<<"--limitswap: an integer is expected. try 1000\n\n";
return 1;
}
if (limit_swap<1 || limit_swap>32000){
- std::cerr<<"--limitswap: [1->32000] expected. try 1000\n\n";
+ cerr<<"--limitswap: [1->32000] expected. try 1000\n\n";
return 1;
}
}
tmp=cverbose;
verbose=tmp.toLong(&ok,10);
if (!ok){
- std::cerr<<"--verbose: an integer is expected\n\n";
+ cerr<<"--verbose: an integer is expected\n\n";
return 1;
}
if (verbose<0){
- std::cerr<<"--verbose: a positive integer is expected\n\n";
+ cerr<<"--verbose: a positive integer is expected\n\n";
return 1;
}
}
tmp=cbackground;
if (tmp=="yes") background="yes";
}
-
- meshholes="no"; //default
- if (cmeshholes){
- tmp=cmeshholes;
- if (tmp=="yes") meshholes="yes";
- }
// We must always have an application
m->show();
a.exec();
if ( m->result() == QDialog::Accepted ) {
- std::cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<std::endl;
+ cout<<"parameters "<<m->KeepFiles()<<" "<<m->NbPart()<<endl;
nbfiles=m->NbPart();
}
else {
path="./";
casenamemed=casenamemed.section('/',-1);
if (casenamemed.length()>20){
- std::cerr<<"--medname truncated (no more 20 characters)"<<std::endl;
+ cerr<<"--medname truncated (no more 20 characters)"<<endl;
casenamemed.truncate(20);
}
pathini="./";
casename=casename.section('/',-1);
if (casename.length()>20){
- std::cerr<<"--casename truncated (no more 20 characters)"<<std::endl;
+ cerr<<"--casename truncated (no more 20 characters)"<<endl;
casename.truncate(20);
}
- /*std::cout<<"CaseNameMed="<<casenamemed<<std::endl;
- std::cout<<"PathMed="<<path<<std::endl;*/
+ /*cout<<"CaseNameMed="<<casenamemed<<endl;
+ cout<<"PathMed="<<path<<endl;*/
deletegroups="(\\bxyz)"; //default improbable name
if (cdeletegroups){
//verbose=5;
if (verbose>0)
- std::cout<<"tepal2med "<<version.toLatin1().constData()<<" parameters:"<<
+ 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()<<
"\n --menu="<<menu.toLatin1().constData()<<
"\n --launchtepal="<<launchtepal.toLatin1().constData()<<
"\n --background="<<background.toLatin1().constData()<<
- "\n --meshholes="<<meshholes.toLatin1().constData()<<
"\n --deletegroups=\""<<deletegroups.toLatin1().constData()<<"\"\n";
- //med_2_2::med_idt fid=MEDouvrir("/tmp/empty.med",MED_CREATION);
- //med_2_2::med_err ret=MEDfermer(fid);
+ //med_idt fid=MEDouvrir("/tmp/empty.med",MED_CREATION);
+ //med_err ret=MEDfermer(fid);
//system("sleep 30");
//return 0; //ok
if (launchtepal=="yes"){
//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);
- if (meshholes=="yes") cmd=cmd+" --tetmesh_args \"-c 0\"";
- cmd=cmd+" > "+path+"tepal.log";
- std::cout<<"\nlaunchtepal command: background="<<cbackground<<
- "\n "<<cmd.toLatin1().constData()<<std::endl;
+ cmd="tepal -f "+pathini+casename+" -n "+cmd.sprintf("%d",nbfiles)+" > "+path+"tepal.log";
+ cout<<"\nlaunchtepal command: background="<<cbackground<<
+ "\n "<<cmd.toLatin1().constData()<<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;
- //std::cout<<"coucou1 "<<mymailw->families.no<<std::endl;
+ //cout<<"coucou1 "<<mymailw->families.no<<endl;
//mymailw->families.add(casename,casenamemed);
format=format.sprintf("%d",nbfiles);
int nbf=format.length();
char ctmp[fileskinmed.length()+1] ; strcpy(ctmp,fileskinmed);
int res=dumpMED(&ctmp[0],1);
}*/
- ok=ReadFileMED(fileskinmed,mymailw);
+ int ret = access(fileskinmed.toLatin1().constData(),F_OK); //on regarde si le fichier existe
+ if (ret >= 0) {
+ ok=ReadFileMED(fileskinmed,mymailw); }
+ else {
+ if (verbose>0)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) std::cout<<"\nReading output files of tepal as input files of tepal2med...\n";
+ if (verbose>0) 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) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp.toLatin1().constData()<<endl;
ok=mymailw->ReadFileMSGnew(tmp);
}
if (verbose>0)
- std::cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
+ cout<<"NumberOfFilesMSGacquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ 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) std::cout<<"FileName="<<tmp<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp<<endl;
QFile File(tmp);
QXmlInputSource source(&File);
reader.parse(source);
File.close();
}
if (verbose>0)
- std::cout<<"NumberOfFilesMSGAcquired="<<mymailw->nbfiles<<"\n";
+ cout<<"NumberOfFilesMSGAcquired="<<mymailw->nbfiles<<"\n";
if (mymailw->nbfiles != nbfiles){
- std::cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n";
+ cerr<<"Problem NumberOfFiles != NumberOfFilesAcquired\n";
return 1;
}
if (test=="yes"){
ok=mymailw->test_msg_wrap();
if (ok){
- if (verbose>0) std::cout<<"\nResult_test_msg_wrap=ok\n\n";
+ if (verbose>0) cout<<"\nResult_test_msg_wrap=ok\n\n";
}
else{
- std::cerr<<"\nResult_test_msg_wrap=NO_OK!\n\n";
+ 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) std::cout<<"NumberOfKeysRemoved="<<nb<<std::endl;
+ if (verbose>3) cout<<"NumberOfKeysRemoved="<<nb<<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) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp.toLatin1().constData()<<endl;
ok=mymailw->ReadFileNOBOITE(tmp);
}
if (verbose>0)
- std::cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->nbfiles<<"\n";
+ cout<<"NumberOfFilesNOBOITEAcquired="<<mymailw->nbfiles<<"\n";
if (mymailw->nbfiles != nbfiles){
- std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n";
+ cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n";
return 1;
}
//if (test=="yes"){
ok=mymailw->test_vertices_wrap();
if (ok){
- if (verbose>0) std::cout<<"\nResult_test_vertices_wrap=ok\n\n";
+ if (verbose>0) cout<<"\nResult_test_vertices_wrap=ok\n\n";
}
else{
- std::cerr<<"\nResult_test_vertices_wrap=NO_OK!\n\n";
+ 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) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp.toLatin1().constData()<<endl;
ok=mymailw->ReadFileFACES(tmp);
}
if (verbose>0)
- std::cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
+ cout<<"NumberOfFilesFACESAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ 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) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp.toLatin1().constData()<<endl;
ok=mymailw->ReadFilePOINTS(tmp);
}
if (verbose>0)
- std::cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
+ cout<<"NumberOfFilesPOINTSAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles)
{
- std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ 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) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+ if (verbose>0) cout<<"FileName="<<tmp.toLatin1().constData()<<endl;
ok=mymailw->ReadFileGLO(tmp);
//mymailw->SwapOutOfMemory_key_mesh_wrap(QRegExp("GL",true,false));
}
if (verbose>0)
- std::cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
+ cout<<"NumberOfFilesGLOAcquired="<<mymailw->nbfiles<<"\n\n";
if (mymailw->nbfiles != nbfiles){
- std::cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
+ cerr<<"NumberOfFiles != NumberOfFilesAcquired is unexpected\n\n";
return 1;
}
//test remove points (type 3)
//nb=mymailw->remove_key_mesh_wrap(QRegExp("PO",true,false));
- //std::cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<std::endl;
+ //cout<<"***remove_key_mesh_wrap*** remove nb="<<nb<<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)std::cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
- if (verbose>0)std::cout<<std::endl<<"===end of "<<argv[0]<<"==="<<std::endl;
+ if (verbose>3)cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
+ if (verbose>0)cout<<endl<<"===end of "<<argv[0]<<"==="<<endl;
//for debug
//int res=dumpMED("/home/wambeke/tmp/DOMAIN_1.med",1);
return 0; //ok
}
-