[petsc-users] How add arguments with PetscInitializeNoArguments()

Barry Smith bsmith at mcs.anl.gov
Mon Jun 27 16:51:00 CDT 2016


  With PETSc 3.7 you can do 

   PetscOptionsSetValue(NULL, "-log_summary",NULL);  etc
   PetscInitializeNoArguments();

   I certainly don't recommend it because it removes the flexibility of changing options at the command line, any time you want to change something you need to recompile.


   Barry

> On Jun 27, 2016, at 4:44 PM, Faraz Hussain <faraz_hussain at yahoo.com> wrote:
> 
> I am using  PetscInitializeNoArguments() inside my app. But wanted to add the argument -log_summary and  -ksp_monitor_true_residual . Is there a quick way to do with this? I tried doing something like this, but it did not work:
> 
> PetscInitializeNoArguments();
> 
> int argc = 1;
> char *argv[1];
> argv[0] = '-ksp_monitor_true_residual';
> 



More information about the petsc-users mailing list