[petsc-users] Transient FEM diffusion

Matthew Knepley knepley at gmail.com
Wed Feb 4 13:49:56 CST 2015


On Wed, Feb 4, 2015 at 1:43 PM, Justin Chang <jychang48 at gmail.com> wrote:

> Hi all,
>
> Are there any any TS examples or tests for FEM using DMPlex? I want to
> solve a transient diffusion problem of the form below:
>

Sorry, I have not had time to set these up yet.


> du/dt = div[grad[u]] + f
>
> using backward euler method. I am curious as to how to implement this,
> namely into the pointwise functions. Working off of SNES ex12, if I
> understand this correctly, would I do something like the following:
>
> 1) Modify the f0 function such that f0[0] = u_t[0] + <forcing function>
>

Yes, exactly.


> 2) Add a g0_uu function such that g0[0] = 1.0
>

Yes.


> 3) Setup the TS solver in the main function
>

Replace SNES with TS and use

        ierr = DMTSSetIFunctionLocal(dm, DMPlexTSComputeIFunctionFEM,
&user);CHKERRQ(ierr);

Let me know if anything does not work.

 Thanks,

    Matt


> Am I missing something crucial here, or am I kind of along the right track?
>
> Thanks,
> Justin
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150204/e1a81077/attachment.html>


More information about the petsc-users mailing list