[petsc-dev] MatMFFDSetType

Barry Smith bsmith at mcs.anl.gov
Fri Jun 24 08:49:33 CDT 2016


> On Jun 24, 2016, at 12:13 AM, Adrian Croucher <a.croucher at auckland.ac.nz> wrote:
> 
> Further to this, I debugged into PetscObjectTypeCompare().
> 
> It's returning PETSC_FALSE because the type name of the variable mat is "seqbaij" (and I guess would normally be something like "mpibaij" if running in parallel outside gdb), which doesn't match with MATMFFD (= "mffd").
> 
> Does that mean I should be setting the matrix type to MATMFFD to get this to work?

   Either you are accessing the "wrong" matrix to set this value or at a later time the given matrix is set to MATMFFD.  If you are getting the matrix in your SNES compute Jacobian code make sure you set the value for the first mat argument, not the second. Are you using a command line argument -snes_mf_operator? Or some other command line argument to use mffd?

   Barry

> - Adrian
> 
> On 24/06/16 16:35, Adrian Croucher wrote:
>> On 24/06/16 15:58, Adrian Croucher wrote:
>>> 
>>> I will try debugging into MatMFFDSetType() and seeing what it's doing when I pass in "ds".
>>> 
>> 
>> I did this. In MatMFFDSetType() (mffd.c: 116), it executes 
>> 
>>   ierr = PetscObjectTypeCompare((PetscObject)mat,MATMFFD,&match);CHKERRQ(ierr);
>> 
>> which returns match = PETSC_FALSE. The next line
>> 
>>   if (!match) PetscFunctionReturn(0);
>> 
>> means it just returns out of there without doing anything.
>> 
>> - 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