13.07.2015 Views

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>UFL</strong> <strong>Specification</strong> <strong>and</strong> <strong>User</strong> <strong>Manual</strong> <strong>0.3</strong>Martin S. Alnæs, Anders Loggbilinear linear forms, we obtain∫ ∫a(v,u) = C∇v ·∇udx+ 2u 0 u∇v ·∇u 0 dx, (3.26)ΩΩ∫ ∫L(v;σ 0 ,f) = vf dx− ∇v ·σ 0 dx. (3.27)ΩThen, two additional forms are created to compute the tangent C <strong>and</strong> thegradientofu 0 . Thissituationshowsupinplasticity<strong>and</strong>otherproblemswherecertain quantities need to be computed elsewhere (in user-defined functions).The 3 forms using the st<strong>and</strong>ard FiniteElement (linear elements) can thenbe implemented as:Ω# FE1NonlinearPoisson.uflelement = FiniteElement("Lagrange", triangle, 1)DG = FiniteElement("Discontinuous Lagrange", triangle, 0)sig = VectorElement("Discontinuous Lagrange", triangle, 0)v = TestFunction(element)u = TrialFunction(element)u0 = Function(element)C = Function(DG)sig0 = Function(sig)f = Function(element)a = v.dx(i)*C*u.dx(i)*dx + v.dx(i)*2*u0*u*u0.dx(i)*dxL = v*f*dx - dot(grad(v), sig0)*dx# FE1Tangent.uflelement = FiniteElement("Lagrange", triangle, 1)DG = FiniteElement("Discontinuous Lagrange", triangle, 0)v = TestFunction(DG)u = TrialFunction(DG)u0= Function(element)a = v*u*dxL = v*(1.0 + u0**2)*dx72

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!