← Back to team overview

ffc team mailing list archive

Re: How to determine the order of function parameters in the Linear/BiLinear form?

 

On Wednesday 29 October 2008 23:45:23 Chong Luo wrote:
> Hi,
>
> I found the Constant function very convenient, so that we don't have to
> recompile the form file every time we change a constant. However, this adds
> many more function parameters to linear/bilinear forms L(v) and a(u,v), and
> it's a pain to determine the correct order of the function parameters. For
> example, I spent a lot of time, but still couldn't figure out my linear
> form should be L(c10, u, alpha, beta, g) or L(c10, alpha, beta, u, g) or
> something else (the total number of possibilities is 5!=120).
>
> Is there any easy way to figure out the correct order of the function
> parameters in the linear/bilinear forms?

It is the order they are _defined_ in the form file, that matters. 

element  = SomeElement()
element2 = SomeOtherElement()

  u = TrialFunction(element)
  v = TestFunction(element)

  # This part is cruicial
  f = Function(element)
  c = Constant('triangle')
  q = Funciton(element2)

  # This is not...
  a = c*u*vdx + f*q*u*v*ds

So then you initialize them as:

  YourFormNameBiliniearForm a(f,c,q);

This problem will be addressed with the new function interface.

Johan Hake


References