Lisandro Dalcin avatar Lisandro Dalcin committed 944e860

Add InsertMode flag to IGAGlobalToLocal()

Comments (0)

Files changed (3)

 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);
   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__
 
 #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);
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.