Subject: [Ufl] Adding form names F and J

From: Anders Logg <[email-masked]>
Date: Thu, 30 Jun 2011 18:35:19 +0200

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?

--
Anders

---

From: Anders Logg <[email-masked]>
Date: Thu, 30 Jun 2011 21:50:08 +0200

>   NonlinearPoisson::BilinearForm J(V, V);

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

---

From: Anders Logg <[email-masked]>
Date: Fri, 1 Jul 2011 09:05:33 +0200

They are always generated as it is now, but I assume it would be
simple to make it so that they are only generated if they are used.

I'm not sure there's a big chance they will be misunderstood. Users
will not know that the classes ResidualForm and JacobianForm are
defined if they don't read through the generated code. Users will only
know about them if they look at a nonlinear example and then it will
be clear how they should be used.

But I don't have a firm opinion on this other than it's a natural
thing to have so that one can work with F and J for nonlinear problems
instead of a and L.

--
Anders

On Fri, Jul 01, 2011 at 08:31:13AM +0200, Martin Sandve Alnæs wrote:
> Are the typedefs only generated if the forms are named F and J? My worry is
> that it could easily be misunderstood and misused.
> Martin
> Den 30. juni 2011 21.50 skrev &quot;Anders Logg&quot; <[email-masked]>
> følgende:
> >> Could we add the additional form names &quot;F&quot; and &quot;J&quot; to
> UFL to be used
> >> &quot;ResidualForm&quot; and &quot;JacobianForm&quot; by the DOLFIN C++
> wrappers.
> >>
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to : [email-masked]
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help : https://help.launchpad.net/ListHelp

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Fri, 1 Jul 2011 11:07:15 +0200

> be clear how they should be used.

Users rarely follow the train of thought they're supposed to :)

I don't have a strong opinion either, do as you like.

Martin

---

From: Anders Logg <[email-masked]>
Date: Fri, 1 Jul 2011 13:13:52 +0200

> I don't have a strong opinion either, do as you like.

ok. :-)

--
Anders