~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

Viewing changes to sandbox/ufl/elasticity/Elasticity.form

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2008-09-16 08:41:20 UTC
  • Revision ID: james.westby@ubuntu.com-20080916084120-i8k3u6lhx3mw3py3
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2005 Johan Jansson (johanjan@math.chalmers.se)
 
2
# Licensed under the GNU LGPL Version 2.1
 
3
#
 
4
# Modified by Anders Logg 2006-2007
 
5
# Modified by Garth N. Wells 2008
 
6
#
 
7
# First added:  2005
 
8
# Last changed: 2008-09-12
 
9
#
 
10
# The bilinear form for classical linear elasticity (Navier).
 
11
# Compile this form with FFC: ffc -l dolfin Elasticity.form.
 
12
 
 
13
element = VectorElement("Lagrange", "tetrahedron", 1)
 
14
 
 
15
v = TestFunction(element)
 
16
u = TrialFunction(element)
 
17
f = Function(element)
 
18
 
 
19
mu    = Constant("tetrahedron")
 
20
lmbda = Constant("tetrahedron")
 
21
 
 
22
def epsilon(v):
 
23
    return 0.5*(grad(v) + transp(grad(v)))
 
24
 
 
25
def sigma(v):
 
26
    return 2*mult(mu, epsilon(v)) + mult(lmbda, mult(trace(epsilon(v)), Identity(len(v))))
 
27
 
 
28
a = dot(epsilon(v), sigma(u))*dx
 
29