25#define MMG2D_AREAMIN 1e-15
34 double dd,ux,uy,vx,vy;
35 MMG5_int *adja,iel,iadr,adj,ib,ic,ncor,nei[3],base;
39 if ( !
MG_VOK(ppt) )
return ilist;
66 ux = p2->
c[0] - p1->
c[0];
67 uy = p2->
c[1] - p1->
c[1];
69 vx = ppt->
c[0] - p1->
c[0];
70 vy = ppt->
c[1] - p1->
c[1];
79 if ( i < 3 /*|| pt->tag &
MG_REQ*/ ) {
82 list[ipil] = list[--lon];
90 while ( ncor > 0 && lon >= nedep );
109 MMG5_int *adja,iadr,jel,ip1,ip2;
126 printf(
" # Error: %s: Unable to add edge %" MMG5_PRId
" %" MMG5_PRId
" within the hash table\n",
133 iadr = (iel-1)*3 + 1;
139 iadr = (jel-1)*3 + 1;
152 double c[2],crit,dd,eps,rad,ct[6];
153 MMG5_int tref,*adja,*adjb,adj,adi,jel,iadr,nei[3],l,base;
156 static int8_t mmgWarn0=0;
171 iadr = (jel-1)*3 + 1;
178 for (i=0; i<3; i++) {
181 if ( !adj )
continue;
185 if ( pt->
base == base || pt->
ref != ptc->
ref )
continue;
188 for (j=0,l=0; j<3; j++,l+=2) {
189 memcpy(&ct[l],
mesh->
point[pt->
v[j]].
c,2*
sizeof(
double));
196 dd = (ppt->
c[0] - c[0]) * (ppt->
c[0] - c[0]) + (ppt->
c[1] - c[1]) * (ppt->
c[1] - c[1]);
197 if ( dd > crit )
continue;
200 iadr = (adj-1)*3 + 1;
203 for (j=0; j<3; j++) {
204 if ( j == voy )
continue;
206 if ( !adi )
continue;
208 if ( pt1->
base == base && adi != jel ) {
209 if ( pt1->
ref != tref ) {
223 fprintf(stderr,
"\n ## Error: %s: we pass here at least one time but one"
224 " should never go through here.\n",__func__);
232 while ( ipil < ilist );
254 MMG5_int base,*adja,*adjb,iel,jel,old,iadr,size,nei[3],iadrold;
261 static int8_t mmgWarn0=0,mmgWarn1=0;
264 for (k=1; k<ilist; k++)
271 for (k=0; k<ilist; k++) {
274 iadr = (old-1)*3 + 1;
279 for (i=0; i<3; i++) {
282 for (j=0; j<2; j++) {
294 for (k=0; k<ilist; k++) {
297 for (i=0; i<3; i++) {
305 for (k=0; k<ilist; k++) {
308 for (i=0; i<3; i++) {
313 if ( alert )
return 0;
318 fprintf(stderr,
"\n ## Warning: %s: unable to allocate hash table.\n",__func__);
324 for (k=1; k<=size; k++) {
328 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
329 " a new element.\n",__func__);
331 printf(
" Exit program.\n");
return -1);
336 for (k=0; k<ilist; k++) {
340 iadrold = (old-1)*3 + 1;
346 for (i=0; i<3; i++) {
352 assert ( size <= ielnum[0] );
353 iel = ielnum[size++];
364 fprintf(stderr,
" ## Warning: %s: creation of a very bad element.\n",
369 iadr = (iel-1)*3 + 1;
374 iadr = (jel-1)*3 + 1;
379 for (j=0; j<3; j++) {
383 fprintf(stderr,
" ## Warning: %s: unable to update adjacency"
384 " relationship (elt %" MMG5_PRId
", edge %d).\n",
396 for (k=0; k<ilist; k++) {
397 if ( (!mmgWarn1) && (tref !=
mesh->
tria[list[k]].
ref) ) {
399 fprintf(stderr,
"\n ## Warning: %s: sud-domain ignored.\n",__func__);
MMG5_pMesh MMG5_pSol * sol
int MMG2D_cenrad_iso(MMG5_pMesh mesh, double *ct, double *c, double *rad)
int MMG2D_delone(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ip, MMG5_int *list, int ilist)
int MMG2D_cavity(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ip, MMG5_int *list)
static int MMG2D_correction_iso(MMG5_pMesh mesh, MMG5_int ip, MMG5_int *list, int ilist, int nedep)
static int MMG2D_hashEdgeDelone(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int iel, int i)
int MMG5_hashNew(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int hsiz, MMG5_int hmax)
MMG5_int MMG5_hashGet(MMG5_Hash *hash, MMG5_int a, MMG5_int b)
int MMG5_hashEdge(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int a, MMG5_int b, MMG5_int k)
MMG5_int MMG2D_indPt(MMG5_pMesh mesh, MMG5_int kp)
int MMG2D_delElt(MMG5_pMesh mesh, MMG5_int iel)
#define MMG2D_TRIA_REALLOC(mesh, jel, wantedGap, law)
static const int MMG2D_iare[3][2]
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
MMG5_int MMG2D_indElt(MMG5_pMesh mesh, MMG5_int kel)
MMG5_int MMG2D_newElt(MMG5_pMesh mesh)
#define MMG5_INCREASE_MEM_MESSAGE()
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
#define MMG5_SAFE_FREE(ptr)
Identic as MMG5_HGeom but use MMG5_hedge to store edges instead of MMG5_hgeom (memory economy).
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.