[petsc-dev] MatMFFDSetType

Barry Smith bsmith at mcs.anl.gov
Sun Jun 26 20:44:48 CDT 2016


> On Jun 26, 2016, at 8:30 PM, Adrian Croucher <a.croucher at auckland.ac.nz> wrote:
> 
> hi
> 
> Sorry, I realise now I was barking up the wrong tree in trying to use MatMFFDSetType().
> 
> What I'm actually looking for is just the equivalent of setting the command line option "-mat_fd_type ds" as default in my code- for an ordinary Jacobian matrix, not for a matrix-free method.
> 
> The doc page on MatFDColoringSetFromOptions():
> 
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/MatFD/MatFDColoringSetFromOptions.html
> 
> mentions setting the fd type to 'wp' or 'ds', and links to pages about MATMFFD_WP and MATMFFD_DS, which is probably where I started going astray.
> 
> 
> How do I do the equivalent of setting the option "-mat_fd_type ds" in my code? There is MatMFFDSetType() for MATMFFD, but doesn't seem to be anything like a plain MatFDSetType().

  Yes, you are correct, there is no MatFDSetType() and in the SetFromOptions we totally cheat  http://www.mcs.anl.gov/petsc/petsc-current/src/mat/matfd/fdmatrix.c.html#MatFDColoringSetFromOptions and just stick the value directly into the data structure. For now you can call 

PetscOptionsSetValue(NULL,"-mat_fd_type","ds") in your code (before you start using the MatFD stuff) and we'll add the routine to the master branch.

  Barry

I didn't think anyone would care about the difference between ds and wp with MatFD.



> 
> - Adrian
> -- 
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: 
> a.croucher at auckland.ac.nz
> 
> tel: +64 (0)9 923 84611
> 




More information about the petsc-dev mailing list