Subject: Re: [Ufl] [Question #173119]: Outputting a symbolic jacobian to a file

From: Marie Rognes <[email-masked]>
Date: Mon, 03 Oct 2011 20:00:52 -0000

Question #173119 on UFL changed:
https://answers.launchpad.net/ufl/+question/173119

    Status: Open => Answered

Marie Rognes proposed the following answer:

Pretty much with a few exceptions: basically replace FunctionSpace by FiniteElement and Function by Coefficient.

Take a look at

    http://fenicsproject.org/doc/ufl/1.0-beta2/ufl.html#ufl-package

and/or relevant UFL demos, for instance

    ufl/demo/PowAD.ufl

-- 
You received this question notification because you are a member of UFL
Team, which is an answer contact for UFL.

---

From: Martin Sandve Alnæs<[email-masked]>
Date: Mon, 03 Oct 2011 21:01:00 -0000

Martin Sandve Alnæs proposed the following answer:
Also, I recommend looking at the UFL chapter in the FEniCS book for
explanation of implementation details.

By mathematical notation, do you mean latex?

Martin
Den 3. okt. 2011 22.02 skrev "Marie Rognes" <
[email-masked]> følgende:
> Pretty much with a few exceptions: basically replace FunctionSpace by
FiniteElement and Function by Coefficient.
> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to : [email-masked]
> Unsubscribe : https://launchpad.net/~ufl
> More help : https://help.launchpad.net/ListHelp

---

From: Colin McAuliffe <[email-masked]>
Date: Mon, 03 Oct 2011 21:51:02 -0000

Status: Answered => Solved

Colin McAuliffe confirmed that the question is solved:
I meant to say by mathematical was to get rid of the
CoefficientDerivative objects to get the resulting derivative. It looks
like this is done by preprocess which is what I was looking for.

Thanks

---

From: Martin Sandve Alnæs<[email-masked]>
Date: Tue, 04 Oct 2011 07:35:52 -0000

Martin Sandve Alnæs posted a new comment:
Ok, that should work. Not sure where you get preprocess from, or which
version you use, but you can also do

fd = a.compute_form_data()
a2 = fd.preprocessed_form

Or
from ufl.algorithms import expand_derivatives
a2 = expand_derivatives(a)

The latter does less processing than preprocess/formdata.

To inspect the form, try str, repr, and ufl.algorithms.tree_format. There is
some latex formatting but I'm not sure what state it us in currently.

Martin
Den 3. okt. 2011 23.59 skrev "Colin McAuliffe" <