1. Lisandro Dalcin
  2. PetIGA

Commits

Lisandro Dalcin  committed 3a5d1ae

Add IGAAxisGetLimits() and IGAAxisGetSizes()

  • Participants
  • Parent commits cacf4fd
  • Branches default

Comments (0)

Files changed (2)

File include/petiga.h

View file
 PETSC_EXTERN PetscErrorCode IGAAxisGetDegree(IGAAxis axis,PetscInt *p);
 PETSC_EXTERN PetscErrorCode IGAAxisSetKnots(IGAAxis axis,PetscInt m,PetscReal U[]);
 PETSC_EXTERN PetscErrorCode IGAAxisGetKnots(IGAAxis axis,PetscInt *m,PetscReal *U[]);
-PETSC_EXTERN PetscErrorCode IGAAxisInitBreaks(IGAAxis axis,PetscInt r,PetscReal u[],PetscInt C);
+PETSC_EXTERN PetscErrorCode IGAAxisGetLimits(IGAAxis axis,PetscReal *Ui,PetscReal *Uf);
+PETSC_EXTERN PetscErrorCode IGAAxisGetSizes(IGAAxis axis,PetscInt *nel,PetscInt *nnp);
+PETSC_EXTERN PetscErrorCode IGAAxisInitBreaks(IGAAxis axis,PetscInt nu,PetscReal u[],PetscInt C);
 PETSC_EXTERN PetscErrorCode IGAAxisInitUniform(IGAAxis axis,PetscInt N,PetscReal Ui,PetscReal Uf,PetscInt C);
 PETSC_EXTERN PetscErrorCode IGAAxisSetUp(IGAAxis axis);
 

File src/petigaaxis.c

View file
 }
 
 #undef  __FUNCT__
+#define __FUNCT__ "IGAAxisGetLimits"
+PetscErrorCode IGAAxisGetLimits(IGAAxis axis,PetscReal *Ui,PetscReal *Uf)
+{
+  PetscFunctionBegin;
+  PetscValidPointer(axis,1);
+  if (Ui) PetscValidRealPointer(Ui,2);
+  if (Uf) PetscValidRealPointer(Uf,3);
+  if (Ui) *Ui = axis->U[axis->p];
+  if (Uf) *Uf = axis->U[axis->m-axis->p];
+  PetscFunctionReturn(0);
+}
+
+#undef  __FUNCT__
+#define __FUNCT__ "IGAAxisGetSizes"
+PetscErrorCode IGAAxisGetSizes(IGAAxis axis,PetscInt *nel,PetscInt *nnp)
+{
+  PetscFunctionBegin;
+  PetscValidPointer(axis,1);
+  if (nel) PetscValidIntPointer(nel,2);
+  if (nnp) PetscValidIntPointer(nnp,3);
+  if (nel) *nel = axis->nel;
+  if (nnp) *nnp = axis->nnp;
+  PetscFunctionReturn(0);
+}
+
+#undef  __FUNCT__
 #define __FUNCT__ "IGAAxisInitBreaks"
 PetscErrorCode IGAAxisInitBreaks(IGAAxis axis,PetscInt nu,PetscReal u[],PetscInt C)
 {