### Construct bilinear and linear term for Non-linear solver

204

views

0

Hi, I am solving a coupled problem where in Bilinear after assembling I have

Thanks for the time.

**[kpp**kpu**;**kup**kuu]**and Residual [fp; fu] but I want to create [kpp kpu**0**; kup kpp -fext;**0****0**1] and [fp; fu; phi]. How can I construct this. Any hint will help to solve my problem.Thanks for the time.

```
from __future__ import print_function
from dolfin import *
mesh = UnitSquareMesh(10,10)
# define Material Properties
Gc = 2.7e-3;
E = 210;
nu = 0.3;
lmbda, mu = E*nu/((1.0 + nu )*(1.0-2.0*nu)) , E/(2*(1+nu))
lo = 2.0*mesh.hmin()
k=1e-6;
#------------------------------------------------
# Define Space
#------------------------------------------------
Q = FunctionSpace(mesh,'CG',1)
V = VectorFunctionSpace(mesh,'CG',1)
# create mix space....
W = V*Q
w = Function(W)
(u,p) = split(w)
(v,q) = TestFunctions(W)
def eps(u):
return sym(grad(u))
def sigma(u):
return 2.0*mu*eps(u) + lmbda*tr(eps(u))*Identity(2)
def HistInfo(u):
IC = tr(eps(u))
ICC = tr(eps(u)*eps(u))
return 0.5*lmbda*IC**2 + mu*ICC
E1 = ( ((1.- p)**2 + k)*inner(grad(u),sigma(v)) )*dx
E2 = ( Gc*lo*inner(grad(p), grad(q)) + (Gc/lo + 2*HistInfo(u))*inner(p,q)
-2.*q*HistInfo(u) )*dx
kuu = derivative(E1,u,v)
kpp = derivative(E2,p,q)
kup = derivative(E1,p,q)
kpu = derivative(E2,u,v)
```

Community: FEniCS Project

### 1 Answer

0

how about ,

`derivative(E1+E2,W,unsplit_trial_function)`

not tested

but where is your trial_function?

Please login to add an answer/comment or follow this question.

extra terms in bilinear form. a = [

kpp, kpu, 0; kup, kuu, -fext; 0,0,1] and L = [[fp; fu; phi]]when I use: gives error: Invalid type conversion: <class 'ufl.form.Form'> can not be converted to any UFL type.

any idea to resolve this issue ?

Thanks