Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
* master:
  ksp/ex20.c: Add MatSetUp() and fix typo
  vec/ex18.c: Correctly fill the last entry of vector xend
  vec/ex1.c: Remove PetscFunctionBegin from main()
  • Loading branch information
jedbrown committed Feb 15, 2014
2 parents 993c0c8 + ad9a81e commit 4ee26ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/ksp/ksp/examples/tests/ex20.c
Expand Up @@ -43,6 +43,7 @@ int main(int argc,char **args)
ierr = MatCreate(PETSC_COMM_WORLD,&C);CHKERRQ(ierr);
ierr = MatSetSizes(C,PETSC_DECIDE,PETSC_DECIDE,N,N);CHKERRQ(ierr);
ierr = MatSetFromOptions(C);CHKERRQ(ierr);
ierr = MatSetUp(C);CHKERRQ(ierr);
start = rank*(M/size) + ((M%size) < rank ? (M%size) : rank);
end = start + M/size + ((M%size) > rank);

Expand Down Expand Up @@ -81,7 +82,7 @@ int main(int argc,char **args)
if (flg) {
ierr = MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,NULL,&nullsp);CHKERRQ(ierr);
ierr = KSPSetNullSpace(ksp,nullsp);CHKERRQ(ierr);
ierr = MatNullSpaceDestroy(&&nullsp);CHKERRQ(ierr);
ierr = MatNullSpaceDestroy(&nullsp);CHKERRQ(ierr);
}
ierr = KSPSolve(ksp,b,u);CHKERRQ(ierr);

Expand Down
3 changes: 0 additions & 3 deletions src/vec/vec/examples/tutorials/ex1.c
Expand Up @@ -27,8 +27,6 @@ int main(int argc,char **argv)
PetscScalar one = 1.0,two = 2.0,three = 3.0,dots[3],dot;

PetscInitialize(&argc,&argv,(char*)0,help);

PetscFunctionBegin;
ierr = PetscOptionsGetInt(NULL,"-n",&n,NULL);CHKERRQ(ierr);

/*
Expand All @@ -47,7 +45,6 @@ int main(int argc,char **argv)
With VecCreate(), VecSetSizes() and VecSetFromOptions() the option -vec_type mpi or
-vec_type shared causes the particular type of vector to be formed.
y
*/

Expand Down
3 changes: 2 additions & 1 deletion src/vec/vec/examples/tutorials/ex18.c
Expand Up @@ -51,7 +51,8 @@ int main(int argc,char **argv)
if (!rank) {
i = 0;
ierr = VecSetValues(xend,1,&i,&result,INSERT_VALUES);CHKERRQ(ierr);
} else if (rank == size) {
}
if (rank == size-1) {
i = N-1;
ierr = VecSetValues(xend,1,&i,&result,INSERT_VALUES);CHKERRQ(ierr);
}
Expand Down

0 comments on commit 4ee26ec

Please sign in to comment.