← Back to team overview

dolfin team mailing list archive

Re: PDE<->ODE interface

 

On Fri, Nov 04, 2005 at 04:00:13PM +0100, Johan Hoffman wrote:

> >> Heat equation discretized by Crank-Nicolson:
> >>
> >> a = v*u*dx + k*0.5*dot(grad(v), grad(u))*dx
> >> L = v*u0*dx - k*0.5*dot(grad(v), grad(u))*dx + v*0.5*(f+f0)*dx
> >>
> >> compared to
> >>
> >> a = v*u.dt()*dx + k*dot(grad(v), grad(u))*dx
> >> L = v*f*dx
> >
> > What is wrong with the second alternative? Isn't that what we want?
> 
> The second alternative is great, that is what I try to say. I would like
> to automatically generate DOLFIN code corresponding to the first alt. from
> the second alt. by just specifying "Crank-Nicolson".

Then I would suggest that a better option is to do the second
alternative and just ask the ODE solver to use cG(1).

Using the ODE solver with cG(1) + Newton is very similar to
Crank-Nicolson with very little overhead.

> > I must be missing something. We already support (1) today and we will
> > soon support (2).
> >
> > /Anders
> 
> Do you mean that today I can write a FFC form-file with
> 
> a = v*u.dt()*dx + k*dot(grad(v), grad(u))*dx
> L = v*f*dx
> 
> where I just specify what time-discretization I want to use, and that FFC
> generates code to DOLFIN with that time discretization? Then I must be
> missing something... or? Isn't it necessary to write out the
> semi-discretized form according to the first alt. above?

No, .dt() is not supported yet. My suggestion would be that either a
user specifies a time derivative and trusts the ODE solver to do the
time integration (using cG(1), dG(0), dG(15) or whatever), or
alternatively writes out the time discretization by hand if she
doesn't want to use the ODE solver.

The ODE solvers are starting to come in pretty good shape, at least
the standard mono-adaptive solvers.

Johan Jansson has done some benchmarking for elasticity and the
overhead was very small compared to explictly forming the system by
hand and solving. I don't remember the exact numbers, maybe Johan can
give us the details?

/Anders



Follow ups

References