Actual source code: test1.c

slepc-3.14.2 2021-02-01
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2020, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.
  7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
  8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9: */

 11: static char help[] = "Test VecComp.\n\n";

 13: #include <slepcsys.h>

 15: int main(int argc,char **argv)
 16: {
 17:   Vec            v,w,x,y,vc,wc,xc,yc,vparent,vchild[2],vecs[2];
 18:   const Vec      *varray;
 19:   PetscMPIInt    size,rank;
 20:   PetscInt       i,n,k,Nx[2];
 21:   PetscReal      norm,normc,norm12[2],norm12c[2],vmax,vmin;
 22:   PetscScalar    dot[2],dotc[2];

 25:   SlepcInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 26:   MPI_Comm_size(PETSC_COMM_WORLD,&size);
 27:   MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
 28:   if (size > 2) SETERRQ(PETSC_COMM_WORLD,1,"This test needs one or two processes");
 29:   PetscPrintf(PET