43 double *a,*b,*c,abx,aby,abz,acx,acy,acz,det,n[3];
58 n[0] = aby*acz - abz*acy;
59 n[1] = abz*acx - abx*acz;
60 n[2] = abx*acy - aby*acx;
61 det = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
63 return 0.5*sqrt(det) ;
80 fprintf(stdout,
" ** Defining %stropic map\n",(met->
size==1)?
"iso":
"aniso");
83 fprintf(stderr,
"\n ## Error: %s: negative hmax value.\n",funcname);
100 fprintf(stdout,
"\n -- GRADATION : %8f ",
105 fprintf(stdout,
"\n");
109 fprintf(stdout,
"\n -- GRADATION : DISABLED (%8f)\n",exp(
mesh->
info.
hgradreq));
139 for ( j=0; j<
mesh->
dim; ++j ) {
140 dist = p1->
c[j]-p0->
c[j];
147 met->
m[met->
size*ip0] += len;
148 met->
m[met->
size*ip1] += len;
172 for ( k=1; k<=
mesh->
np; k++ ) {
174 if ( !
MG_VOK(p0) )
continue;
176 if ( !p0->
s )
continue;
185 printf(
"\n -- SIZEMAP CORRECTION : overwritten of sizes at required vertices\n");
207 MMG5_int k,ip0,ip1,iad0,iad1;
210 for ( k=1; k<=
mesh->
nt; k++ ) {
212 if ( !
MG_EOK(pt) )
continue;
214 for ( i=0; i<3; ++i ) {
220 iad0 = met->
size*ip0;
221 iad1 = met->
size*ip1;
223 for ( j=0; j<met->
size; ++j ) {
225 met->
m[ iad0 + j ] = 0.;
226 met->
m[ iad1 + j ] = 0.;
249 for ( k=1; k<=
mesh->
np; k++ ) {
255 for ( k=1; k<=
mesh->
nt; k++ ) {
257 if ( !
MG_EOK(pt) ) {
continue; }
259 for ( i=0; i<3; ++i ) {
281 double hgrad,ll,h1,h2,hn,val;
288 fprintf(stdout,
" ** Grading mesh\n");
293 for ( k=1; k<=
mesh->
np; k++ ) {
306 for (k=1; k<=
mesh->
nt; k++) {
308 if ( !
MG_EOK(pt) )
continue;
310 for (i=0; i<3; i++) {
320 if ( p1->
s || p2->
s )
continue;
323 for ( j=0; j<
mesh->
dim; ++j ) {
324 val = p2->
c[j]-p1->
c[j];
353 while ( ++it < maxit && nu > 0 );
356 fprintf(stdout,
" gradation: %7"MMG5_PRId
" updated, %d iter.\n",nup,it);
375 double hgrad,ll,h1,h2,hn,ux,uy;
377 MMG5_int k,ip1,ip2,ipmaster,ipslave;
382 fprintf(stdout,
" ** Grading required points.\n");
397 for (k=1; k<=
mesh->
nt; k++) {
403 for (i=0; i<3; i++) {
411 if ( MMG5_abs ( p1->
s - p2->
s ) < 2 ) {
415 else if ( p1->
s > p2->
s ) {
420 assert ( p2->
s > p1->
s );
425 ux = p2->
c[0]-p1->
c[0];
426 uy = p2->
c[1]-p1->
c[1];
430 h1 = met->
m[ipmaster];
431 h2 = met->
m[ipslave];
447 met->
m[ipslave] = hn;
454 while ( ++it < maxit && nu > 0 );
457 fprintf(stdout,
" gradation (required): %7d updated, %d iter.\n",nup,it);
void MMG5_gradation_info(MMG5_pMesh mesh)
double MMG5_surftri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
int MMG5_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip0, MMG5_int ip1)
void MMG5_mark_pointsOnReqEdge_fromTria(MMG5_pMesh mesh)
int MMG5_reset_metricAtReqEdges_surf(MMG5_pMesh mesh, MMG5_pSol met, int8_t ismet)
int MMG5_gradsiz_iso(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_compute_meanMetricAtMarkedPoints_iso(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_defsiz_startingMessage(MMG5_pMesh mesh, MMG5_pSol met, const char *funcname)
int MMG5_gradsizreq_iso(MMG5_pMesh mesh, MMG5_pSol met)
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.