Changeset 26692


Ignore:
Timestamp:
12/02/21 06:49:14 (3 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing problem with indexing of weights

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r26691 r26692  
    12471247
    12481248   /*Weights*/
    1249    Gauss* gauss = NULL;
    12501249   IssmDouble loadweights_g[NUMVERTICES2D];
    12511250   IssmDouble total_weight = 0;
     
    12921291                else _error_("case not possible");
    12931292        }
    1294         if(trapezeisnegative) phi = 1-f1*f2;
     1293        if(trapezeisnegative) phi = 1.-f1*f2;
    12951294        else                  phi = f1*f2;
    12961295       
    12971296        /*Compute weights*/
    1298         gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
     1297        Gauss* gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
    12991298
    13001299        total_weight = 0.0;
     
    13051304                total_weight += gauss->weight;
    13061305        }
     1306        delete gauss;
    13071307
    13081308        /*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/
    1309    if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++) weights[i] = weights[i]*phi/total_weight;
     1309   if(total_weight>0.) for(int i=0;i<NUMVERTICES2D;i++) weights[i] = weights[i]*phi/total_weight;
    13101310        else for(int i=0;i<NUMVERTICES2D;i++) weights[i] = 0.0;
    1311 
    1312         /*Cleanup*/
    1313         delete gauss;
    13141311       
    13151312        /*Assign output pointers*/
     
    22012198                        lsf2d[i]   = lsf[i];
    22022199                }
    2203                 GetFractionGeometry2D(weights,&phi,&point,&f1,&f2,&istrapneg,lsf2d);
     2200                GetFractionGeometry2D(&weights[0],&phi,&point,&f1,&f2,&istrapneg,lsf2d);
    22042201               
    22052202                IssmDouble basetot;
Note: See TracChangeset for help on using the changeset viewer.