# Copyright (c) 2005 Johan Jansson # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # DOLFIN is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with DOLFIN. If not, see . # # Modified by Anders Logg 2006-2007 # Modified by Garth N. Wells 2008 # # First added: 2005 # Last changed: 2011-03-09 # # The bilinear form for classical linear elasticity (Navier). # Compile this form with FFC: ffc -l dolfin Elasticity.ufl from ufl_legacy import (Coefficient, dx, FiniteElement, VectorElement, grad, inner, Identity, tr, triangle, TestFunction, TrialFunction) cell = triangle element = VectorElement("Lagrange", cell, 1) R = FiniteElement("Real", cell, 0) u = TrialFunction(element) v = TestFunction(element) f = Coefficient(element) mu = Coefficient(R) lmbda = Coefficient(R) def epsilon(v): return 0.5*(grad(v) + grad(v).T) def sigma(v): return 2.0*mu*epsilon(v) + lmbda*tr(epsilon(v))*Identity(v.geometric_dimension()) a = inner(sigma(u), epsilon(v))*dx L = inner(f, v)*dx