23#ifndef LIBMMG2D_PRIVATE_H
24#define LIBMMG2D_PRIVATE_H
45#define M_MAX(a,b) (((a) > (b)) ? (a) : (b))
46#define M_MIN(a,b) (((a) < (b)) ? (a) : (b))
51#define MMG2D_EPSD 1.e-10
52#define MMG2D_EPSA 1.e-12
55#define MMG2D_SIZE 0.75
56#define MMG2D_ALPHA 0.28867513459
57#define MMG2D_ALPHAD 3.464101615137755
58#define MMG2D_BADKAL 0.2
59#define MMG2D_NULKAL 1.e-6
60#define MMG2D_ANGCORN -1.e-6
61#define MMG2D_SHORTMAX 0x7fff
63#define MMG2D_LLONG 2.0
64#define MMG2D_LSHRT 0.3
65#define MMG2D_LOPTL 1.4
66#define MMG2D_LOPTS 0.71
68#define MMG2D_NPMAX 50000
69#define MMG2D_NEDMAX 100000
70#define MMG2D_NEMAX 100000
73static const uint8_t
MMG2D_idir_q[4][2] = { {0,1},{0,3},{1,2},{2,3} };
76#define MMG2D_RETURN_AND_FREE(mesh,met,ls,disp,val)do \
78 if ( !MMG2D_Free_all(MMG5_ARG_start, \
79 MMG5_ARG_ppMesh,&mesh,MMG5_ARG_ppMet,&met, \
80 MMG5_ARG_ppLs,&ls,MMG5_ARG_ppDisp,&disp, \
82 return MMG5_LOWFAILURE; \
95 fprintf(stdout,
"\n Unexpected error:"); fflush(stdout);
98 fprintf(stdout,
" Abnormal stop\n");
break;
100 fprintf(stdout,
" Floating-point exception\n");
break;
102 fprintf(stdout,
" Illegal instruction\n");
break;
104 fprintf(stdout,
" Segmentation fault\n");
break;
107 fprintf(stdout,
" Program killed\n");
break;
117#define MMG2D_POINT_REALLOC(mesh,sol,ip,wantedGap,law,o,tag ) do \
121 assert ( mesh && mesh->point ); \
122 MMG5_TAB_RECALLOC(mesh,mesh->point,mesh->npmax,wantedGap,MMG5_Point, \
123 "larger point table",law); \
125 mesh->npnil = mesh->np+1; \
126 for (klink=mesh->npnil; klink<mesh->npmax-1; klink++) \
127 mesh->point[klink].tmp = klink+1; \
132 MMG5_ADD_MEM(mesh,(sol->size*(mesh->npmax-sol->npmax))*sizeof(double), \
133 "larger solution",law); \
134 MMG5_SAFE_REALLOC(sol->m,sol->size*(sol->npmax+1), \
135 sol->size*(mesh->npmax+1), \
136 double,"larger solution",law); \
138 sol->npmax = mesh->npmax; \
142 ip = MMG2D_newPt(mesh,o,tag); \
148#define MMG2D_TRIA_REALLOC(mesh,jel,wantedGap,law ) do \
150 MMG5_int klink,oldSiz; \
152 oldSiz = mesh->ntmax; \
155 if ( mesh->nquad ) { \
164 MMG5_CHK_INT32_OVERFLOW(wantedGap,oldSiz,max_factor,max_factor+2,law);\
166 MMG5_TAB_RECALLOC(mesh,mesh->tria,mesh->ntmax,wantedGap,MMG5_Tria, \
167 "larger tria table",law); \
169 mesh->nenil = mesh->nt+1; \
170 for (klink=mesh->nenil; klink<mesh->ntmax-1; klink++) \
171 mesh->tria[klink].v[2] = klink+1; \
173 if ( mesh->adja ) { \
175 MMG5_ADD_MEM(mesh,3*(mesh->ntmax-oldSiz)*sizeof(MMG5_int), \
176 "larger adja table",law); \
177 MMG5_SAFE_RECALLOC(mesh->adja,3*oldSiz+5,3*mesh->ntmax+5,MMG5_int \
178 ,"larger adja table",law); \
182 jel = MMG2D_newElt(mesh); \
311double long_ani(
double *ca,
double *cb,
double *ma,
double *mb);
312double long_iso(
double *ca,
double *cb,
double *ma,
double *mb);
MMG5_pMesh MMG5_pSol * sol
void MMG5_delEdge(MMG5_pMesh mesh, MMG5_int iel)
MMG5_int MMG2D_isInTriangle(MMG5_pMesh, MMG5_int, double c[2])
int MMG2D_mmg2d1n(MMG5_pMesh, MMG5_pSol)
int MMG2D_grad2metreq_ani(MMG5_pMesh, MMG5_pSol, MMG5_pTria, MMG5_int, MMG5_int)
int MMG2D_bezierCurv(MMG5_pMesh, MMG5_int, int8_t, double, double *, double *)
int MMG2D_setMeshSize_alloc(MMG5_pMesh)
int MMG2D_cenrad_iso(MMG5_pMesh, double *, double *, double *)
int MMG2D_memOption(MMG5_pMesh mesh)
double MMG2D_quickcal(MMG5_pMesh, MMG5_pTria)
size_t MMG5_memSize(void)
int MMG2D_dichoto(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *)
double MMG2D_lencurv_ani(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int)
int MMG2D_movintpt(MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
MMG5_int MMG2D_grad2met_ani(MMG5_pMesh, MMG5_pSol, MMG5_pTria, MMG5_int, MMG5_int)
MMG5_int MMG2D_colelt(MMG5_pMesh, MMG5_pSol, int)
MMG5_int MMG2D_indPt(MMG5_pMesh mesh, MMG5_int kp)
int interp_iso(double *, double *, double *, double)
double MMG2D_caltri_iso_3pt(double *a, double *b, double *c)
int MMG2D_split3(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
MMG5_int MMG2D_findTria(MMG5_pMesh, MMG5_int)
int MMG2D_swapdelone(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, double, MMG5_int *)
int MMG2D_splitbar(MMG5_pMesh, MMG5_int, MMG5_int)
int MMG2D_boulet(MMG5_pMesh, MMG5_int, int8_t, MMG5_int *)
int MMG2D_zaldy(MMG5_pMesh mesh)
int lissmet_iso(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_colver2(MMG5_pMesh, MMG5_int *)
int MMG2D_defsiz_iso(MMG5_pMesh, MMG5_pSol)
MMG5_int MMG2D_movtri(MMG5_pMesh, MMG5_pSol, int, int8_t)
int MMG2D_savemesh_db(MMG5_pMesh, char *, int8_t)
int MMG2D_gradsiz_ani(MMG5_pMesh, MMG5_pSol)
int MMG2D_split2_sim(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
int interp_ani(double *, double *, double *, double)
MMG5_int MMG2D_anaelt(MMG5_pMesh, MMG5_pSol, int)
int MMG2D_delone(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *, int)
int MMG2D_colver(MMG5_pMesh, int, MMG5_int *)
int MMG2D_bdryEdge(MMG5_pMesh)
int MMG2D_singul(MMG5_pMesh, MMG5_int)
int lissmet_ani(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_split2(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
int MMG2D_settagtriangles(MMG5_pMesh, MMG5_pSol)
int MMG2D_chkswp(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, int8_t)
int MMG2D_defsiz_ani(MMG5_pMesh, MMG5_pSol)
int MMG2D_freeLocalPar(MMG5_pMesh)
int MMG2D_chkcol(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int *, int8_t)
int MMG2D_assignEdge(MMG5_pMesh)
double MMG2D_caltri_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
MMG5_int MMG2D_chkspl(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
MMG5_int MMG2D_findtrianglestate(MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int, MMG5_int, MMG5_int, MMG5_int)
int MMG2D_bouleendp(MMG5_pMesh, MMG5_int, int8_t, MMG5_int *, MMG5_int *, MMG5_int *)
int MMG2D_split1b(MMG5_pMesh, MMG5_int, int8_t, MMG5_int)
int MMG2D_hashQuad(MMG5_pMesh mesh)
int MMG2D_doSol_iso(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_split1(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
MMG5_int MMG2D_newPt(MMG5_pMesh mesh, double c[2], uint16_t tag)
int MMG2D_gradsizreq_ani(MMG5_pMesh, MMG5_pSol)
int MMG2D_delElt(MMG5_pMesh mesh, MMG5_int iel)
int MMG2D_norver(MMG5_pMesh, MMG5_int)
int MMG2D_savemet_db(MMG5_pMesh, MMG5_pSol, char *, int8_t)
static const unsigned int MMG2D_idir[5]
int MMG2D_prilen(MMG5_pMesh, MMG5_pSol)
int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh, MMG5_pSol, MMG5_pTria, int8_t)
int MMG2D_movintpt_ani(MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
int MMG2D_cutEdge(MMG5_pMesh, MMG5_pTria, MMG5_pPoint, MMG5_pPoint)
int MMG2D_adpcol(MMG5_pMesh, MMG5_pSol)
int MMG2D_setadj(MMG5_pMesh, int8_t)
static void MMG2D_excfun(int sigid)
int MMG2D_hashTria(MMG5_pMesh)
int MMG2D_analys(MMG5_pMesh)
int MMG2D_cutEdgeTriangle(MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int)
void MMG2D_delPt(MMG5_pMesh mesh, MMG5_int ip)
double MMG2D_lencurv_iso(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int)
int MMG2D_split1_sim(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
int MMG2D_coorbary(MMG5_pMesh, MMG5_pTria, double c[2], double *, double *, double *)
static const int MMG2D_iare[3][2]
int MMG5_mmg2dChkmsh(MMG5_pMesh, int, MMG5_int)
MMG5_int MMG2D_swpmsh(MMG5_pMesh, MMG5_pSol, int)
int MMG2D_boulen(MMG5_pMesh, MMG5_int, int8_t, MMG5_int *, MMG5_int *, double *)
int MMG2D_defmetbdy_2d(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
int MMG2D_doSol_ani(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_locateEdge(MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int *, MMG5_int *)
int MMG2D_boulep(MMG5_pMesh, MMG5_int, int, MMG5_int *)
int MMG2D_mmg2d9(MMG5_pMesh, MMG5_pSol, MMG5_pSol, MMG5_int **)
int MMG2D_set_metricAtPointsOnReqEdges(MMG5_pMesh, MMG5_pSol, int8_t)
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
int MMG2D_intmet_ani(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int, double)
int MMG2D_bdryenforcement(MMG5_pMesh, MMG5_pSol)
int MMG2D_regnor(MMG5_pMesh)
int MMG2D_mmg2d2(MMG5_pMesh, MMG5_pSol)
int MMG2D_mmg2d1(MMG5_pMesh, MMG5_pSol)
int MMG2D_baseBdry(MMG5_pMesh mesh)
int MMG2D_swapar(MMG5_pMesh, MMG5_int, int8_t)
int MMG2D_cavity(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int *)
double long_ani(double *ca, double *cb, double *ma, double *mb)
int MMG2D_Free_all_var(va_list argptr)
int MMG2D_velextLS(MMG5_pMesh, MMG5_pSol)
int MMG2D_anatri(MMG5_pMesh, MMG5_pSol, int8_t)
int MMG2D_2dMeshCheck(MMG5_pMesh mesh)
int MMG2D_Free_structures_var(va_list argptr)
MMG5_int MMG2D_indElt(MMG5_pMesh mesh, MMG5_int kel)
int MMG2D_regver(MMG5_pMesh)
int MMG2D_defaultmet_2d(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t)
int MMG2D_movedgpt(MMG5_pMesh, MMG5_pSol, int, MMG5_int *, int8_t)
int MMG2D_intmet_iso(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, MMG5_int, double)
int MMG2D_savedisp_db(MMG5_pMesh mesh, MMG5_pSol, char *, int8_t)
int MMG2D_outqua(MMG5_pMesh, MMG5_pSol)
int MMG5_interpmet22(MMG5_pMesh, double *, double *, double, double *)
int MMG2D_Free_names_var(va_list argptr)
int MMG2D_colver3(MMG5_pMesh, MMG5_int *)
double long_iso(double *ca, double *cb, double *ma, double *mb)
static const uint8_t MMG2D_idir_q[4][2]
idir[i]: vertices of edge i for a quad
int MMG2D_split3_sim(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_int vx[3])
int MMG2D_Init_mesh_var(va_list argptr)
int MMG2D_cuttri(MMG5_pMesh, MMG5_pSol, MMG5_pSol)
MMG5_int MMG2D_adpspl(MMG5_pMesh, MMG5_pSol)
void MMG2D_keep_only1Subdomain(MMG5_pMesh mesh, int nsd)
int MMG2D_pack(MMG5_pMesh, MMG5_pSol, MMG5_pSol)
MMG5_int MMG2D_newElt(MMG5_pMesh mesh)
int MMG2D_chkedg(MMG5_pMesh, MMG5_int)
int MMG2D_savenor_db(MMG5_pMesh, char *, int8_t)
int MMG2D_adptri(MMG5_pMesh, MMG5_pSol)
int MMG2D_mmg2d6(MMG5_pMesh, MMG5_pSol, MMG5_pSol)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.