<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 30 March 2016 at 19:54, Christian Peco Regales, Ph.D. <span dir="ltr"><<a href="mailto:cp226@duke.edu" target="_blank">cp226@duke.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I have started to use the TS environment to solve a diffusion problem with XFEM in which, at the beginning of every step, a number of values have to be recomputed in order to properly fill the Jacobian (e.g. change some quadrature weights). However, I see
that the the function is expected with the format func(TS ts), with no possibility of getting a user context to perform the computations I need.</p></div></div></blockquote><div><br></div><div>There are a number of ways to get around this:<br><br>[1] Set an application context on the TS<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetApplicationContext.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetApplicationContext.html</a><br></div><div> <br></div><div>and retrieve via<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSGetApplicationContext.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSGetApplicationContext.html</a><br></div><div><br></div><div>[2] It sounds like your information is related to geometry, so you could bundle it into a DM and use<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetDM.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetDM.html</a><br><br></div><div>[3] The "nastiest" way is to use<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscContainerCreate.html#PetscContainerCreate">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscContainerCreate.html#PetscContainerCreate</a><br><br></div><div>and then compose the PetscContainer object with the TS object via<br></div><div><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectCompose.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectCompose.html</a><br></div><div><br></div><div><br></div><div>Thanks,<br></div><div> Dave<br></div><div><br></div><div><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 dir="ltr"><div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif"><p>
</p>
<p>Is there a way to get around that? Thanks!</p>
<p><br>
</p>
<p>Christian <span> </span></p>
<p><br>
</p>
<div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif">
<div style="font-family:Helvetica;font-size:12px">_______________________________<br>
</div>
<div style="font-family:Helvetica;font-size:12px">Christian Peco Regales, Ph.D. <br>
</div>
<div style="font-family:Helvetica;font-size:12px">Postdoctoral Research Associate<br>
</div>
<div style="font-family:Helvetica;font-size:12px">Civil and Environmental Engineering <br>
</div>
<div style="font-family:Helvetica;font-size:12px">Pratt School of Engineering<br>
</div>
<div style="font-family:Helvetica;font-size:12px">Duke University<br>
</div>
<div style="font-family:Helvetica;font-size:12px">2407 CIEMAS (office)<br>
</div>
<div style="font-family:Helvetica;font-size:12px">Durham, NC 27708, USA</div>
<div style="font-family:Helvetica;font-size:12px">email: <a href="mailto:christian.peco@duke.edu" target="_blank">christian.peco@duke.edu</a><br>
</div>
<div style="font-family:Helvetica;font-size:12px">web: <a href="http://christianpeco.com" target="_blank">
http://www.christianpeco.com</a></div>
<div style="font-family:Helvetica;font-size:12px">_______________________________<br>
</div>
</div>
</div>
</div>
</div>
</blockquote></div><br></div></div>