← Back to team overview

dolfin team mailing list archive

Re: Fwd: Added temporary fix for initial values for convection-diffusion. [...]

 

ok, I looked at your form. The problem is that when you define a
bilinear form it must be specified for exactly two basis functions.

If you write a = v[i]*u[i]*dx + q*eta*dx then you have four basis
functions.

There are two alternative approaches you can take:

1. Group the functions together:  v = [v q], u = [u eta] and write

    a = v[i]*u[i]*dx

or, for something more complicated like a = v[i]*u[i]*dx + g*q*eta*dx,

    a = (v[0]*u[0] + v[1]*u[1] + g*v[2]*u[2])*dx

The problem here comes when you want the first part of your finite
element space (the first two components in your case) to be different
from the second part (the third component in your case). There is
currently way to this in FFC (or FIAT), but I think we should support
this at some point. You could then do things like

  e1 = FiniteElement("Lagrange", 1, 2)
  e2 = FiniteElement("Lagrange", 1)
  e = e1 + e2

2. Assemble two different forms and then work on the matrices to
create one single system. You can do everything PETSc supports with
the matrix that DOLFIN assembles.

/Anders

On Thu, Apr 14, 2005 at 08:09:51AM +0200, Garth N. Wells wrote:
> Hi Anders,
> 
> Thanks for your response. I'm not fully convinced that FFC + FIAT will be able
> to solve everything, but we'll see!
> 
> I've attached a .form file which involves just the mass terms for the shallow
> water equations (I've left the rest out). FFC doesn't seem to handle it. Will it
> be possible to write forms that involve different test and trial functions?
> Unlike Johan Hoffman's NS solver, don't want to split up the solution of the
> momentum and continuity equations. When I have the shallow water module well
> tested and stabilised, and let you know.
> 
> I read a paper from Robert Kirby about matrix evaluations. It assumed that the
> Jacobian for an element is constant, even for higher order elements. Will you
> adopt this assumption in Dolfin?
> 
> Regards,
> Garth  
>