[17358a]: example / Biharmonic / Biharmonic.ufl Maximize Restore History

Download this file

Biharmonic.ufl    27 lines (20 with data), 632 Bytes

# Copyright (C) 2005-2009 Anders Logg

# Elements
element = FiniteElement("Lagrange", triangle, 2)

# Trial and test functions
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)

# Normal component, mesh size and right-hand side
n  = element.cell().n
h = 2.0*triangle.circumradius
h_avg = (h('+') + h('-'))/2

# Parameters
alpha = Constant(triangle)

# Bilinear form
a = inner(div(grad(u)), div(grad(v)))*dx \
  - inner(avg(div(grad(u))), jump(grad(v), n))*dS \
  - inner(jump(grad(u), n), avg(div(grad(v))))*dS \
  + alpha('+')/h_avg*inner(jump(grad(u), n), jump(grad(v),n))*dS

# Linear form
L = f*v*dx