Weakform of nonlinear equation

Dear all

How can I represent this pde using ufl.

-d/dx(du/dx) - 2u*du/dx = 0

I'm having trouble particularly with 2u*du/dx.

Thanks

Jack

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Jack
Solved:
2010-03-27
Last query:
2010-03-27
2010-03-27

This question was reopened

• 2010-03-27 by Jack
 Anders Logg (logg) said on 2010-03-27: #1

On Fri, Mar 26, 2010 at 10:11:24PM -0000, Jack wrote:
> New question #105644 on DOLFIN:
>
> Dear all
>
> How can I represent this pde using ufl.
>
> -d/dx(du/dx) - 2u*du/dx = 0
>
> I'm having trouble particularly with 2u*du/dx.
>
> Thanks
>
> Jack

Does it not work if you write 2*u*u.dx(0)*dx?

--
Anders

 Jack (attacking-chess) said on 2010-03-27: #2

Thanks Anders Logg, that solved my question.

 Jack (attacking-chess) said on 2010-03-27: #3

Thanks Anders.

 Jack (attacking-chess) said on 2010-03-27: #4

I just spotted that ffc -l dolfin Nonlinear.ufl gives this error at the end:

Compiler stage 2: Computing intermediate representation
-------------------------------------------------------
Computing representation of 1 elements
Computing representation of 1 dofmaps
Computing representation of integrals
Computing tensor representation
Extracting monomial form representation from UFL form
Transforming monomial form to reference element
Precomputing integrals on reference element
Precomputing integrals on reference element
Unable to extract all indices.

*** FFC: Unable to extract all indices.

This is what I have in my UFL form file

element = FiniteElement("Lagrange", "interval", 2)

v = TestFunction(element)
du = TrialFunction(element)

u = Coefficient(element)