<div dir="ltr">You can write your own DMPlexTSComputeRHSFunctionFVM method like this and give that to the dm.<div><pre style="color:rgb(0,0,0);white-space:pre-wrap">PetscErrorCode foo(DM dm, PetscReal time, Vec locX, Vec F, void *user)
{
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = DMPlexTSComputeRHSFunctionFVM(dm, time, locX, F, user);CHKERRQ(ierr);
...</pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"> PetscFunctionReturn(0);
}</pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 17, 2020 at 5:28 AM MUKKUND SUNJII <<a href="mailto:mukkundsunjii@gmail.com">mukkundsunjii@gmail.com</a>> wrote:<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 style="overflow-wrap: break-word;">Greetings, <div><br></div><div>I had been working on ts/tutorials/ex11.c as part of my master’s thesis. </div><div><br></div><div>In ex11.c, there is a 2D Shallow Water Model. I want to modify the model by adding a source term to the model. This source term would factor in the effects of bathymetry or bed elevation in addition to water height. </div><div><br></div><div>I know how I will be able to achieve this if just use TSSetRHSFunction(). However ex11.c makes use of the Riemann Solver for the computation fluxes at the interfaces (therefore, it uses <span style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43)">DMTSSetRHSFunctionLocal(dm</span><span style="font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43);color:rgb(204,120,50)">, </span><span style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43)">DMPlexTSComputeRHSFunctionFVM</span><span style="font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43);color:rgb(204,120,50)">, </span><span style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43)">user)</span><span style="color:rgb(0,0,0)"> </span>). </div><div><br></div><div>Is there a routine that allows me to <b>add</b> a source term <b>for every cell</b> to the RHS function? </div><div><br></div><div>Thank you in advance! </div><div><br></div><div>Regards, </div><div><br></div><div>Mukkund </div></div></blockquote></div>