Skip to content
Snippets Groups Projects
Commit 6f6fbfc8 authored by Emilie Marchandise's avatar Emilie Marchandise
Browse files

mmg3D with less verbosity:wq

parent 6fcbc895
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ static void gmsh2MMG(GRegion *gr, MMG_pMesh mmg, MMG_pSol sol,
}
}
printf("%d vertices %d on faces\n", (int) allVertices.size(), (int) LCS.size());
//printf("%d vertices %d on faces\n", (int) allVertices.size(), (int) LCS.size());
int k=1;
int count = 1;//sol->offset;
......@@ -263,15 +263,16 @@ void refineMeshMMG(GRegion *gr)
gmsh2MMG (gr, mmg, sol,mmg2gmsh);
for (int ITER=0;ITER<2;ITER++){
int opt[9] = {1,0,64,0,0,(Msg::GetVerbosity() > 3) ? 222222222 : 222222222,0,0,0};
int verb_mmg = (Msg::GetVerbosity() > 9) ? -1 : 0;
int opt[9] = {1,0,64,0,0,0, verb_mmg , 0,0};
Msg::Debug("-------- GMSH LAUNCHES MMG3D ---------------");
mmg3d::MMG_mmg3dlib(opt,mmg,sol);
Msg::Debug("-------- MG3D TERMINATED -------------------");
// Here we should interact with BGM
updateSizes(gr,mmg, sol);
}
char test[] = "test.mesh";
MMG_saveMesh(mmg, test);
//char test[] = "test.mesh";
//MMG_saveMesh(mmg, test);
gr->deleteVertexArrays();
for (int i=0;i<gr->tetrahedra.size();++i)delete gr->tetrahedra[i];
......
......@@ -203,6 +203,8 @@ int MMG_prilen(pMesh mesh,pSol sol) {
/* /if ( dep < 0 ) break;*/
}
if(mesh->info.imprim < 0) {
fprintf(stdout,"\n -- RESULTING EDGE LENGTHS %d\n",navg);
fprintf(stdout," AVERAGE LENGTH %12.4f\n",lavg / (double)navg);
fprintf(stdout," SMALLEST EDGE LENGTH %12.4f %6d %6d\n",
......@@ -214,7 +216,6 @@ int MMG_prilen(pMesh mesh,pSol sol) {
fprintf(stdout," %6.2f < L <%5.2f %8d %5.2f %% \n",
bd[3],bd[6],hl[4]+hl[5]+hl[6],100.*(hl[4]+hl[5]+hl[6])/(double)navg);
if ( abs(mesh->info.imprim) > 4 ) {
fprintf(stdout,"\n HISTOGRAMM\n");
if ( hl[1] )
fprintf(stdout," 0.00 < L < 0.20 %8d %5.2f %% \n",
......@@ -229,6 +230,7 @@ int MMG_prilen(pMesh mesh,pSol sol) {
fprintf(stdout," 5. < L %8d %5.2f %% \n",
hl[9],100.*(hl[9]/(float)navg));
}
}
return(1);
......
......@@ -358,7 +358,7 @@ int MMG_optra9(pMesh mesh,pSol sol) {
nm = MMG_optlen(mesh,sol,declic,base);
// if(abs(mesh->info.option)!=9 || !mesh->disp) if(it<2) MMG_optlap(mesh,sol);
if ( mesh->info.imprim && nw+ns+nm )
if ( mesh->info.imprim< -4 && nw+ns+nm )
fprintf(stdout," %8d IMPROVED %8d SWAPPED %8d MOVED\n",nw,ns,nm);
}
while ( ns+nm/*(ns && (ns > 0.005*mesh->ne || it < 5))*/ && ++it < maxtou );
......
......@@ -256,9 +256,11 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
short imprim;
int k,iadr,i,jj,kk,ii,im;
double lambda[3],v[3][3],*mold,*m;
fprintf(stdout," -- MMG3d, Release %s (%s) \n",M_VER,M_REL);
fprintf(stdout," Copyright (c) LJLL/IMB, 2010\n");
fprintf(stdout," %s\n",COMPIL);
fprintf(stdout," %s \n", M_STR);
fprintf(stdout," -- START MMG3d \n") ;
if (opt[6] < 0) fprintf(stdout," -- MMG3d, Release %s (%s) \n",M_VER,M_REL);
if (opt[6] < -10) fprintf(stdout," Copyright (c) LJLL/IMB, 2010\n");
if (opt[6] < -10) fprintf(stdout," %s\n",COMPIL);
signal(SIGABRT,MMG_excfun);
......@@ -309,7 +311,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
if ( !MMG_setfunc(sol->offset) ) return(1);
if ( !MMG_scaleMesh(mesh,sol) ) return(1);
TIM_chrono(OFF,&MMG_ctim[1]);
if ( imprim )
if ( imprim < -10)
fprintf(stdout," -- DATA READING COMPLETED. %.2f sec.\n",
TIM_gttime(MMG_ctim[1]));
......@@ -320,15 +322,17 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
}
if(MMG_imprim < 0) MMG_outquacubic(mesh,sol);
fprintf(stdout,"\n %s\n MODULE MMG3D-LJLL/IMB : %s (%s) %s\n %s\n",
M_STR,M_VER,M_REL,sol->offset == 1 ? "ISO" : "ANISO",M_STR);
if (info->imprim < -10){
fprintf(stdout,"\n %s\n MODULE MMG3D-LJLL/IMB : %s (%s) %s\n \n",
M_STR,M_VER,M_REL,sol->offset == 1 ? "ISO" : "ANISO");
fprintf(stdout," MAXIMUM NUMBER OF POINTS (NPMAX) : %8d\n",mesh->npmax);
fprintf(stdout," MAXIMUM NUMBER OF TRIANGLES (NTMAX) : %8d\n",mesh->ntmax);
fprintf(stdout," MAXIMUM NUMBER OF ELEMENTS (NEMAX) : %8d\n",mesh->nemax);
}
/* mesh analysis */
TIM_chrono(ON,&MMG_ctim[2]);
if ( MMG_imprim ) fprintf(stdout,"\n -- PHASE 1 : ANALYSIS\n");
if ( MMG_imprim < 0 ) fprintf(stdout,"\n -- PHASE 1 : ANALYSIS\n");
if ( !MMG_hashTetra(mesh) ) return(1);
if ( !MMG_markBdry(mesh) ) return(1);
if (abs(mesh->info.option)==10) {
......@@ -343,7 +347,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
im = 0;
TIM_chrono(OFF,&MMG_ctim[2]);
if ( MMG_imprim )
if ( MMG_imprim < 0 )
fprintf(stdout," -- PHASE 1 COMPLETED. %.2f sec.\n",
TIM_gttime(MMG_ctim[2]));
if ( info->ddebug ) MMG_chkmsh(mesh,1,1);
......@@ -374,7 +378,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
/* mesh optimization */
if ( info->option ) {
TIM_chrono(ON,&MMG_ctim[3]);
if ( MMG_imprim ) fprintf(stdout,"\n -- PHASE 2 : UNIT MESH\n");
if ( MMG_imprim < 0 ) fprintf(stdout,"\n -- PHASE 2 : UNIT MESH\n");
if ( abs(info->option) == 9 ) {
if(!MMG_mmg3d9(mesh,sol,&alert)) {
if ( !MMG_unscaleMesh(mesh,sol) ) return(1);
......@@ -415,7 +419,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
}
TIM_chrono(OFF,&MMG_ctim[3]);
if ( MMG_imprim )
if ( MMG_imprim < 0 )
fprintf(stdout," -- PHASE 2 COMPLETED. %.2f sec.\n",
TIM_gttime(MMG_ctim[3]));
}
......@@ -442,7 +446,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
/* renumbering end */
#endif
TIM_chrono(ON,&MMG_ctim[4]);
if ( MMG_imprim ) fprintf(stdout,"\n -- PHASE 3 : OPTIMIZATION\n");
if ( MMG_imprim < 0) fprintf(stdout,"\n -- PHASE 3 : OPTIMIZATION\n");
if ( !alert ) {
if ( info->option == 9 ) {
MMG_optra4(mesh,sol);
......@@ -453,7 +457,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
if ( info->ddebug ) MMG_chkmsh(mesh,1,1);
TIM_chrono(OFF,&MMG_ctim[4]);
if ( MMG_imprim )
if ( MMG_imprim < 0)
fprintf(stdout," -- PHASE 3 COMPLETED. %.2f sec.\n",
TIM_gttime(MMG_ctim[4]));
}
......@@ -465,7 +469,7 @@ int MMG_mmg3dlib(int opt[9],MMG_pMesh mesh,MMG_pSol sol) {
MMG_prilen(mesh,sol);
MMG_ratio(mesh,sol,NULL);
}
fprintf(stdout,"\n %s\n END OF MODULE MMG3D \n %s\n",M_STR,M_STR);
fprintf(stdout," -- END MMG3D \n");
if ( alert )
fprintf(stdout,"\n ## WARNING: INCOMPLETE MESH %d , %d\n",
mesh->np,mesh->ne);
......
......@@ -95,7 +95,7 @@ int MMG_optra4(pMesh mesh,pSol sol) {
}
//if(!mesh->info.nomove && it<2) MMG_optlap(mesh,sol);
if ( mesh->info.imprim && nw+ns+nm )
if ( mesh->info.imprim < -10 && nw+ns+nm )
fprintf(stdout," %8d IMPROVED %8d SWAPPED %8d MOVED\n",nw,ns,nm);
}
//while ( (ns && ((ns > 0.005*mesh->ne /*&& nwold > nw*/) || it < 5)) && ++it < maxtou );
......
......@@ -677,7 +677,7 @@ ds[ityp]++;
}
while ( k && *alert == 0 );
if(mesh->info.imprim<0) {
if(mesh->info.imprim < -10) {
for (k=0; k<=7; k++)
if ( cs[k] )
......
......@@ -123,6 +123,7 @@ int MMG_outqua(pMesh mesh,pSol sol) {
}
/* print histo */
if(mesh->info.imprim < 0) {
fprintf(stdout,"\n -- MESH QUALITY %d \n",rapnum);
if ( (rapavg > 0) && (rapavg / rapnum < 100.0) )
fprintf(stdout," AVERAGE QUALITY %12.4f\n",rapavg / rapnum);
......@@ -166,6 +167,7 @@ int MMG_outqua(pMesh mesh,pSol sol) {
i,i+1,his01[i],100.*(his01[i]/(float)his01[0]));
}
}
}
return(iout);
}
......
......@@ -209,7 +209,7 @@ int MMG_ratio(pMesh mesh, pSol sol,char* firaoame) {
}
if ( abs(mesh->info.imprim) > 7 ) {
if ( mesh->info.imprim < 0 ) {
/*ratio prescribed*/
......@@ -353,6 +353,10 @@ int MMG_ratio(pMesh mesh, pSol sol,char* firaoame) {
if(inm) fclose(inm);
/* print histo ratio obtained*/
if (mesh->info.imprim == 0){
fprintf(stdout," ANISOTROPIC RATIO (MEAN = %6.2g, MAX = %6.2g, MIN = %6.2f)\n",rapavg / rapnum, rapmax, rapmin);
}
else if (mesh->info.imprim < 0){
fprintf(stdout,"\n -- ANISOTROPIC RATIO OBTAINED %d\n",rapnum);
fprintf(stdout," AVERAGE RATIO %12.4f\n",rapavg / rapnum);
fprintf(stdout," SMALLEST RATIO %12.4f\n",rapmin);
......@@ -362,8 +366,10 @@ int MMG_ratio(pMesh mesh, pSol sol,char* firaoame) {
fprintf(stdout," LARGEST RATIO %12.4e\n",rapmax);
}
pt = &mesh->tetra[iel];
fprintf(stdout," ELEMENT %d (%d) %d %d %d %d\n",
iel,ielreal,pt->v[0],pt->v[1],pt->v[2],pt->v[3]);
}
if ( abs(mesh->info.imprim) < 5 ) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment