45 #define M_MAX(a,b) (((a) > (b)) ? (a) : (b)) 46 #define M_MIN(a,b) (((a) < (b)) ? (a) : (b)) 51 #define _MMG2_EPSD 1.e-10 //e-20?? 52 #define _MMG2D_EPSA 1.e-12 54 #define _MMG2D_PRECI 1. 55 #define _MMG2D_SIZE 0.75 56 #define _MMG2D_ALPHA 0.28867513459 57 #define _MMG2D_ALPHAD 3.464101615137755 58 #define MMG2_LONMAX 1024 59 #define _MMG2D_BADKAL 0.2 60 #define _MMG2_NULKAL 1.e-6 61 #define _MMG2_ANGCORN -1.e-6 62 #define _MMG2_SHORTMAX 0x7fff 64 #define MMG2_LLONG 2.0 65 #define MMG2_LSHRT 0.3 66 #define MMG2_LOPTL 1.4 67 #define MMG2_LOPTS 0.71 69 #define _MMG2D_NPMAX 50000 70 #define _MMG2D_NEDMAX 100000 71 #define _MMG2D_NEMAX 100000 74 #define _MMG2D_RETURN_AND_FREE(mesh,met,disp,val)do \ 76 if ( !MMG2D_Free_all(MMG5_ARG_start, \ 77 MMG5_ARG_ppMesh,&mesh,MMG5_ARG_ppMet,&met, \ 79 return MMG5_LOWFAILURE; \ 92 fprintf(stdout,
"\n Unexpected error:"); fflush(stdout);
95 fprintf(stdout,
" Abnormal stop\n");
break;
97 fprintf(stdout,
" Floating-point exception\n");
break;
99 fprintf(stdout,
" Illegal instruction\n");
break;
101 fprintf(stdout,
" Segmentation fault\n");
break;
104 fprintf(stdout,
" Program killed\n");
break;
139 #define _MMG2D_POINT_REALLOC(mesh,sol,ip,wantedGap,law,o,tag,retval ) do \ 143 _MMG5_TAB_RECALLOC(mesh,mesh->point,mesh->npmax,wantedGap,MMG5_Point, \ 144 "larger point table",law,retval); \ 146 mesh->npnil = mesh->np+1; \ 147 for (klink=mesh->npnil; klink<mesh->npmax-1; klink++) \ 148 mesh->point[klink].tmp = klink+1; \ 152 _MMG5_ADD_MEM(mesh,(sol->size*(mesh->npmax-sol->npmax))*sizeof(double), \ 153 "larger solution",law); \ 154 _MMG5_SAFE_REALLOC(sol->m,sol->size*(mesh->npmax+1), \ 155 double,"larger solution",retval); \ 157 sol->npmax = mesh->npmax; \ 160 ip = _MMG2D_newPt(mesh,o,tag); \ 166 #define _MMG2D_TRIA_REALLOC(mesh,jel,wantedGap,law,retval ) do \ 170 oldSiz = mesh->ntmax; \ 171 _MMG5_TAB_RECALLOC(mesh,mesh->tria,mesh->ntmax,wantedGap,MMG5_Tria, \ 172 "larger tria table",law,retval); \ 174 mesh->nenil = mesh->nt+1; \ 175 for (klink=mesh->nenil; klink<mesh->ntmax-1; klink++) \ 176 mesh->tria[klink].v[2] = klink+1; \ 178 if ( mesh->adja ) { \ 180 _MMG5_ADD_MEM(mesh,3*(mesh->ntmax-oldSiz)*sizeof(int), \ 181 "larger adja table",law); \ 182 _MMG5_SAFE_RECALLOC(mesh->adja,3*oldSiz+5,3*mesh->ntmax+5,int \ 183 ,"larger adja table",retval); \ 187 jel = _MMG2D_newElt(mesh); \ 193 #define _MMG2D_EDGE_REALLOC(mesh,jel,wantedGap,law,retval ) do \ 197 _MMG5_TAB_RECALLOC(mesh,mesh->edge,mesh->namax,wantedGap,MMG5_Edge, \ 198 "larger edge table",law,retval); \ 200 mesh->nanil = mesh->na+1; \ 201 for (klink=mesh->nanil; klink<mesh->namax-1; klink++) \ 202 mesh->edge[klink].b = klink+1; \ 206 jel = _MMG5_newEdge(mesh); \ 275 int simred(
double *m1,
double *m2,
double *
m);
361 double long_ani(
double *ca,
double *cb,
double *ma,
double *mb);
362 double long_iso(
double *ca,
double *cb,
double *ma,
double *mb);
368 int interp_ani(
double *,
double *,
double * ,
double );
369 int interp_iso(
double *,
double *,
double * ,
double );
int _MMG2_defmetbdy_2d(MMG5_pMesh, MMG5_pSol, int, char)
Definition: anisosiz_2d.c:77
int _MMG2_adptri(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d1.c:542
int interp_iso(double *, double *, double *, double)
int _MMG2_colver2(MMG5_pMesh, int *)
Definition: colver_2d.c:404
pQueue MMG2_kiuini(MMG5_pMesh mesh, int nbel, double declic, int base)
int _MMG5_mmg2dChkmsh(MMG5_pMesh, int, int)
Definition: chkmsh_2d.c:34
int _MMG2_split2(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:494
int _MMG2_split3(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:619
Bucket * pBucket
Definition: mmg2d.h:119
API headers for the mmg2d library.
void _MMG2_Init_parameters(MMG5_pMesh mesh)
HashTable * pHashTable
Definition: mmg2d.h:129
! double max[3]
Definition: libmmgtypesf.h:484
! double * m
Definition: libmmgtypesf.h:585
int _MMG2_adpspl(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d1.c:632
int MMG2_mmg2d2(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d2.c:490
int _MMG2_defsiz_iso(MMG5_pMesh, MMG5_pSol)
Definition: isosiz_2d.c:46
int(* _MMG5_chkmsh)(MMG5_pMesh, int, int)
Definition: mmgcommon.h:531
! double c[3]
Definition: libmmgtypesf.h:244
int MMG2_locateEdge(MMG5_pMesh, int, int, int *, int *)
Definition: locate_2d.c:326
int MMG2_cutEdgeTriangle(MMG5_pMesh, int, int, int)
Definition: locate_2d.c:131
int * head
Definition: mmg2d.h:116
int _MMG2_movintpt_ani(MMG5_pMesh, MMG5_pSol, int, int *, char)
Definition: anisomovpt_2d.c:37
int optlen_iso_bar(MMG5_pMesh mesh, MMG5_pSol sol, double declic, int base)
Definition: libmmgtypes.h:526
int _MMG2_defaultmet_2d(MMG5_pMesh, MMG5_pSol, int, char)
Definition: anisosiz_2d.c:47
Hedge * item
Definition: mmg2d.h:127
int _MMG2_velextLS(MMG5_pMesh, MMG5_pSol)
int _MMG5_getnElt(MMG5_pMesh mesh, int n)
Definition: zaldy_2d.c:150
int _MMG2_regnor(MMG5_pMesh)
Definition: analys_2d.c:378
MMG5_Tria * MMG5_pTria
Definition: libmmgtypes.h:274
int MMG2_mmg2d6(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d6.c:613
static void _MMG2_excfun(int sigid)
Definition: mmg2d.h:91
int * link
Definition: mmg2d.h:117
int _MMG2_split2_sim(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:445
int _MMG2_delone(MMG5_pMesh, MMG5_pSol, int, int *, int)
Definition: delone_2d.c:265
int _MMG2_intmet_ani(MMG5_pMesh, MMG5_pSol, int, char, int, double)
Definition: intmet_2d.c:237
int _MMG2_split1b(MMG5_pMesh, int, char, int)
Definition: split_2d.c:233
int _MMG2_savemet_db(MMG5_pMesh, MMG5_pSol, char *, char)
Definition: inout_2d.c:1634
int _MMG2_bouleendp(MMG5_pMesh, int, char, int *, int *)
Definition: boulep_2d.c:255
int _MMG2_colver(MMG5_pMesh, int, int *)
Definition: colver_2d.c:256
int _MMG2_getIniRef(MMG5_pMesh, int)
Definition: mmg2d6.c:70
int _MMG2D_Free_names_var(va_list argptr)
Definition: variadic_2d.c:447
int MMG2_assignEdge(MMG5_pMesh)
Definition: hash_2d.c:214
int _MMG2D_indElt(MMG5_pMesh mesh, int kel)
Definition: tools_2d.c:45
int MMG2_unscaleMesh(MMG5_pMesh, MMG5_pSol)
Definition: scalem_2d.c:300
MMG5_Sol * MMG5_pSol
Definition: libmmgtypes.h:539
int interp_ani(double *, double *, double *, double)
int MMG2_bdryEdge(MMG5_pMesh)
Definition: hash_2d.c:275
int _MMG2_anaelt(MMG5_pMesh, MMG5_pSol, int)
Definition: mmg2d1.c:109
int MMG2_baseBdry(MMG5_pMesh mesh)
int MMG2_findtrianglestate(MMG5_pMesh, int, int, int, int, int, int)
Definition: mmg2d2.c:132
static const int MMG2_iare[3][2]
Definition: mmg2d.h:131
Queue * pQueue
Definition: mmg2d.h:112
int MMG2_scaleMesh(MMG5_pMesh, MMG5_pSol)
Definition: scalem_2d.c:47
int MMG2_kiupop(pQueue q)
int _MMG2_boulet(MMG5_pMesh, int, char, int *)
Definition: boulep_2d.c:202
int optlen_iso(MMG5_pMesh mesh, MMG5_pSol sol, double declic, int base)
const int va_list argptr
Definition: API_functionsf_2d.c:507
int MMG2_isInTriangle(MMG5_pMesh, int, double c[2])
Definition: locate_2d.c:72
MMG5_pMesh MMG5_pSol * sol
Definition: API_functionsf_2d.c:63
int _MMG2_colver3(MMG5_pMesh, int *)
Definition: colver_2d.c:342
int _MMG2_setref_ls(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d6.c:553
int MMG2_kiuput(pQueue q, int iel)
MMG5_pMesh * mesh
Definition: API_functionsf_2d.c:63
int MMG2_hashNew(HashTable *hash, int hsize, int hmax)
Definition: hash_2d.c:28
int MMG2_coorbary(MMG5_pMesh, MMG5_pTria, double c[2], double *, double *, double *)
Definition: locate_2d.c:40
long long _MMG5_memSize(void)
Definition: tools.c:418
int _MMG2_chkmsh(MMG5_pMesh)
Definition: chkmsh_2d.c:204
int _MMG2_savedisp_db(MMG5_pMesh mesh, MMG5_pSol, char *, char)
Definition: inout_2d.c:1749
int _MMG2_ismaniball(MMG5_pMesh, MMG5_pSol, int, char)
Definition: mmg2d6.c:113
int _MMG2_chkcol(MMG5_pMesh, MMG5_pSol, int, char, int *, char)
Definition: colver_2d.c:28
int _MMG2_gradsiz_ani(MMG5_pMesh, MMG5_pSol)
Definition: anisosiz_2d.c:507
int MMG2_settagtriangles(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d2.c:99
void MMG2_kiufree(pQueue q)
int _MMG2D_Free_all_var(va_list argptr)
Definition: variadic_2d.c:238
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:205
int MMG2_findTria(MMG5_pMesh, int)
Definition: locate_2d.c:217
void _MMG2D_delPt(MMG5_pMesh mesh, int ip)
Definition: zaldy_2d.c:58
int MMG2_invmat(double *m, double *minv)
int _MMG2_split3_sim(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:581
int MMG2_kiudel(pQueue q, int iel)
int MMG2_outqua(MMG5_pMesh, MMG5_pSol)
Definition: quality_2d.c:156
int _MMG2_chkswp(MMG5_pMesh, MMG5_pSol, int, char, char)
Definition: swapar_2d.c:126
int _MMG2_splitbar(MMG5_pMesh, int, int)
Definition: split_2d.c:710
int(* MMG2D_gradsiz)(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d.h:377
MMG5_Mesh * MMG5_pMesh
Definition: libmmgtypes.h:520
int size
Definition: mmg2d.h:126
double long_iso(double *ca, double *cb, double *ma, double *mb)
Definition: length_2d.c:26
int _MMG2D_Free_structures_var(va_list argptr)
Definition: variadic_2d.c:348
int _MMG2_cuttri_ls(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d6.c:413
! int16_t tag
Definition: libmmgtypesf.h:252
double long_ani(double *ca, double *cb, double *ma, double *mb)
Definition: length_2d.c:46
int _MMG2_movtri(MMG5_pMesh, MMG5_pSol, int, char)
Definition: mmg2d1.c:743
double(* MMG2D_lencurv)(MMG5_pMesh, MMG5_pSol, int, int)
Definition: mmg2d.h:373
int lissmet_ani(MMG5_pMesh mesh, MMG5_pSol sol)
Definition: lissmet_2d.c:46
! double min[3]
Definition: libmmgtypesf.h:484
int MMG2_parsop(MMG5_pMesh, MMG5_pSol)
Definition: libmmg2d_tools.c:63
int _MMG2_analys(MMG5_pMesh)
Definition: analys_2d.c:620
int _MMG2D_memOption(MMG5_pMesh mesh)
Definition: zaldy_2d.c:164
int MMG2_mmg2d1n(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d1.c:804
int _MMG2_dichoto(MMG5_pMesh, MMG5_pSol, int, int *)
Definition: mmg2d1.c:357
double _MMG2_lencurv_iso(MMG5_pMesh, MMG5_pSol, int, int)
Definition: length_2d.c:62
int _MMG2_swpmsh(MMG5_pMesh, MMG5_pSol, int)
Definition: mmg2d1.c:507
int MMG2D_zaldy(MMG5_pMesh mesh)
Definition: zaldy_2d.c:252
int _MMG2_setadj(MMG5_pMesh)
Definition: analys_2d.c:48
int size
Definition: mmg2d.h:115
int _MMG2_chkor(MMG5_pMesh)
Definition: chkmsh_2d.c:404
MMG mesh structure.
Definition: libmmgtypes.h:473
int _MMG5_interpmet22(MMG5_pMesh, double *, double *, double, double *)
Definition: intmet_2d.c:54
int _MMG2_anatri(MMG5_pMesh, MMG5_pSol, char)
Definition: mmg2d1.c:39
int _MMG2D_indPt(MMG5_pMesh mesh, int kp)
Definition: tools_2d.c:69
static void _MMG2D_Set_commonFunc()
Definition: mmg2d.h:388
double _MMG2_lencurv_ani(MMG5_pMesh, MMG5_pSol, int, int)
Definition: length_2d.c:81
int cur
Definition: mmg2d.h:110
int _MMG2_savenor_db(MMG5_pMesh, char *, char)
Definition: inout_2d.c:1694
int lissmet_iso(MMG5_pMesh mesh, MMG5_pSol sol)
int _MMG2_split1_sim(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:334
double _MMG2_quickcal(MMG5_pMesh, MMG5_pTria)
Definition: quality_2d.c:45
int _MMG2D_Init_mesh_var(va_list argptr)
Definition: variadic_2d.c:146
int _MMG2_defsiz_ani(MMG5_pMesh, MMG5_pSol)
Definition: anisosiz_2d.c:260
int _MMG2_chkmanimesh(MMG5_pMesh)
Definition: mmg2d6.c:343
int _MMG2_cavity(MMG5_pMesh, MMG5_pSol, int, int *)
Definition: delone_2d.c:176
int MMG2_mmg2d9(MMG5_pMesh, MMG5_pSol, MMG5_pSol)
Definition: mmg2d9.c:521
int _MMG2D_newElt(MMG5_pMesh mesh)
Definition: zaldy_2d.c:107
int _MMG2_adpcol(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d1.c:686
int _MMG5_newEdge(MMG5_pMesh mesh)
Definition: zaldy_2d.c:77
int _MMG2_isSplit(MMG5_pMesh, int, int *, int *)
Definition: mmg2d6.c:45
int _MMG2_movintpt(MMG5_pMesh, MMG5_pSol, int, int *, char)
Definition: movpt_2d.c:212
int _MMG2_snapval(MMG5_pMesh, MMG5_pSol, double *)
Definition: mmg2d6.c:183
! double hmax
Definition: libmmgtypesf.h:231
double _MMG2_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
Definition: quality_2d.c:59
int _MMG2_colelt(MMG5_pMesh, MMG5_pSol, int)
Definition: mmg2d1.c:433
int(* MMG2_optlen)(MMG5_pMesh, MMG5_pSol, double, int)
Definition: mmg2d.h:375
int MMG2_prilen(MMG5_pMesh, MMG5_pSol)
Definition: length_2d.c:124
int * stack
Definition: mmg2d.h:110
int _MMG2_bezierCurv(MMG5_pMesh, int, char, double, double *, double *)
Definition: bezier_2d.c:117
void _MMG5_delEdge(MMG5_pMesh mesh, int iel)
Definition: zaldy_2d.c:92
int _MMG2_swapdelone(MMG5_pMesh, MMG5_pSol, int, char, double, int *)
Definition: swapar_2d.c:39
int _MMG2_intmet_iso(MMG5_pMesh, MMG5_pSol, int, char, int, double)
Definition: intmet_2d.c:38
! double n[3]
Definition: libmmgtypesf.h:245
int MMG2_bdryenforcement(MMG5_pMesh, MMG5_pSol)
Definition: enforcement_2d.c:34
static const unsigned int MMG2_idir[5]
Definition: mmg2d.h:133
int MMG2_hashTria(MMG5_pMesh)
Definition: hash_2d.c:49
int MMG2_hashEdge(pHashTable edgeTable, int iel, int ia, int ib)
Definition: hash_2d.c:154
static const int MMG2_iopp[3][2]
Definition: mmg2d.h:132
int _MMG2_cenrad_iso(MMG5_pMesh, double *, double *, double *)
Definition: cenrad_2d.c:42
int _MMG2D_delElt(MMG5_pMesh mesh, int iel)
Definition: zaldy_2d.c:127
int _MMG2_gradsiz_iso(MMG5_pMesh, MMG5_pSol)
Definition: isosiz_2d.c:172
int(* MMG2D_defsiz)(MMG5_pMesh, MMG5_pSol)
Definition: mmg2d.h:378
int _MMG2_split1(MMG5_pMesh, MMG5_pSol, int, int vx[3])
Definition: split_2d.c:379
int _MMG2_boulen(MMG5_pMesh, int, char, int *, int *, double *)
Definition: boulep_2d.c:96
int _MMG2_norver(MMG5_pMesh)
Definition: analys_2d.c:296
int optlen_ani(MMG5_pMesh mesh, MMG5_pSol sol, double declic, int base)
int _MMG2_singul(MMG5_pMesh)
Definition: analys_2d.c:197
double _MMG2_caltri_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
Definition: quality_2d.c:95
int _MMG2_swapar(MMG5_pMesh, int, char)
Definition: swapar_2d.c:219
int _MMG2_movedgpt(MMG5_pMesh, MMG5_pSol, int, int *, char)
Definition: movpt_2d.c:52
int _MMG2_grad2met_ani(MMG5_pMesh, MMG5_pSol, double *, double *, double)
Definition: anisosiz_2d.c:340
int _MMG2_chkspl(MMG5_pMesh, MMG5_pSol, int, char)
Definition: split_2d.c:50
void MMG2D_solTruncatureForOptim(MMG5_pMesh mesh, MMG5_pSol met)
Definition: libmmg2d.c:49
Definition: libmmgtypes.h:261
int nxt
Definition: mmg2d.h:122
int simred(double *m1, double *m2, double *m)
Definition: simred_2d.c:58
int _MMG2_chkedg(MMG5_pMesh, int)
Definition: bezier_2d.c:28
int _MMG2_savemesh_db(MMG5_pMesh, char *, char)
Definition: inout_2d.c:1545
double(* MMG2D_caltri)(MMG5_pMesh, MMG5_pSol, MMG5_pTria)
Definition: mmg2d.h:374
int MMG2_mmg2d1(MMG5_pMesh, MMG5_pSol)
int(* MMG2D_intmet)(MMG5_pMesh, MMG5_pSol, int, char, int, double)
Definition: mmg2d.h:376
! int base
Definition: libmmgtypesf.h:277
int MMG2_boulep(MMG5_pMesh, int, int, int *)
Definition: boulep_2d.c:34
int _MMG2D_newPt(MMG5_pMesh mesh, double c[2], int16_t tag)
Definition: zaldy_2d.c:38
static const unsigned int MMG2_inxt[5]
Definition: mmg2d.h:134
int MMG2_cutEdge(MMG5_pMesh, MMG5_pTria, MMG5_pPoint, MMG5_pPoint)
Definition: locate_2d.c:92
int _MMG2_resetRef(MMG5_pMesh)
Definition: mmg2d6.c:83
int MMG2_pack(MMG5_pMesh, MMG5_pSol)
Definition: hash_2d.c:354