← Back to team overview

dolfin team mailing list archive

Re: [Question #135590]: formtransformations.py : Found basis function in %s, this is an invalid expression

 

On 26. nov. 2010 17:16, bilenemek wrote:
> New question #135590 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/135590
>
> what might be the reason of this exception at
> ...dist-packages/ufl/algorithms/formtransformations.py
> line 45
>     def expr(self, x):
>         "The default is a nonlinear operator not accepting any basis functions in its children."
>         # TODO: Other operators to implement particularly? Will see when errors here trigger...
>         if any(isinstance(t, Argument) for t in traverse_terminals(x)):
>             error("Found basis function in %s, this is an invalid expression." % repr(x))
>
> while trying to construct this tensor-linear dirichlet poisson problem:
>
> def sigma(v):
> 	d = 0.5*(grad(v)+grad(v).T)
> 	d2 = 0.5*inner(d,d)
> 	mu = atan(sqrt(d2)/b)
> 	return (2.0*mu*d)
>
> w = TestFunction(V)
> v = TrialFunction(V)
> a = inner(sigma(v),grad(w))*dx 
> L = 0.0
> problem = VariationalProblem(a, L, bcs=bc)
>
>   


Since your operator sigma is not linear in v, you do not want to treat
this as a linear variational problem. In particular, you probably want
to define v is a Function instead of as a TrialFunction. For more
details, take a look at some of the nonlinear demos, for instance

    demo/pde/hyperelasticity

--
Marie



References