Commits

Lisandro Dalcin  committed 944e860

Add InsertMode flag to IGAGlobalToLocal()

  • Participants
  • Parent commits f4a2595

Comments (0)

Files changed (3)

File include/petiga.h

 PETSC_EXTERN PetscErrorCode IGACreateLocalVec(IGA iga, Vec *lvec);
 PETSC_EXTERN PetscErrorCode IGAGetLocalVec(IGA iga,Vec *lvec);
 PETSC_EXTERN PetscErrorCode IGARestoreLocalVec(IGA iga,Vec *lvec);
-PETSC_EXTERN PetscErrorCode IGAGlobalToLocal(IGA iga,Vec gvec,Vec lvec);
+PETSC_EXTERN PetscErrorCode IGAGlobalToLocal(IGA iga,Vec gvec,Vec lvec,InsertMode addv);
 PETSC_EXTERN PetscErrorCode IGALocalToGlobal(IGA iga,Vec lvec,Vec gvec,InsertMode addv);
 
 PETSC_EXTERN PetscErrorCode IGAGetNaturalVec(IGA iga,Vec *nvec);

File src/petigadm.c

   IGA            iga = DMIGACast(dm)->iga;
   PetscErrorCode ierr;
   PetscFunctionBegin;
-  ierr = IGAGlobalToLocal(iga,g,l);CHKERRQ(ierr);
+  ierr = IGAGlobalToLocal(iga,g,l,mode);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 #undef  __FUNCT__
   IGA            iga = DMIGACast(dm)->iga;
   PetscErrorCode ierr;
   PetscFunctionBegin;
-  if(0){ierr = IGAGlobalToLocal(iga,g,l);CHKERRQ(ierr);}
+  if(0){ierr = IGAGlobalToLocal(iga,g,l,mode);CHKERRQ(ierr);}
   PetscFunctionReturn(0);
 }
 #undef  __FUNCT__

File src/petigavec.c

 
 #undef  __FUNCT__
 #define __FUNCT__ "IGAGlobalToLocal"
-PetscErrorCode IGAGlobalToLocal(IGA iga,Vec gvec,Vec lvec)
+PetscErrorCode IGAGlobalToLocal(IGA iga,Vec gvec,Vec lvec,InsertMode addv)
 {
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(gvec,VEC_CLASSID,2);
   PetscValidHeaderSpecific(lvec,VEC_CLASSID,3);
   IGACheckSetUp(iga,1);
-  ierr = VecScatterBegin(iga->g2l,gvec,lvec,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);
-  ierr = VecScatterEnd  (iga->g2l,gvec,lvec,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);
+  ierr = VecScatterBegin(iga->g2l,gvec,lvec,addv,SCATTER_FORWARD);CHKERRQ(ierr);
+  ierr = VecScatterEnd  (iga->g2l,gvec,lvec,addv,SCATTER_FORWARD);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
   PetscValidPointer(array,4);
   IGACheckSetUp(iga,1);
   ierr = IGAGetLocalVec(iga,lvec);CHKERRQ(ierr);
-  ierr = IGAGlobalToLocal(iga,gvec,*lvec);CHKERRQ(ierr);
+  ierr = IGAGlobalToLocal(iga,gvec,*lvec,INSERT_VALUES);CHKERRQ(ierr);
   ierr = VecGetArrayRead(*lvec,array);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }