Commits

Lisandro Dalcin  committed 2d0ec31

Add IGASetQuadrature()

  • Participants
  • Parent commits bc24ffb

Comments (0)

Files changed (1)

File src/petiga.c

 }
 
 #undef  __FUNCT__
+#define __FUNCT__ "IGASetQuadrature"
+PetscErrorCode IGASetQuadrature(IGA iga,PetscInt i,PetscInt q)
+{
+  IGARule        rule;
+  PetscErrorCode ierr;
+  PetscFunctionBegin;
+  PetscValidHeaderSpecific(iga,IGA_CLASSID,1);
+  PetscValidLogicalCollectiveInt(iga,q,2);
+  ierr = IGAGetRule(iga,i,&rule);CHKERRQ(ierr);
+  if (q == PETSC_DECIDE && iga->axis[i]->p > 0) q = iga->axis[i]->p + 1;
+  if (q <= 0) SETERRQ1(((PetscObject)iga)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Number of quadrature points %D must be positive",q);
+  if (q == rule->nqp) PetscFunctionReturn(0);
+  if (iga->setup) {iga->setup = PETSC_FALSE; iga->setupstage--;}
+  ierr = IGARuleInit(rule,q);CHKERRQ(ierr);
+  PetscFunctionReturn(0);
+}
+
+#undef  __FUNCT__
 #define __FUNCT__ "IGASetProcessors"
 PetscErrorCode IGASetProcessors(IGA iga,PetscInt i,PetscInt processors)
 {