45 double lon,len,calold,calnew,caltmp;
46 MMG5_int ip1,ip2,ipb,l,ll,lj,jel,kel,*adja;
48 uint8_t i1,i2,j,jj,j2,voy,open;
60 adja = &
mesh->adja[3*(k-1)+1];
62 calold = calnew = DBL_MAX;
66 if ( typchk == 2 && met->
m ) {
67 lon = MMG2D_lencurv(
mesh,met,ip1,ip2);
84 pt1 = &
mesh->tria[jel];
100 jel = list[ilist-1] / 3;
101 pt1 = &
mesh->tria[jel];
102 j = list[ilist-1] % 3;
108 pt1 = &
mesh->tria[jel];
112 adja = &
mesh->adja[3*(jel-1)+1];
114 pt1 = &
mesh->tria[jel];
119 if ( ipb == pt1->
v[j] )
return 0;
123 if (
mesh->info.fem ) {
124 p2 = &
mesh->point[ip2];
127 for (l=0; l<ilist-1; l++) {
132 pt1 = &
mesh->tria[jel];
133 p2 = &
mesh->point[pt1->
v[j2]];
139 if ( ilist > 3 || ( ilist == 3 && open ) ) {
151 for (l=1; l<ilist-1+open; l++) {
156 pt1 = &
mesh->tria[jel];
162 if ( typchk == 2 && met->
m && !
MG_EDG(
mesh->point[ip2].tag) ) {
164 len = MMG2D_lencurv(
mesh,met,ip1,ip2);
165 if ( len > lon )
return 0;
170 pt0->
tag[j2] |= pt->
tag[i1];
172 else if ( l == ilist-2 && !open ) {
173 ll = list[ilist-1+open] / 3;
175 if ( ll >
mesh->nt )
return 0;
176 lj = list[ilist-1+open] % 3;
177 pt0->
tag[jj] |=
mesh->tria[ll].tag[lj];
185 if ( typchk == 2 && met->
m && met->
size == 3 )
190 calold =
MG_MIN(calold,caltmp);
192 if ( typchk == 2 && met->
m && met->
size == 3 )
198 calnew =
MG_MIN(calnew,caltmp);
199 if ( calold <
MMG2D_NULKAL && calnew <= calold )
return 0;
200 else if ( calnew <
MMG2D_NULKAL || calnew < 0.001*calold )
return 0;
205 else if ( ilist == 3 ) {
206 ppt = &
mesh->point[pt->
v[i1]];
217 pt0 = &
mesh->tria[0];
218 pt1 = &
mesh->tria[jel];
224 pt1 = &
mesh->tria[jel];
225 pt0->
tag[jj] |= pt1->
tag[j];
235 assert ( ilist == 2 );
236 if ( ilist !=2 )
return 0;
237 if ( !open )
return 0;
243 adja = &
mesh->adja[3*(jel-1)+1];
246 pt2 = &
mesh->tria[kel];
247 if ( pt2->
v[voy] == ip2 )
return 0;
250 pt1 = &
mesh->tria[jel];
251 if ( MMG5_abs(pt->
ref) != MMG5_abs(pt1->
ref) )
return 0;
252 else if ( !(pt1->
tag[jj] &
MG_GEO) )
return 0;
256 pt0 = &
mesh->tria[0];
263 if ( calold <
MMG2D_NULKAL && calnew <= calold )
return 0;
275 MMG5_int iel,jel,ip1,ip2,k,kel,*adja;
276 uint8_t i,j,jj,i1,i2,open;
282 pt = &
mesh->tria[iel];
287 adja = &
mesh->adja[3*(iel-1)+1];
291 mesh->point[ip2].tag |=
mesh->point[ip1].tag;
293 for (k=1; k<ilist-1+open; k++) {
296 pt1 = &
mesh->tria[jel];
305 pt1 = &
mesh->tria[jel];
307 pt1->
tag[j] |= pt->
tag[i1];
313 mesh->adja[3*(kel-1)+1+k] = 3*jel+j;
314 mesh->adja[3*(jel-1)+1+j] = 3*kel+k;
315 pt2 = &
mesh->tria[kel];
316 pt2->
tag[k] |= pt1->
tag[j];
320 mesh->adja[3*(jel-1)+1+j] = 0;
324 iel = list[ilist-1] / 3;
325 i1 = list[ilist-1] % 3;
326 pt = &
mesh->tria[iel];
328 jel = list[ilist-2] / 3;
329 jj = list[ilist-2] % 3;
331 pt1 = &
mesh->tria[jel];
332 pt1->
tag[j] |= pt->
tag[i1];
334 adja = &
mesh->adja[3*(iel-1)+1];
339 mesh->adja[3*(kel-1)+1+k] = 3*jel + j;
340 mesh->adja[3*(jel-1)+1+j] = 3*kel + k;
341 pt2 = &
mesh->tria[kel];
342 pt2->
tag[k] |= pt1->
tag[j];
346 mesh->adja[3*(jel-1)+1+j] = 0;
361 MMG5_int iel,jel,kel,mel,ip,*adja;
362 uint8_t i,i1,j,j1,j2,k,m;
368 pt = &
mesh->tria[iel];
374 pt1 = &
mesh->tria[jel];
378 pt2 = &
mesh->tria[kel];
381 pt1->
v[j] = pt->
v[i1];
382 pt1->
tag[j1] |= pt2->
tag[k];
384 pt1->
tag[j2] |= pt->
tag[i];
389 adja = &
mesh->adja[3*(jel-1)+1];
390 adja[j1] =
mesh->adja[3*(kel-1)+1+k];
391 adja[j2] =
mesh->adja[3*(iel-1)+1+i];
396 pt = &
mesh->tria[mel];
397 pt->
tag[m] = pt1->
tag[j2];
398 pt->
edg[m] = pt1->
edg[j2];
399 mesh->adja[3*(mel-1)+1+m] = 3*jel + j2;
405 pt = &
mesh->tria[mel];
406 pt->
tag[m] = pt1->
tag[j1];
407 pt->
edg[m] = pt1->
edg[j1];
408 mesh->adja[3*(mel-1)+1+m] = 3*jel + j1;
423 MMG5_int *adja,iel,jel,kel,ip1,ip2;
424 int8_t i1,i2,jj,j2,k;
430 pt = &
mesh->tria[iel];
437 pt1 = &
mesh->tria[jel];
441 pt1->
tag[jj] |= pt->
tag[i1];
442 pt1->
edg[jj] = pt->
edg[i1];
446 adja = &
mesh->adja[3*(jel-1)+1];
447 adja[jj] =
mesh->adja[3*(iel-1)+1+i1];
448 adja = &
mesh->adja[3*(iel-1)+1];
452 mesh->adja[3*(kel-1)+1+k] = 3*jel + jj;
int MMG2D_chkedg(MMG5_pMesh mesh, MMG5_int k)
int MMG5_boulet(MMG5_pMesh mesh, MMG5_int start, int ip, MMG5_int *list, int8_t s, int8_t *opn)
int MMG2D_colver(MMG5_pMesh mesh, int ilist, MMG5_int *list)
int MMG2D_chkcol(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int *list, int8_t typchk)
int MMG2D_colver3(MMG5_pMesh mesh, MMG5_int *list)
int MMG2D_colver2(MMG5_pMesh mesh, MMG5_int *list)
double MMG2D_caltri_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
int MMG2D_delElt(MMG5_pMesh mesh, MMG5_int iel)
void MMG2D_delPt(MMG5_pMesh mesh, MMG5_int ip)
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
Structure to store triangles of a MMG mesh.