← Back to team overview

ufl team mailing list archive

Re: Adding form names F and J

 

On Thu, Jun 30, 2011 at 06:35:19PM +0200, Anders Logg wrote:
> Could we add the additional form names "F" and "J" to UFL to be used
> for nonlinear problems? These would then be mapped (typedeffed) to
> "ResidualForm" and "JacobianForm" by the DOLFIN C++ wrappers.
>
> Then one can use F and J in the .ufl file and then initialize the
> forms in C++ by
>
>   NonlinearPoisson::ResidualForm F(V);
>   NonlinearPoisson::JacobianForm J(V, V);
>
> instead of using L and a and then initializing by
>
>   NonlinearPoisson::LinearForm F(V);
>   NonlinearPoisson::BilinearForm J(V, V);
>
> Any objections?

I didn't hear any objections and it sounded like a good idea so I have
added this now (will merge into main when the buildbot is green).

In short, I've made a small change to UFL to allow 'F' and 'J' to be
used in form files and a small change in the DOLFIN wrapper code
generators to generate typedef aliases:

  BilinearForm = JacobianForm
  LinearForm   = ResidualForm

So nothing should break for old code. One can still use BilinearForm
and LinearForm for nonlinear problems, but no in addition the more
logical ResidualForm and JacobianForm.

--
Anders


References