← Back to team overview

ufl team mailing list archive

Re: [Dolfin] Adding form names F and J

 

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; <logg@xxxxxxxxx>
> følgende:
> > On Thu, Jun 30, 2011 at 06:35:19PM +0200, Anders Logg wrote:
> >> Could we add the additional form names &quot;F&quot; and &quot;J&quot; to
> UFL to be used
> >> for nonlinear problems? These would then be mapped (typedeffed) to
> >> &quot;ResidualForm&quot; and &quot;JacobianForm&quot; 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.
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help : https://help.launchpad.net/ListHelp


Follow ups

References