Commits

Lisandro Dalcin committed 5b06406

Fix loop limit in boundary quadrature

Comments (0)

Files changed (1)

     }
     {
       PetscInt q;
-      PetscInt nqp = element->nqp;
+      PetscInt nqp = element->nqp / element->BD[dir]->nqp;
       PetscInt dim = element->dim;
       PetscReal *S = element->detS;
       PetscReal *n = element->normal;
+      for (q=0; q<nqp; q++) S[q] = 1.0;
       (void)PetscMemzero(n,nqp*dim*sizeof(PetscReal));
-      for (q=0; q<nqp; q++) {
-        S[q] = 1.0;
-        n[q*dim+dir] = side ? 1.0 : -1.0;
-      }
+      for (q=0; q<nqp; q++) n[q*dim+dir] = side ? 1.0 : -1.0;
     }
   }
 
     PetscInt q;
     PetscInt dim  = element->dim;
     PetscInt ord  = element->parent->order;
-    PetscInt nqp  = element->nqp;
+    PetscInt nqp  = element->nqp / element->BD[dir]->nqp;
     PetscInt nen  = element->nen;
     PetscReal *X  = element->geometryX;
     PetscReal **M = element->basis;