[petsc-users] MatSetValues vs MatSetValuesBlocked

Nidish nb25 at rice.edu
Mon Aug 10 17:48:11 CDT 2020


Urgh I must've been blind - flycheck was throwing warnings only if I 
didn't cast elstiff[][] into const PetscScalar* .

Thanks for the responses!
Nidish

On 8/10/20 5:35 PM, Jed Brown wrote:
> Nidish <nb25 at rice.edu> writes:
>
>> Ah I get it now, MatSetBlocked has to be set node-wise. I tried this and
>> it works, thank you.
>>
>> The other question I had was why are the arguments for MatSetValues()
>> and MatSetValuesBlocked() set to const PetscInt* and const PetscScalar*
>> instead of just PetscInt* and PetscScalar* ? I have the typecast there
>> so my flycheck doesn't keep throwing me warnings on emacs ;)
> Your flycheck must be misconfigured.  I use flycheck with clangd, but it doesn't have a problem with that (this more specific type qualifier can always be added without a cast).
>
> To pick a more mundane example, nobody casts the second argument.
>
> void *memcpy(void *dest, const void *src, size_t n);
-- 
Nidish


More information about the petsc-users mailing list