<div dir="ltr">You can achieve the same effect by calling MatAssemblyBegin/End<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 8 mag 2023 alle ore 15:54 Pichler, Franz <<a href="mailto:franz.pichler@v2c2.at">franz.pichler@v2c2.at</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-4794575725287173255">
<div style="overflow-wrap: break-word;" lang="EN-US">
<div class="m_-4794575725287173255WordSection1">
<p class="MsoNormal">Hello,<br>
<span style="font-size:12pt;color:black">i am using petsc in a single cpu setup where I have preassembled crs matrices that I wrap via PetSC’s<u></u><u></u></span></p>
<p class="MsoNormal">MatCreateSeqAIJWithArrays Functionality.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now I manipulate the values of these matrices (wohtout changing the sparsity) without using petsc,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">When I now want to solve again I have to call <u></u><u></u></p>
<p class="MsoNormal">PetscObjectStateIncrease((PetscObject)petsc_A);<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So that oetsc actually solves again (otherwise thinking nothing hs changed ,<u></u><u></u></p>
<p class="MsoNormal">This means I have to include the private header<u></u><u></u></p>
<p class="MsoNormal">#include <petsc/private/petscimpl.h><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would like to resolve that by “going” around the private header,<u></u><u></u></p>
<p class="MsoNormal">My first intuition was to increase the state by hand<u></u><u></u></p>
<p class="MsoNormal">((PetscObject)petsc_A_aux[the_sys])->state++;<br>
<br>
<u></u><u></u></p>
<p class="MsoNormal">This is the definition of petscstateincrease in the header. This throws me an
<u></u><u></u></p>
<p class="MsoNormal">error: invalid use of incomplete type ‘struct _p_PetscObject’<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">compilation error.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there any elegeant way around this?<u></u><u></u></p>
<p class="MsoNormal">This is the first time I use the petsc mailing list so apologies for any beginners mistake I did in formatting or anything else.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Best regards<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Franz Pichler<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Stefano</div>