Commits

Lisandro Dalcin  committed 7638bda

Compose the IGA context in SNES and TS instances

  • Participants
  • Parent commits 24cbad0

Comments (0)

Files changed (2)

File src/petigasnes.c

   PetscFunctionBegin;
   PetscValidHeaderSpecific(iga,IGA_CLASSID,1);
   PetscValidPointer(snes,2);
+
   ierr = IGAGetComm(iga,&comm);CHKERRQ(ierr);
   ierr = SNESCreate(comm,snes);CHKERRQ(ierr);
+
   ierr = IGACreateVec(iga,&F);CHKERRQ(ierr);
   ierr = SNESSetFunction(*snes,F,IGASNESFormFunction,iga);CHKERRQ(ierr);
   ierr = VecDestroy(&F);CHKERRQ(ierr);
+
   ierr = IGACreateMat(iga,&J);CHKERRQ(ierr);
   ierr = SNESSetJacobian(*snes,J,J,IGASNESFormJacobian,iga);CHKERRQ(ierr);
   ierr = MatDestroy(&J);CHKERRQ(ierr);
-  /*ierr = SNESSetDM(**snes,iga->dm_dof);CHKERRQ(ierr);*/
+
+  ierr = PetscObjectCompose((PetscObject)*snes,"IGA",(PetscObject)iga);CHKERRQ(ierr);
+
   PetscFunctionReturn(0);
 }

File src/petigats.c

   PetscFunctionBegin;
   PetscValidHeaderSpecific(iga,IGA_CLASSID,1);
   PetscValidPointer(ts,2);
+
   ierr = IGAGetComm(iga,&comm);CHKERRQ(ierr);
   ierr = TSCreate(comm,ts);CHKERRQ(ierr);
+
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = TSSetSolution(*ts,U);CHKERRQ(ierr);
   ierr = VecDestroy(&U);CHKERRQ(ierr);
+
   ierr = IGACreateVec(iga,&F);CHKERRQ(ierr);
   ierr = TSSetIFunction(*ts,F,IGATSFormIFunction,iga);CHKERRQ(ierr);
   ierr = VecDestroy(&F);CHKERRQ(ierr);
+
   ierr = IGACreateMat(iga,&J);CHKERRQ(ierr);
   ierr = TSSetIJacobian(*ts,J,J,IGATSFormIJacobian,iga);CHKERRQ(ierr);
   ierr = MatDestroy(&J);CHKERRQ(ierr);
-  /*ierr = TSSetDM(*ts,iga->dm_dof);CHKERRQ(ierr);*/
+
+  ierr = PetscObjectCompose((PetscObject)*ts,"IGA",(PetscObject)iga);CHKERRQ(ierr);
+
   PetscFunctionReturn(0);
 }