Commits

Lisandro Dalcin committed 1798b28

Rename PETSC_NULL -> NULL

Comments (0)

Files changed (44)

demo/AdaptiveL2Projection.c

   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
 
   KSP ksp;
   ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);
 
   PetscReal errors[2];
-  ierr  = IGAFormScalar(iga,x,2,&errors[0],Error,PETSC_NULL);CHKERRQ(ierr);
+  ierr  = IGAFormScalar(iga,x,2,&errors[0],Error,NULL);CHKERRQ(ierr);
   errors[0] = PetscSqrtReal(PetscRealPart(errors[0]));
   errors[1] = PetscSqrtReal(PetscRealPart(errors[1]));
   *error = errors[0]/errors[1];
   PetscInt i,j;
   PetscInt dim = 2, p = 2, C = 1;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-p","polynomial order",       __FILE__,p,&p,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-p","polynomial order",       __FILE__,p,&p,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   // initial breaks (2x2 mesh)
   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
 
   KSP ksp;

demo/AdvectionDiffusion.c

   PetscInt  i,dim;
   PetscReal Pe = 1.0;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","AdvectionDiffusion Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-Pe","Peclet number",__FILE__,Pe,&Pe,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-Pe","Peclet number",__FILE__,Pe,&Pe,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;

demo/BoundaryIntegral.c

   PetscBool check_error = PETSC_FALSE;
   PetscBool draw = PETSC_FALSE;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","BoundaryIntegral Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt ("-dir", "Neuman BC direction",__FILE__,user.dir, &user.dir, PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt ("-side","Neuman BC side",     __FILE__,user.side,&user.side,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt ("-dir", "Neuman BC direction",__FILE__,user.dir, &user.dir, NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt ("-side","Neuman BC side",     __FILE__,user.side,&user.side,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;
     ierr = IGAGetBoundary(iga,user.dir,d,&bnd);CHKERRQ(ierr);
     ierr = IGABoundarySetValue(bnd,0,1.0);CHKERRQ(ierr);
     ierr = IGAGetBoundary(iga,user.dir,n,&bnd);CHKERRQ(ierr);
-    ierr = IGABoundarySetUserSystem(bnd,Neumann,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGABoundarySetUserSystem(bnd,Neumann,NULL);CHKERRQ(ierr);
   } else {
     IGABoundary bnd;
     PetscInt dir,side;
     for (dir=0; dir<dim; dir++) {
       for (side=0; side<2; side++) {
         ierr = IGAGetBoundary(iga,dir,side,&bnd);CHKERRQ(ierr);
-        ierr = IGABoundarySetUserSystem(bnd,Neumann0Collocation,PETSC_NULL);CHKERRQ(ierr);
+        ierr = IGABoundarySetUserSystem(bnd,Neumann0Collocation,NULL);CHKERRQ(ierr);
       }
     }
     ierr = IGAGetBoundary(iga,user.dir,d,&bnd);CHKERRQ(ierr);
-    ierr = IGABoundarySetUserSystem(bnd,DirichletCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGABoundarySetUserSystem(bnd,DirichletCollocation,NULL);CHKERRQ(ierr);
     ierr = IGAGetBoundary(iga,user.dir,n,&bnd);CHKERRQ(ierr);
-    ierr = IGABoundarySetUserSystem(bnd,NeumannCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGABoundarySetUserSystem(bnd,NeumannCollocation,NULL);CHKERRQ(ierr);
   }
   ierr = IGASetUp(iga);CHKERRQ(ierr);
 
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
   if (!iga->collocation) {
-    ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   } else {
-    ierr = IGASetUserSystem(iga,SystemCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemCollocation,NULL);CHKERRQ(ierr);
   }
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
 
   PetscBool steady = PETSC_TRUE;
   PetscReal lambda = 6.80;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","Bratu Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-lambda","Bratu parameter",__FILE__,lambda,&lambda,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-steady","Steady problem",__FILE__,steady,&steady,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-lambda","Bratu parameter",__FILE__,lambda,&lambda,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-steady","Steady problem",__FILE__,steady,&steady,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;
     ierr = SNESSetTolerances(snes,PETSC_DEFAULT,1e-5,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);
     ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-    ierr = TSSolve(ts,x,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSSolve(ts,x,NULL);CHKERRQ(ierr);
 #else
     ierr = TSSolve(ts,x);CHKERRQ(ierr);
 #endif

demo/CahnHilliard2D.c

   PetscBool monitor = PETSC_FALSE; 
   char initial[PETSC_MAX_PATH_LEN] = {0};
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","CahnHilliard2D Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-N","number of elements (along one dimension)",__FILE__,N,&N,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-p","polynomial order",__FILE__,p,&p,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsString("-ch_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-ch_output","Enable output files",__FILE__,output,&output,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-ch_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-ch_cbar","Initial average concentration",__FILE__,user.cbar,&user.cbar,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-ch_alpha","Characteristic parameter",__FILE__,user.alpha,&user.alpha,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-N","number of elements (along one dimension)",__FILE__,N,&N,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-p","polynomial order",__FILE__,p,&p,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsString("-ch_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-ch_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-ch_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-ch_cbar","Initial average concentration",__FILE__,user.cbar,&user.cbar,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-ch_alpha","Characteristic parameter",__FILE__,user.alpha,&user.alpha,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (C == PETSC_DECIDE) C = p-1;
 
 
   ierr = TSSetType(ts,TSALPHA);CHKERRQ(ierr);
   ierr = TSAlphaSetRadius(ts,0.5);CHKERRQ(ierr);
-  ierr = TSAlphaSetAdapt(ts,TSAlphaAdaptDefault,PETSC_NULL);CHKERRQ(ierr); 
+  ierr = TSAlphaSetAdapt(ts,TSAlphaAdaptDefault,NULL);CHKERRQ(ierr); 
 
   if (monitor) {
     user.iga = iga;
     PetscPrintf(PETSC_COMM_WORLD,"#Time        dt           Free Energy            Second moment          Third moment\n");
-    ierr = TSMonitorSet(ts,StatsMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,StatsMonitor,&user,NULL);CHKERRQ(ierr);
   }
   if (output) {
-    ierr = TSMonitorSet(ts,OutputMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);
   }
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(&user,iga,initial,U);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif

demo/CahnHilliard3D.c

   PetscBool monitor = PETSC_FALSE; 
   char initial[PETSC_MAX_PATH_LEN] = {0};
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","CahnHilliard3D Options","CH3D");CHKERRQ(ierr);
-  ierr = PetscOptionsString("-ch_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-ch_output","Enable output files",__FILE__,output,&output,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-ch_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-ch_cbar","Initial average concentration",__FILE__,user.cbar,&user.cbar,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-ch_alpha","Characteristic parameter",__FILE__,user.alpha,&user.alpha,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsString("-ch_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-ch_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-ch_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-ch_cbar","Initial average concentration",__FILE__,user.cbar,&user.cbar,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-ch_alpha","Characteristic parameter",__FILE__,user.alpha,&user.alpha,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;
   ierr = TSSetType(ts,TSALPHA);CHKERRQ(ierr);
   ierr = TSAlphaSetRadius(ts,0.5);CHKERRQ(ierr);
 
-  user.E = PETSC_NULL;
+  user.E = NULL;
   ierr = TSAlphaSetAdapt(ts,CHAdapt,&user);CHKERRQ(ierr); 
 
   if (monitor) {
     user.iga = iga;
     PetscPrintf(PETSC_COMM_WORLD,"#Time        dt           Free Energy            Second moment          Third moment\n");
-    ierr = TSMonitorSet(ts,StatsMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,StatsMonitor,&user,NULL);CHKERRQ(ierr);
   }
   if (output) {
-    ierr = TSMonitorSet(ts,OutputMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);
   }
 
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
   ierr = VecDuplicate(U,&user.X0);CHKERRQ(ierr);
   ierr = VecCopy(U,user.X0);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif

demo/ElasticRod.c

   user.E   = 1.0;
 
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","ElasticRod Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-density","Density",__FILE__,user.rho,&user.rho,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-Young_modulus","Young modulus",__FILE__,user.E,&user.E,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-density","Density",__FILE__,user.rho,&user.rho,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-Young_modulus","Young modulus",__FILE__,user.E,&user.E,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;

demo/HyperElasticity.c

   NeoHook = StVenant = MooneyR1 = MooneyR2 = PETSC_FALSE;
   PetscInt nsteps = 1;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","HyperElasticity Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-neohook","Use the NeoHookean constitutive model",__FILE__,NeoHook,&NeoHook,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-mooneyr1","Use the MooneyRivlin1 constitutive model",__FILE__,MooneyR1,&MooneyR1,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-mooneyr2","Use the MooneyRivlin2 constitutive model",__FILE__,MooneyR2,&MooneyR2,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-stvenant","Use the StVenant constitutive model",__FILE__,StVenant,&StVenant,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-nsteps","Number of load steps to take",__FILE__,nsteps,&nsteps,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-neohook","Use the NeoHookean constitutive model",__FILE__,NeoHook,&NeoHook,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-mooneyr1","Use the MooneyRivlin1 constitutive model",__FILE__,MooneyR1,&MooneyR1,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-mooneyr2","Use the MooneyRivlin2 constitutive model",__FILE__,MooneyR2,&MooneyR2,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-stvenant","Use the StVenant constitutive model",__FILE__,StVenant,&StVenant,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-nsteps","Number of load steps to take",__FILE__,nsteps,&nsteps,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   user.lambda = E*nu/(1.+nu)/(1.-2.*nu);
 
     // Solve step
     ierr = VecZeroEntries(U);CHKERRQ(ierr);
-    ierr = SNESSolve(snes,PETSC_NULL,U);CHKERRQ(ierr);
+    ierr = SNESSolve(snes,NULL,U);CHKERRQ(ierr);
 
     // Store total displacement
     ierr = VecAXPY(Utotal,1.0,U);CHKERRQ(ierr);
   PetscInt  choice=2;
   const char *choicelist[] = {"line", "parabola", "poly3", "poly4", "hill", "sine", 0};
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","L2 Projection 1D Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool ("-periodic", "periodicity",__FILE__,w,&w,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt  ("-N", "number of elements",__FILE__,N,&N,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt  ("-p", "polynomial order",  __FILE__,p,&p,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt  ("-C", "continuity order",  __FILE__,C,&C,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsEList("-function","1D function", __FILE__,choicelist,6,choicelist[choice],&choice,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool ("-periodic", "periodicity",__FILE__,w,&w,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt  ("-N", "number of elements",__FILE__,N,&N,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt  ("-p", "polynomial order",  __FILE__,p,&p,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt  ("-C", "continuity order",  __FILE__,C,&C,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsEList("-function","1D function", __FILE__,choicelist,6,choicelist[choice],&choice,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (C == PETSC_DECIDE) C = p-1;
   switch (choice) {
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","L2 Projection 2D Options","IGA");CHKERRQ(ierr);
   ierr = PetscOptionsBoolArray("-periodic", "periodicity",    __FILE__,w,&nw,&flg);CHKERRQ(ierr);
   if (flg && nw==0) w[nw++] = PETSC_TRUE;
-  ierr = PetscOptionsIntArray ("-N","number of elements",__FILE__,N,&nN,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray ("-p","polynomial order",  __FILE__,p,&np,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray ("-C","continuity order",  __FILE__,C,&nC,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsEList    ("-function","2D function",__FILE__,choicelist,4,choicelist[choice],&choice,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-N","number of elements",__FILE__,N,&nN,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-p","polynomial order",  __FILE__,p,&np,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-C","continuity order",  __FILE__,C,&nC,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsEList    ("-function","2D function",__FILE__,choicelist,4,choicelist[choice],&choice,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (nw == 1) w[1] = w[0];
   if (nN == 1) N[1] = N[0];

demo/L2Projection.c

   PetscInt C[3] = {-1,-1,-1};
   PetscInt n1=3, n2=3, n3=3;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","L2Projection Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,NULL);CHKERRQ(ierr);
   n1 = n2 = n3 = dim;
-  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&n1,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&n2,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&n3,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&n1,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&n2,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&n3,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (n1<3) N[2] = N[0]; if (n1<2) N[1] = N[0];
   if (n2<3) p[2] = p[0]; if (n2<2) p[1] = p[0];
   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
 
   KSP ksp;
   ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);
 
   PetscScalar error = 0;
-  ierr = IGAFormScalar(iga,x,1,&error,Error,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGAFormScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
   PetscBool print_error = PETSC_FALSE;
   ierr = PetscOptionsGetBool(0,"-print_error",&print_error,0);CHKERRQ(ierr);
   PetscBool save = PETSC_FALSE;
   PetscBool draw = PETSC_FALSE;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","Laplace Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-collocation","Enable to use collocation",__FILE__,collocation,&collocation,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-save","Save the solution to file",__FILE__,save,&save,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-collocation","Enable to use collocation",__FILE__,collocation,&collocation,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-save","Save the solution to file",__FILE__,save,&save,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   // Initialize the discretization
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   if (!iga->collocation) {
-    ierr = IGASetUserSystem(iga,SystemGalerkin,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemGalerkin,NULL);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SPD,PETSC_TRUE);CHKERRQ(ierr);
   } else {
-    ierr = IGASetUserSystem(iga,SystemCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemCollocation,NULL);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_FALSE);CHKERRQ(ierr);
   }
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   // Various post-processing options
 
   PetscScalar error = 0;
-  ierr = IGAFormScalar(iga,x,1,&error,Error,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGAFormScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
   if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %G\n",error);CHKERRQ(ierr);}

demo/LoggChallenge.c

   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
 
   PetscLogDouble ta1,ta2,ta;
   ierr = PetscGetTime(&ta1);
   ierr = IGASetUp(iga);CHKERRQ(ierr);
 
   PetscScalar error = 0;
-  ierr = IGAFormScalar(iga,x,1,&error,Error,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGAFormScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
   ierr = PetscPrintf(PETSC_COMM_WORLD,

demo/NavierStokesKorteweg2D.c

   PetscInt  N=256,p=2,C=1;
   PetscBool output=PETSC_FALSE,monitor=PETSC_TRUE;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD, "", "NSK Options", "IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-N", "number of elements along one dimension", __FILE__, N, &N, PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-p", "polynomial order", __FILE__, p, &p, PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-C", "global continuity order", __FILE__, C, &C, PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-nsk_output","Enable output files",__FILE__,output,&output,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-nsk_monitor","Monitor the free energy of the solution",__FILE__,monitor,&monitor,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-N", "number of elements along one dimension", __FILE__, N, &N, NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-p", "polynomial order", __FILE__, p, &p, NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-C", "global continuity order", __FILE__, C, &C, NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-nsk_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-nsk_monitor","Monitor the free energy of the solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   // Compute simulation parameters
   ierr = TSSetTimeStep(ts,1.0e-2);CHKERRQ(ierr);
   ierr = TSSetType(ts,TSALPHA);CHKERRQ(ierr);
   ierr = TSAlphaSetRadius(ts,0.5);CHKERRQ(ierr);
-  if (monitor) {ierr = TSMonitorSet(ts,NSKMonitor,&user,PETSC_NULL);CHKERRQ(ierr);}
-  if (output)  {ierr = TSMonitorSet(ts,OutputMonitor,&user,PETSC_NULL);CHKERRQ(ierr);}
+  if (monitor) {ierr = TSMonitorSet(ts,NSKMonitor,&user,NULL);CHKERRQ(ierr);}
+  if (output)  {ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);}
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 
   PetscReal t=0; Vec U;
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(iga,t,U,&user);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif

demo/NavierStokesVMS.c

   PetscScalar uz_xx=der2_u[2][0][0],uz_yy=der2_u[2][1][1],uz_zz=der2_u[2][2][2];
 
   PetscReal InvGradMap[3][3];
-  IGAPointFormGradMap(pnt,PETSC_NULL,&InvGradMap[0][0]);
+  IGAPointFormGradMap(pnt,NULL,&InvGradMap[0][0]);
   PetscScalar tauM,tauC;
   Tau(InvGradMap,dt,u,nu,&tauM,&tauC);
   PetscScalar ux_s,uy_s,uz_s,p_s;
 
   PetscReal v; Vec pert;
   ierr = VecDuplicate(U,&pert);CHKERRQ(ierr);
-  ierr = VecSetRandom(pert,PETSC_NULL);CHKERRQ(ierr);
-  ierr = VecMax(U,PETSC_NULL,&v);CHKERRQ(ierr);
+  ierr = VecSetRandom(pert,NULL);CHKERRQ(ierr);
+  ierr = VecMax(U,NULL,&v);CHKERRQ(ierr);
   ierr = VecAXPY(U,0.05*v,pert);CHKERRQ(ierr);
   ierr = VecStrideSet(U,3,0.0);CHKERRQ(ierr);
   ierr = VecDestroy(&pert);CHKERRQ(ierr);
   PetscBool monitor = PETSC_FALSE;
   char initial[PETSC_MAX_PATH_LEN] = {0};
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","NavierStokesVMS Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&nN,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&np,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&nC,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsString("-ns_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool  ("-ns_output","Enable output files",__FILE__,output,&output,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool  ("-ns_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&nN,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&np,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&nC,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsString("-ns_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool  ("-ns_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool  ("-ns_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (nN == 1) N[2] = N[1] = N[0]; if (nN == 2) N[2] = N[0];
   if (np == 1) p[2] = p[1] = p[0]; if (np == 2) p[2] = p[0];
   ierr = TSAlphaSetRadius(ts,0.5);CHKERRQ(ierr);
 
   if (output) {
-    ierr = TSMonitorSet(ts,OutputMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);
   }
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(&user,iga,initial,t,U);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif
   PetscBool check_error = PETSC_FALSE;
   PetscBool draw = PETSC_FALSE;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","Neumann Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-print_error","Prints the L2 error of the solution",__FILE__,print_error,&print_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-check_error","Checks the L2 error of the solution",__FILE__,check_error,&check_error,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;
   ierr = IGACreateKSP(iga,&ksp);CHKERRQ(ierr);
   ierr = KSPSetOperators(ksp,A,A,SAME_NONZERO_PATTERN);CHKERRQ(ierr);
   if (!iga->collocation) {
-    ierr = IGASetUserSystem(iga,SystemGalerkin,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemGalerkin,NULL);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SPD,PETSC_TRUE);CHKERRQ(ierr);
     ierr = KSPSetType(ksp,KSPCG);CHKERRQ(ierr);
   } else {
-    ierr = IGASetUserSystem(iga,SystemCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemCollocation,NULL);CHKERRQ(ierr);
   }
 
   {
     MPI_Comm comm;
     MatNullSpace nsp;
     ierr = IGAGetComm(iga,&comm);CHKERRQ(ierr);
-    ierr = MatNullSpaceCreate(comm,PETSC_TRUE,0,PETSC_NULL,&nsp);CHKERRQ(ierr);
+    ierr = MatNullSpaceCreate(comm,PETSC_TRUE,0,NULL,&nsp);CHKERRQ(ierr);
     ierr = KSPSetNullSpace(ksp,nsp);CHKERRQ(ierr);
     ierr = MatNullSpaceDestroy(&nsp);CHKERRQ(ierr);
   }
   }
 
   PetscScalar error;
-  ierr = IGAFormScalar(iga,x,1,&error,Error,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGAFormScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
   if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"Error=%G\n",error);CHKERRQ(ierr);}

demo/PatternFormation.c

   PetscInt p[2] = { 2, 2}, np = 2;
   PetscInt C[2] = {-1,-1}, nC = 2;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","PatternFormation Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-implicit","Treat all terms implicitly",__FILE__,user.IMPLICIT,&user.IMPLICIT,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&nN,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&np,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&nC,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-implicit","Treat all terms implicitly",__FILE__,user.IMPLICIT,&user.IMPLICIT,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-N","number of elements",     __FILE__,N,&nN,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-p","polynomial order",       __FILE__,p,&np,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray("-C","global continuity order",__FILE__,C,&nC,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (nN == 1) N[1] = N[0];
   if (np == 1) p[1] = p[0];
 
   Vec U;
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
-  ierr = VecSetRandom(U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = VecSetRandom(U,NULL);CHKERRQ(ierr);
   ierr = VecScale(U,1.);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif

demo/PhaseFieldCrystal2D.c

   PetscBool monitor = PETSC_FALSE; 
   char initial[PETSC_MAX_PATH_LEN] = {0};
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","PhaseFieldCrystal2D Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-N","number of elements (along one dimension)",__FILE__,N,&N,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-p","polynomial order",__FILE__,p,&p,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsString("-pfc_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-pfc_output","Enable output files",__FILE__,output,&output,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-pfc_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-pfc_cbar","Initial atomistic density field",__FILE__,user.cbar,&user.cbar,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-pfc_g","Physical parameter",__FILE__,user.g,&user.g,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-pfc_k","Positive number",__FILE__,user.k,&user.k,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-pfc_Eps","Physical parameter",__FILE__,user.Eps,&user.Eps,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-pfc_D","Positive number",__FILE__,user.D,&user.D,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-N","number of elements (along one dimension)",__FILE__,N,&N,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-p","polynomial order",__FILE__,p,&p,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-C","global continuity order",__FILE__,C,&C,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsString("-pfc_initial","Load initial solution from file",__FILE__,initial,initial,sizeof(initial),NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-pfc_output","Enable output files",__FILE__,output,&output,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-pfc_monitor","Compute and show statistics of solution",__FILE__,monitor,&monitor,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-pfc_cbar","Initial atomistic density field",__FILE__,user.cbar,&user.cbar,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-pfc_g","Physical parameter",__FILE__,user.g,&user.g,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-pfc_k","Positive number",__FILE__,user.k,&user.k,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-pfc_Eps","Physical parameter",__FILE__,user.Eps,&user.Eps,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-pfc_D","Positive number",__FILE__,user.D,&user.D,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (C == PETSC_DECIDE) C = p-1;
   
   if (monitor) {
     user.iga = iga;
     PetscPrintf(PETSC_COMM_WORLD,"#Time        dt           Free Energy\n");
-    ierr = TSMonitorSet(ts,StatsMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,StatsMonitor,&user,NULL);CHKERRQ(ierr);
   }
   if (output) {
-    ierr = TSMonitorSet(ts,OutputMonitor,&user,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,OutputMonitor,&user,NULL);CHKERRQ(ierr);
   }
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(&user,iga,initial,U);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif
   PetscBool draw = PETSC_FALSE;
   PetscBool save = PETSC_FALSE;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","Laplace Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-save","Save the solution to file",                        __FILE__,save,&save,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-draw","If dim <= 2, then draw the solution to the screen",__FILE__,draw,&draw,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-save","Save the solution to file",                        __FILE__,save,&save,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
   IGA iga;
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
   if (!iga->collocation) {
-    ierr = IGASetUserSystem(iga,SystemGalerkin,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemGalerkin,NULL);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SPD,PETSC_TRUE);CHKERRQ(ierr);
   } else {
-    ierr = IGASetUserSystem(iga,SystemCollocation,PETSC_NULL);CHKERRQ(ierr);
+    ierr = IGASetUserSystem(iga,SystemCollocation,NULL);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_FALSE);CHKERRQ(ierr);
   }
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   
   KSP ksp;
   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   
   KSP ksp;
   ierr = IGACreateMat(iga,&A);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
-  ierr = IGASetUserSystem(iga,System,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGASetUserSystem(iga,System,NULL);CHKERRQ(ierr);
   ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   
   KSP ksp;
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(iga,U,&user);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif

demo/ShallowWater.c

   PetscInt  p[2] = { 2, 2}, np = 2;
   PetscInt  C[2] = {-1,-1}, nC = 2;
   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","ShallowWater Options","IGA");CHKERRQ(ierr);
-  ierr = PetscOptionsBoolArray("-W","periodicity",            __FILE__,W,&nW,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray ("-N","number of elements",     __FILE__,N,&nN,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray ("-p","polynomial order",       __FILE__,p,&np,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsIntArray ("-C","global continuity order",__FILE__,C,&nC,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBoolArray("-W","periodicity",            __FILE__,W,&nW,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-N","number of elements",     __FILE__,N,&nN,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-p","polynomial order",       __FILE__,p,&np,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsIntArray ("-C","global continuity order",__FILE__,C,&nC,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (nW == 1) W[1] = W[0];
   if (nN == 1) N[1] = N[0];
   ierr = IGACreateVec(iga,&U);CHKERRQ(ierr);
   ierr = FormInitialCondition(&user,iga,t,U);CHKERRQ(ierr);
 #if PETSC_VERSION_LE(3,3,0)
-  ierr = TSSolve(ts,U,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,U,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,U);CHKERRQ(ierr);
 #endif
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidPointer(_iga,2);
-  *_iga = PETSC_NULL;
+  *_iga = NULL;
 #ifndef PETSC_USE_DYNAMIC_LIBRARIES
   ierr = IGAInitializePackage();CHKERRQ(ierr);
 #endif
   *_iga = iga;
 
   ierr = PetscNew(struct _IGAUserOps,&iga->userops);CHKERRQ(ierr);
-  iga->vectype = PETSC_NULL;
-  iga->mattype = PETSC_NULL;
+  iga->vectype = NULL;
+  iga->mattype = NULL;
 
   iga->dim = -1;
   iga->dof = -1;
       ierr = IGARead(iga,filename);CHKERRQ(ierr);
     } else { /* set axis details */
       ierr = PetscOptionsIntArray ("-iga_elements",  "Elements",  "IGAAxisInitUniform",elems,(ne=dim,&ne),&flg);CHKERRQ(ierr);
-      ierr = PetscOptionsIntArray ("-iga_degree",    "Degree",    "IGAAxisSetDegree",  degrs,(nd=dim,&nd),PETSC_NULL);CHKERRQ(ierr);
-      ierr = PetscOptionsIntArray ("-iga_continuity","Continuity","IGAAxisInitUniform",conts,(nc=dim,&nc),PETSC_NULL);CHKERRQ(ierr);
-      ierr = PetscOptionsRealArray("-iga_limits",    "Limits",    "IGAAxisInitUniform",&ulims[0][0],(nl=2*dim,&nl),PETSC_NULL);CHKERRQ(ierr);
+      ierr = PetscOptionsIntArray ("-iga_degree",    "Degree",    "IGAAxisSetDegree",  degrs,(nd=dim,&nd),NULL);CHKERRQ(ierr);
+      ierr = PetscOptionsIntArray ("-iga_continuity","Continuity","IGAAxisInitUniform",conts,(nc=dim,&nc),NULL);CHKERRQ(ierr);
+      ierr = PetscOptionsRealArray("-iga_limits",    "Limits",    "IGAAxisInitUniform",&ulims[0][0],(nl=2*dim,&nl),NULL);CHKERRQ(ierr);
       for (nl/=2, i=0; i<dim; i++) {
         IGAAxis axis = iga->axis[i];
         PetscBool  w = axis->periodic;
     if (flg) {ierr = IGASetMatType(iga,mtype);CHKERRQ(ierr);}
 
     /* View options, handled in IGASetUp() */
-    ierr = PetscOptionsName("-iga_view",       "Information on IGA context",      "IGAView",PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsName("-iga_view_info",  "Output more detailed information","IGAView",PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsName("-iga_view_detail","Output more detailed information","IGAView",PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsName("-iga_view_binary","Save to file in binary format",   "IGAView",PETSC_NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsName("-iga_view",       "Information on IGA context",      "IGAView",NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsName("-iga_view_info",  "Output more detailed information","IGAView",NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsName("-iga_view_detail","Output more detailed information","IGAView",NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsName("-iga_view_binary","Save to file in binary format",   "IGAView",NULL);CHKERRQ(ierr);
 
     ierr = PetscObjectProcessOptionsHandlers((PetscObject)iga);CHKERRQ(ierr);
     ierr = PetscOptionsEnd();CHKERRQ(ierr);
   PetscInt         procs[3]   = {-1,-1,-1};
   PetscInt         sizes[3]   = { 1, 1, 1};
   PetscInt         width[3]   = { 1, 1, 1};
-  PetscInt         *ranges[3] = {PETSC_NULL, PETSC_NULL, PETSC_NULL};
+  PetscInt         *ranges[3] = {NULL, NULL, NULL};
   DMDABoundaryType btype[3]   = {DMDA_BOUNDARY_NONE,DMDA_BOUNDARY_NONE,DMDA_BOUNDARY_NONE};
   DMDAStencilType  stype      = stencil_box ? DMDA_STENCIL_BOX : DMDA_STENCIL_STAR;
   PetscInt         swidth     = stencil_width;
   PetscValidPointer(dm,3);
   IGACheckSetUp(iga,1);
   ierr = IGACreateDM(iga,bs,iga->elem_sizes,iga->elem_width,
-                     PETSC_NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
+                     NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
   PetscValidPointer(dm,3);
   IGACheckSetUp(iga,1);
   ierr = IGACreateDM(iga,bs,iga->geom_sizes,iga->geom_lwidth,
-                     PETSC_NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
+                     NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
   PetscValidPointer(dm,3);
   IGACheckSetUp(iga,1);
   ierr = IGACreateDM(iga,bs,iga->node_sizes,iga->node_lwidth,
-                     PETSC_NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
+                     NULL,PETSC_TRUE,0,dm);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
 
   ierr = PetscObjectOptionsBegin((PetscObject)iga);CHKERRQ(ierr);
   ierr = PetscOptionsString("-iga_view",        "Information on IGA context",      "IGAView",filename1,filename1,PETSC_MAX_PATH_LEN,&flg1);CHKERRQ(ierr);
-  ierr = PetscOptionsBool(  "-iga_view_info",   "Output more detailed information","IGAView",info,&info,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsBool(  "-iga_view_detail", "Output more detailed information","IGAView",info,&info,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool(  "-iga_view_info",   "Output more detailed information","IGAView",info,&info,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool(  "-iga_view_detail", "Output more detailed information","IGAView",info,&info,NULL);CHKERRQ(ierr);
   ierr = PetscOptionsString("-iga_view_binary", "Save to file in binary format",   "IGAView",filename2,filename2,PETSC_MAX_PATH_LEN,&flg2);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
 
    Input Parameters:
 +  iga - the IGA context
 .  System - the function which evaluates a(w,u) and L(w)
--  ctx - user-defined context for evaluation routine (may be PETSC_NULL)
+-  ctx - user-defined context for evaluation routine (may be NULL)
 
    Details of System:
 $  PetscErrorCode System(IGAPoint p,PetscScalar *K,PetscScalar *F,void *ctx);
    Input Parameter:
 +  iga - the IGA context
 .  IFunction - the function evaluation routine
--  IFunCtx - user-defined context for private data for the function evaluation routine (may be PETSC_NULL)
+-  IFunCtx - user-defined context for private data for the function evaluation routine (may be NULL)
 
    Details of IFunction:
 $  PetscErrorCode IFunction(IGAPoint p,PetscReal dt,
    Input Parameter:
 +  iga - the IGA context
 .  IJacobian - the Jacobian evaluation routine
--  IJacCtx - user-defined context for private data for the Jacobian evaluation routine (may be PETSC_NULL)
+-  IJacCtx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)
 
    Details of IJacobian:
 $  PetscErrorCode IJacobian(IGAPoint p,PetscReal dt,
    Input Parameter:
 +  iga - the IGA context
 .  IFunction - the function evaluation routine
--  IFunCtx - user-defined context for private data for the function evaluation routine (may be PETSC_NULL)
+-  IFunCtx - user-defined context for private data for the function evaluation routine (may be NULL)
 
    Details of IFunction:
 $  PetscErrorCode IFunction(IGAPoint p,PetscReal dt,
    Input Parameter:
 +  iga       - the IGA context
 .  IJacobian - the Jacobian evaluation routine
--  IJacCtx   - user-defined context for private data for the Jacobian evaluation routine (may be PETSC_NULL)
+-  IJacCtx   - user-defined context for private data for the Jacobian evaluation routine (may be NULL)
 
    Details of IJacobian:
 $  PetscErrorCode IJacobian(IGAPoint p,PetscReal dt,
    Input Parameter:
 +  iga - the IGA context
 .  IEFunction - the function evaluation routine
--  IEFunCtx - user-defined context for private data for the function evaluation routine (may be PETSC_NULL)
+-  IEFunCtx - user-defined context for private data for the function evaluation routine (may be NULL)
 
    Details of IEFunction:
 $  PetscErrorCode IEFunction(IGAPoint p,PetscReal dt,
    Input Parameter:
 +  iga - the IGA context
 .  IEJacobian - the Jacobian evaluation routine
--  IEJacCtx - user-defined context for private data for the Jacobian evaluation routine (may be PETSC_NULL)
+-  IEJacCtx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)
 
    Details of IEJacobian:
 $  PetscErrorCode IEJacobian(IGAPoint p,PetscReal dt,

src/petigabound.c

    Input Parameters:
 +  boundary - the IGABoundary context
 .  System - the function which evaluates a(w,u) and L(w)
--  ctx - user-defined context for evaluation routine (may be PETSC_NULL)
+-  ctx - user-defined context for evaluation routine (may be NULL)
 
    Details of System:
 $  PetscErrorCode System(IGAPoint p,PetscScalar *K,PetscScalar *F,void *ctx);
   PetscValidPointer(*element,2);
   if (PetscUnlikely((*element)->index != -1)) {
     (*element)->index = -1;
-    *element = PETSC_NULL;
+    *element = NULL;
     PetscFunctionReturn(PETSC_ERR_PLIB);
   }
-  *element = PETSC_NULL;
+  *element = NULL;
   PetscFunctionReturn(0);
 }
 
   point->geometry = element->geometryX;
   point->property = element->propertyA;
   if (!element->geometry)
-    point->geometry = PETSC_NULL;
+    point->geometry = NULL;
   if (!element->property)
-    point->property = PETSC_NULL;
+    point->property = NULL;
 
   point->weight   = element->weight;
   point->detJac   = element->detJac;
     (*point)->index = -1;
     PetscFunctionReturn(PETSC_ERR_PLIB);
   }
-  *point = PETSC_NULL;
+  *point = NULL;
   /* XXX */
   if (PetscLikely(!element->collocation)) PetscFunctionReturn(0);
   if (PetscLikely(!element->atboundary))  PetscFunctionReturn(0);
 {
   IGABoundary b = element->parent->boundary[dir][side];
   PetscInt e = side ? element->sizes[dir]-1 : 0;
-  return (element->ID[dir] == e) ? b : PETSC_NULL;
+  return (element->ID[dir] == e) ? b : NULL;
 }
 
 PETSC_STATIC_INLINE
   if (!g->aob) {
     PetscInt napp,*iapp;
     ierr = IGA_Grid_LocalIndices(g,1,&napp,&iapp);CHKERRQ(ierr);
-    ierr = AOCreateMemoryScalable(g->comm,napp,iapp,PETSC_NULL,&g->aob);CHKERRQ(ierr);
+    ierr = AOCreateMemoryScalable(g->comm,napp,iapp,NULL,&g->aob);CHKERRQ(ierr);
     ierr = PetscFree(iapp);CHKERRQ(ierr);
   }
   *aob = g->aob;
   if (!g->ao) {
     PetscInt napp,*iapp;
     ierr = IGA_Grid_LocalIndices(g,g->dof,&napp,&iapp);CHKERRQ(ierr);
-    ierr = AOCreateMemoryScalable(g->comm,napp,iapp,PETSC_NULL,&g->ao);CHKERRQ(ierr);
+    ierr = AOCreateMemoryScalable(g->comm,napp,iapp,NULL,&g->ao);CHKERRQ(ierr);
     ierr = PetscFree(iapp);CHKERRQ(ierr);
   }
   *ao = g->ao;
     ierr = ISLocalToGlobalMappingGetSize(lgmap,&nghost);CHKERRQ(ierr);
     ierr = ISLocalToGlobalMappingGetIndices(lgmap,&ighost);CHKERRQ(ierr);
     ierr = ISCreateGeneral(g->comm,nghost,ighost,PETSC_USE_POINTER,&isghost);CHKERRQ(ierr);
-    ierr = VecScatterCreate(gvec,isghost,lvec,PETSC_NULL,&g->g2l);CHKERRQ(ierr);
+    ierr = VecScatterCreate(gvec,isghost,lvec,NULL,&g->g2l);CHKERRQ(ierr);
     ierr = ISDestroy(&isghost);CHKERRQ(ierr);
     ierr = ISLocalToGlobalMappingRestoreIndices(lgmap,&ighost);CHKERRQ(ierr);
   }
     ierr = IGA_Grid_GetVecGlobal(g,VECSTANDARD,&gvec);CHKERRQ(ierr);
     ierr = IGA_Grid_GetVecLocal(g,VECSTANDARD,&lvec);CHKERRQ(ierr);
     ierr = VecGetLocalSize(gvec,&nlocal);CHKERRQ(ierr);
-    ierr = VecGetOwnershipRange(gvec,&start,PETSC_NULL);CHKERRQ(ierr);
+    ierr = VecGetOwnershipRange(gvec,&start,NULL);CHKERRQ(ierr);
     ierr = PetscMalloc(nlocal*sizeof(PetscInt),&ilocal);CHKERRQ(ierr);
     for (k=kgstart; k<kgend; k++)
       for (j=jgstart; j<jgend; j++)
     ierr = IGA_Grid_GetVecGlobal (g,VECSTANDARD,&gvec);CHKERRQ(ierr);
     ierr = IGA_Grid_GetVecNatural(g,VECSTANDARD,&nvec);CHKERRQ(ierr);
     ierr = IGA_Grid_LocalIndices(g,g->dof,&nlocal,&inatural);CHKERRQ(ierr);
-    ierr = VecGetOwnershipRange(gvec,&start,PETSC_NULL);CHKERRQ(ierr);
+    ierr = VecGetOwnershipRange(gvec,&start,NULL);CHKERRQ(ierr);
     ierr = ISCreateStride(g->comm,nlocal,start,1,&isglobal);CHKERRQ(ierr);
     ierr = ISCreateGeneral(g->comm,nlocal,inatural,PETSC_OWN_POINTER,&isnatural);CHKERRQ(ierr);
     ierr = VecScatterCreate(gvec,isglobal,nvec,isnatural,&g->g2n);CHKERRQ(ierr);
     /* */
     PetscInt c,i,j,k,pos = 0,bs = g->dof;
     ierr = VecGetLocalSize(gvec,&nlocal);CHKERRQ(ierr);
-    ierr = VecGetOwnershipRange(gvec,&gstart,PETSC_NULL);CHKERRQ(ierr);
+    ierr = VecGetOwnershipRange(gvec,&gstart,NULL);CHKERRQ(ierr);
     ierr = PetscMalloc(nlocal*sizeof(PetscInt),&inatural);CHKERRQ(ierr);
     for (k=klstart; k<klend; k++)
       for (j=jlstart; j<jlend; j++)
   /* global -> local */
   ierr = VecScatterBegin(g2l,gvec,lvec,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);
   ierr = VecScatterEnd  (g2l,gvec,lvec,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);
-  ierr = VecStrideMin(gvec,nsd,PETSC_NULL,&min_w);CHKERRQ(ierr);
-  ierr = VecStrideMax(gvec,nsd,PETSC_NULL,&max_w);CHKERRQ(ierr);
+  ierr = VecStrideMin(gvec,nsd,NULL,&min_w);CHKERRQ(ierr);
+  ierr = VecStrideMax(gvec,nsd,NULL,&max_w);CHKERRQ(ierr);
 
   iga->rational = ((max_w-min_w)>tol_w) ? PETSC_TRUE : PETSC_FALSE;
   ierr = PetscFree(iga->geometryX);CHKERRQ(ierr);
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(ksp,KSP_CLASSID,1);
-  /*ierr = PetscObjectAddOptionsHandler((PetscObject)ksp,IGA_OptionsHandler_KSP,OptHdlDel,PETSC_NULL);CHKERRQ(ierr);*/
+  /*ierr = PetscObjectAddOptionsHandler((PetscObject)ksp,IGA_OptionsHandler_KSP,OptHdlDel,NULL);CHKERRQ(ierr);*/
   ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr);
   ierr = IGASetOptionsHandlerPC(pc);CHKERRQ(ierr);
   PetscFunctionReturn(0);
   }
 
   ierr = PetscObjectGetComm((PetscObject)A,&comm);CHKERRQ(ierr);
-  ierr = MatGetLocalSize(A,&n,PETSC_NULL);CHKERRQ(ierr);
-  ierr = MatGetSize(A,PETSC_NULL,&N);CHKERRQ(ierr);
+  ierr = MatGetLocalSize(A,&n,NULL);CHKERRQ(ierr);
+  ierr = MatGetSize(A,NULL,&N);CHKERRQ(ierr);
   n /= bs; N /= bs;
 
   maxnnz = 1;
   PetscValidHeaderSpecific(pc,PC_CLASSID,2);
   IGACheckSetUp(iga,1);
 
-  ierr = PCGetOperators(pc,PETSC_NULL,&mat,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PCGetOperators(pc,NULL,&mat,NULL);CHKERRQ(ierr);
   ierr = PetscObjectQueryFunction((PetscObject)mat,"MatISGetLocalMat_C",&f);CHKERRQ(ierr);
   if (!f) PetscFunctionReturn(0);
   ierr = PetscObjectQueryFunction((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C",&f);CHKERRQ(ierr);
   PetscFunctionBegin;
   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
   if (PetscOptionsPublishCount != 1) PetscFunctionReturn(0);
-  ierr = PCGetOperators(pc,PETSC_NULL,&mat,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PCGetOperators(pc,NULL,&mat,NULL);CHKERRQ(ierr);
   if (!mat) PetscFunctionReturn(0);
   PetscValidHeaderSpecific(mat,MAT_CLASSID,1);
   ierr = PetscObjectQuery((PetscObject)mat,"IGA",(PetscObject*)&iga);CHKERRQ(ierr);
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
-  ierr = PetscObjectAddOptionsHandler((PetscObject)pc,IGA_OptionsHandler_PC,OptHdlDel,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscObjectAddOptionsHandler((PetscObject)pc,IGA_OptionsHandler_PC,OptHdlDel,NULL);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
   bbb->overlap[0] = PETSC_DECIDE;
   bbb->overlap[1] = PETSC_DECIDE;
   bbb->overlap[2] = PETSC_DECIDE;
-  bbb->mat        = PETSC_NULL;
+  bbb->mat        = NULL;
 
   pc->ops->setup               = PCSetUp_BBB;
   pc->ops->reset               = PCReset_BBB;
           ierr = MatGetSize(A,&M,&N);CHKERRQ(ierr);
           ierr = MatGetLocalSize(A,&m,&n);CHKERRQ(ierr);
           ierr = MatGetBlockSize(A,&bs);CHKERRQ(ierr);
-          ierr = MatGetOwnershipRangeColumn(A,&cstart,PETSC_NULL);CHKERRQ(ierr);
+          ierr = MatGetOwnershipRangeColumn(A,&cstart,NULL);CHKERRQ(ierr);
           if (baij || sbaij) cstart /= bs;
 
           ierr = MatCreate(comm,&mat);CHKERRQ(ierr);
 
           ierr = PetscMalloc1(ia[na],PetscInt,&newja);CHKERRQ(ierr);
           for (j=0; j<ia[na]; j++) newja[j] = ja[j] + cstart;
-          if (aij)   {ierr = MatMPIAIJSetPreallocationCSR  (mat,   ia,newja,PETSC_NULL);CHKERRQ(ierr);}
-          if (baij)  {ierr = MatMPIBAIJSetPreallocationCSR (mat,bs,ia,newja,PETSC_NULL);CHKERRQ(ierr);}
-          if (sbaij) {ierr = MatMPISBAIJSetPreallocationCSR(mat,bs,ia,newja,PETSC_NULL);CHKERRQ(ierr);}
+          if (aij)   {ierr = MatMPIAIJSetPreallocationCSR  (mat,   ia,newja,NULL);CHKERRQ(ierr);}
+          if (baij)  {ierr = MatMPIBAIJSetPreallocationCSR (mat,bs,ia,newja,NULL);CHKERRQ(ierr);}
+          if (sbaij) {ierr = MatMPISBAIJSetPreallocationCSR(mat,bs,ia,newja,NULL);CHKERRQ(ierr);}
           ierr = PetscFree(newja);CHKERRQ(ierr);
           #if PETSC_VERSION_(3,2,0)
           ierr = MatSetBlockSize(mat,bs);CHKERRQ(ierr);
     ISLocalToGlobalMapping map;
 
     ierr = IGAGetElement(iga,&element);CHKERRQ(ierr);
-    ierr = IGAElementGetSizes(element,PETSC_NULL,&nen,&dof);CHKERRQ(ierr);
+    ierr = IGAElementGetSizes(element,NULL,&nen,&dof);CHKERRQ(ierr);
 
     if (dof == 1) {
-      ierr = MatGetLocalToGlobalMapping(A,&map,PETSC_NULL);CHKERRQ(ierr);
+      ierr = MatGetLocalToGlobalMapping(A,&map,NULL);CHKERRQ(ierr);
     } else {
-      ierr = MatGetLocalToGlobalMappingBlock(A,&map,PETSC_NULL);CHKERRQ(ierr);
+      ierr = MatGetLocalToGlobalMappingBlock(A,&map,NULL);CHKERRQ(ierr);
     }
     ierr = ISLocalToGlobalMappingGetIndices(map,&ltogmap);CHKERRQ(ierr);
     ierr = MatGetOwnershipRange(A,&start,&end);CHKERRQ(ierr);

src/petigapoint.c

   point->geometry = element->geometryX;
   point->property = element->propertyA;
   if (!element->geometry)
-    point->geometry = PETSC_NULL;
+    point->geometry = NULL;
   if (!element->property)
-    point->property = PETSC_NULL;
+    point->property = NULL;
 
   point->weight   = element->weight;
   point->detJac   = element->detJac;
 .  vecU - the vector to be used in computing the scalars
 .  n - the number of scalars being computed
 .  Scalar - the function which represents the linear functional
--  ctx - user-defined context for evaluation routine (may be PETSC_NULL)
+-  ctx - user-defined context for evaluation routine (may be NULL)
 
    Output Parameter:
 .  S - an array [0:n-1] of scalars produced by Scalar
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
-  /*ierr = PetscObjectAddOptionsHandler((PetscObject)snes,IGA_OptionsHandler_SNES,OptHdlDel,PETSC_NULL);CHKERRQ(ierr);*/
+  /*ierr = PetscObjectAddOptionsHandler((PetscObject)snes,IGA_OptionsHandler_SNES,OptHdlDel,NULL);CHKERRQ(ierr);*/
   ierr = SNESGetKSP(snes,&ksp);CHKERRQ(ierr);
   ierr = IGASetOptionsHandlerKSP(ksp);CHKERRQ(ierr);
   PetscFunctionReturn(0);
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(ts,TS_CLASSID,1);
-  /*ierr = PetscObjectAddOptionsHandler((PetscObject)ts,IGA_OptionsHandler_TS,OptHdlDel,PETSC_NULL);CHKERRQ(ierr);*/
+  /*ierr = PetscObjectAddOptionsHandler((PetscObject)ts,IGA_OptionsHandler_TS,OptHdlDel,NULL);CHKERRQ(ierr);*/
   ierr = TSGetSNES(ts,&snes);CHKERRQ(ierr);
   ierr = IGASetOptionsHandlerSNES(snes);CHKERRQ(ierr);
   PetscFunctionReturn(0);
   IGACheckSetUp(iga,1);
   if (iga->nwork > 0) {
     *lvec = iga->vwork[--iga->nwork];
-    iga->vwork[iga->nwork] = PETSC_NULL;
+    iga->vwork[iga->nwork] = NULL;
   } else {
     ierr = IGACreateLocalVec(iga,lvec);CHKERRQ(ierr);
   }

src/snesfdcolor.c

 #define __FUNCT__ "SNESSetUpFDColoring"
 PetscErrorCode SNESSetUpFDColoring(SNES snes)
 {
-  const char*    prefix = PETSC_NULL;
-  Vec            f = PETSC_NULL;
-  PetscErrorCode (*fun)(SNES,Vec,Vec,void*) = PETSC_NULL;
-  void*          funP = PETSC_NULL;
-  Mat            A = PETSC_NULL, B = PETSC_NULL;
-  PetscErrorCode (*jac)(SNES,Vec,Mat*,Mat*,MatStructure*,void*) = PETSC_NULL;
-  void*          jacP = PETSC_NULL;
-  ISColoring     iscoloring = PETSC_NULL;
-  MatFDColoring  fdcoloring = PETSC_NULL;
+  const char*    prefix = NULL;
+  Vec            f = NULL;
+  PetscErrorCode (*fun)(SNES,Vec,Vec,void*) = NULL;
+  void*          funP = NULL;
+  Mat            A = NULL, B = NULL;
+  PetscErrorCode (*jac)(SNES,Vec,Mat*,Mat*,MatStructure*,void*) = NULL;
+  void*          jacP = NULL;
+  ISColoring     iscoloring = NULL;
+  MatFDColoring  fdcoloring = NULL;
   PetscErrorCode ierr;
   PetscFunctionBegin;
   PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
   PetscBool        opt;
   PetscErrorCode   ierr;
   PetscFunctionBegin;
-  ierr = PetscOptionsBool("-snes_fd_color","Use colored finite differences to compute Jacobian","SNESSetUpFDColoring",fdc,&fdc,PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-snes_fd_color","Use colored finite differences to compute Jacobian","SNESSetUpFDColoring",fdc,&fdc,NULL);CHKERRQ(ierr);
   if (PetscOptionsPublishCount != 1) PetscFunctionReturn(0);
   opt = fdc; fdc = PETSC_FALSE;
   if (opt) {ierr = SNESSetUpFDColoring(snes);CHKERRQ(ierr);}
     ierr = TSPreStage(ts,th->stage_time);CHKERRQ(ierr);
     /* nonlinear solve R(X,V,A) = 0 */
     ierr = VecCopy(th->X0,th->X1);CHKERRQ(ierr);
-    ierr = SNESSolve(ts->snes,PETSC_NULL,th->X1);CHKERRQ(ierr);
+    ierr = SNESSolve(ts->snes,NULL,th->X1);CHKERRQ(ierr);
     ierr = th->StageVecs(ts,th->X1);CHKERRQ(ierr);
     /* nonlinear solve convergence */
     ierr = SNESGetConvergedReason(ts->snes,&snesreason);CHKERRQ(ierr);
   ierr = TSReset_Alpha2(ts);CHKERRQ(ierr);
   ierr = PetscFree(ts->data);CHKERRQ(ierr);
   /* */
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetIFunction2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetIJacobian2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSComputeIFunction2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSComputeIJacobian2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetSolution2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSGetSolution2_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSolve2_C",PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetIFunction2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetIJacobian2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSComputeIFunction2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSComputeIJacobian2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSetSolution2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSGetSolution2_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSSolve2_C",NULL);CHKERRQ(ierr);
   /* */
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2SetRadius_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2SetParams_C",PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2GetParams_C",PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2SetRadius_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2SetParams_C",NULL);CHKERRQ(ierr);
+  ierr = PetscObjectComposeFunction((PetscObject)ts,"TSAlpha2GetParams_C",NULL);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
     PetscReal radius = 1.0;
     ierr = PetscOptionsReal("-ts_alpha_radius", "spectral radius (high-frequency dissipation)","TSAlpha2SetRadius",radius,&radius,&flg);CHKERRQ(ierr);
     if (flg) {ierr = TSAlpha2SetRadius(ts,radius);CHKERRQ(ierr);}
-    ierr = PetscOptionsReal("-ts_alpha_alpha_m","algoritmic parameter alpha_m","TSAlpha2SetParams",th->Alpha_m,&th->Alpha_m,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsReal("-ts_alpha_alpha_f","algoritmic parameter alpha_f","TSAlpha2SetParams",th->Alpha_f,&th->Alpha_f,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsReal("-ts_alpha_gamma",  "algoritmic parameter gamma",  "TSAlpha2SetParams",th->Gamma,  &th->Gamma,  PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsReal("-ts_alpha_beta",   "algoritmic parameter beta",   "TSAlpha2SetParams",th->Beta,   &th->Beta,   PETSC_NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsReal("-ts_alpha_alpha_m","algoritmic parameter alpha_m","TSAlpha2SetParams",th->Alpha_m,&th->Alpha_m,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsReal("-ts_alpha_alpha_f","algoritmic parameter alpha_f","TSAlpha2SetParams",th->Alpha_f,&th->Alpha_f,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsReal("-ts_alpha_gamma",  "algoritmic parameter gamma",  "TSAlpha2SetParams",th->Gamma,  &th->Gamma,  NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsReal("-ts_alpha_beta",   "algoritmic parameter beta",   "TSAlpha2SetParams",th->Beta,   &th->Beta,   NULL);CHKERRQ(ierr);
     ierr = TSAlpha2SetParams(ts,th->Alpha_m,th->Alpha_f,th->Gamma,th->Beta);CHKERRQ(ierr);
   }
   ierr = PetscOptionsTail();CHKERRQ(ierr);
   TS_Alpha2      *th = (TS_Alpha2*)ts->data;
   PetscErrorCode ierr;
   PetscFunctionBegin;
-  ierr = TSSetIFunction(ts,F,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSetIFunction(ts,F,NULL,NULL);CHKERRQ(ierr);
   if (f)   th->Function = f;
   if (ctx) th->FunCtx   = ctx;
   PetscFunctionReturn(0);
   TS_Alpha2      *th = (TS_Alpha2*)ts->data;
   PetscErrorCode ierr;
   PetscFunctionBegin;
-  ierr = TSSetIJacobian(ts,J,P,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSetIJacobian(ts,J,P,NULL,NULL);CHKERRQ(ierr);
   if (j)   th->Jacobian = j;
   if (ctx) th->JacCtx   = ctx;
   PetscFunctionReturn(0);
   PetscFunctionBegin;
   ierr = TSSetSolution2(ts,X,V);CHKERRQ(ierr);
 #if PETSC_VERSION_(3,3,0) || PETSC_VERSION_(3,2,0)
-  ierr = TSSolve(ts,X,PETSC_NULL);CHKERRQ(ierr);
+  ierr = TSSolve(ts,X,NULL);CHKERRQ(ierr);
 #else
   ierr = TSSolve(ts,X);CHKERRQ(ierr);
 #endif
 
    Input Parameters:
 +  ts  - the TS context obtained from TSCreate()
-.  F   - vector to hold the residual (or PETSC_NULL to have it created internally)
+.  F   - vector to hold the residual (or NULL to have it created internally)
 .  fun - the function evaluation routine
--  ctx - user-defined context for private data for the function evaluation routine (may be PETSC_NULL)
+-  ctx - user-defined context for private data for the function evaluation routine (may be NULL)
 
    Calling sequence of fun:
 $  fun(TS ts,PetscReal t,Vec U,Vec U_t,Vec U_tt,Vec F,ctx);
 .  U_t  - time derivative of state vector
 .  U_tt - second time derivative of state vector
 .  F    - function vector
--  ctx  - [optional] user-defined context for matrix evaluation routine (may be PETSC_NULL)
+-  ctx  - [optional] user-defined context for matrix evaluation routine (may be NULL)
 
    Level: beginner
 
 .  J   - Jacobian matrix
 .  P   - preconditioning matrix for J (may be same as J)
 .  jac - the Jacobian evaluation routine
--  ctx - user-defined context for private data for the Jacobian evaluation routine (may be PETSC_NULL)
+-  ctx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)
 
    Calling sequence of jac:
 $  jac(TS ts,PetscReal t,Vec U,Vec U_t,Vec U_tt,PetscReal v,PetscReal a,Mat *J,Mat *P,MatStructure *m,void *ctx);
   PetscInt nen,dim,i;
   IGAPointGetSizes(p,0,&nen,0);
   IGAPointGetDims(p,&dim,0,0);
-  
+
   PetscInt Nb[3] = {0,0,0};
   Nb[0] = p->parent->parent->axis[0]->nnp;
   Nb[1] = p->parent->parent->axis[1]->nnp;
   Nb[2] = p->parent->parent->axis[2]->nnp;
-  
+
   const PetscReal *N0,(*N2)[dim][dim];
   IGAPointGetBasisFuns(p,0,(const PetscReal**)&N0);
   IGAPointGetBasisFuns(p,2,(const PetscReal**)&N2);
-  
+
   PetscInt a;
   PetscBool Dirichlet=PETSC_FALSE;
   for (i=0; i<dim; i++) if (p->parent->ID[i] == 0 || p->parent->ID[i] == Nb[i]-1) Dirichlet=PETSC_TRUE;
   }else{
     for (a=0; a<nen; a++){
       K[a] = N0[a];
-      for (i=0; i<dim; i++) K[a] += -N2[a][i][i]; 
+      for (i=0; i<dim; i++) K[a] += -N2[a][i][i];
     }
     F[0] = (1.+dim*omega2);
     for (i=0; i<dim; i++) F[0] *= sin(omega*p->point[i]);
   ierr = IGASetUp(iga);CHKERRQ(ierr);
 
   // Set boundary conditions
-  PetscInt  dim,i; 
+  PetscInt  dim,i;
   ierr = IGAGetDim(iga,&dim);CHKERRQ(ierr);
   if(!iga->collocation){
     for (i=0; i<dim; i++) {
       ierr = IGABoundarySetValue(bnd,0,0.0);CHKERRQ(ierr);
     }
   }
-  
+
   // Assemble
 
   Mat A;
   ierr = IGACreateVec(iga,&x);CHKERRQ(ierr);
   ierr = IGACreateVec(iga,&b);CHKERRQ(ierr);
   if (iga->collocation){
-    ierr = IGASetUserSystem(iga,Collocation1,PETSC_NULL);CHKERRQ(ierr); 
+    ierr = IGASetUserSystem(iga,Collocation1,NULL);CHKERRQ(ierr);
     ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
   }else{
-    ierr = IGASetUserSystem(iga,Galerkin1,PETSC_NULL);CHKERRQ(ierr); 
+    ierr = IGASetUserSystem(iga,Galerkin1,NULL);CHKERRQ(ierr);
     ierr = IGAComputeSystem(iga,A,b);CHKERRQ(ierr);
     ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr);
   }
 
   iga->collocation = PETSC_FALSE;
   PetscScalar error[2] = {0,0};
-  ierr = IGAFormScalar(iga,x,2,&error[0],ErrorLaplace,PETSC_NULL);CHKERRQ(ierr);
+  ierr = IGAFormScalar(iga,x,2,&error[0],ErrorLaplace,NULL);CHKERRQ(ierr);
   error[0] = PetscSqrtReal(PetscRealPart(error[0]));
   ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %.16e\n",error[0]);CHKERRQ(ierr);
 

test/IGAInputOutput.c

     PetscInt  C[3] = {-1,-1,-1};
     PetscInt  n0=3, n1=3, n2=3, n3=3;
     ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","InputOutput Options","IGA");CHKERRQ(ierr);
-    ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsInt("-dof","dofs/node",__FILE__,dof,&dof,PETSC_NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsInt("-dim","dimension",__FILE__,dim,&dim,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsInt("-dof","dofs/node",__FILE__,dof,&dof,NULL);CHKERRQ(ierr);
     n0 = n1 = n2 = n3 = dim;
-    ierr = PetscOptionsBoolArray("-periodic","periodicity",     __FILE__,b,&n0,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsIntArray ("-N","number of elements",     __FILE__,N,&n1,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsIntArray ("-p","polynomial order",       __FILE__,p,&n2,PETSC_NULL);CHKERRQ(ierr);
-    ierr = PetscOptionsIntArray ("-C","global continuity order",__FILE__,C,&n3,PETSC_NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsBoolArray("-periodic","periodicity",     __FILE__,b,&n0,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsIntArray ("-N","number of elements",     __FILE__,N,&n1,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsIntArray ("-p","polynomial order",       __FILE__,p,&n2,NULL);CHKERRQ(ierr);
+    ierr = PetscOptionsIntArray ("-C","global continuity order",__FILE__,C,&n3,NULL);CHKERRQ(ierr);
     ierr = PetscOptionsEnd();CHKERRQ(ierr);
     if (n0<3) b[2] = b[0]; if (n0<2) b[1] = b[0];
     if (n1<3) N[2] = N[0]; if (n1<2) N[1] = N[0];

test/Oscillator.c

   user.Omega = 1.0;
   user.Xi    = 0.0;
   ierr = PetscOptionsBegin(PETSC_COMM_SELF,"","Oscillator Options","TS");CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-frequency","Frequency",__FILE__,user.Omega,&user.Omega,PETSC_NULL);CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-damping",  "Damping",  __FILE__,user.Xi,   &user.Xi,   PETSC_NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-frequency","Frequency",__FILE__,user.Omega,&user.Omega,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsReal("-damping",  "Damping",  __FILE__,user.Xi,   &user.Xi,   NULL);CHKERRQ(ierr);
   ierr = PetscOptionsString("-output","Output",__FILE__,output,output,sizeof(output),&out);CHKERRQ(ierr);
   ierr = PetscOptionsEnd();CHKERRQ(ierr);
   if (out && !output[0]) {ierr = PetscStrcpy(output,"Oscillator.out");CHKERRQ(ierr);}
 
   ierr = VecCreateSeq(PETSC_COMM_SELF,1,&R);CHKERRQ(ierr);
   ierr = VecSetUp(R);CHKERRQ(ierr);
-  ierr = MatCreateSeqDense(PETSC_COMM_SELF,1,1,PETSC_NULL,&J);CHKERRQ(ierr);
+  ierr = MatCreateSeqDense(PETSC_COMM_SELF,1,1,NULL,&J);CHKERRQ(ierr);
   ierr = MatSetUp(J);CHKERRQ(ierr);
   if (user.Xi <= 0.0) {
     ierr = TSSetIFunction(ts,R,Residual1,&user);CHKERRQ(ierr);
   ierr = MatDestroy(&J);CHKERRQ(ierr);
 
   if (output[0]) {
-    ierr = TSMonitorSet(ts,Monitor,output,PETSC_NULL);CHKERRQ(ierr);
+    ierr = TSMonitorSet(ts,Monitor,output,NULL);CHKERRQ(ierr);
   }
 
   ierr = VecCreateSeq(PETSC_COMM_SELF,1,&X);CHKERRQ(ierr);
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.