[petsc-users] Petsc ObjectStateIncrease without proivate header

Stefano Zampini stefano.zampini at gmail.com
Mon May 8 08:31:00 CDT 2023


You can achieve the same effect by calling MatAssemblyBegin/End

Il giorno lun 8 mag 2023 alle ore 15:54 Pichler, Franz <
franz.pichler at v2c2.at> ha scritto:

> Hello,
> i am using petsc in a single cpu setup where I have preassembled crs
> matrices that I wrap via PetSC’s
>
> MatCreateSeqAIJWithArrays  Functionality.
>
>
>
> Now I manipulate the values of these matrices (wohtout changing the
> sparsity) without using petsc,
>
>
>
> When I now want to solve again I have to call
>
> PetscObjectStateIncrease((PetscObject)petsc_A);
>
>
>
> So that oetsc actually solves again (otherwise thinking nothing hs changed
> ,
>
> This means I have to include the private header
>
> #include <petsc/private/petscimpl.h>
>
>
>
> Which makes a seamingless implementation of petsc into a cmake process
> more complicate (This guy has to be stated explicitly in the cmake process
> at the moment)
>
>
>
> I would like to resolve that by “going” around the private header,
>
> My first intuition was to increase the state by hand
>
> ((PetscObject)petsc_A_aux[the_sys])->state++;
>
> This is the definition of petscstateincrease in the header. This throws me
> an
>
> error: invalid use of incomplete type ‘struct _p_PetscObject’
>
>
>
> compilation error.
>
>
>
> Is there any elegeant way around this?
>
> This is the first time I use the petsc mailing list so apologies for any
> beginners mistake I did in formatting or anything else.
>
>
>
> Best regards
>
>
>
> Franz Pichler
>
>
>


-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230508/f5ed7364/attachment.html>


More information about the petsc-users mailing list