← Back to team overview

dolfin team mailing list archive

Re: PDE<->ODE interface

 

>> > We just need to allow the specification of a time derivative in the
>> > form. If none is specified, we generate PDE code as usual, and if the
>> > form contains a time derivative, we generate code suitable for the ODE
>> > solver.
>>
>> Yes, that would be the do-nothing option for the PDE case; the way it is
>> today demands that you as a user need to semi-discretize in time by
>> yourself. But I think it would be a nice feature of FFC to also
>> automatically discretize the PDE in time. It is not only about how to
>> write the time derivative; the other terms are changed as well.
>>
>> 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".


> 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?

/Johan






Follow ups

References