Skip to content

Commit

Permalink
Revert "Addition of the option LSBaseReferences in mmg2d"
Browse files Browse the repository at this point in the history
This reverts commit 3cd2798.
  • Loading branch information
Algiane committed Jun 23, 2022
1 parent 3cd2798 commit b29c88d
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 76 deletions.
12 changes: 0 additions & 12 deletions src/mmg2d/API_functions_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,6 @@ int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, int val){
mesh->info.par[k].hmax = mesh->info.hmax;
}
break;
case MMG2D_IPARAM_numberOfLSBaseReferences :
mesh->info.nbr = val;
MMG5_ADD_MEM(mesh,mesh->info.nbr*sizeof(int),"References",
printf(" Exit program.\n");
return 0);
MMG5_SAFE_CALLOC(mesh->info.br,mesh->info.nbr,int,return 0);

for (k=0; k<mesh->info.nbr; k++)
mesh->info.br[k] = 0;

break;

case MMG2D_IPARAM_numberOfMat :
if ( mesh->info.mat ) {
MMG5_DEL_MEM(mesh,mesh->info.mat);
Expand Down
3 changes: 1 addition & 2 deletions src/mmg2d/libmmg2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ extern "C" {
MMG2D_IPARAM_nreg, /*!< [0/1], Enable normal regularization */
MMG2D_IPARAM_numsubdomain, /*!< [0/n], Save the subdomain nb (0==all subdomain) */
MMG2D_IPARAM_numberOfLocalParam,/*!< [n], Number of local parameters */
MMG2D_IPARAM_numberOfLSBaseReferences, /*!< [n], Number of base references for bubble removal */
MMG2D_IPARAM_numberOfMat, /*!< [n], Number of material in ls mode */
MMG2D_IPARAM_numberOfMat, /*!< [n], Number of material in ls mode */
MMG2D_IPARAM_anisosize, /*!< [1/0], Turn on/off anisotropic metric creation when no metric is provided */
MMG2D_IPARAM_nosizreq, /*!< [0/1], Allow/avoid overwritten of sizes at required points (advanced usage) */
MMG2D_DPARAM_angleDetection, /*!< [val], Value for angle detection */
Expand Down
13 changes: 1 addition & 12 deletions src/mmg2d/libmmg2d_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int MMG2D_defaultValues(MMG5_pMesh mesh) {
*
*/
int MMG2D_parsop(MMG5_pMesh mesh,MMG5_pSol met) {
int ret,ref,i,j,npar,nbr,br,rin,rex,split;
int ret,ref,i,j,npar,rin,rex,split;
float fp1,fp2,fp3;
char *ptr,data[256];
FILE *in;
Expand Down Expand Up @@ -184,17 +184,6 @@ int MMG2D_parsop(MMG5_pMesh mesh,MMG5_pSol met) {
}
}
}
/* Read user-defined references where connected components should stay attached in ls mode */
else if ( !strcmp(data,"lsbasereferences") ) {
MMG_FSCANF(in,"%d",&nbr);
if ( !MMG2D_Set_iparameter(mesh,met,MMG2D_IPARAM_numberOfLSBaseReferences,nbr) )
return 0;

for (i=0; i<mesh->info.nbr; i++) {
MMG_FSCANF(in,"%d",&br);
mesh->info.br[i] = br;
}
}
else {
fprintf(stderr," %%%% Wrong format: %s\n",data);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/mmg2d/mmg2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ int main(int argc,char *argv[]) {
met = NULL;
ls = NULL;
disp = NULL;

if ( !MMG2D_Init_mesh(MMG5_ARG_start,
MMG5_ARG_ppMesh,&mesh,MMG5_ARG_ppMet,&met,
MMG5_ARG_ppLs,&ls,
Expand Down
1 change: 0 additions & 1 deletion src/mmg2d/mmg2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ int MMG2D_hashQuad(MMG5_pMesh mesh);
int MMG2D_resetRef(MMG5_pMesh );
int MMG2D_cuttri_ls(MMG5_pMesh ,MMG5_pSol,MMG5_pSol );
int MMG2D_rmc(MMG5_pMesh ,MMG5_pSol );
int MMG2D_isbr(MMG5_pMesh ,int );
int MMG2D_setref_ls(MMG5_pMesh ,MMG5_pSol );
int MMG2D_split1_sim(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]);
int MMG2D_split2_sim(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]);
Expand Down
39 changes: 1 addition & 38 deletions src/mmg2d/mmg2d6.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){
MMG5_pTria pt,pt1,pt2;
double volc,voltot,v0,v1,v2;
int k,kk,l,ll,ncp,ncm,ip0,ip1,ip2,base,cur,ipile,*pile,*adja;
int8_t i,i1,i2,onbr;
int8_t i,i1,i2;

ncp = 0;
ncm = 0;
Expand Down Expand Up @@ -792,43 +792,6 @@ int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){
}
ncm++;
}

/* Remove connected component if it is not attached to one base reference */
if ( mesh->info.nbr ) {
onbr = 0;
for (l=0; l<ipile; l++) {
pt1 = &mesh->tria[pile[l]];
for (i=0; i<3; i++) {
if ( MMG2D_isbr(mesh,pt1->edg[i]) ) {
i1 = MMG5_inxt2[i];
i2 = MMG5_inxt2[i1];
ip1 = pt1->v[i1];
if ( sol->m[ip1]-mesh->info.ls < 0.0 ) {
onbr = 1;
break;
}
ip2 = pt1->v[i2];
if ( sol->m[ip2]-mesh->info.ls < 0.0 ) {
onbr = 1;
break;
}
}
}
if ( onbr ) break;
}

if ( !onbr ) {
for (l=0; l<ipile; l++) {
pt1 = &mesh->tria[pile[l]];
for (i=0; i<3; i++) {
ip0 = pt1->v[i];
if ( sol->m[ip0]-mesh->info.ls < 0.0 ) sol->m[ip0] = mesh->info.ls + 100*MMG5_EPS;
}
}
ncm++;
}
}

}

/* Erase triangle flags */
Expand Down
10 changes: 0 additions & 10 deletions src/mmg2d/tools_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@

#include "mmg2d.h"

/** Return 1 if reference ref is in the br table, 0 otherwise */
int MMG2D_isbr(MMG5_pMesh mesh,int ref) {
int k;

for(k=0; k<mesh->info.nbr; k++)
if ( ref == mesh->info.br[k] ) return(1);

return(0);
}

/**
* \param mesh pointer toward the mesh structure.
* \param kel index of the element in the unpacked mesh
Expand Down

0 comments on commit b29c88d

Please sign in to comment.