[cig-commits] commit: MADDs-4 now compiles under 0.9.5

Mercurial hg at geodynamics.org
Wed Dec 9 20:51:13 PST 2009


changeset:   99:945ab07a21be
user:        Marc Spiegelman <mspieg at ldeo.columbia.edu>
date:        Sat Dec 05 22:52:18 2009 -0500
files:       MADDs-4/cpp/PetscFunctions.cpp MADDs-4/cpp/PetscFunctions.h MADDs-4/cpp/SemiLagrangianRHS2D.cpp MADDs-4/cpp/SemiLagrangianRHS3D.cpp MADDs-4/cpp/SolitaryWave2D.cpp MADDs-4/cpp/SolitaryWave2D.h MADDs-4/cpp/SolitaryWave3D.cpp MADDs-4/cpp/SolitaryWave3D.h MADDs-4/cpp/main.cpp MADDs-4/cpp/makeMADDs-4_Pn.py
description:
MADDs-4 now compiles under 0.9.5


diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/PetscFunctions.cpp
--- a/MADDs-4/cpp/PetscFunctions.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/PetscFunctions.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -31,7 +31,7 @@ PetscErrorCode FormFunction(SNES snes, V
     
   //add in RHS vector
   
-  real* values = new real[size];
+  double* values = new double[size];
   unsigned int* irows = new unsigned int[size]; 
   
   for ( unsigned int i=0; i< size; ++i) //set rows to point to second vector
@@ -39,17 +39,14 @@ PetscErrorCode FormFunction(SNES snes, V
     irows[i] = i+size;
   }
   
-  user->bStar.get(values);
+  user->bStar.get_local(values);
   b.add(values, size, irows);
-  dolfin_set("output destination", "silent");
   bc.apply(b, X);
-  dolfin_set("output destination", "terminal");
   b.apply();
   VecCopy(*(b.vec()),f);
 
   delete [] values;
   delete [] irows;
-  //printf("FormFunction: ||F||=%16.12g\n",b.norm());
   PetscFunctionReturn(0);
 }
   
@@ -67,9 +64,7 @@ PetscErrorCode FormJacobian(SNES snes, V
   uWork.vector() = X;
 
   Assembler::assemble(J,user->a, reset_tensor);
-  dolfin_set("output destination", "silent");
   bc.apply(J);
-  dolfin_set("output destination", "terminal");
 
   *flag = SAME_NONZERO_PATTERN;
   // Matrices should already be assembled by assemble and bc.apply
@@ -100,59 +95,3 @@ PetscErrorCode Initialize(GenericVector&
     
 }
     
-
-// Additional Utility functions for calculating maximum melt velocity
-
-//-----------------------------------------------------------------------------
-//utility routine to use find maximum magnitude of the melt velocity using petsc vec operations
-// only issue is that the melt_flux and the porosity are not necessarily in the same FunctionSpace,
-// will need to interpolate the porosity to the same function space as the melt_flux
-PetscErrorCode FindMaxVelocity(double& max_mag_v,  Function& melt_flux,  Function& f, const double& U0onw0, const double& epsilon )
-{
-  Function qx, qz;
-  qx = melt_flux[0];
-  qz = melt_flux[1];
-
-  PETScVector mag_q(qx.vector().size()), v_tmp(qx.vector().size());
-
-  //calculate the magnitude of the melt flux
-  mag_q = qx.vector();
-  v_tmp = qz.vector();
-  // if using newest dolfin dev
-  // mag_q *= qx.vector();
-  // v_tmp *= qz.vector();
-  // mag_q += v_tmp;
-  // otherwise use PETSc Pointwise functions
-  VecPointwiseMult(*(mag_q.vec()),*(mag_q.vec()),*(mag_q.vec()));
-  VecPointwiseMult(*(v_tmp.vec()),*(v_tmp.vec()),*(v_tmp.vec()));
-  mag_q += v_tmp;
-
-  //find the max value and location of the melt_flux squared
-  PetscInt iMax;
-  PetscReal qMax;
-  VecMax(*(mag_q.vec()), &iMax, &qMax);
-
-  qMax = sqrt(qMax);
-
-  //interpolate the porosity to the same function space as the scalar melt flux
-  f.interpolate(v_tmp, qx.function_space());
-
-  //find the porosity at the location of maximum flux
-  double fMax;
-  v_tmp.get(&fMax, 1, (const dolfin::uint*) &iMax);
-  //new version convenience function
-  // fMax = v_tmp[iMax];
-
-  //check for zero divide or extremely small porosities
-  if (fMax < epsilon) {
-    max_mag_v = U0onw0;
-  }
-  else {
-    max_mag_v = qMax/fMax;
-  }
-  printf("max_flux = %g, f at max = %g, max |v|=%g\n",qMax,fMax,max_mag_v);
-  PetscFunctionReturn(0);
-
-
-}
-//-----------------------------------------------------------------------------
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/PetscFunctions.h
--- a/MADDs-4/cpp/PetscFunctions.h	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/PetscFunctions.h	Sat Dec 05 22:52:18 2009 -0500
@@ -19,7 +19,6 @@
 #include <dolfin/fem/BoundaryCondition.h>
 #include <dolfin/fem/DirichletBC.h>
 #include <dolfin/function/Function.h>
-#include <dolfin/function/SubFunction.h>
 #include <dolfin/function/FunctionSpace.h>
 #include <dolfin/common/NoDeleter.h>
 #include <dolfin/la/Vector.h> 
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SemiLagrangianRHS2D.cpp
--- a/MADDs-4/cpp/SemiLagrangianRHS2D.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SemiLagrangianRHS2D.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -1,49 +1,49 @@
 #include "SemiLagrangianRHS2D.h"
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::UFC_SemiLagrangianRHS2DLinearForm_finite_element_0() : ufc::finite_element()
+semilagrangianrhs2d_0_finite_element_0::semilagrangianrhs2d_0_finite_element_0() : ufc::finite_element()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::~UFC_SemiLagrangianRHS2DLinearForm_finite_element_0()
+semilagrangianrhs2d_0_finite_element_0::~semilagrangianrhs2d_0_finite_element_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::signature() const
+const char* semilagrangianrhs2d_0_finite_element_0::signature() const
 {
-    return "FiniteElement('Lagrange', 'triangle', 2)";
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::cell_shape() const
+ufc::shape semilagrangianrhs2d_0_finite_element_0::cell_shape() const
 {
     return ufc::triangle;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::space_dimension() const
+unsigned int semilagrangianrhs2d_0_finite_element_0::space_dimension() const
 {
     return 6;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::value_rank() const
+unsigned int semilagrangianrhs2d_0_finite_element_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::value_dimension(unsigned int i) const
+unsigned int semilagrangianrhs2d_0_finite_element_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_basis(unsigned int i,
+void semilagrangianrhs2d_0_finite_element_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -56,7 +56,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
     const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
     const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -110,7 +110,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -131,7 +131,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_basis_all(double* values,
+void semilagrangianrhs2d_0_finite_element_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -139,7 +139,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+void semilagrangianrhs2d_0_finite_element_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -153,7 +153,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
     const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
     const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -183,14 +183,14 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -215,7 +215,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -267,7 +267,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -277,7 +277,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -285,7 +285,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -382,7 +382,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+void semilagrangianrhs2d_0_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -391,14 +391,14 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_dof(unsigned int i,
+double semilagrangianrhs2d_0_finite_element_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -425,14 +425,14 @@ double UFC_SemiLagrangianRHS2DLinearForm
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::evaluate_dofs(double* values,
+void semilagrangianrhs2d_0_finite_element_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -440,7 +440,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+void semilagrangianrhs2d_0_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -451,62 +451,62 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::num_sub_elements() const
+unsigned int semilagrangianrhs2d_0_finite_element_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SemiLagrangianRHS2DLinearForm_finite_element_0::create_sub_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs2d_0_finite_element_0::create_sub_element(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS2DLinearForm_finite_element_0();
+    return new semilagrangianrhs2d_0_finite_element_0();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::UFC_SemiLagrangianRHS2DLinearForm_finite_element_1() : ufc::finite_element()
+semilagrangianrhs2d_0_finite_element_1::semilagrangianrhs2d_0_finite_element_1() : ufc::finite_element()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::~UFC_SemiLagrangianRHS2DLinearForm_finite_element_1()
+semilagrangianrhs2d_0_finite_element_1::~semilagrangianrhs2d_0_finite_element_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::signature() const
+const char* semilagrangianrhs2d_0_finite_element_1::signature() const
 {
-    return "Quadrature element with 9 quadrature point(s) (3x3) on a triangle";
+    return "FiniteElement('Quadrature', Cell('triangle', 1, Space(2)), 4)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::cell_shape() const
+ufc::shape semilagrangianrhs2d_0_finite_element_1::cell_shape() const
 {
     return ufc::triangle;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::space_dimension() const
+unsigned int semilagrangianrhs2d_0_finite_element_1::space_dimension() const
 {
     return 9;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::value_rank() const
+unsigned int semilagrangianrhs2d_0_finite_element_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::value_dimension(unsigned int i) const
+unsigned int semilagrangianrhs2d_0_finite_element_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_basis(unsigned int i,
+void semilagrangianrhs2d_0_finite_element_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -515,7 +515,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_basis_all(double* values,
+void semilagrangianrhs2d_0_finite_element_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -523,7 +523,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+void semilagrangianrhs2d_0_finite_element_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -533,7 +533,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+void semilagrangianrhs2d_0_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -542,14 +542,14 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_dof(unsigned int i,
+double semilagrangianrhs2d_0_finite_element_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[9][1][2] = {{{0.102717654809626, 0.088587959512704}}, {{0.0665540678391645, 0.409466864440735}}, {{0.0239311322870806, 0.787659461760847}}, {{0.455706020243648, 0.088587959512704}}, {{0.295266567779633, 0.409466864440735}}, {{0.106170269119576, 0.787659461760847}}, {{0.80869438567767, 0.088587959512704}}, {{0.523979067720101, 0.409466864440735}}, {{0.188409405952072, 0.787659461760847}}};
-    const static double W[9][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[9][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[9][1][2] = {{{0.102717654809626, 0.088587959512704}}, {{0.0665540678391645, 0.409466864440735}}, {{0.0239311322870806, 0.787659461760847}}, {{0.455706020243648, 0.088587959512704}}, {{0.295266567779633, 0.409466864440735}}, {{0.106170269119576, 0.787659461760847}}, {{0.80869438567767, 0.088587959512704}}, {{0.523979067720101, 0.409466864440735}}, {{0.188409405952072, 0.787659461760847}}};
+    static const double W[9][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[9][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -576,14 +576,14 @@ double UFC_SemiLagrangianRHS2DLinearForm
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::evaluate_dofs(double* values,
+void semilagrangianrhs2d_0_finite_element_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -591,7 +591,7 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+void semilagrangianrhs2d_0_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -599,39 +599,39 @@ void UFC_SemiLagrangianRHS2DLinearForm_f
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::num_sub_elements() const
+unsigned int semilagrangianrhs2d_0_finite_element_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SemiLagrangianRHS2DLinearForm_finite_element_1::create_sub_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs2d_0_finite_element_1::create_sub_element(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS2DLinearForm_finite_element_1();
+    return new semilagrangianrhs2d_0_finite_element_1();
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::UFC_SemiLagrangianRHS2DLinearForm_dof_map_0() : ufc::dof_map()
+semilagrangianrhs2d_0_dof_map_0::semilagrangianrhs2d_0_dof_map_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::~UFC_SemiLagrangianRHS2DLinearForm_dof_map_0()
+semilagrangianrhs2d_0_dof_map_0::~semilagrangianrhs2d_0_dof_map_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::signature() const
+const char* semilagrangianrhs2d_0_dof_map_0::signature() const
 {
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
+bool semilagrangianrhs2d_0_dof_map_0::needs_mesh_entities(unsigned int d) const
 {
-    switch (d)
+    switch ( d )
     {
     case 0:
       return true;
@@ -647,57 +647,63 @@ bool UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+bool semilagrangianrhs2d_0_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::init_cell(const ufc::mesh& m,
+void semilagrangianrhs2d_0_dof_map_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::init_cell_finalize()
+void semilagrangianrhs2d_0_dof_map_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::global_dimension() const
+unsigned int semilagrangianrhs2d_0_dof_map_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int semilagrangianrhs2d_0_dof_map_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int semilagrangianrhs2d_0_dof_map_0::max_local_dimension() const
 {
     return 6;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::geometric_dimension() const
+unsigned int semilagrangianrhs2d_0_dof_map_0::geometric_dimension() const
 {
     return 2;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::num_facet_dofs() const
+unsigned int semilagrangianrhs2d_0_dof_map_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
+unsigned int semilagrangianrhs2d_0_dof_map_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -711,10 +717,10 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -735,14 +741,14 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void semilagrangianrhs2d_0_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -761,40 +767,40 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::num_sub_dof_maps() const
+unsigned int semilagrangianrhs2d_0_dof_map_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SemiLagrangianRHS2DLinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs2d_0_dof_map_0::create_sub_dof_map(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS2DLinearForm_dof_map_0();
+    return new semilagrangianrhs2d_0_dof_map_0();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::UFC_SemiLagrangianRHS2DLinearForm_dof_map_1() : ufc::dof_map()
+semilagrangianrhs2d_0_dof_map_1::semilagrangianrhs2d_0_dof_map_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::~UFC_SemiLagrangianRHS2DLinearForm_dof_map_1()
+semilagrangianrhs2d_0_dof_map_1::~semilagrangianrhs2d_0_dof_map_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::signature() const
+const char* semilagrangianrhs2d_0_dof_map_1::signature() const
 {
-    return "FFC dof map for Quadrature element with 9 quadrature point(s) (3x3) on a triangle";
+    return "FFC dof map for FiniteElement('Quadrature', Cell('triangle', 1, Space(2)), 4)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
+bool semilagrangianrhs2d_0_dof_map_1::needs_mesh_entities(unsigned int d) const
 {
-    switch (d)
+    switch ( d )
     {
     case 0:
       return false;
@@ -810,57 +816,63 @@ bool UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+bool semilagrangianrhs2d_0_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 9*m.num_entities[2];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::init_cell(const ufc::mesh& m,
+void semilagrangianrhs2d_0_dof_map_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::init_cell_finalize()
+void semilagrangianrhs2d_0_dof_map_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::global_dimension() const
+unsigned int semilagrangianrhs2d_0_dof_map_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int semilagrangianrhs2d_0_dof_map_1::local_dimension(const ufc::cell& c) const
+{
+    return 9;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int semilagrangianrhs2d_0_dof_map_1::max_local_dimension() const
 {
     return 9;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::geometric_dimension() const
+unsigned int semilagrangianrhs2d_0_dof_map_1::geometric_dimension() const
 {
     return 2;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::num_facet_dofs() const
+unsigned int semilagrangianrhs2d_0_dof_map_1::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
+unsigned int semilagrangianrhs2d_0_dof_map_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -876,10 +888,10 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -894,14 +906,14 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+void semilagrangianrhs2d_0_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void semilagrangianrhs2d_0_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -926,32 +938,32 @@ void UFC_SemiLagrangianRHS2DLinearForm_d
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::num_sub_dof_maps() const
+unsigned int semilagrangianrhs2d_0_dof_map_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SemiLagrangianRHS2DLinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs2d_0_dof_map_1::create_sub_dof_map(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS2DLinearForm_dof_map_1();
+    return new semilagrangianrhs2d_0_dof_map_1();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0_quadrature::UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
+semilagrangianrhs2d_0_cell_integral_0_quadrature::semilagrangianrhs2d_0_cell_integral_0_quadrature() : ufc::cell_integral()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0_quadrature::~UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0_quadrature()
+semilagrangianrhs2d_0_cell_integral_0_quadrature::~semilagrangianrhs2d_0_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void semilagrangianrhs2d_0_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -963,10 +975,10 @@ void UFC_SemiLagrangianRHS2DLinearForm_c
     const double J_01 = x[2][0] - x[0][0];
     const double J_10 = x[1][1] - x[0][1];
     const double J_11 = x[2][1] - x[0][1];
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute inverse of Jacobian
     
     // Set scale factor
@@ -974,10 +986,11 @@ void UFC_SemiLagrangianRHS2DLinearForm_c
     
     
     // Array of quadrature weights
-    const static double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
+    static const double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
+    // Quadrature points on the UFC reference element: (0.102717654809626, 0.088587959512704), (0.0665540678391645, 0.409466864440735), (0.0239311322870806, 0.787659461760847), (0.455706020243648, 0.088587959512704), (0.295266567779633, 0.409466864440735), (0.106170269119576, 0.787659461760847), (0.80869438567767, 0.088587959512704), (0.523979067720101, 0.409466864440735), (0.188409405952072, 0.787659461760847)
     
-    
-    const static double FE0[9][6] = \
+    // Value of basis functions at quadrature points.
+    static const double FE0[9][6] = \
     {{0.499278833175498, -0.0816158215904472, -0.072892306371455, 0.0363981897820602, 0.286562341986258, 0.332268763018087},
     {0.0251290590975512, -0.0576951799472843, -0.0741406382908806, 0.109006741895515, 0.858208263567716, 0.139491753677383},
     {-0.117413197449647, -0.022785734101997, 0.453155393641927, 0.0753983311062782, 0.593609805131561, 0.0180354016718773},
@@ -988,12 +1001,10 @@ void UFC_SemiLagrangianRHS2DLinearForm_c
     {-0.0576951799472841, 0.0251290590975512, -0.0741406382908806, 0.858208263567716, 0.109006741895515, 0.139491753677383},
     {-0.022785734101997, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.0753983311062783, 0.0180354016718774}};
     
-    // Number of operations to compute geometry constants: 1
-    const double G0 =  - det;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 127
+    // Total number of operations to compute element tensor: 126
     
     // Loop quadrature points for integral
     // Number of operations to compute element tensor for following IP loop = 126
@@ -1002,139 +1013,135 @@ void UFC_SemiLagrangianRHS2DLinearForm_c
       
       // Number of operations to compute ip constants: 2
       // Number of operations: 2
-      const double Gip0 = W9[ip]*w[0][ip]*G0;
+      const double Gip0 = -W9[ip]*det*w[0][ip];
       
       
-      // Number of operations for primary indices = 12
+      // Number of operations for primary indices: 12
       for (unsigned int j = 0; j < 6; j++)
       {
-        // Number of operations to compute entry = 2
+        // Number of operations to compute entry: 2
         A[j] += FE0[ip][j]*Gip0;
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0::UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0() : ufc::cell_integral()
+semilagrangianrhs2d_0_cell_integral_0::semilagrangianrhs2d_0_cell_integral_0() : ufc::cell_integral()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0::~UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0()
+semilagrangianrhs2d_0_cell_integral_0::~semilagrangianrhs2d_0_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0::tabulate_tensor(double* A,
+void semilagrangianrhs2d_0_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
+    for (unsigned int j = 0; j < 6; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS2DLinearForm::UFC_SemiLagrangianRHS2DLinearForm() : ufc::form()
+semilagrangianrhs2d_form_0::semilagrangianrhs2d_form_0() : ufc::form()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS2DLinearForm::~UFC_SemiLagrangianRHS2DLinearForm()
+semilagrangianrhs2d_form_0::~semilagrangianrhs2d_form_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SemiLagrangianRHS2DLinearForm::signature() const
+const char* semilagrangianrhs2d_form_0::signature() const
 {
-    return "Form([Integral(Product(Function(FiniteElement('Quadrature', Cell('triangle', 1), 4), 0), Product(IntValue(-1, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('triangle', 1), 2), 0))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+    return "Form([Integral(Product(Function(FiniteElement('Quadrature', Cell('triangle', 1, Space(2)), 4), 0), Product(IntValue(-1, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), 0))), Measure('cell', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm::rank() const
+unsigned int semilagrangianrhs2d_form_0::rank() const
 {
     return 1;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SemiLagrangianRHS2DLinearForm::num_coefficients() const
+unsigned int semilagrangianrhs2d_form_0::num_coefficients() const
 {
     return 1;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SemiLagrangianRHS2DLinearForm::num_cell_integrals() const
+unsigned int semilagrangianrhs2d_form_0::num_cell_integrals() const
 {
     return 1;
 }
-  
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SemiLagrangianRHS2DLinearForm::num_exterior_facet_integrals() const
+unsigned int semilagrangianrhs2d_form_0::num_exterior_facet_integrals() const
 {
     return 0;
 }
-  
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SemiLagrangianRHS2DLinearForm::num_interior_facet_integrals() const
+unsigned int semilagrangianrhs2d_form_0::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SemiLagrangianRHS2DLinearForm::create_finite_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs2d_form_0::create_finite_element(unsigned int i) const
 {
-    switch (i)
+    switch ( i )
     {
     case 0:
-      return new UFC_SemiLagrangianRHS2DLinearForm_finite_element_0();
+      return new semilagrangianrhs2d_0_finite_element_0();
       break;
     case 1:
-      return new UFC_SemiLagrangianRHS2DLinearForm_finite_element_1();
+      return new semilagrangianrhs2d_0_finite_element_1();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SemiLagrangianRHS2DLinearForm::create_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs2d_form_0::create_dof_map(unsigned int i) const
 {
-    switch (i)
+    switch ( i )
     {
     case 0:
-      return new UFC_SemiLagrangianRHS2DLinearForm_dof_map_0();
+      return new semilagrangianrhs2d_0_dof_map_0();
       break;
     case 1:
-      return new UFC_SemiLagrangianRHS2DLinearForm_dof_map_1();
+      return new semilagrangianrhs2d_0_dof_map_1();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SemiLagrangianRHS2DLinearForm::create_cell_integral(unsigned int i) const
+ufc::cell_integral* semilagrangianrhs2d_form_0::create_cell_integral(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS2DLinearForm_cell_integral_0();
+    return new semilagrangianrhs2d_0_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SemiLagrangianRHS2DLinearForm::create_exterior_facet_integral(unsigned int i) const
+ufc::exterior_facet_integral* semilagrangianrhs2d_form_0::create_exterior_facet_integral(unsigned int i) const
 {
     return 0;
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SemiLagrangianRHS2DLinearForm::create_interior_facet_integral(unsigned int i) const
+ufc::interior_facet_integral* semilagrangianrhs2d_form_0::create_interior_facet_integral(unsigned int i) const
 {
     return 0;
 }
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SemiLagrangianRHS3D.cpp
--- a/MADDs-4/cpp/SemiLagrangianRHS3D.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SemiLagrangianRHS3D.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -1,49 +1,49 @@
 #include "SemiLagrangianRHS3D.h"
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::UFC_SemiLagrangianRHS3DLinearForm_finite_element_0() : ufc::finite_element()
+semilagrangianrhs3d_0_finite_element_0::semilagrangianrhs3d_0_finite_element_0() : ufc::finite_element()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::~UFC_SemiLagrangianRHS3DLinearForm_finite_element_0()
+semilagrangianrhs3d_0_finite_element_0::~semilagrangianrhs3d_0_finite_element_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::signature() const
+const char* semilagrangianrhs3d_0_finite_element_0::signature() const
 {
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::cell_shape() const
+ufc::shape semilagrangianrhs3d_0_finite_element_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::space_dimension() const
+unsigned int semilagrangianrhs3d_0_finite_element_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::value_rank() const
+unsigned int semilagrangianrhs3d_0_finite_element_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::value_dimension(unsigned int i) const
+unsigned int semilagrangianrhs3d_0_finite_element_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_basis(unsigned int i,
+void semilagrangianrhs3d_0_finite_element_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -61,7 +61,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
+    
     // Compute sub determinants
     const double d00 = J_11*J_22 - J_12*J_21;
     const double d01 = J_12*J_20 - J_10*J_22;
@@ -74,7 +74,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double d20 = J_01*J_12 - J_02*J_11;
     const double d21 = J_02*J_10 - J_00*J_12;
     const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -161,7 +161,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -190,7 +190,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_basis_all(double* values,
+void semilagrangianrhs3d_0_finite_element_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -198,7 +198,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+void semilagrangianrhs3d_0_finite_element_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -217,7 +217,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
+    
     // Compute sub determinants
     const double d00 = J_11*J_22 - J_12*J_21;
     const double d01 = J_12*J_20 - J_10*J_22;
@@ -230,7 +230,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double d20 = J_01*J_12 - J_02*J_11;
     const double d21 = J_02*J_10 - J_00*J_12;
     const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -274,14 +274,14 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -306,7 +306,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -377,7 +377,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -391,7 +391,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -403,7 +403,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -415,7 +415,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -553,7 +553,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+void semilagrangianrhs3d_0_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -562,14 +562,14 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_dof(unsigned int i,
+double semilagrangianrhs3d_0_finite_element_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -598,14 +598,14 @@ double UFC_SemiLagrangianRHS3DLinearForm
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::evaluate_dofs(double* values,
+void semilagrangianrhs3d_0_finite_element_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -613,7 +613,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+void semilagrangianrhs3d_0_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -625,62 +625,62 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::num_sub_elements() const
+unsigned int semilagrangianrhs3d_0_finite_element_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SemiLagrangianRHS3DLinearForm_finite_element_0::create_sub_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs3d_0_finite_element_0::create_sub_element(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS3DLinearForm_finite_element_0();
+    return new semilagrangianrhs3d_0_finite_element_0();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::UFC_SemiLagrangianRHS3DLinearForm_finite_element_1() : ufc::finite_element()
+semilagrangianrhs3d_0_finite_element_1::semilagrangianrhs3d_0_finite_element_1() : ufc::finite_element()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::~UFC_SemiLagrangianRHS3DLinearForm_finite_element_1()
+semilagrangianrhs3d_0_finite_element_1::~semilagrangianrhs3d_0_finite_element_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::signature() const
+const char* semilagrangianrhs3d_0_finite_element_1::signature() const
 {
-    return "Quadrature element with 27 quadrature point(s) (3x3x3) on a tetrahedron";
+    return "FiniteElement('Quadrature', Cell('tetrahedron', 1, Space(3)), 4)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::cell_shape() const
+ufc::shape semilagrangianrhs3d_0_finite_element_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::space_dimension() const
+unsigned int semilagrangianrhs3d_0_finite_element_1::space_dimension() const
 {
     return 27;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::value_rank() const
+unsigned int semilagrangianrhs3d_0_finite_element_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::value_dimension(unsigned int i) const
+unsigned int semilagrangianrhs3d_0_finite_element_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_basis(unsigned int i,
+void semilagrangianrhs3d_0_finite_element_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -689,7 +689,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_basis_all(double* values,
+void semilagrangianrhs3d_0_finite_element_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -697,7 +697,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+void semilagrangianrhs3d_0_finite_element_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -707,7 +707,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+void semilagrangianrhs3d_0_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -716,14 +716,14 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_dof(unsigned int i,
+double semilagrangianrhs3d_0_finite_element_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[27][1][3] = {{{0.0952198798417149, 0.0821215678634425, 0.0729940240731498}}, {{0.0670742417520586, 0.0578476039361427, 0.347003766038352}}, {{0.0303014811742758, 0.0261332522867349, 0.705002209888498}}, {{0.0616960186091465, 0.379578230280591, 0.0729940240731498}}, {{0.0434595556538024, 0.267380320411884, 0.347003766038352}}, {{0.0196333029354845, 0.120791820133903, 0.705002209888498}}, {{0.0221843026408197, 0.730165028047632, 0.0729940240731498}}, {{0.0156269392579017, 0.514338662174092, 0.347003766038352}}, {{0.00705963113955477, 0.232357800579865, 0.705002209888498}}, {{0.422442204031704, 0.0821215678634425, 0.0729940240731498}}, {{0.297574315012753, 0.0578476039361427, 0.347003766038352}}, {{0.134432268912383, 0.0261332522867349, 0.705002209888498}}, {{0.27371387282313, 0.379578230280591, 0.0729940240731498}}, {{0.192807956774882, 0.267380320411884, 0.347003766038352}}, {{0.0871029849887995, 0.120791820133903, 0.705002209888498}}, {{0.0984204739396093, 0.730165028047632, 0.0729940240731498}}, {{0.0693287858937781, 0.514338662174092, 0.347003766038352}}, {{0.0313199947658185, 0.232357800579865, 0.705002209888498}}, {{0.749664528221693, 0.0821215678634425, 0.0729940240731498}}, {{0.528074388273447, 0.0578476039361427, 0.347003766038352}}, {{0.238563056650491, 0.0261332522867349, 0.705002209888498}}, {{0.485731727037113, 0.379578230280591, 0.0729940240731498}}, {{0.342156357895961, 0.267380320411884, 0.347003766038352}}, {{0.154572667042115, 0.120791820133903, 0.705002209888498}}, {{0.174656645238399, 0.730165028047632, 0.0729940240731498}}, {{0.123030632529655, 0.514338662174092, 0.347003766038352}}, {{0.0555803583920821, 0.232357800579865, 0.705002209888498}}};
-    const static double W[27][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[27][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[27][1][3] = {{{0.0952198798417149, 0.0821215678634425, 0.0729940240731498}}, {{0.0670742417520586, 0.0578476039361427, 0.347003766038352}}, {{0.0303014811742758, 0.0261332522867349, 0.705002209888498}}, {{0.0616960186091465, 0.379578230280591, 0.0729940240731498}}, {{0.0434595556538024, 0.267380320411884, 0.347003766038352}}, {{0.0196333029354845, 0.120791820133903, 0.705002209888498}}, {{0.0221843026408197, 0.730165028047632, 0.0729940240731498}}, {{0.0156269392579017, 0.514338662174092, 0.347003766038352}}, {{0.00705963113955477, 0.232357800579865, 0.705002209888498}}, {{0.422442204031704, 0.0821215678634425, 0.0729940240731498}}, {{0.297574315012753, 0.0578476039361427, 0.347003766038352}}, {{0.134432268912383, 0.0261332522867349, 0.705002209888498}}, {{0.27371387282313, 0.379578230280591, 0.0729940240731498}}, {{0.192807956774882, 0.267380320411884, 0.347003766038352}}, {{0.0871029849887995, 0.120791820133903, 0.705002209888498}}, {{0.0984204739396093, 0.730165028047632, 0.0729940240731498}}, {{0.0693287858937781, 0.514338662174092, 0.347003766038352}}, {{0.0313199947658185, 0.232357800579865, 0.705002209888498}}, {{0.749664528221693, 0.0821215678634425, 0.0729940240731498}}, {{0.528074388273447, 0.0578476039361427, 0.347003766038352}}, {{0.238563056650491, 0.0261332522867349, 0.705002209888498}}, {{0.485731727037113, 0.379578230280591, 0.0729940240731498}}, {{0.342156357895961, 0.267380320411884, 0.347003766038352}}, {{0.154572667042115, 0.120791820133903, 0.705002209888498}}, {{0.174656645238399, 0.730165028047632, 0.0729940240731498}}, {{0.123030632529655, 0.514338662174092, 0.347003766038352}}, {{0.0555803583920821, 0.232357800579865, 0.705002209888498}}};
+    static const double W[27][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[27][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -752,14 +752,14 @@ double UFC_SemiLagrangianRHS3DLinearForm
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::evaluate_dofs(double* values,
+void semilagrangianrhs3d_0_finite_element_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -767,7 +767,7 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+void semilagrangianrhs3d_0_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -775,39 +775,39 @@ void UFC_SemiLagrangianRHS3DLinearForm_f
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::num_sub_elements() const
+unsigned int semilagrangianrhs3d_0_finite_element_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SemiLagrangianRHS3DLinearForm_finite_element_1::create_sub_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs3d_0_finite_element_1::create_sub_element(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS3DLinearForm_finite_element_1();
+    return new semilagrangianrhs3d_0_finite_element_1();
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::UFC_SemiLagrangianRHS3DLinearForm_dof_map_0() : ufc::dof_map()
+semilagrangianrhs3d_0_dof_map_0::semilagrangianrhs3d_0_dof_map_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::~UFC_SemiLagrangianRHS3DLinearForm_dof_map_0()
+semilagrangianrhs3d_0_dof_map_0::~semilagrangianrhs3d_0_dof_map_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::signature() const
+const char* semilagrangianrhs3d_0_dof_map_0::signature() const
 {
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
+bool semilagrangianrhs3d_0_dof_map_0::needs_mesh_entities(unsigned int d) const
 {
-    switch (d)
+    switch ( d )
     {
     case 0:
       return true;
@@ -826,57 +826,63 @@ bool UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+bool semilagrangianrhs3d_0_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::init_cell(const ufc::mesh& m,
+void semilagrangianrhs3d_0_dof_map_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::init_cell_finalize()
+void semilagrangianrhs3d_0_dof_map_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::global_dimension() const
+unsigned int semilagrangianrhs3d_0_dof_map_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int semilagrangianrhs3d_0_dof_map_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int semilagrangianrhs3d_0_dof_map_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::geometric_dimension() const
+unsigned int semilagrangianrhs3d_0_dof_map_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::num_facet_dofs() const
+unsigned int semilagrangianrhs3d_0_dof_map_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
+unsigned int semilagrangianrhs3d_0_dof_map_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -894,10 +900,10 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -935,14 +941,14 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void semilagrangianrhs3d_0_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -979,40 +985,40 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::num_sub_dof_maps() const
+unsigned int semilagrangianrhs3d_0_dof_map_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SemiLagrangianRHS3DLinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs3d_0_dof_map_0::create_sub_dof_map(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS3DLinearForm_dof_map_0();
+    return new semilagrangianrhs3d_0_dof_map_0();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::UFC_SemiLagrangianRHS3DLinearForm_dof_map_1() : ufc::dof_map()
+semilagrangianrhs3d_0_dof_map_1::semilagrangianrhs3d_0_dof_map_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::~UFC_SemiLagrangianRHS3DLinearForm_dof_map_1()
+semilagrangianrhs3d_0_dof_map_1::~semilagrangianrhs3d_0_dof_map_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::signature() const
+const char* semilagrangianrhs3d_0_dof_map_1::signature() const
 {
-    return "FFC dof map for Quadrature element with 27 quadrature point(s) (3x3x3) on a tetrahedron";
+    return "FFC dof map for FiniteElement('Quadrature', Cell('tetrahedron', 1, Space(3)), 4)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
+bool semilagrangianrhs3d_0_dof_map_1::needs_mesh_entities(unsigned int d) const
 {
-    switch (d)
+    switch ( d )
     {
     case 0:
       return false;
@@ -1031,57 +1037,63 @@ bool UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+bool semilagrangianrhs3d_0_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 27*m.num_entities[3];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::init_cell(const ufc::mesh& m,
+void semilagrangianrhs3d_0_dof_map_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::init_cell_finalize()
+void semilagrangianrhs3d_0_dof_map_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::global_dimension() const
+unsigned int semilagrangianrhs3d_0_dof_map_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int semilagrangianrhs3d_0_dof_map_1::local_dimension(const ufc::cell& c) const
+{
+    return 27;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int semilagrangianrhs3d_0_dof_map_1::max_local_dimension() const
 {
     return 27;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::geometric_dimension() const
+unsigned int semilagrangianrhs3d_0_dof_map_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::num_facet_dofs() const
+unsigned int semilagrangianrhs3d_0_dof_map_1::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
+unsigned int semilagrangianrhs3d_0_dof_map_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -1115,10 +1127,10 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -1136,14 +1148,14 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+void semilagrangianrhs3d_0_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void semilagrangianrhs3d_0_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -1231,32 +1243,32 @@ void UFC_SemiLagrangianRHS3DLinearForm_d
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::num_sub_dof_maps() const
+unsigned int semilagrangianrhs3d_0_dof_map_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SemiLagrangianRHS3DLinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs3d_0_dof_map_1::create_sub_dof_map(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS3DLinearForm_dof_map_1();
+    return new semilagrangianrhs3d_0_dof_map_1();
 }
 
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0_quadrature::UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
+semilagrangianrhs3d_0_cell_integral_0_quadrature::semilagrangianrhs3d_0_cell_integral_0_quadrature() : ufc::cell_integral()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0_quadrature::~UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0_quadrature()
+semilagrangianrhs3d_0_cell_integral_0_quadrature::~semilagrangianrhs3d_0_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void semilagrangianrhs3d_0_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -1273,17 +1285,17 @@ void UFC_SemiLagrangianRHS3DLinearForm_c
     const double J_20 = x[1][2] - x[0][2];
     const double J_21 = x[2][2] - x[0][2];
     const double J_22 = x[3][2] - x[0][2];
-      
+    
     // Compute sub determinants
     const double d_00 = J_11*J_22 - J_12*J_21;
     
     const double d_10 = J_02*J_21 - J_01*J_22;
     
     const double d_20 = J_01*J_12 - J_02*J_11;
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
-      
+    
     // Compute inverse of Jacobian
     
     // Set scale factor
@@ -1291,10 +1303,11 @@ void UFC_SemiLagrangianRHS3DLinearForm_c
     
     
     // Array of quadrature weights
-    const static double W27[27] = {0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384, 0.0140327598874417, 0.0130602412264747, 0.00267468981037392, 0.0160098281154818, 0.0149002918071527, 0.00305152546397085, 0.0048766033448291, 0.00453863791300947, 0.000929496505339815, 0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384};
+    static const double W27[27] = {0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384, 0.0140327598874417, 0.0130602412264747, 0.00267468981037392, 0.0160098281154818, 0.0149002918071527, 0.00305152546397085, 0.0048766033448291, 0.00453863791300947, 0.000929496505339815, 0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384};
+    // Quadrature points on the UFC reference element: (0.0952198798417149, 0.0821215678634425, 0.0729940240731498), (0.0670742417520586, 0.0578476039361427, 0.347003766038352), (0.0303014811742758, 0.0261332522867349, 0.705002209888498), (0.0616960186091465, 0.379578230280591, 0.0729940240731498), (0.0434595556538024, 0.267380320411884, 0.347003766038352), (0.0196333029354845, 0.120791820133903, 0.705002209888498), (0.0221843026408197, 0.730165028047632, 0.0729940240731498), (0.0156269392579017, 0.514338662174092, 0.347003766038352), (0.00705963113955477, 0.232357800579865, 0.705002209888498), (0.422442204031704, 0.0821215678634425, 0.0729940240731498), (0.297574315012753, 0.0578476039361427, 0.347003766038352), (0.134432268912383, 0.0261332522867349, 0.705002209888498), (0.27371387282313, 0.379578230280591, 0.0729940240731498), (0.192807956774882, 0.267380320411884, 0.347003766038352), (0.0871029849887995, 0.120791820133903, 0.705002209888498), (0.0984204739396093, 0.730165028047632, 0.0729940240731498), (0.0693287858937781, 0.514338662174092, 0.347003766038352), (0.0313199947658185, 0.232357800579865, 0.705002209888498), (0.749664528221693, 0.0821215678634425, 0.0729940240731498), (0.528074388273447, 0.0578476039361427, 0.347003766038352), (0.238563056650491, 0.0261332522867349, 0.705002209888498), (0.485731727037113, 0.379578230280591, 0.0729940240731498), (0.342156357895961, 0.267380320411884, 0.347003766038352), (0.154572667042115, 0.120791820133903, 0.705002209888498), (0.174656645238399, 0.730165028047632, 0.0729940240731498), (0.123030632529655, 0.514338662174092, 0.347003766038352), (0.0555803583920821, 0.232357800579865, 0.705002209888498)
     
-    
-    const static double FE1[27][10] = \
+    // Value of basis functions at quadrature points.
+    static const double FE0[27][10] = \
     {{0.374329281526014, -0.0770862288075737, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.0278019288056344, 0.031278423297481, 0.218884122479203, 0.246254505716693, 0.285531865195462},
     {0.0296507308273034, -0.0580763339388314, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.0931000579685249, 0.0155203366847607, 0.73297520591714, 0.122191352246653, 0.141680756728494},
     {-0.12473839265364, -0.0284651216515657, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.0854504447630367, 0.00316750500875634, 0.672749928545405, 0.0249377141829676, 0.0289152558798902},
@@ -1323,12 +1336,10 @@ void UFC_SemiLagrangianRHS3DLinearForm_c
     {-0.0151385367967613, -0.0927575594483608, 0.0147498566399774, -0.106180538748753, 0.71390981117415, 0.170768371303483, 0.25311764376694, 0.0216904270965777, 0.0321501561271395, 0.00769036888560861},
     {-0.00695995435590172, -0.0494020059140976, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.156737101971251, 0.0516581193256993, 0.0199082222175352, 0.00656144145796827, 0.00156950731540955}};
     
-    // Number of operations to compute geometry constants: 1
-    const double G0 =  - det;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 595
+    // Total number of operations to compute element tensor: 594
     
     // Loop quadrature points for integral
     // Number of operations to compute element tensor for following IP loop = 594
@@ -1337,143 +1348,135 @@ void UFC_SemiLagrangianRHS3DLinearForm_c
       
       // Number of operations to compute ip constants: 2
       // Number of operations: 2
-      const double Gip0 = W27[ip]*w[0][ip]*G0;
+      const double Gip0 = -W27[ip]*det*w[0][ip];
       
       
-      // Number of operations for primary indices = 20
+      // Number of operations for primary indices: 20
       for (unsigned int j = 0; j < 10; j++)
       {
-        // Number of operations to compute entry = 2
-        A[j] += FE1[ip][j]*Gip0;
+        // Number of operations to compute entry: 2
+        A[j] += FE0[ip][j]*Gip0;
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0::UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0() : ufc::cell_integral()
+semilagrangianrhs3d_0_cell_integral_0::semilagrangianrhs3d_0_cell_integral_0() : ufc::cell_integral()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0::~UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0()
+semilagrangianrhs3d_0_cell_integral_0::~semilagrangianrhs3d_0_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0::tabulate_tensor(double* A,
+void semilagrangianrhs3d_0_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
+    for (unsigned int j = 0; j < 10; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SemiLagrangianRHS3DLinearForm::UFC_SemiLagrangianRHS3DLinearForm() : ufc::form()
+semilagrangianrhs3d_form_0::semilagrangianrhs3d_form_0() : ufc::form()
 {
     // Do nothing
 }
 
 /// Destructor
-UFC_SemiLagrangianRHS3DLinearForm::~UFC_SemiLagrangianRHS3DLinearForm()
+semilagrangianrhs3d_form_0::~semilagrangianrhs3d_form_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SemiLagrangianRHS3DLinearForm::signature() const
+const char* semilagrangianrhs3d_form_0::signature() const
 {
-    return "Form([Integral(Product(Function(FiniteElement('Quadrature', Cell('tetrahedron', 1), 4), 0), Product(IntValue(-1, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), 0))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+    return "Form([Integral(Product(Function(FiniteElement('Quadrature', Cell('tetrahedron', 1, Space(3)), 4), 0), Product(IntValue(-1, (), (), {}), BasisFunction(FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), 0))), Measure('cell', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm::rank() const
+unsigned int semilagrangianrhs3d_form_0::rank() const
 {
     return 1;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SemiLagrangianRHS3DLinearForm::num_coefficients() const
+unsigned int semilagrangianrhs3d_form_0::num_coefficients() const
 {
     return 1;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SemiLagrangianRHS3DLinearForm::num_cell_integrals() const
+unsigned int semilagrangianrhs3d_form_0::num_cell_integrals() const
 {
     return 1;
 }
-  
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SemiLagrangianRHS3DLinearForm::num_exterior_facet_integrals() const
+unsigned int semilagrangianrhs3d_form_0::num_exterior_facet_integrals() const
 {
     return 0;
 }
-  
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SemiLagrangianRHS3DLinearForm::num_interior_facet_integrals() const
+unsigned int semilagrangianrhs3d_form_0::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SemiLagrangianRHS3DLinearForm::create_finite_element(unsigned int i) const
+ufc::finite_element* semilagrangianrhs3d_form_0::create_finite_element(unsigned int i) const
 {
-    switch (i)
+    switch ( i )
     {
     case 0:
-      return new UFC_SemiLagrangianRHS3DLinearForm_finite_element_0();
+      return new semilagrangianrhs3d_0_finite_element_0();
       break;
     case 1:
-      return new UFC_SemiLagrangianRHS3DLinearForm_finite_element_1();
+      return new semilagrangianrhs3d_0_finite_element_1();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SemiLagrangianRHS3DLinearForm::create_dof_map(unsigned int i) const
+ufc::dof_map* semilagrangianrhs3d_form_0::create_dof_map(unsigned int i) const
 {
-    switch (i)
+    switch ( i )
     {
     case 0:
-      return new UFC_SemiLagrangianRHS3DLinearForm_dof_map_0();
+      return new semilagrangianrhs3d_0_dof_map_0();
       break;
     case 1:
-      return new UFC_SemiLagrangianRHS3DLinearForm_dof_map_1();
+      return new semilagrangianrhs3d_0_dof_map_1();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SemiLagrangianRHS3DLinearForm::create_cell_integral(unsigned int i) const
+ufc::cell_integral* semilagrangianrhs3d_form_0::create_cell_integral(unsigned int i) const
 {
-    return new UFC_SemiLagrangianRHS3DLinearForm_cell_integral_0();
+    return new semilagrangianrhs3d_0_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SemiLagrangianRHS3DLinearForm::create_exterior_facet_integral(unsigned int i) const
+ufc::exterior_facet_integral* semilagrangianrhs3d_form_0::create_exterior_facet_integral(unsigned int i) const
 {
     return 0;
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SemiLagrangianRHS3DLinearForm::create_interior_facet_integral(unsigned int i) const
+ufc::interior_facet_integral* semilagrangianrhs3d_form_0::create_interior_facet_integral(unsigned int i) const
 {
     return 0;
 }
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SolitaryWave2D.cpp
--- a/MADDs-4/cpp/SolitaryWave2D.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SolitaryWave2D.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -1,62 +1,62 @@
 #include "SolitaryWave2D.h"
 
 /// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0_0::UFC_SolitaryWave2DBilinearForm_finite_element_0_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0_0::~UFC_SolitaryWave2DBilinearForm_finite_element_0_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_0_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_0_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_0::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+solitarywave2d_0_finite_element_0_0::solitarywave2d_0_finite_element_0_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_0_0::~solitarywave2d_0_finite_element_0_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_0_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_0_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_0_0::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_0_0::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_0_0::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_0_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -110,7 +110,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -131,91 +131,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_0_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -267,7 +267,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -277,7 +277,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -285,7 +285,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -382,23 +382,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_0_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -425,22 +425,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_0_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -451,75 +451,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_0_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0_1::UFC_SolitaryWave2DBilinearForm_finite_element_0_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0_1::~UFC_SolitaryWave2DBilinearForm_finite_element_0_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_0_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_0_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_1::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_0_0::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_0_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_0_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_0_1::solitarywave2d_0_finite_element_0_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_0_1::~solitarywave2d_0_finite_element_0_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_0_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_0_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_0_1::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_0_1::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_0_1::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_0_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -573,7 +573,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -594,91 +594,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_0_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -730,7 +730,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -740,7 +740,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -748,7 +748,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -845,23 +845,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_0_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -888,22 +888,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_0_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -914,75 +914,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_0_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0::UFC_SolitaryWave2DBilinearForm_finite_element_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_0::~UFC_SolitaryWave2DBilinearForm_finite_element_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_0::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0::space_dimension() const
-{
-    return 12;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_0_1::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_0_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_0_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_0::solitarywave2d_0_finite_element_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_0::~solitarywave2d_0_finite_element_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_0::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_0::space_dimension() const
+{
+    return 12;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_0::value_rank() const
+{
+    return 1;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_0::value_dimension(unsigned int i) const
+{
+    return 2;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -1039,7 +1039,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1091,7 +1091,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1114,91 +1114,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -1252,7 +1252,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1262,7 +1262,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -1270,7 +1270,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -1398,7 +1398,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1408,7 +1408,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -1416,7 +1416,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -1515,23 +1515,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+void solitarywave2d_0_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -1558,22 +1558,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -1588,84 +1588,84 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_0::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_0::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1_0::UFC_SolitaryWave2DBilinearForm_finite_element_1_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1_0::~UFC_SolitaryWave2DBilinearForm_finite_element_1_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_1_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_1_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_0::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_0::num_sub_elements() const
+{
+    return 2;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_0::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_finite_element_0_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_finite_element_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_1_0::solitarywave2d_0_finite_element_1_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_1_0::~solitarywave2d_0_finite_element_1_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_1_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_1_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_1_0::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_1_0::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_1_0::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_1_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -1719,7 +1719,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1740,91 +1740,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_1_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -1876,7 +1876,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -1886,7 +1886,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -1894,7 +1894,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -1991,23 +1991,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_1_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -2034,22 +2034,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_1_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -2060,75 +2060,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_1_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1_1::UFC_SolitaryWave2DBilinearForm_finite_element_1_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1_1::~UFC_SolitaryWave2DBilinearForm_finite_element_1_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_1_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_1_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_1::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_1_0::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_1_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_1_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_1_1::solitarywave2d_0_finite_element_1_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_1_1::~solitarywave2d_0_finite_element_1_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_1_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_1_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_1_1::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_1_1::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_1_1::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_1_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -2182,7 +2182,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -2203,91 +2203,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_1_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -2339,7 +2339,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -2349,7 +2349,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -2357,7 +2357,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -2454,23 +2454,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_1_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -2497,22 +2497,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_1_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -2523,75 +2523,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_1_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1::UFC_SolitaryWave2DBilinearForm_finite_element_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_1::~UFC_SolitaryWave2DBilinearForm_finite_element_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_1::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1::space_dimension() const
-{
-    return 12;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_1_1::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_1_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_1_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_1::solitarywave2d_0_finite_element_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_1::~solitarywave2d_0_finite_element_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_1::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_1::space_dimension() const
+{
+    return 12;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_1::value_rank() const
+{
+    return 1;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_1::value_dimension(unsigned int i) const
+{
+    return 2;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -2648,7 +2648,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -2700,7 +2700,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -2723,91 +2723,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -2861,7 +2861,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -2871,7 +2871,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -2879,7 +2879,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -3007,7 +3007,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -3017,7 +3017,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -3025,7 +3025,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -3124,23 +3124,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+void solitarywave2d_0_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -3167,22 +3167,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -3197,84 +3197,84 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_1::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_1::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2_0::UFC_SolitaryWave2DBilinearForm_finite_element_2_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2_0::~UFC_SolitaryWave2DBilinearForm_finite_element_2_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_2_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_2_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_0::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_1::num_sub_elements() const
+{
+    return 2;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_1::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_finite_element_1_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_finite_element_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_2_0::solitarywave2d_0_finite_element_2_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_2_0::~solitarywave2d_0_finite_element_2_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_2_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_2_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_2_0::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_2_0::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_2_0::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_2_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -3328,7 +3328,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -3349,91 +3349,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_2_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_2_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -3485,7 +3485,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -3495,7 +3495,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -3503,7 +3503,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -3600,23 +3600,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_2_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_2_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -3643,22 +3643,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_2_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_2_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -3669,75 +3669,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_2_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_2_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2_1::UFC_SolitaryWave2DBilinearForm_finite_element_2_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2_1::~UFC_SolitaryWave2DBilinearForm_finite_element_2_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_2_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_2_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_1::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_2_0::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_2_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_2_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_2_1::solitarywave2d_0_finite_element_2_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_2_1::~solitarywave2d_0_finite_element_2_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_2_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_2_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_2_1::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_2_1::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_2_1::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_2_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -3791,7 +3791,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -3812,91 +3812,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_2_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_2_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -3948,7 +3948,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -3958,7 +3958,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -3966,7 +3966,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -4063,23 +4063,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_0_finite_element_2_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_2_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -4106,22 +4106,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_2_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_2_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_2_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -4132,75 +4132,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_2_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_2_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2::UFC_SolitaryWave2DBilinearForm_finite_element_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_2::~UFC_SolitaryWave2DBilinearForm_finite_element_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_2::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_2::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2::space_dimension() const
-{
-    return 12;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_2_1::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_2_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_2_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_2::solitarywave2d_0_finite_element_2() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_2::~solitarywave2d_0_finite_element_2()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_2::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_2::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_2::space_dimension() const
+{
+    return 12;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_2::value_rank() const
+{
+    return 1;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_2::value_dimension(unsigned int i) const
+{
+    return 2;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_2::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -4257,7 +4257,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -4309,7 +4309,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -4332,91 +4332,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_2::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_2::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -4470,7 +4470,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -4480,7 +4480,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -4488,7 +4488,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -4616,7 +4616,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -4626,7 +4626,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -4634,7 +4634,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -4733,23 +4733,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+void solitarywave2d_0_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_2::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -4776,22 +4776,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_2::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_2::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_2::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -4806,84 +4806,84 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_2::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_2::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_2_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_2_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_3::UFC_SolitaryWave2DBilinearForm_finite_element_3() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_3::~UFC_SolitaryWave2DBilinearForm_finite_element_3()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_3::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_3::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_3::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_3::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_3::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_2::num_sub_elements() const
+{
+    return 2;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_2::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_finite_element_2_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_finite_element_2_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_3::solitarywave2d_0_finite_element_3() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_3::~solitarywave2d_0_finite_element_3()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_3::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_3::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_3::space_dimension() const
+{
+    return 1;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_3::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_3::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_3::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -4923,7 +4923,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Extract relevant coefficients
@@ -4934,91 +4934,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_3::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_3::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -5056,15 +5056,15 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -5126,23 +5126,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+void solitarywave2d_0_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_3::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -5169,22 +5169,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_3::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_3::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_3::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -5195,75 +5195,75 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_3::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_3::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_4::UFC_SolitaryWave2DBilinearForm_finite_element_4() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_4::~UFC_SolitaryWave2DBilinearForm_finite_element_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_4::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_4::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_4::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_4::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_4::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_0_finite_element_3::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_3::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_3();
+}
+
+
+/// Constructor
+solitarywave2d_0_finite_element_4::solitarywave2d_0_finite_element_4() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_finite_element_4::~solitarywave2d_0_finite_element_4()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_0_finite_element_4::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_0_finite_element_4::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_0_finite_element_4::space_dimension() const
+{
+    return 1;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_0_finite_element_4::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_0_finite_element_4::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_0_finite_element_4::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -5303,7 +5303,7 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Extract relevant coefficients
@@ -5314,91 +5314,91 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_0_finite_element_4::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_0_finite_element_4::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -5436,15 +5436,15 @@ void UFC_SolitaryWave2DBilinearForm_fini
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -5506,23 +5506,23 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+void solitarywave2d_0_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_0_finite_element_4::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -5549,22 +5549,22 @@ double UFC_SolitaryWave2DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_4::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_0_finite_element_4::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_0_finite_element_4::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -5575,1708 +5575,449 @@ void UFC_SolitaryWave2DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_4::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_4::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_4();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5_0::UFC_SolitaryWave2DBilinearForm_finite_element_5_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5_0::~UFC_SolitaryWave2DBilinearForm_finite_element_5_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_5_0::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_5_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_0::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_0::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_5_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_5_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5_1::UFC_SolitaryWave2DBilinearForm_finite_element_5_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5_1::~UFC_SolitaryWave2DBilinearForm_finite_element_5_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_5_1::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_5_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_1::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_5_1::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_5_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_finite_element_5_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5::UFC_SolitaryWave2DBilinearForm_finite_element_5() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_finite_element_5::~UFC_SolitaryWave2DBilinearForm_finite_element_5()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DBilinearForm_finite_element_5::signature() const
-{
-    return "MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0), FiniteElement('Discontinuous Lagrange', 'triangle', 0)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DBilinearForm_finite_element_5::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5::space_dimension() const
-{
-    return 2;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0;
-    }
-    
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[2][1][2] = {{{0.333333333333333, 0.333333333333333}}, {{0.333333333333333, 0.333333333333333}}};
-    const static double W[2][1] = {{1}, {1}};
-    const static double D[2][1][2] = {{{1, 0}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DBilinearForm_finite_element_5::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[4] = dof_values[0];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[1];
-    vertex_values[3] = dof_values[1];
-    vertex_values[5] = dof_values[1];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_finite_element_5::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm_finite_element_5::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_5_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_5_1();
-      break;
-    }
-    return 0;
-}
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0_0::UFC_SolitaryWave2DBilinearForm_dof_map_0_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0_0::~UFC_SolitaryWave2DBilinearForm_dof_map_0_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_0_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_finite_element_4::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_0_finite_element_4::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_0_finite_element_4();
+}
+
+/// Constructor
+solitarywave2d_0_dof_map_0_0::solitarywave2d_0_dof_map_0_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_0_0::~solitarywave2d_0_dof_map_0_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_0_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_0_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_0_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::num_facet_dofs() const
+void solitarywave2d_0_dof_map_0_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_0_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_0_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_0_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_0_0::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_0_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_0_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_0_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0_1::UFC_SolitaryWave2DBilinearForm_dof_map_0_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0_1::~UFC_SolitaryWave2DBilinearForm_dof_map_0_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_0_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_0_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_0_0::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_0_0::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_0_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_0_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_0_1::solitarywave2d_0_dof_map_0_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_0_1::~solitarywave2d_0_dof_map_0_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_0_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_0_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_0_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::num_facet_dofs() const
+void solitarywave2d_0_dof_map_0_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_0_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_0_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_0_1::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_0_1::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_0_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_0_1::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_0_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0::UFC_SolitaryWave2DBilinearForm_dof_map_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_0::~UFC_SolitaryWave2DBilinearForm_dof_map_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_0::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_0_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_0_1::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_0_1::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_0_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_0_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_0::solitarywave2d_0_dof_map_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_0::~solitarywave2d_0_dof_map_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_0::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::local_dimension() const
-{
-    return 12;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::num_facet_dofs() const
-{
-    return 6;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_0_dof_map_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_0::local_dimension(const ufc::cell& c) const
+{
+    return 12;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_0::max_local_dimension() const
+{
+    return 12;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_0::num_facet_dofs() const
+{
+    return 6;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_0_dof_map_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -7298,10 +6039,10 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
+void solitarywave2d_0_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -7331,14 +6072,14 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void solitarywave2d_0_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -7369,441 +6110,459 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_0::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1_0::UFC_SolitaryWave2DBilinearForm_dof_map_1_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1_0::~UFC_SolitaryWave2DBilinearForm_dof_map_1_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_1_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_0::num_sub_dof_maps() const
+{
+    return 2;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_0::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_dof_map_0_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_dof_map_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_1_0::solitarywave2d_0_dof_map_1_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_1_0::~solitarywave2d_0_dof_map_1_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_1_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_1_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_1_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::num_facet_dofs() const
+void solitarywave2d_0_dof_map_1_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_1_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_1_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_1_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_1_0::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_1_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_1_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_1_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1_1::UFC_SolitaryWave2DBilinearForm_dof_map_1_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1_1::~UFC_SolitaryWave2DBilinearForm_dof_map_1_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_1_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_1_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_1_0::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_1_0::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_1_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_1_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_1_1::solitarywave2d_0_dof_map_1_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_1_1::~solitarywave2d_0_dof_map_1_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_1_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_1_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_1_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::num_facet_dofs() const
+void solitarywave2d_0_dof_map_1_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_1_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_1_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_1_1::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_1_1::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_1_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_1_1::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_1_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1::UFC_SolitaryWave2DBilinearForm_dof_map_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_1::~UFC_SolitaryWave2DBilinearForm_dof_map_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_1::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_1_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_1_1::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_1_1::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_1_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_1_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_1::solitarywave2d_0_dof_map_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_1::~solitarywave2d_0_dof_map_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_1::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::local_dimension() const
-{
-    return 12;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::num_facet_dofs() const
-{
-    return 6;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_0_dof_map_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_1::local_dimension(const ufc::cell& c) const
+{
+    return 12;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_1::max_local_dimension() const
+{
+    return 12;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_1::num_facet_dofs() const
+{
+    return 6;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_0_dof_map_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -7825,10 +6584,10 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
+void solitarywave2d_0_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -7858,14 +6617,14 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void solitarywave2d_0_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -7896,441 +6655,459 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_1::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2_0::UFC_SolitaryWave2DBilinearForm_dof_map_2_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2_0::~UFC_SolitaryWave2DBilinearForm_dof_map_2_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_2_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_1::num_sub_dof_maps() const
+{
+    return 2;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_1::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_dof_map_1_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_dof_map_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_2_0::solitarywave2d_0_dof_map_2_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_2_0::~solitarywave2d_0_dof_map_2_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_2_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_2_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_2_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::num_facet_dofs() const
+void solitarywave2d_0_dof_map_2_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_2_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_2_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_2_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_2_0::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_2_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_2_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_2_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_2_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2_1::UFC_SolitaryWave2DBilinearForm_dof_map_2_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2_1::~UFC_SolitaryWave2DBilinearForm_dof_map_2_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_2_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_2_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_2_0::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_2_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_2_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_2_0::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_2_0::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_2_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_2_0();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_2_1::solitarywave2d_0_dof_map_2_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_2_1::~solitarywave2d_0_dof_map_2_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_2_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_2_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_2_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::num_facet_dofs() const
+void solitarywave2d_0_dof_map_2_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_2_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_2_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_2_1::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_2_1::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_2_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_2_1::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_2_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_2_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2::UFC_SolitaryWave2DBilinearForm_dof_map_2() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_2::~UFC_SolitaryWave2DBilinearForm_dof_map_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_2::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_2::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_2_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_2_1::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_0_dof_map_2_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_2_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_2_1::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_0_dof_map_2_1::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_2_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_2_1();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_2::solitarywave2d_0_dof_map_2() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_2::~solitarywave2d_0_dof_map_2()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_2::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_2::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_2::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::local_dimension() const
-{
-    return 12;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::num_facet_dofs() const
-{
-    return 6;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_0_dof_map_2::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_2::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_2::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_2::local_dimension(const ufc::cell& c) const
+{
+    return 12;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_2::max_local_dimension() const
+{
+    return 12;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_2::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_2::num_facet_dofs() const
+{
+    return 6;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_0_dof_map_2::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_2::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -8352,10 +7129,10 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
+void solitarywave2d_0_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -8385,14 +7162,14 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_2::tabulate_coordinates(double** coordinates,
+void solitarywave2d_0_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_2::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -8423,115 +7200,121 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_2::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_2::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_2_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_2_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_3::UFC_SolitaryWave2DBilinearForm_dof_map_3() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_3::~UFC_SolitaryWave2DBilinearForm_dof_map_3()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_3::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_3::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_3::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_2::num_sub_dof_maps() const
+{
+    return 2;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_2::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_dof_map_2_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_dof_map_2_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_3::solitarywave2d_0_dof_map_3() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_3::~solitarywave2d_0_dof_map_3()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_3::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_3::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return false;
+      break;
+    case 1:
+      return false;
+      break;
+    case 2:
+      return true;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_3::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[2];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_0_dof_map_3::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_3::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_3::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_3::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_3::max_local_dimension() const
+{
+    return 1;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_3::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_3::num_facet_dofs() const
+{
+    return 0;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_0_dof_map_3::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_3::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -8539,32 +7322,32 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_3::tabulate_coordinates(double** coordinates,
+void solitarywave2d_0_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      
+      break;
+    case 1:
+      
+      break;
+    case 2:
+      
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_3::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -8573,106 +7356,112 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_3::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_3::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_4::UFC_SolitaryWave2DBilinearForm_dof_map_4() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_4::~UFC_SolitaryWave2DBilinearForm_dof_map_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_4::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_4::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_4::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_0_dof_map_3::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_3::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_3();
+}
+
+
+/// Constructor
+solitarywave2d_0_dof_map_4::solitarywave2d_0_dof_map_4() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_0_dof_map_4::~solitarywave2d_0_dof_map_4()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_0_dof_map_4::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_0_dof_map_4::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return false;
+      break;
+    case 1:
+      return false;
+      break;
+    case 2:
+      return true;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_0_dof_map_4::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[2];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_0_dof_map_4::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_0_dof_map_4::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_0_dof_map_4::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_0_dof_map_4::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_0_dof_map_4::max_local_dimension() const
+{
+    return 1;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_0_dof_map_4::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_0_dof_map_4::num_facet_dofs() const
+{
+    return 0;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_0_dof_map_4::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_0_dof_map_4::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -8680,32 +7469,32 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_4::tabulate_coordinates(double** coordinates,
+void solitarywave2d_0_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      
+      break;
+    case 1:
+      
+      break;
+    case 2:
+      
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_0_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_0_dof_map_4::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -8714,468 +7503,32 @@ void UFC_SolitaryWave2DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_4::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_4::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_4();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5_0::UFC_SolitaryWave2DBilinearForm_dof_map_5_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5_0::~UFC_SolitaryWave2DBilinearForm_dof_map_5_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_5_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5_0::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_5_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_5_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5_1::UFC_SolitaryWave2DBilinearForm_dof_map_5_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5_1::~UFC_SolitaryWave2DBilinearForm_dof_map_5_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_5_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5_1::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_5_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_dof_map_5_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5::UFC_SolitaryWave2DBilinearForm_dof_map_5() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_dof_map_5::~UFC_SolitaryWave2DBilinearForm_dof_map_5()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DBilinearForm_dof_map_5::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0), FiniteElement('Discontinuous Lagrange', 'triangle', 0)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DBilinearForm_dof_map_5::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = 2*m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::local_dimension() const
-{
-    return 2;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-    unsigned int offset = m.num_entities[2];
-    dofs[1] = offset + c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DBilinearForm_dof_map_5::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-    coordinates[1][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[1][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DBilinearForm_dof_map_5::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm_dof_map_5::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_5_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_5_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DBilinearForm_cell_integral_0_quadrature::UFC_SolitaryWave2DBilinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_cell_integral_0_quadrature::~UFC_SolitaryWave2DBilinearForm_cell_integral_0_quadrature()
+unsigned int solitarywave2d_0_dof_map_4::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_0_dof_map_4::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_0_dof_map_4();
+}
+
+
+/// Constructor
+solitarywave2d_0_cell_integral_0_quadrature::solitarywave2d_0_cell_integral_0_quadrature() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_cell_integral_0_quadrature::~solitarywave2d_0_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave2DBilinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave2d_0_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -9187,10 +7540,10 @@ void UFC_SolitaryWave2DBilinearForm_cell
     const double J_01 = x[2][0] - x[0][0];
     const double J_10 = x[1][1] - x[0][1];
     const double J_11 = x[2][1] - x[0][1];
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute inverse of Jacobian
     const double Jinv_00 =  J_11 / detJ;
     const double Jinv_01 = -J_01 / detJ;
@@ -9202,73 +7555,119 @@ void UFC_SolitaryWave2DBilinearForm_cell
     
     
     // Array of quadrature weights
-    const static double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
-    
-    
-    const static double FE0_C1_D01[9][5] = \
-    {{-2.23477754271068, -0.645648161949184, 0.410870619238505, 2.88042570465986, -0.410870619238505},
-    {-1.0959162708804, 0.63786745776294, 0.266216271356658, 0.458048813117464, -0.266216271356658},
-    {0.246362376191711, 2.15063784704339, 0.0957245291483235, -2.3970002232351, -0.0957245291483223},
-    {-0.822824080974591, -0.645648161949185, 1.82282408097459, 1.46847224292378, -1.82282408097459},
-    {-0.18106627111853, 0.637867457762939, 1.18106627111853, -0.456801186644408, -1.18106627111853},
-    {0.575318923521695, 2.15063784704339, 0.424681076478307, -2.72595677056508, -0.424681076478306},
-    {0.589129380761496, -0.645648161949184, 3.23477754271068, 0.0565187811876888, -3.23477754271068},
-    {0.733783728643343, 0.637867457762939, 2.0959162708804, -1.37165118640628, -2.0959162708804},
-    {0.904275470851678, 2.15063784704339, 0.75363762380829, -3.05491331789507, -0.753637623808289}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[5] = {6, 8, 9, 10, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc3[5] = {0, 2, 3, 4, 5};
-    
-    const static double FE0_C1_D10[9][5] = \
-    {{-2.23477754271068, -0.589129380761495, 0.354351838050815, -0.354351838050815, 2.82390692347217},
-    {-1.0959162708804, -0.733783728643342, 1.63786745776294, -1.63786745776294, 1.82969999952375},
-    {0.246362376191711, -0.904275470851678, 3.15063784704339, -3.15063784704339, 0.657913094659967},
-    {-0.822824080974592, 0.822824080974592, 0.354351838050816, -0.354351838050816, 0},
-    {-0.18106627111853, 0.181066271118531, 1.63786745776294, -1.63786745776294, 0},
-    {0.575318923521695, -0.575318923521694, 3.15063784704339, -3.15063784704339, 0},
-    {0.589129380761495, 2.23477754271068, 0.354351838050816, -0.354351838050816, -2.82390692347217},
-    {0.733783728643342, 1.0959162708804, 1.63786745776294, -1.63786745776294, -1.82969999952375},
-    {0.904275470851678, -0.246362376191711, 3.15063784704339, -3.15063784704339, -0.657913094659967}};
-    // Array of non-zero columns
-    static const unsigned int nzc1[5] = {6, 7, 9, 10, 11};
+    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
+    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE1_C0[25][6] = \
+    {{0.759842524889054, -0.0409849230988148, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
+    {0.404143384962011, -0.0347905350890822, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
+    {0.03820389372017, -0.0249744559383749, -0.0543309414249183, 0.0461882014671774, 0.938423301877431, 0.0564900002985142},
+    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218535},
+    {-0.0762735703276687, -0.00457955736373819, 0.723813068870285, 0.0166673234982246, 0.338636367163553, 0.00173636815934486},
+    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
+    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
+    {-0.0585120870225412, -0.0960538647466012, -0.0543309414249183, 0.227214213208259, 0.75739729013635, 0.224285389849452},
+    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372835},
+    {-0.0643063527627087, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032842},
+    {-0.0191125161665052, -0.0191125161665052, -0.036640207614552, 0.0764500646660208, 0.0764500646660207, 0.921965110615521},
+    {-0.07940205210781, -0.0794020521078101, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
+    {-0.123076437918076, -0.123076437918076, -0.0543309414249183, 0.492305751672304, 0.492305751672304, 0.315872313916462},
+    {-0.105896858921168, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.092742008804029},
+    {-0.0444129613327222, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330889, 0.00970916313338224},
+    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877737, 0.65464206627708},
+    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320686},
+    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249183, 0.75739729013635, 0.227214213208259, 0.224285389849452},
+    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.651676269947229, 0.19549860142211, 0.0658515377372836},
+    {-0.0217044058396819, -0.0643063527627086, 0.723813068870285, 0.273311911925214, 0.0819917787365633, 0.00689399907032842},
+    {-0.0409849230988148, 0.759842524889054, -0.036640207614552, 0.145727572487076, 0.00717255684496521, 0.164882476492272},
+    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.0297980510461639, 0.115025523822223},
+    {-0.024974455938375, 0.0382038937201699, -0.0543309414249183, 0.938423301877431, 0.0461882014671775, 0.0564900002985145},
+    {-0.0138776265525464, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743822, 0.0165858034218536},
+    {-0.00457955736373822, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982245, 0.00173636815934486}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc0[6] = {0, 1, 2, 3, 4, 5};
+    // Array of non-zero columns
+    static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
+    static const double FE1_C0_D01[25][5] = \
+    {{-2.66059019751491, -0.840760571794125, 0.180170374279215, 3.50135076930903, -0.180170374279215},
+    {-2.05746131912512, -0.207946328505567, 0.150485009380445, 2.26540764763069, -0.150485009380445},
+    {-1.14264217923257, 0.751899240989545, 0.105458579777884, 0.390742938243026, -0.105458579777884},
+    {-0.16099972900317, 1.78185709341454, 0.0571431775822861, -1.62085736441137, -0.0571431775822855},
+    {0.624348810664881, 2.60585965680469, 0.0184891538601872, -3.23020846746957, -0.018489153860186},
+    {-1.95444613358461, -0.840760571794126, 0.886314438209517, 2.79520670537873, -0.886314438209516},
+    {-1.46766348743601, -0.207946328505567, 0.740282841069557, 1.67560981594158, -0.740282841069557},
+    {-0.729317011881439, 0.751899240989545, 0.518783747129016, -0.0225822291081061, -0.518783747129016},
+    {0.0629622614476711, 1.78185709341454, 0.281105168033127, -1.84481935486222, -0.281105168033127},
+    {0.696813589059751, 2.60585965680469, 0.0909539322550576, -3.30267324586444, -0.0909539322550564},
+    {-0.920380285897062, -0.840760571794126, 1.92038028589706, 1.76114085769119, -1.92038028589706},
+    {-0.603973164252783, -0.207946328505567, 1.60397316425278, 0.811919492758351, -1.60397316425278},
+    {-0.124050379505228, 0.751899240989545, 1.12405037950523, -0.627848861484317, -1.12405037950523},
+    {0.390928546707272, 1.78185709341454, 0.609071453292728, -2.17278564012182, -0.609071453292728},
+    {0.802929828402348, 2.60585965680469, 0.197070171597654, -3.40878948520704, -0.197070171597653},
+    {0.113685561790484, -0.840760571794125, 2.95444613358461, 0.727075010003642, -2.95444613358461},
+    {0.259717158930443, -0.207946328505567, 2.46766348743601, -0.0517708304248748, -2.46766348743601},
+    {0.481216252870984, 0.751899240989544, 1.72931701188144, -1.23311549386053, -1.72931701188144},
+    {0.718894831966874, 1.78185709341454, 0.937037738552329, -2.50075192538142, -0.937037738552329},
+    {0.909046067744945, 2.60585965680469, 0.303186410940251, -3.51490572454964, -0.30318641094025},
+    {0.819829625720786, -0.840760571794125, 3.66059019751491, 0.0209309460733398, -3.66059019751491},
+    {0.849514990619556, -0.207946328505567, 3.05746131912512, -0.641568662113988, -3.05746131912512},
+    {0.894541420222117, 0.751899240989544, 2.14264217923257, -1.64644066121166, -2.14264217923257},
+    {0.942856822417715, 1.78185709341454, 1.16099972900317, -2.72471391583226, -1.16099972900317},
+    {0.981510846139815, 2.60585965680469, 0.375651189335121, -3.58737050294451, -0.37565118933512}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
+    static const double FE1_C0_D10[25][5] = \
+    {{-2.66059019751491, -0.819829625720785, 0.159239428205874, -0.159239428205874, 3.4804198232357},
+    {-2.05746131912512, -0.849514990619555, 0.792053671494433, -0.792053671494433, 2.90697630974468},
+    {-1.14264217923257, -0.894541420222116, 1.75189924098954, -1.75189924098954, 2.03718359945469},
+    {-0.16099972900317, -0.942856822417714, 2.78185709341454, -2.78185709341454, 1.10385655142088},
+    {0.624348810664881, -0.981510846139815, 3.60585965680469, -3.60585965680469, 0.357162035474934},
+    {-1.95444613358461, -0.113685561790483, 0.159239428205875, -0.159239428205875, 2.06813169537509},
+    {-1.46766348743601, -0.259717158930442, 0.792053671494433, -0.792053671494433, 1.72738064636645},
+    {-0.729317011881439, -0.481216252870983, 1.75189924098954, -1.75189924098954, 1.21053326475242},
+    {0.0629622614476713, -0.718894831966873, 2.78185709341454, -2.78185709341454, 0.655932570519202},
+    {0.696813589059752, -0.909046067744944, 3.60585965680469, -3.60585965680469, 0.212232478685193},
+    {-0.920380285897062, 0.920380285897063, 0.159239428205875, -0.159239428205875, 0},
+    {-0.603973164252783, 0.603973164252784, 0.792053671494433, -0.792053671494433, 0},
+    {-0.124050379505228, 0.124050379505228, 1.75189924098954, -1.75189924098954, 0},
+    {0.390928546707273, -0.390928546707272, 2.78185709341454, -2.78185709341454, 0},
+    {0.802929828402348, -0.802929828402348, 3.60585965680469, -3.60585965680469, 0},
+    {0.113685561790483, 1.95444613358461, 0.159239428205875, -0.159239428205875, -2.06813169537509},
+    {0.259717158930442, 1.46766348743601, 0.792053671494433, -0.792053671494433, -1.72738064636645},
+    {0.481216252870984, 0.729317011881439, 1.75189924098954, -1.75189924098954, -1.21053326475242},
+    {0.718894831966873, -0.0629622614476713, 2.78185709341454, -2.78185709341454, -0.655932570519202},
+    {0.909046067744945, -0.696813589059751, 3.60585965680469, -3.60585965680469, -0.212232478685194},
+    {0.819829625720786, 2.66059019751491, 0.159239428205876, -0.159239428205876, -3.4804198232357},
+    {0.849514990619555, 2.05746131912512, 0.792053671494433, -0.792053671494433, -2.90697630974468},
+    {0.894541420222116, 1.14264217923257, 1.75189924098954, -1.75189924098954, -2.03718359945469},
+    {0.942856822417715, 0.16099972900317, 2.78185709341454, -2.78185709341454, -1.10385655142088},
+    {0.981510846139815, -0.624348810664881, 3.60585965680469, -3.60585965680469, -0.357162035474935}};
+    
     // Array of non-zero columns
     static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
     
-    const static double FE0_C1[9][6] = \
-    {{0.499278833175498, -0.0816158215904472, -0.072892306371455, 0.0363981897820602, 0.286562341986258, 0.332268763018087},
-    {0.0251290590975512, -0.0576951799472843, -0.0741406382908806, 0.109006741895515, 0.858208263567716, 0.139491753677383},
-    {-0.117413197449647, -0.022785734101997, 0.453155393641927, 0.0753983311062782, 0.593609805131561, 0.0180354016718773},
-    {-0.0403700664710397, -0.0403700664710397, -0.072892306371455, 0.161480265884159, 0.161480265884159, 0.830671907545216},
-    {-0.120901875682904, -0.120901875682904, -0.0741406382908806, 0.483607502731615, 0.483607502731615, 0.348729384193458},
-    {-0.0836260170297298, -0.0836260170297298, 0.453155393641927, 0.33450406811892, 0.33450406811892, 0.0450885041796933},
-    {-0.0816158215904471, 0.499278833175498, -0.072892306371455, 0.286562341986258, 0.0363981897820602, 0.332268763018087},
-    {-0.0576951799472841, 0.0251290590975512, -0.0741406382908806, 0.858208263567716, 0.109006741895515, 0.139491753677383},
-    {-0.022785734101997, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.0753983311062783, 0.0180354016718774}};
-    // Array of non-zero columns
-    static const unsigned int nzc4[6] = {6, 7, 8, 9, 10, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc5[6] = {0, 1, 2, 3, 4, 5};
-    
-    // Number of operations to compute geometry constants: 41
-    const double G0 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
-    const double G1 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
-    const double G2 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
-    const double G3 = det*w[2][0];
-    const double G4 =  - 0.5*det*w[1][0]*w[2][0];
-    const double G5 = det*(3*Jinv_10*Jinv_10 + 3*Jinv_11*Jinv_11);
-    const double G6 = det*(3*Jinv_00*Jinv_10 + 3*Jinv_01*Jinv_11);
-    const double G7 =  - 3*Jinv_11*det;
-    const double G8 = det*(3*Jinv_00*Jinv_00 + 3*Jinv_01*Jinv_01);
-    const double G9 =  - 3*Jinv_01*det;
+    // Number of operations to compute geometry constants: 35
+    const double G0 = 3*det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
+    const double G1 = -3*Jinv_01*det;
+    const double G2 = 3*det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
+    const double G3 = -0.5*det*w[1][0]*w[2][0];
+    const double G4 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
+    const double G5 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
+    const double G6 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
+    const double G7 = det*w[2][0];
+    const double G8 = -3*Jinv_11*det;
+    const double G9 = 3*det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 7826
+    // Total number of operations to compute element tensor: 21660
     
     // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 7785
-    for (unsigned int ip = 0; ip < 9; ip++)
+    // Number of operations to compute element tensor for following IP loop = 21625
+    for (unsigned int ip = 0; ip < 25; ip++)
     {
       
       // Function declarations
@@ -9279,267 +7678,125 @@ void UFC_SolitaryWave2DBilinearForm_cell
       // Total number of operations to compute function values = 20
       for (unsigned int r = 0; r < 5; r++)
       {
-        F1 += FE0_C1_D10[ip][r]*w[0][nzc2[r]];
-        F2 += FE0_C1_D01[ip][r]*w[0][nzc3[r]];
+        F1 += FE1_C0_D10[ip][r]*w[0][nzc2[r]];
+        F2 += FE1_C0_D01[ip][r]*w[0][nzc1[r]];
       }// end loop over 'r'
       
       // Total number of operations to compute function values = 12
       for (unsigned int r = 0; r < 6; r++)
       {
-        F0 += FE0_C1[ip][r]*w[0][nzc4[r]];
+        F0 += FE1_C0[ip][r]*w[0][nzc3[r]];
       }// end loop over 'r'
       
       // Number of operations to compute ip constants: 29
+      // Number of operations: 7
+      const double Gip0 = F0*F0*W25[ip]*(G1 + F1*G0 + F2*G2);
+      
+      // Number of operations: 1
+      const double Gip1 = G3*W25[ip];
+      
       // Number of operations: 4
-      const double Gip0 = F0*F0*F0*W9[ip]*G0;
+      const double Gip2 = F0*F0*F0*G4*W25[ip];
       
       // Number of operations: 4
-      const double Gip1 = F0*F0*F0*W9[ip]*G1;
+      const double Gip3 = F0*F0*F0*G5*W25[ip];
       
       // Number of operations: 1
-      const double Gip2 = W9[ip]*det;
+      const double Gip4 = W25[ip]*det;
       
       // Number of operations: 4
-      const double Gip3 = F0*F0*F0*W9[ip]*G2;
+      const double Gip5 = F0*F0*F0*G6*W25[ip];
       
       // Number of operations: 1
-      const double Gip4 = W9[ip]*G3;
-      
-      // Number of operations: 1
-      const double Gip5 = W9[ip]*G4;
+      const double Gip6 = G7*W25[ip];
       
       // Number of operations: 7
-      const double Gip6 = F0*F0*W9[ip]*(G7 + F1*G6 + F2*G5);
-      
-      // Number of operations: 7
-      const double Gip7 = F0*F0*W9[ip]*(G9 + F1*G8 + F2*G6);
-      
-      
-      // Number of operations for primary indices = 324
+      const double Gip7 = F0*F0*W25[ip]*(G8 + F1*G2 + F2*G9);
+      
+      
+      // Number of operations for primary indices: 324
       for (unsigned int j = 0; j < 6; j++)
       {
         for (unsigned int k = 0; k < 6; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*12 + nzc4[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip2;
-          // Number of operations to compute entry = 3
-          A[nzc5[j]*12 + nzc5[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip4;
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*12 + nzc5[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip5;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*12 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip1;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*12 + nzc3[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip4;
+          // Number of operations to compute entry: 3
+          A[nzc0[j]*12 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip6;
         }// end loop over 'k'
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 180
+      // Number of operations for primary indices: 180
       for (unsigned int j = 0; j < 5; j++)
       {
         for (unsigned int k = 0; k < 6; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*12 + nzc4[k]] += FE0_C1[ip][k]*FE0_C1_D01[ip][j]*Gip6;
-          // Number of operations to compute entry = 3
-          A[nzc2[j]*12 + nzc4[k]] += FE0_C1[ip][k]*FE0_C1_D10[ip][j]*Gip7;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*12 + nzc3[k]] += FE1_C0[ip][k]*FE1_C0_D10[ip][j]*Gip0;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*12 + nzc3[k]] += FE1_C0[ip][k]*FE1_C0_D01[ip][j]*Gip7;
         }// end loop over 'k'
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 300
+      // Number of operations for primary indices: 300
       for (unsigned int j = 0; j < 5; j++)
       {
         for (unsigned int k = 0; k < 5; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc2[j]*12 + nzc2[k]] += FE0_C1_D10[ip][j]*FE0_C1_D10[ip][k]*Gip0;
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*12 + nzc2[k]] += FE0_C1_D01[ip][j]*FE0_C1_D10[ip][k]*Gip1;
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*12 + nzc3[k]] += FE0_C1_D01[ip][j]*FE0_C1_D01[ip][k]*Gip3;
-          // Number of operations to compute entry = 3
-          A[nzc2[j]*12 + nzc3[k]] += FE0_C1_D01[ip][k]*FE0_C1_D10[ip][j]*Gip1;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*12 + nzc2[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip2;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*12 + nzc1[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip3;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*12 + nzc1[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip5;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*12 + nzc2[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip5;
         }// end loop over 'k'
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SolitaryWave2DBilinearForm_cell_integral_0::UFC_SolitaryWave2DBilinearForm_cell_integral_0() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_cell_integral_0::~UFC_SolitaryWave2DBilinearForm_cell_integral_0()
+solitarywave2d_0_cell_integral_0::solitarywave2d_0_cell_integral_0() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_cell_integral_0::~solitarywave2d_0_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave2DBilinearForm_cell_integral_0::tabulate_tensor(double* A,
+void solitarywave2d_0_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
-    A[20] = 0;
-    A[21] = 0;
-    A[22] = 0;
-    A[23] = 0;
-    A[24] = 0;
-    A[25] = 0;
-    A[26] = 0;
-    A[27] = 0;
-    A[28] = 0;
-    A[29] = 0;
-    A[30] = 0;
-    A[31] = 0;
-    A[32] = 0;
-    A[33] = 0;
-    A[34] = 0;
-    A[35] = 0;
-    A[36] = 0;
-    A[37] = 0;
-    A[38] = 0;
-    A[39] = 0;
-    A[40] = 0;
-    A[41] = 0;
-    A[42] = 0;
-    A[43] = 0;
-    A[44] = 0;
-    A[45] = 0;
-    A[46] = 0;
-    A[47] = 0;
-    A[48] = 0;
-    A[49] = 0;
-    A[50] = 0;
-    A[51] = 0;
-    A[52] = 0;
-    A[53] = 0;
-    A[54] = 0;
-    A[55] = 0;
-    A[56] = 0;
-    A[57] = 0;
-    A[58] = 0;
-    A[59] = 0;
-    A[60] = 0;
-    A[61] = 0;
-    A[62] = 0;
-    A[63] = 0;
-    A[64] = 0;
-    A[65] = 0;
-    A[66] = 0;
-    A[67] = 0;
-    A[68] = 0;
-    A[69] = 0;
-    A[70] = 0;
-    A[71] = 0;
-    A[72] = 0;
-    A[73] = 0;
-    A[74] = 0;
-    A[75] = 0;
-    A[76] = 0;
-    A[77] = 0;
-    A[78] = 0;
-    A[79] = 0;
-    A[80] = 0;
-    A[81] = 0;
-    A[82] = 0;
-    A[83] = 0;
-    A[84] = 0;
-    A[85] = 0;
-    A[86] = 0;
-    A[87] = 0;
-    A[88] = 0;
-    A[89] = 0;
-    A[90] = 0;
-    A[91] = 0;
-    A[92] = 0;
-    A[93] = 0;
-    A[94] = 0;
-    A[95] = 0;
-    A[96] = 0;
-    A[97] = 0;
-    A[98] = 0;
-    A[99] = 0;
-    A[100] = 0;
-    A[101] = 0;
-    A[102] = 0;
-    A[103] = 0;
-    A[104] = 0;
-    A[105] = 0;
-    A[106] = 0;
-    A[107] = 0;
-    A[108] = 0;
-    A[109] = 0;
-    A[110] = 0;
-    A[111] = 0;
-    A[112] = 0;
-    A[113] = 0;
-    A[114] = 0;
-    A[115] = 0;
-    A[116] = 0;
-    A[117] = 0;
-    A[118] = 0;
-    A[119] = 0;
-    A[120] = 0;
-    A[121] = 0;
-    A[122] = 0;
-    A[123] = 0;
-    A[124] = 0;
-    A[125] = 0;
-    A[126] = 0;
-    A[127] = 0;
-    A[128] = 0;
-    A[129] = 0;
-    A[130] = 0;
-    A[131] = 0;
-    A[132] = 0;
-    A[133] = 0;
-    A[134] = 0;
-    A[135] = 0;
-    A[136] = 0;
-    A[137] = 0;
-    A[138] = 0;
-    A[139] = 0;
-    A[140] = 0;
-    A[141] = 0;
-    A[142] = 0;
-    A[143] = 0;
+    for (unsigned int j = 0; j < 144; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0_quadrature::UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0_quadrature::~UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0_quadrature()
+solitarywave2d_0_exterior_facet_integral_0_quadrature::solitarywave2d_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_exterior_facet_integral_0_quadrature::~solitarywave2d_0_exterior_facet_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave2d_0_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
@@ -9548,9 +7805,9 @@ void UFC_SolitaryWave2DBilinearForm_exte
     const double * const * x = c.coordinates;
     
     // Compute Jacobian of affine map from reference cell
-      
-    // Compute determinant of Jacobian
-      
+    
+    // Compute determinant of Jacobian
+    
     // Compute inverse of Jacobian
     
     // Vertices on edges
@@ -9565,31 +7822,40 @@ void UFC_SolitaryWave2DBilinearForm_exte
     const double dx1 = x[v1][1] - x[v0][1];
     const double det = std::sqrt(dx0*dx0 + dx1*dx1);
     
+    const bool direction = dx1*(x[facet][0] - x[v0][0]) - dx0*(x[facet][1] - x[v0][1]) < 0;
+    
+    // Compute facet normals from the facet scale factor constants
+    const double n1 = direction ? -dx0 / det : dx0 / det;
+    
     
     // Array of quadrature weights
-    const static double W3[3] = {0.277777777777778, 0.444444444444444, 0.277777777777778};
-    
-    
-    const static double FE0_f0_C1[3][3] = \
-    {{0.687298334620742, -0.0872983346207417, 0.4},
+    static const double W5[5] = {0.118463442528094, 0.239314335249683, 0.284444444444444, 0.239314335249683, 0.118463442528094};
+    // Quadrature points on the UFC reference element: (0.046910077030668), (0.230765344947158), (0.5), (0.769234655052841), (0.953089922969332)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE0_f0_C0[5][3] = \
+    {{0.863670879562042, -0.0425089663766216, 0.178838086814579},
+    {0.414209254015687, -0.124260056089996, 0.71005080207431},
     {0, 0, 1},
-    {-0.0872983346207416, 0.687298334620742, 0.4}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[3] = {7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc1[3] = {1, 2, 3};
-    // Array of non-zero columns
-    static const unsigned int nzc2[3] = {6, 7, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc3[3] = {0, 1, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc6[3] = {0, 2, 4};
-    // Array of non-zero columns
-    static const unsigned int nzc7[3] = {6, 8, 10};
+    {-0.124260056089996, 0.414209254015687, 0.71005080207431},
+    {-0.0425089663766216, 0.863670879562042, 0.178838086814579}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[3] = {7, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc0[3] = {1, 2, 3};
+    // Array of non-zero columns
+    static const unsigned int nzc5[3] = {6, 7, 11};
+    // Array of non-zero columns
+    static const unsigned int nzc4[3] = {0, 1, 5};
+    // Array of non-zero columns
+    static const unsigned int nzc2[3] = {0, 2, 4};
+    // Array of non-zero columns
+    static const unsigned int nzc3[3] = {6, 8, 10};
     
     // Number of operations to compute geometry constants: 2
     // Should be added to total operation count.
-    const double G0 = 3*det*w[3][1];
+    const double G0 = 3*det*n1;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
@@ -9597,11 +7863,11 @@ void UFC_SolitaryWave2DBilinearForm_exte
     {
     case 0:
       {
-      // Total number of operations to compute element tensor (from this point): 108
+      // Total number of operations to compute element tensor (from this point): 180
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 108
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 180
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -9610,21 +7876,21 @@ void UFC_SolitaryWave2DBilinearForm_exte
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc0[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 27
+        const double Gip0 = F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 27
         for (unsigned int j = 0; j < 3; j++)
         {
           for (unsigned int k = 0; k < 3; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc1[j]*12 + nzc0[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc0[j]*12 + nzc1[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -9632,11 +7898,11 @@ void UFC_SolitaryWave2DBilinearForm_exte
       break;
     case 1:
       {
-      // Total number of operations to compute element tensor (from this point): 108
+      // Total number of operations to compute element tensor (from this point): 180
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 108
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 180
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -9645,21 +7911,21 @@ void UFC_SolitaryWave2DBilinearForm_exte
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc7[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 27
+        const double Gip0 = F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 27
         for (unsigned int j = 0; j < 3; j++)
         {
           for (unsigned int k = 0; k < 3; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc6[j]*12 + nzc7[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc2[j]*12 + nzc3[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -9667,11 +7933,11 @@ void UFC_SolitaryWave2DBilinearForm_exte
       break;
     case 2:
       {
-      // Total number of operations to compute element tensor (from this point): 108
+      // Total number of operations to compute element tensor (from this point): 180
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 108
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 180
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -9680,21 +7946,21 @@ void UFC_SolitaryWave2DBilinearForm_exte
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc2[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 27
+        const double Gip0 = F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 27
         for (unsigned int j = 0; j < 3; j++)
         {
           for (unsigned int k = 0; k < 3; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc3[j]*12 + nzc2[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc4[j]*12 + nzc5[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -9704,351 +7970,203 @@ void UFC_SolitaryWave2DBilinearForm_exte
 }
 
 /// Constructor
-UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0::UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0::~UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0()
+solitarywave2d_0_exterior_facet_integral_0::solitarywave2d_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_0_exterior_facet_integral_0::~solitarywave2d_0_exterior_facet_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0::tabulate_tensor(double* A,
+void solitarywave2d_0_exterior_facet_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
-    A[20] = 0;
-    A[21] = 0;
-    A[22] = 0;
-    A[23] = 0;
-    A[24] = 0;
-    A[25] = 0;
-    A[26] = 0;
-    A[27] = 0;
-    A[28] = 0;
-    A[29] = 0;
-    A[30] = 0;
-    A[31] = 0;
-    A[32] = 0;
-    A[33] = 0;
-    A[34] = 0;
-    A[35] = 0;
-    A[36] = 0;
-    A[37] = 0;
-    A[38] = 0;
-    A[39] = 0;
-    A[40] = 0;
-    A[41] = 0;
-    A[42] = 0;
-    A[43] = 0;
-    A[44] = 0;
-    A[45] = 0;
-    A[46] = 0;
-    A[47] = 0;
-    A[48] = 0;
-    A[49] = 0;
-    A[50] = 0;
-    A[51] = 0;
-    A[52] = 0;
-    A[53] = 0;
-    A[54] = 0;
-    A[55] = 0;
-    A[56] = 0;
-    A[57] = 0;
-    A[58] = 0;
-    A[59] = 0;
-    A[60] = 0;
-    A[61] = 0;
-    A[62] = 0;
-    A[63] = 0;
-    A[64] = 0;
-    A[65] = 0;
-    A[66] = 0;
-    A[67] = 0;
-    A[68] = 0;
-    A[69] = 0;
-    A[70] = 0;
-    A[71] = 0;
-    A[72] = 0;
-    A[73] = 0;
-    A[74] = 0;
-    A[75] = 0;
-    A[76] = 0;
-    A[77] = 0;
-    A[78] = 0;
-    A[79] = 0;
-    A[80] = 0;
-    A[81] = 0;
-    A[82] = 0;
-    A[83] = 0;
-    A[84] = 0;
-    A[85] = 0;
-    A[86] = 0;
-    A[87] = 0;
-    A[88] = 0;
-    A[89] = 0;
-    A[90] = 0;
-    A[91] = 0;
-    A[92] = 0;
-    A[93] = 0;
-    A[94] = 0;
-    A[95] = 0;
-    A[96] = 0;
-    A[97] = 0;
-    A[98] = 0;
-    A[99] = 0;
-    A[100] = 0;
-    A[101] = 0;
-    A[102] = 0;
-    A[103] = 0;
-    A[104] = 0;
-    A[105] = 0;
-    A[106] = 0;
-    A[107] = 0;
-    A[108] = 0;
-    A[109] = 0;
-    A[110] = 0;
-    A[111] = 0;
-    A[112] = 0;
-    A[113] = 0;
-    A[114] = 0;
-    A[115] = 0;
-    A[116] = 0;
-    A[117] = 0;
-    A[118] = 0;
-    A[119] = 0;
-    A[120] = 0;
-    A[121] = 0;
-    A[122] = 0;
-    A[123] = 0;
-    A[124] = 0;
-    A[125] = 0;
-    A[126] = 0;
-    A[127] = 0;
-    A[128] = 0;
-    A[129] = 0;
-    A[130] = 0;
-    A[131] = 0;
-    A[132] = 0;
-    A[133] = 0;
-    A[134] = 0;
-    A[135] = 0;
-    A[136] = 0;
-    A[137] = 0;
-    A[138] = 0;
-    A[139] = 0;
-    A[140] = 0;
-    A[141] = 0;
-    A[142] = 0;
-    A[143] = 0;
+    for (unsigned int j = 0; j < 144; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c, facet);
 }
 
 /// Constructor
-UFC_SolitaryWave2DBilinearForm::UFC_SolitaryWave2DBilinearForm() : ufc::form()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DBilinearForm::~UFC_SolitaryWave2DBilinearForm()
+solitarywave2d_form_0::solitarywave2d_form_0() : ufc::form()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_form_0::~solitarywave2d_form_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SolitaryWave2DBilinearForm::signature() const
-{
-    return "Form([Integral(Sum(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),)))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('triangle', 1), 2), Product(Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1), 1)), Product(IntValue(-1, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(0),))), MultiIndex((Index(1),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(2),))), MultiIndex((Index(1),)))), MultiIndex((Index(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))), Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))))))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(3),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(3),))), MultiIndex((Index(4),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(5),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(5),))), MultiIndex((Index(4),)))), MultiIndex((Index(4),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {})))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('triangle', 1), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),)))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4})), Integral(Product(Indexed(VectorConstant(Cell('triangle', 1), 2, 3), MultiIndex((FixedIndex(1),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))))), Measure('exterior_facet', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+const char* solitarywave2d_form_0::signature() const
+{
+    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1, Space(2)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2}))))))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('triangle', 1, Space(2))), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Measure('exterior_facet', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SolitaryWave2DBilinearForm::rank() const
+unsigned int solitarywave2d_form_0::rank() const
 {
     return 2;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SolitaryWave2DBilinearForm::num_coefficients() const
-{
-    return 4;
+unsigned int solitarywave2d_form_0::num_coefficients() const
+{
+    return 3;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SolitaryWave2DBilinearForm::num_cell_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave2d_form_0::num_cell_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SolitaryWave2DBilinearForm::num_exterior_facet_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave2d_form_0::num_exterior_facet_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SolitaryWave2DBilinearForm::num_interior_facet_integrals() const
+unsigned int solitarywave2d_form_0::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SolitaryWave2DBilinearForm::create_finite_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_2();
+ufc::finite_element* solitarywave2d_form_0::create_finite_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_finite_element_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_finite_element_1();
+      break;
+    case 2:
+      return new solitarywave2d_0_finite_element_2();
       break;
     case 3:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_3();
+      return new solitarywave2d_0_finite_element_3();
       break;
     case 4:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_4();
-      break;
-    case 5:
-      return new UFC_SolitaryWave2DBilinearForm_finite_element_5();
+      return new solitarywave2d_0_finite_element_4();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SolitaryWave2DBilinearForm::create_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_2();
+ufc::dof_map* solitarywave2d_form_0::create_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_0_dof_map_0();
+      break;
+    case 1:
+      return new solitarywave2d_0_dof_map_1();
+      break;
+    case 2:
+      return new solitarywave2d_0_dof_map_2();
       break;
     case 3:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_3();
+      return new solitarywave2d_0_dof_map_3();
       break;
     case 4:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_4();
-      break;
-    case 5:
-      return new UFC_SolitaryWave2DBilinearForm_dof_map_5();
+      return new solitarywave2d_0_dof_map_4();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SolitaryWave2DBilinearForm::create_cell_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_cell_integral_0();
+ufc::cell_integral* solitarywave2d_form_0::create_cell_integral(unsigned int i) const
+{
+    return new solitarywave2d_0_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SolitaryWave2DBilinearForm::create_exterior_facet_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DBilinearForm_exterior_facet_integral_0();
+ufc::exterior_facet_integral* solitarywave2d_form_0::create_exterior_facet_integral(unsigned int i) const
+{
+    return new solitarywave2d_0_exterior_facet_integral_0();
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SolitaryWave2DBilinearForm::create_interior_facet_integral(unsigned int i) const
-{
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_0_0::UFC_SolitaryWave2DLinearForm_finite_element_0_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_0_0::~UFC_SolitaryWave2DLinearForm_finite_element_0_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_0_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_0_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_0::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+ufc::interior_facet_integral* solitarywave2d_form_0::create_interior_facet_integral(unsigned int i) const
+{
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_0_0::solitarywave2d_1_finite_element_0_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_0_0::~solitarywave2d_1_finite_element_0_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_0_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_0_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_0_0::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_0_0::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_0_0::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_0_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -10102,7 +8220,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -10123,91 +8241,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_0_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -10259,7 +8377,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -10269,7 +8387,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -10277,7 +8395,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -10374,23 +8492,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_1_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_0_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -10417,22 +8535,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_0_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -10443,75 +8561,75 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_0_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_0_1::UFC_SolitaryWave2DLinearForm_finite_element_0_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_0_1::~UFC_SolitaryWave2DLinearForm_finite_element_0_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_0_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_0_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_1::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_0_0::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_0_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_0_0();
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_0_1::solitarywave2d_1_finite_element_0_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_0_1::~solitarywave2d_1_finite_element_0_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_0_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_0_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_0_1::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_0_1::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_0_1::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_0_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -10565,7 +8683,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -10586,91 +8704,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_0_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -10722,7 +8840,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -10732,7 +8850,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -10740,7 +8858,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -10837,23 +8955,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_1_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_0_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -10880,22 +8998,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_0_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -10906,75 +9024,75 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_0_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_0::UFC_SolitaryWave2DLinearForm_finite_element_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_0::~UFC_SolitaryWave2DLinearForm_finite_element_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_0::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0::space_dimension() const
-{
-    return 12;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_0_1::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_0_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_0_1();
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_0::solitarywave2d_1_finite_element_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_0::~solitarywave2d_1_finite_element_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_0::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_0::space_dimension() const
+{
+    return 12;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_0::value_rank() const
+{
+    return 1;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_0::value_dimension(unsigned int i) const
+{
+    return 2;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -11031,7 +9149,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11083,7 +9201,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11106,91 +9224,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -11244,7 +9362,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11254,7 +9372,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -11262,7 +9380,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -11390,7 +9508,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11400,7 +9518,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -11408,7 +9526,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -11507,23 +9625,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+void solitarywave2d_1_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -11550,22 +9668,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -11580,84 +9698,84 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_0::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_0::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_1_0::UFC_SolitaryWave2DLinearForm_finite_element_1_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_1_0::~UFC_SolitaryWave2DLinearForm_finite_element_1_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_1_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_1_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_0::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_0::num_sub_elements() const
+{
+    return 2;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_0::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_finite_element_0_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_finite_element_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_1_0::solitarywave2d_1_finite_element_1_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_1_0::~solitarywave2d_1_finite_element_1_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_1_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_1_0::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_1_0::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_1_0::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_1_0::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_1_0::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -11711,7 +9829,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11732,91 +9850,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_1_0::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -11868,7 +9986,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -11878,7 +9996,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -11886,7 +10004,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -11983,23 +10101,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_1_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_1_0::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -12026,22 +10144,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_1_0::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -12052,75 +10170,75 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_1_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_1_1::UFC_SolitaryWave2DLinearForm_finite_element_1_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_1_1::~UFC_SolitaryWave2DLinearForm_finite_element_1_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_1_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_1_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_1::space_dimension() const
-{
-    return 6;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_1_0::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_1_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_1_0();
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_1_1::solitarywave2d_1_finite_element_1_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_1_1::~solitarywave2d_1_finite_element_1_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_1_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_1_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_1_1::space_dimension() const
+{
+    return 6;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_1_1::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_1_1::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_1_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -12174,7 +10292,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -12195,91 +10313,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_1_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -12331,7 +10449,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[6][6] = \
+    static const double coefficients0[6][6] = \
     {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
     {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
     {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -12341,7 +10459,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[6][6] = \
+    static const double dmats0[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {4.89897948556636, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0},
@@ -12349,7 +10467,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     {4, 0, 7.07106781186548, 0, 0, 0},
     {0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[6][6] = \
+    static const double dmats1[6][6] = \
     {{0, 0, 0, 0, 0, 0},
     {2.44948974278318, 0, 0, 0, 0, 0},
     {4.24264068711928, 0, 0, 0, 0, 0},
@@ -12446,23 +10564,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+void solitarywave2d_1_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_1_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -12489,22 +10607,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_1_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -12515,75 +10633,75 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_1_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_1::UFC_SolitaryWave2DLinearForm_finite_element_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_1::~UFC_SolitaryWave2DLinearForm_finite_element_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_1::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1::space_dimension() const
-{
-    return 12;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_1_1::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_1_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_1_1();
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_1::solitarywave2d_1_finite_element_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_1::~solitarywave2d_1_finite_element_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_1::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_1::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_1::space_dimension() const
+{
+    return 12;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_1::value_rank() const
+{
+    return 1;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_1::value_dimension(unsigned int i) const
+{
+    return 2;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_1::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -12640,7 +10758,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -12692,7 +10810,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -12715,91 +10833,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_1::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -12853,7 +10971,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -12863,7 +10981,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -12871,7 +10989,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -12999,7 +11117,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[6][6] =   \
+      static const double coefficients0[6][6] =   \
       {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
       {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
       {0, 0, 0.2, 0, 0, 0.163299316185545},
@@ -13009,7 +11127,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[6][6] =   \
+      static const double dmats0[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {4.89897948556636, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0},
@@ -13017,7 +11135,7 @@ void UFC_SolitaryWave2DLinearForm_finite
       {4, 0, 7.07106781186548, 0, 0, 0},
       {0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[6][6] =   \
+      static const double dmats1[6][6] =   \
       {{0, 0, 0, 0, 0, 0},
       {2.44948974278318, 0, 0, 0, 0, 0},
       {4.24264068711928, 0, 0, 0, 0, 0},
@@ -13116,23 +11234,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    const static double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+void solitarywave2d_1_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_1::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
+    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -13159,22 +11277,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_1::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -13189,84 +11307,84 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_1::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_1::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_2::UFC_SolitaryWave2DLinearForm_finite_element_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_2::~UFC_SolitaryWave2DLinearForm_finite_element_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_2::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_2::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_2::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_2::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_2::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_1::num_sub_elements() const
+{
+    return 2;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_1::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_finite_element_1_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_finite_element_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_2::solitarywave2d_1_finite_element_2() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_2::~solitarywave2d_1_finite_element_2()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_2::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_2::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_2::space_dimension() const
+{
+    return 1;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_2::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_2::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_2::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -13306,7 +11424,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Extract relevant coefficients
@@ -13317,91 +11435,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_2::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_2::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -13439,15 +11557,15 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -13509,23 +11627,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+void solitarywave2d_1_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_2::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -13552,22 +11670,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_2::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_2::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_2::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_2::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -13578,75 +11696,75 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_2::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_2::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_3::UFC_SolitaryWave2DLinearForm_finite_element_3() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_3::~UFC_SolitaryWave2DLinearForm_finite_element_3()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_3::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_3::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_3::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_3::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_3::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
+unsigned int solitarywave2d_1_finite_element_2::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_2::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_2();
+}
+
+
+/// Constructor
+solitarywave2d_1_finite_element_3::solitarywave2d_1_finite_element_3() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_finite_element_3::~solitarywave2d_1_finite_element_3()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the finite element
+const char* solitarywave2d_1_finite_element_3::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return the cell shape
+ufc::shape solitarywave2d_1_finite_element_3::cell_shape() const
+{
+    return ufc::triangle;
+}
+
+/// Return the dimension of the finite element function space
+unsigned int solitarywave2d_1_finite_element_3::space_dimension() const
+{
+    return 1;
+}
+
+/// Return the rank of the value space
+unsigned int solitarywave2d_1_finite_element_3::value_rank() const
+{
+    return 0;
+}
+
+/// Return the dimension of the value space for axis i
+unsigned int solitarywave2d_1_finite_element_3::value_dimension(unsigned int i) const
+{
+    return 1;
+}
+
+/// Evaluate basis function i at given point in cell
+void solitarywave2d_1_finite_element_3::evaluate_basis(unsigned int i,
+                                   double* values,
+                                   const double* coordinates,
+                                   const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
     // Compute determinant of Jacobian
     const double detJ = J_00*J_11 - J_01*J_10;
     
@@ -13686,7 +11804,7 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Extract relevant coefficients
@@ -13697,91 +11815,91 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
+void solitarywave2d_1_finite_element_3::evaluate_basis_all(double* values,
+                                       const double* coordinates,
+                                       const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
+}
+
+/// Evaluate order n derivatives of basis function i at given point in cell
+void solitarywave2d_1_finite_element_3::evaluate_basis_derivatives(unsigned int i,
+                                               unsigned int n,
+                                               double* values,
+                                               const double* coordinates,
+                                               const ufc::cell& c) const
+{
+    // Extract vertex coordinates
+    const double * const * element_coordinates = c.coordinates;
+    
+    // Compute Jacobian of affine map from reference cell
+    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
+    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
+    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
+    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
+    
+    // Compute determinant of Jacobian
+    const double detJ = J_00*J_11 - J_01*J_10;
+    
+    // Compute inverse of Jacobian
+    
+    // Get coordinates and map to the reference (UFC) element
+    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
+                element_coordinates[0][0]*element_coordinates[2][1] +\
+                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
+    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
+                element_coordinates[1][0]*element_coordinates[0][1] -\
+                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
+    
+    // Map coordinates to the reference square
+    if (std::abs(y - 1.0) < 1e-14)
+      x = -1.0;
+    else
+      x = 2.0 *x/(1.0 - y) - 1.0;
+    y = 2.0*y - 1.0;
+    
+    // Compute number of derivatives
+    unsigned int num_derivatives = 1;
+    
+    for (unsigned int j = 0; j < n; j++)
+      num_derivatives *= 2;
+    
+    
+    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
+    unsigned int **combinations = new unsigned int *[num_derivatives];
+    
+    for (unsigned int j = 0; j < num_derivatives; j++)
+    {
+      combinations[j] = new unsigned int [n];
+      for (unsigned int k = 0; k < n; k++)
+        combinations[j][k] = 0;
+    }
+    
+    // Generate combinations of derivatives
+    for (unsigned int row = 1; row < num_derivatives; row++)
+    {
+      for (unsigned int num = 0; num < row; num++)
+      {
+        for (unsigned int col = n-1; col+1 > 0; col--)
+        {
+          if (combinations[row][col] + 1 > 1)
+            combinations[row][col] = 0;
+          else
+          {
+            combinations[row][col] += 1;
+            break;
+          }
+        }
+      }
+    }
+    
+    // Compute inverse of Jacobian
+    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
+    
+    // Declare transformation matrix
+    // Declare pointer to two dimensional array and initialise
+    double **transform = new double *[num_derivatives];
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -13819,15 +11937,15 @@ void UFC_SolitaryWave2DLinearForm_finite
     const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.41421356237309}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -13889,23 +12007,23 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+void solitarywave2d_1_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
+                                                   double* values,
+                                                   const double* coordinates,
+                                                   const ufc::cell& c) const
+{
+    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
+}
+
+/// Evaluate linear functional for dof i on the function f
+double solitarywave2d_1_finite_element_3::evaluate_dof(unsigned int i,
+                                   const ufc::function& f,
+                                   const ufc::cell& c) const
+{
+    // The reference points, direction and weights:
+    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -13932,22 +12050,22 @@ double UFC_SolitaryWave2DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_3::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_3::interpolate_vertex_values(double* vertex_values,
+    // Multiply by weights
+    result *= W[i][0];
+    
+    return result;
+}
+
+/// Evaluate linear functionals for all dofs on the function f
+void solitarywave2d_1_finite_element_3::evaluate_dofs(double* values,
+                                  const ufc::function& f,
+                                  const ufc::cell& c) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Interpolate vertex values from dof values
+void solitarywave2d_1_finite_element_3::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -13958,1708 +12076,449 @@ void UFC_SolitaryWave2DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_3::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_3::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_4_0::UFC_SolitaryWave2DLinearForm_finite_element_4_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_4_0::~UFC_SolitaryWave2DLinearForm_finite_element_4_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_4_0::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_4_0::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_0::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_4_0::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_4_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_4_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_4_1::UFC_SolitaryWave2DLinearForm_finite_element_4_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_4_1::~UFC_SolitaryWave2DLinearForm_finite_element_4_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_4_1::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_4_1::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_1::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_4_1::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_4_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_finite_element_4_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_finite_element_4::UFC_SolitaryWave2DLinearForm_finite_element_4() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_finite_element_4::~UFC_SolitaryWave2DLinearForm_finite_element_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave2DLinearForm_finite_element_4::signature() const
-{
-    return "MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0), FiniteElement('Discontinuous Lagrange', 'triangle', 0)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave2DLinearForm_finite_element_4::cell_shape() const
-{
-    return ufc::triangle;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4::space_dimension() const
-{
-    return 2;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4::value_dimension(unsigned int i) const
-{
-    return 2;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0;
-    }
-    
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-      
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.41421356237309}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[2][1][2] = {{{0.333333333333333, 0.333333333333333}}, {{0.333333333333333, 0.333333333333333}}};
-    const static double W[2][1] = {{1}, {1}};
-    const static double D[2][1][2] = {{{1, 0}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave2DLinearForm_finite_element_4::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave2DLinearForm_finite_element_4::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[4] = dof_values[0];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[1];
-    vertex_values[3] = dof_values[1];
-    vertex_values[5] = dof_values[1];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_finite_element_4::num_sub_elements() const
-{
-    return 2;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave2DLinearForm_finite_element_4::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_4_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_4_1();
-      break;
-    }
-    return 0;
-}
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_0_0::UFC_SolitaryWave2DLinearForm_dof_map_0_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_0_0::~UFC_SolitaryWave2DLinearForm_dof_map_0_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_0_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_0_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_0_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_finite_element_3::num_sub_elements() const
+{
+    return 1;
+}
+
+/// Create a new finite element for sub element i (for a mixed element)
+ufc::finite_element* solitarywave2d_1_finite_element_3::create_sub_element(unsigned int i) const
+{
+    return new solitarywave2d_1_finite_element_3();
+}
+
+/// Constructor
+solitarywave2d_1_dof_map_0_0::solitarywave2d_1_dof_map_0_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_0_0::~solitarywave2d_1_dof_map_0_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_0_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_0_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_0_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::num_facet_dofs() const
+void solitarywave2d_1_dof_map_0_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_0_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_0_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_0_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_0_0::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_0_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_0_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_0_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_0_1::UFC_SolitaryWave2DLinearForm_dof_map_0_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_0_1::~UFC_SolitaryWave2DLinearForm_dof_map_0_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_0_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_0_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_0_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_0_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_1_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_0_0::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_1_dof_map_0_0::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_0_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_0_0();
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_0_1::solitarywave2d_1_dof_map_0_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_0_1::~solitarywave2d_1_dof_map_0_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_0_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_0_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_0_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::num_facet_dofs() const
+void solitarywave2d_1_dof_map_0_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_0_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_0_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_0_1::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_0_1::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_0_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_0_1::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_0_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_0::UFC_SolitaryWave2DLinearForm_dof_map_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_0::~UFC_SolitaryWave2DLinearForm_dof_map_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_0::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_0_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_1_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_0_1::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_1_dof_map_0_1::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_0_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_0_1();
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_0::solitarywave2d_1_dof_map_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_0::~solitarywave2d_1_dof_map_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_0::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::local_dimension() const
-{
-    return 12;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::num_facet_dofs() const
-{
-    return 6;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_1_dof_map_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_0::local_dimension(const ufc::cell& c) const
+{
+    return 12;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_0::max_local_dimension() const
+{
+    return 12;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_0::num_facet_dofs() const
+{
+    return 6;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_1_dof_map_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -15681,10 +12540,10 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
+void solitarywave2d_1_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -15714,14 +12573,14 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void solitarywave2d_1_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -15752,441 +12611,459 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_0::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_1_0::UFC_SolitaryWave2DLinearForm_dof_map_1_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_1_0::~UFC_SolitaryWave2DLinearForm_dof_map_1_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_1_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_1_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_1_0::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_0::num_sub_dof_maps() const
+{
+    return 2;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_0::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_dof_map_0_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_dof_map_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_1_0::solitarywave2d_1_dof_map_1_0() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_1_0::~solitarywave2d_1_dof_map_1_0()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_1_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_1_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_1_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::num_facet_dofs() const
+void solitarywave2d_1_dof_map_1_0::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_1_0::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_1_0::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_1_0::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_1_0::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_1_0::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_1_0::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_1_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_1_1::UFC_SolitaryWave2DLinearForm_dof_map_1_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_1_1::~UFC_SolitaryWave2DLinearForm_dof_map_1_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_1_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_1_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_1_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_1_0::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_1_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_1_0::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_1_dof_map_1_0::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_1_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_1_0();
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_1_1::solitarywave2d_1_dof_map_1_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_1_1::~solitarywave2d_1_dof_map_1_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_1_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_1_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_1_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::local_dimension() const
-{
-    return 6;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::num_facet_dofs() const
+void solitarywave2d_1_dof_map_1_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_1_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_1_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_1_1::local_dimension(const ufc::cell& c) const
+{
+    return 6;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_1_1::max_local_dimension() const
+{
+    return 6;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_1_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_1_1::num_facet_dofs() const
 {
     return 3;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_1_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_1::UFC_SolitaryWave2DLinearForm_dof_map_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_1::~UFC_SolitaryWave2DLinearForm_dof_map_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_1::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_1_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
+                                  const ufc::mesh& m,
+                                  const ufc::cell& c) const
+{
+    dofs[0] = c.entity_indices[0][0];
+    dofs[1] = c.entity_indices[0][1];
+    dofs[2] = c.entity_indices[0][2];
+    unsigned int offset = m.num_entities[0];
+    dofs[3] = offset + c.entity_indices[1][0];
+    dofs[4] = offset + c.entity_indices[1][1];
+    dofs[5] = offset + c.entity_indices[1][2];
+}
+
+/// Tabulate the local-to-local mapping from facet dofs to cell dofs
+void solitarywave2d_1_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      dofs[0] = 1;
+      dofs[1] = 2;
+      dofs[2] = 3;
+      break;
+    case 1:
+      dofs[0] = 0;
+      dofs[1] = 2;
+      dofs[2] = 4;
+      break;
+    case 2:
+      dofs[0] = 0;
+      dofs[1] = 1;
+      dofs[2] = 5;
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_1_1::tabulate_coordinates(double** coordinates,
+                                         const ufc::cell& c) const
+{
+    const double * const * x = c.coordinates;
+    coordinates[0][0] = x[0][0];
+    coordinates[0][1] = x[0][1];
+    coordinates[1][0] = x[1][0];
+    coordinates[1][1] = x[1][1];
+    coordinates[2][0] = x[2][0];
+    coordinates[2][1] = x[2][1];
+    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
+    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
+    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
+    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
+    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
+    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
+}
+
+/// Return the number of sub dof maps (for a mixed element)
+unsigned int solitarywave2d_1_dof_map_1_1::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_1_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_1_1();
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_1::solitarywave2d_1_dof_map_1() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_1::~solitarywave2d_1_dof_map_1()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_1::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return true;
+      break;
+    case 1:
+      return true;
+      break;
+    case 2:
+      return false;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::local_dimension() const
-{
-    return 12;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::num_facet_dofs() const
-{
-    return 6;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_1_dof_map_1::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_1::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_1::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_1::local_dimension(const ufc::cell& c) const
+{
+    return 12;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_1::max_local_dimension() const
+{
+    return 12;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_1::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_1::num_facet_dofs() const
+{
+    return 6;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_1_dof_map_1::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -16208,10 +13085,10 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
+void solitarywave2d_1_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -16241,14 +13118,14 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void solitarywave2d_1_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -16279,115 +13156,121 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_1::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_2::UFC_SolitaryWave2DLinearForm_dof_map_2() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_2::~UFC_SolitaryWave2DLinearForm_dof_map_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_2::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_2::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_1::num_sub_dof_maps() const
+{
+    return 2;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_1::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_dof_map_1_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_dof_map_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_2::solitarywave2d_1_dof_map_2() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_2::~solitarywave2d_1_dof_map_2()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_2::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_2::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return false;
+      break;
+    case 1:
+      return false;
+      break;
+    case 2:
+      return true;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_2::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[2];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_2::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_2::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_2::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_1_dof_map_2::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_2::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_2::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_2::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_2::max_local_dimension() const
+{
+    return 1;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_2::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_2::num_facet_dofs() const
+{
+    return 0;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_1_dof_map_2::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_2::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -16395,32 +13278,32 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_2::tabulate_coordinates(double** coordinates,
+void solitarywave2d_1_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      
+      break;
+    case 1:
+      
+      break;
+    case 2:
+      
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_2::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -16429,106 +13312,112 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_2::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_2::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_3::UFC_SolitaryWave2DLinearForm_dof_map_3() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_3::~UFC_SolitaryWave2DLinearForm_dof_map_3()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_3::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_3::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_3::init_mesh(const ufc::mesh& m)
+unsigned int solitarywave2d_1_dof_map_2::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_2::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_2();
+}
+
+
+/// Constructor
+solitarywave2d_1_dof_map_3::solitarywave2d_1_dof_map_3() : ufc::dof_map()
+{
+    __global_dimension = 0;
+}
+
+/// Destructor
+solitarywave2d_1_dof_map_3::~solitarywave2d_1_dof_map_3()
+{
+    // Do nothing
+}
+
+/// Return a string identifying the dof map
+const char* solitarywave2d_1_dof_map_3::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+}
+
+/// Return true iff mesh entities of topological dimension d are needed
+bool solitarywave2d_1_dof_map_3::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
+    {
+    case 0:
+      return false;
+      break;
+    case 1:
+      return false;
+      break;
+    case 2:
+      return true;
+      break;
+    }
+    return false;
+}
+
+/// Initialize dof map for mesh (return true iff init_cell() is needed)
+bool solitarywave2d_1_dof_map_3::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[2];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_3::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_3::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_3::tabulate_dofs(unsigned int* dofs,
+void solitarywave2d_1_dof_map_3::init_cell(const ufc::mesh& m,
+                              const ufc::cell& c)
+{
+    // Do nothing
+}
+
+/// Finish initialization of dof map for cells
+void solitarywave2d_1_dof_map_3::init_cell_finalize()
+{
+    // Do nothing
+}
+
+/// Return the dimension of the global finite element function space
+unsigned int solitarywave2d_1_dof_map_3::global_dimension() const
+{
+    return __global_dimension;
+}
+
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave2d_1_dof_map_3::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave2d_1_dof_map_3::max_local_dimension() const
+{
+    return 1;
+}
+
+// Return the geometric dimension of the coordinates this dof map provides
+unsigned int solitarywave2d_1_dof_map_3::geometric_dimension() const
+{
+    return 2;
+}
+
+/// Return the number of dofs on each cell facet
+unsigned int solitarywave2d_1_dof_map_3::num_facet_dofs() const
+{
+    return 0;
+}
+
+/// Return the number of dofs associated with each cell entity of dimension d
+unsigned int solitarywave2d_1_dof_map_3::num_entity_dofs(unsigned int d) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the local-to-global mapping of dofs on a cell
+void solitarywave2d_1_dof_map_3::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -16536,32 +13425,32 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_3::tabulate_coordinates(double** coordinates,
+void solitarywave2d_1_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
+                                        unsigned int facet) const
+{
+    switch ( facet )
+    {
+    case 0:
+      
+      break;
+    case 1:
+      
+      break;
+    case 2:
+      
+      break;
+    }
+}
+
+/// Tabulate the local-to-local mapping of dofs on entity (d, i)
+void solitarywave2d_1_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
+                                  unsigned int d, unsigned int i) const
+{
+    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
+}
+
+/// Tabulate the coordinates of all dofs on a cell
+void solitarywave2d_1_dof_map_3::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -16570,468 +13459,32 @@ void UFC_SolitaryWave2DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_3::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_3::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_4_0::UFC_SolitaryWave2DLinearForm_dof_map_4_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_4_0::~UFC_SolitaryWave2DLinearForm_dof_map_4_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_4_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_4_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_4_0::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_4_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_4_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_4_1::UFC_SolitaryWave2DLinearForm_dof_map_4_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_4_1::~UFC_SolitaryWave2DLinearForm_dof_map_4_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_4_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_4_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_4_1::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_4_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_dof_map_4_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_dof_map_4::UFC_SolitaryWave2DLinearForm_dof_map_4() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_dof_map_4::~UFC_SolitaryWave2DLinearForm_dof_map_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave2DLinearForm_dof_map_4::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0), FiniteElement('Discontinuous Lagrange', 'triangle', 0)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave2DLinearForm_dof_map_4::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave2DLinearForm_dof_map_4::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = 2*m.num_entities[2];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave2DLinearForm_dof_map_4::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::local_dimension() const
-{
-    return 2;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::geometric_dimension() const
-{
-    return 2;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[2][0];
-    unsigned int offset = m.num_entities[2];
-    dofs[1] = offset + c.entity_indices[2][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave2DLinearForm_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave2DLinearForm_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave2DLinearForm_dof_map_4::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-    coordinates[1][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[1][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave2DLinearForm_dof_map_4::num_sub_dof_maps() const
-{
-    return 2;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave2DLinearForm_dof_map_4::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_4_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_4_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave2DLinearForm_cell_integral_0_quadrature::UFC_SolitaryWave2DLinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_cell_integral_0_quadrature::~UFC_SolitaryWave2DLinearForm_cell_integral_0_quadrature()
+unsigned int solitarywave2d_1_dof_map_3::num_sub_dof_maps() const
+{
+    return 1;
+}
+
+/// Create a new dof_map for sub dof map i (for a mixed element)
+ufc::dof_map* solitarywave2d_1_dof_map_3::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave2d_1_dof_map_3();
+}
+
+
+/// Constructor
+solitarywave2d_1_cell_integral_0_quadrature::solitarywave2d_1_cell_integral_0_quadrature() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_cell_integral_0_quadrature::~solitarywave2d_1_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave2DLinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave2d_1_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -17043,10 +13496,10 @@ void UFC_SolitaryWave2DLinearForm_cell_i
     const double J_01 = x[2][0] - x[0][0];
     const double J_10 = x[1][1] - x[0][1];
     const double J_11 = x[2][1] - x[0][1];
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute inverse of Jacobian
     const double Jinv_00 =  J_11 / detJ;
     const double Jinv_01 = -J_01 / detJ;
@@ -17058,70 +13511,116 @@ void UFC_SolitaryWave2DLinearForm_cell_i
     
     
     // Array of quadrature weights
-    const static double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
-    
-    
-    const static double FE0_C1_D01[9][5] = \
-    {{-2.23477754271068, -0.645648161949184, 0.410870619238505, 2.88042570465986, -0.410870619238505},
-    {-1.0959162708804, 0.63786745776294, 0.266216271356658, 0.458048813117464, -0.266216271356658},
-    {0.246362376191711, 2.15063784704339, 0.0957245291483235, -2.3970002232351, -0.0957245291483225},
-    {-0.822824080974591, -0.645648161949185, 1.82282408097459, 1.46847224292378, -1.82282408097459},
-    {-0.18106627111853, 0.637867457762939, 1.18106627111853, -0.456801186644408, -1.18106627111853},
-    {0.575318923521695, 2.15063784704339, 0.424681076478307, -2.72595677056508, -0.424681076478306},
-    {0.589129380761496, -0.645648161949184, 3.23477754271068, 0.0565187811876888, -3.23477754271068},
-    {0.733783728643343, 0.637867457762939, 2.0959162708804, -1.37165118640628, -2.0959162708804},
-    {0.904275470851678, 2.15063784704339, 0.75363762380829, -3.05491331789507, -0.753637623808289}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[5] = {6, 8, 9, 10, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc3[5] = {0, 2, 3, 4, 5};
-    
-    const static double FE0_C1_D10[9][5] = \
-    {{-2.23477754271068, -0.589129380761495, 0.354351838050815, -0.354351838050815, 2.82390692347217},
-    {-1.0959162708804, -0.733783728643342, 1.63786745776294, -1.63786745776294, 1.82969999952375},
-    {0.246362376191711, -0.904275470851678, 3.15063784704339, -3.15063784704339, 0.657913094659967},
-    {-0.822824080974592, 0.822824080974592, 0.354351838050816, -0.354351838050816, 0},
-    {-0.18106627111853, 0.181066271118531, 1.63786745776294, -1.63786745776294, 0},
-    {0.575318923521695, -0.575318923521694, 3.15063784704339, -3.15063784704339, 0},
-    {0.589129380761495, 2.23477754271068, 0.354351838050816, -0.354351838050816, -2.82390692347217},
-    {0.733783728643342, 1.0959162708804, 1.63786745776294, -1.63786745776294, -1.82969999952375},
-    {0.904275470851678, -0.246362376191711, 3.15063784704339, -3.15063784704339, -0.657913094659967}};
-    // Array of non-zero columns
-    static const unsigned int nzc1[5] = {6, 7, 9, 10, 11};
+    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
+    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE1_C0[25][6] = \
+    {{0.759842524889054, -0.0409849230988148, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
+    {0.404143384962011, -0.0347905350890822, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
+    {0.03820389372017, -0.0249744559383749, -0.0543309414249183, 0.0461882014671774, 0.938423301877431, 0.0564900002985142},
+    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218535},
+    {-0.0762735703276687, -0.00457955736373819, 0.723813068870285, 0.0166673234982246, 0.338636367163553, 0.00173636815934486},
+    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
+    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
+    {-0.0585120870225412, -0.0960538647466012, -0.0543309414249183, 0.227214213208259, 0.75739729013635, 0.224285389849452},
+    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372835},
+    {-0.0643063527627087, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032842},
+    {-0.0191125161665052, -0.0191125161665052, -0.036640207614552, 0.0764500646660208, 0.0764500646660207, 0.921965110615521},
+    {-0.07940205210781, -0.0794020521078101, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
+    {-0.123076437918076, -0.123076437918076, -0.0543309414249183, 0.492305751672304, 0.492305751672304, 0.315872313916462},
+    {-0.105896858921168, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.092742008804029},
+    {-0.0444129613327222, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330889, 0.00970916313338224},
+    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877737, 0.65464206627708},
+    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320686},
+    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249183, 0.75739729013635, 0.227214213208259, 0.224285389849452},
+    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.651676269947229, 0.19549860142211, 0.0658515377372836},
+    {-0.0217044058396819, -0.0643063527627086, 0.723813068870285, 0.273311911925214, 0.0819917787365633, 0.00689399907032842},
+    {-0.0409849230988148, 0.759842524889054, -0.036640207614552, 0.145727572487076, 0.00717255684496521, 0.164882476492272},
+    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.0297980510461639, 0.115025523822223},
+    {-0.024974455938375, 0.0382038937201699, -0.0543309414249183, 0.938423301877431, 0.0461882014671775, 0.0564900002985145},
+    {-0.0138776265525464, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743822, 0.0165858034218536},
+    {-0.00457955736373822, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982245, 0.00173636815934486}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc0[6] = {0, 1, 2, 3, 4, 5};
+    // Array of non-zero columns
+    static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
+    static const double FE1_C0_D01[25][5] = \
+    {{-2.66059019751491, -0.840760571794125, 0.180170374279215, 3.50135076930903, -0.180170374279215},
+    {-2.05746131912512, -0.207946328505567, 0.150485009380445, 2.26540764763069, -0.150485009380445},
+    {-1.14264217923257, 0.751899240989545, 0.105458579777884, 0.390742938243026, -0.105458579777884},
+    {-0.16099972900317, 1.78185709341454, 0.0571431775822861, -1.62085736441137, -0.0571431775822855},
+    {0.624348810664881, 2.60585965680469, 0.0184891538601872, -3.23020846746957, -0.018489153860186},
+    {-1.95444613358461, -0.840760571794126, 0.886314438209517, 2.79520670537873, -0.886314438209516},
+    {-1.46766348743601, -0.207946328505567, 0.740282841069557, 1.67560981594158, -0.740282841069557},
+    {-0.729317011881439, 0.751899240989545, 0.518783747129016, -0.0225822291081061, -0.518783747129016},
+    {0.0629622614476711, 1.78185709341454, 0.281105168033127, -1.84481935486222, -0.281105168033127},
+    {0.696813589059751, 2.60585965680469, 0.0909539322550576, -3.30267324586444, -0.0909539322550564},
+    {-0.920380285897062, -0.840760571794126, 1.92038028589706, 1.76114085769119, -1.92038028589706},
+    {-0.603973164252783, -0.207946328505567, 1.60397316425278, 0.811919492758351, -1.60397316425278},
+    {-0.124050379505228, 0.751899240989545, 1.12405037950523, -0.627848861484317, -1.12405037950523},
+    {0.390928546707272, 1.78185709341454, 0.609071453292728, -2.17278564012182, -0.609071453292728},
+    {0.802929828402348, 2.60585965680469, 0.197070171597654, -3.40878948520704, -0.197070171597653},
+    {0.113685561790484, -0.840760571794125, 2.95444613358461, 0.727075010003642, -2.95444613358461},
+    {0.259717158930443, -0.207946328505567, 2.46766348743601, -0.0517708304248748, -2.46766348743601},
+    {0.481216252870984, 0.751899240989544, 1.72931701188144, -1.23311549386053, -1.72931701188144},
+    {0.718894831966874, 1.78185709341454, 0.937037738552329, -2.50075192538142, -0.937037738552329},
+    {0.909046067744945, 2.60585965680469, 0.303186410940251, -3.51490572454964, -0.30318641094025},
+    {0.819829625720786, -0.840760571794125, 3.66059019751491, 0.0209309460733398, -3.66059019751491},
+    {0.849514990619556, -0.207946328505567, 3.05746131912512, -0.641568662113988, -3.05746131912512},
+    {0.894541420222117, 0.751899240989544, 2.14264217923257, -1.64644066121166, -2.14264217923257},
+    {0.942856822417715, 1.78185709341454, 1.16099972900317, -2.72471391583226, -1.16099972900317},
+    {0.981510846139815, 2.60585965680469, 0.375651189335121, -3.58737050294451, -0.37565118933512}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
+    static const double FE1_C0_D10[25][5] = \
+    {{-2.66059019751491, -0.819829625720785, 0.159239428205874, -0.159239428205874, 3.4804198232357},
+    {-2.05746131912512, -0.849514990619555, 0.792053671494433, -0.792053671494433, 2.90697630974468},
+    {-1.14264217923257, -0.894541420222116, 1.75189924098954, -1.75189924098954, 2.03718359945469},
+    {-0.16099972900317, -0.942856822417714, 2.78185709341454, -2.78185709341454, 1.10385655142088},
+    {0.624348810664881, -0.981510846139815, 3.60585965680469, -3.60585965680469, 0.357162035474934},
+    {-1.95444613358461, -0.113685561790483, 0.159239428205875, -0.159239428205875, 2.06813169537509},
+    {-1.46766348743601, -0.259717158930442, 0.792053671494433, -0.792053671494433, 1.72738064636645},
+    {-0.729317011881439, -0.481216252870983, 1.75189924098954, -1.75189924098954, 1.21053326475242},
+    {0.0629622614476713, -0.718894831966873, 2.78185709341454, -2.78185709341454, 0.655932570519202},
+    {0.696813589059752, -0.909046067744944, 3.60585965680469, -3.60585965680469, 0.212232478685193},
+    {-0.920380285897062, 0.920380285897063, 0.159239428205875, -0.159239428205875, 0},
+    {-0.603973164252783, 0.603973164252784, 0.792053671494433, -0.792053671494433, 0},
+    {-0.124050379505228, 0.124050379505228, 1.75189924098954, -1.75189924098954, 0},
+    {0.390928546707273, -0.390928546707272, 2.78185709341454, -2.78185709341454, 0},
+    {0.802929828402348, -0.802929828402348, 3.60585965680469, -3.60585965680469, 0},
+    {0.113685561790483, 1.95444613358461, 0.159239428205875, -0.159239428205875, -2.06813169537509},
+    {0.259717158930442, 1.46766348743601, 0.792053671494433, -0.792053671494433, -1.72738064636645},
+    {0.481216252870984, 0.729317011881439, 1.75189924098954, -1.75189924098954, -1.21053326475242},
+    {0.718894831966873, -0.0629622614476713, 2.78185709341454, -2.78185709341454, -0.655932570519202},
+    {0.909046067744945, -0.696813589059751, 3.60585965680469, -3.60585965680469, -0.212232478685194},
+    {0.819829625720786, 2.66059019751491, 0.159239428205876, -0.159239428205876, -3.4804198232357},
+    {0.849514990619555, 2.05746131912512, 0.792053671494433, -0.792053671494433, -2.90697630974468},
+    {0.894541420222116, 1.14264217923257, 1.75189924098954, -1.75189924098954, -2.03718359945469},
+    {0.942856822417715, 0.16099972900317, 2.78185709341454, -2.78185709341454, -1.10385655142088},
+    {0.981510846139815, -0.624348810664881, 3.60585965680469, -3.60585965680469, -0.357162035474935}};
+    
     // Array of non-zero columns
     static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
     
-    const static double FE0_C1[9][6] = \
-    {{0.499278833175498, -0.0816158215904472, -0.072892306371455, 0.0363981897820602, 0.286562341986258, 0.332268763018087},
-    {0.0251290590975511, -0.0576951799472843, -0.0741406382908807, 0.109006741895515, 0.858208263567716, 0.139491753677383},
-    {-0.117413197449647, -0.0227857341019971, 0.453155393641927, 0.0753983311062782, 0.593609805131561, 0.0180354016718773},
-    {-0.0403700664710398, -0.0403700664710398, -0.072892306371455, 0.161480265884159, 0.161480265884159, 0.830671907545216},
-    {-0.120901875682904, -0.120901875682904, -0.0741406382908807, 0.483607502731615, 0.483607502731615, 0.348729384193458},
-    {-0.0836260170297299, -0.0836260170297299, 0.453155393641927, 0.33450406811892, 0.33450406811892, 0.0450885041796933},
-    {-0.0816158215904472, 0.499278833175498, -0.072892306371455, 0.286562341986258, 0.0363981897820602, 0.332268763018087},
-    {-0.0576951799472842, 0.0251290590975512, -0.0741406382908807, 0.858208263567716, 0.109006741895515, 0.139491753677383},
-    {-0.0227857341019971, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.0753983311062783, 0.0180354016718774}};
-    // Array of non-zero columns
-    static const unsigned int nzc4[6] = {6, 7, 8, 9, 10, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc5[6] = {0, 1, 2, 3, 4, 5};
-    
-    // Number of operations to compute geometry constants: 21
-    const double G0 =  - Jinv_11*det;
-    const double G1 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
+    // Number of operations to compute geometry constants: 18
+    const double G0 = det*w[2][0];
+    const double G1 = -0.5*det*w[1][0]*w[2][0];
     const double G2 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
-    const double G3 = det*w[2][0];
-    const double G4 =  - Jinv_01*det;
-    const double G5 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
-    const double G6 =  - 0.5*det*w[1][0]*w[2][0];
+    const double G3 = -Jinv_11*det;
+    const double G4 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
+    const double G5 = -Jinv_01*det;
+    const double G6 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 1011
+    // Total number of operations to compute element tensor: 2768
     
     // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 990
-    for (unsigned int ip = 0; ip < 9; ip++)
+    // Number of operations to compute element tensor for following IP loop = 2750
+    for (unsigned int ip = 0; ip < 25; ip++)
     {
       
       // Function declarations
@@ -17133,100 +13632,90 @@ void UFC_SolitaryWave2DLinearForm_cell_i
       // Total number of operations to compute function values = 20
       for (unsigned int r = 0; r < 5; r++)
       {
-        F2 += FE0_C1_D10[ip][r]*w[0][nzc2[r]];
-        F3 += FE0_C1_D01[ip][r]*w[0][nzc3[r]];
+        F2 += FE1_C0_D10[ip][r]*w[0][nzc2[r]];
+        F3 += FE1_C0_D01[ip][r]*w[0][nzc1[r]];
       }// end loop over 'r'
       
       // Total number of operations to compute function values = 24
       for (unsigned int r = 0; r < 6; r++)
       {
-        F0 += FE0_C1[ip][r]*w[0][nzc4[r]];
-        F1 += FE0_C1[ip][r]*w[0][nzc5[r]];
+        F0 += FE1_C0[ip][r]*w[0][nzc3[r]];
+        F1 += FE1_C0[ip][r]*w[0][nzc0[r]];
       }// end loop over 'r'
       
       // Number of operations to compute ip constants: 22
+      // Number of operations: 2
+      const double Gip0 = F1*G0*W25[ip];
+      
+      // Number of operations: 4
+      const double Gip1 = W25[ip]*(F0*det + F1*G1);
+      
       // Number of operations: 8
-      const double Gip0 = F0*F0*F0*W9[ip]*(G0 + F2*G1 + F3*G2);
-      
-      // Number of operations: 2
-      const double Gip1 = F1*W9[ip]*G3;
+      const double Gip2 = F0*F0*F0*W25[ip]*(G3 + F2*G4 + F3*G2);
       
       // Number of operations: 8
-      const double Gip2 = F0*F0*F0*W9[ip]*(G4 + F2*G5 + F3*G1);
-      
-      // Number of operations: 4
-      const double Gip3 = W9[ip]*(F0*det + F1*G6);
-      
-      
-      // Number of operations for primary indices = 20
+      const double Gip3 = F0*F0*F0*W25[ip]*(G5 + F2*G6 + F3*G4);
+      
+      
+      // Number of operations for primary indices: 20
       for (unsigned int j = 0; j < 5; j++)
       {
-        // Number of operations to compute entry = 2
-        A[nzc3[j]] += FE0_C1_D01[ip][j]*Gip0;
-        // Number of operations to compute entry = 2
-        A[nzc2[j]] += FE0_C1_D10[ip][j]*Gip2;
+        // Number of operations to compute entry: 2
+        A[nzc1[j]] += FE1_C0_D01[ip][j]*Gip2;
+        // Number of operations to compute entry: 2
+        A[nzc2[j]] += FE1_C0_D10[ip][j]*Gip3;
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 24
+      // Number of operations for primary indices: 24
       for (unsigned int j = 0; j < 6; j++)
       {
-        // Number of operations to compute entry = 2
-        A[nzc5[j]] += FE0_C1[ip][j]*Gip1;
-        // Number of operations to compute entry = 2
-        A[nzc4[j]] += FE0_C1[ip][j]*Gip3;
+        // Number of operations to compute entry: 2
+        A[nzc0[j]] += FE1_C0[ip][j]*Gip0;
+        // Number of operations to compute entry: 2
+        A[nzc3[j]] += FE1_C0[ip][j]*Gip1;
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SolitaryWave2DLinearForm_cell_integral_0::UFC_SolitaryWave2DLinearForm_cell_integral_0() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_cell_integral_0::~UFC_SolitaryWave2DLinearForm_cell_integral_0()
+solitarywave2d_1_cell_integral_0::solitarywave2d_1_cell_integral_0() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_cell_integral_0::~solitarywave2d_1_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave2DLinearForm_cell_integral_0::tabulate_tensor(double* A,
+void solitarywave2d_1_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
+    for (unsigned int j = 0; j < 12; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0_quadrature::UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0_quadrature::~UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0_quadrature()
+solitarywave2d_1_exterior_facet_integral_0_quadrature::solitarywave2d_1_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_exterior_facet_integral_0_quadrature::~solitarywave2d_1_exterior_facet_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave2d_1_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
@@ -17235,9 +13724,9 @@ void UFC_SolitaryWave2DLinearForm_exteri
     const double * const * x = c.coordinates;
     
     // Compute Jacobian of affine map from reference cell
-      
-    // Compute determinant of Jacobian
-      
+    
+    // Compute determinant of Jacobian
+    
     // Compute inverse of Jacobian
     
     // Vertices on edges
@@ -17252,31 +13741,40 @@ void UFC_SolitaryWave2DLinearForm_exteri
     const double dx1 = x[v1][1] - x[v0][1];
     const double det = std::sqrt(dx0*dx0 + dx1*dx1);
     
+    const bool direction = dx1*(x[facet][0] - x[v0][0]) - dx0*(x[facet][1] - x[v0][1]) < 0;
+    
+    // Compute facet normals from the facet scale factor constants
+    const double n1 = direction ? -dx0 / det : dx0 / det;
+    
     
     // Array of quadrature weights
-    const static double W3[3] = {0.277777777777778, 0.444444444444444, 0.277777777777778};
-    
-    
-    const static double FE0_f0_C1[3][3] = \
-    {{0.687298334620742, -0.0872983346207417, 0.4},
+    static const double W5[5] = {0.118463442528094, 0.239314335249683, 0.284444444444444, 0.239314335249683, 0.118463442528094};
+    // Quadrature points on the UFC reference element: (0.046910077030668), (0.230765344947158), (0.5), (0.769234655052841), (0.953089922969332)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE0_f0_C0[5][3] = \
+    {{0.863670879562042, -0.0425089663766216, 0.178838086814579},
+    {0.414209254015687, -0.124260056089996, 0.71005080207431},
     {0, 0, 1},
-    {-0.0872983346207417, 0.687298334620742, 0.4}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[3] = {7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc1[3] = {1, 2, 3};
-    // Array of non-zero columns
-    static const unsigned int nzc2[3] = {6, 7, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc3[3] = {0, 1, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc6[3] = {0, 2, 4};
-    // Array of non-zero columns
-    static const unsigned int nzc7[3] = {6, 8, 10};
+    {-0.124260056089996, 0.414209254015687, 0.71005080207431},
+    {-0.0425089663766216, 0.863670879562042, 0.178838086814579}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[3] = {7, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc0[3] = {1, 2, 3};
+    // Array of non-zero columns
+    static const unsigned int nzc5[3] = {6, 7, 11};
+    // Array of non-zero columns
+    static const unsigned int nzc4[3] = {0, 1, 5};
+    // Array of non-zero columns
+    static const unsigned int nzc2[3] = {0, 2, 4};
+    // Array of non-zero columns
+    static const unsigned int nzc3[3] = {6, 8, 10};
     
     // Number of operations to compute geometry constants: 1
     // Should be added to total operation count.
-    const double G0 = det*w[3][1];
+    const double G0 = det*n1;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
@@ -17284,11 +13782,11 @@ void UFC_SolitaryWave2DLinearForm_exteri
     {
     case 0:
       {
-      // Total number of operations to compute element tensor (from this point): 48
+      // Total number of operations to compute element tensor (from this point): 80
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 48
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 80
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -17297,30 +13795,30 @@ void UFC_SolitaryWave2DLinearForm_exteri
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc0[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 6
+        const double Gip0 = F0*F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 6
         for (unsigned int j = 0; j < 3; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc1[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc0[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
       break;
     case 1:
       {
-      // Total number of operations to compute element tensor (from this point): 48
+      // Total number of operations to compute element tensor (from this point): 80
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 48
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 80
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -17329,30 +13827,30 @@ void UFC_SolitaryWave2DLinearForm_exteri
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc7[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 6
+        const double Gip0 = F0*F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 6
         for (unsigned int j = 0; j < 3; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc6[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc2[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
       break;
     case 2:
       {
-      // Total number of operations to compute element tensor (from this point): 48
+      // Total number of operations to compute element tensor (from this point): 80
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 48
-      for (unsigned int ip = 0; ip < 3; ip++)
+      // Number of operations to compute element tensor for following IP loop = 80
+      for (unsigned int ip = 0; ip < 5; ip++)
       {
         
         // Function declarations
@@ -17361,19 +13859,19 @@ void UFC_SolitaryWave2DLinearForm_exteri
         // Total number of operations to compute function values = 6
         for (unsigned int r = 0; r < 3; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc2[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W3[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 6
+        const double Gip0 = F0*F0*F0*G0*W5[ip];
+        
+        
+        // Number of operations for primary indices: 6
         for (unsigned int j = 0; j < 3; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc3[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc4[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
@@ -17382,152 +13880,136 @@ void UFC_SolitaryWave2DLinearForm_exteri
 }
 
 /// Constructor
-UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0::UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0::~UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0()
+solitarywave2d_1_exterior_facet_integral_0::solitarywave2d_1_exterior_facet_integral_0() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_1_exterior_facet_integral_0::~solitarywave2d_1_exterior_facet_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0::tabulate_tensor(double* A,
+void solitarywave2d_1_exterior_facet_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
+    for (unsigned int j = 0; j < 12; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c, facet);
 }
 
 /// Constructor
-UFC_SolitaryWave2DLinearForm::UFC_SolitaryWave2DLinearForm() : ufc::form()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave2DLinearForm::~UFC_SolitaryWave2DLinearForm()
+solitarywave2d_form_1::solitarywave2d_form_1() : ufc::form()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave2d_form_1::~solitarywave2d_form_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SolitaryWave2DLinearForm::signature() const
-{
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('triangle', 1), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(0),))), MultiIndex((Index(1),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(2),))), MultiIndex((Index(1),)))), MultiIndex((Index(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('triangle', 1), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),)))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4})), Integral(Product(Indexed(VectorConstant(Cell('triangle', 1), 2, 3), MultiIndex((FixedIndex(1),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1), 2), FiniteElement('Lagrange', Cell('triangle', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+const char* solitarywave2d_form_1::signature() const
+{
+    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1, Space(2)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2}))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('triangle', 1, Space(2))), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SolitaryWave2DLinearForm::rank() const
+unsigned int solitarywave2d_form_1::rank() const
 {
     return 1;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SolitaryWave2DLinearForm::num_coefficients() const
-{
-    return 4;
+unsigned int solitarywave2d_form_1::num_coefficients() const
+{
+    return 3;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SolitaryWave2DLinearForm::num_cell_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave2d_form_1::num_cell_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SolitaryWave2DLinearForm::num_exterior_facet_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave2d_form_1::num_exterior_facet_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SolitaryWave2DLinearForm::num_interior_facet_integrals() const
+unsigned int solitarywave2d_form_1::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SolitaryWave2DLinearForm::create_finite_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_2();
+ufc::finite_element* solitarywave2d_form_1::create_finite_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_finite_element_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_finite_element_1();
+      break;
+    case 2:
+      return new solitarywave2d_1_finite_element_2();
       break;
     case 3:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_3();
-      break;
-    case 4:
-      return new UFC_SolitaryWave2DLinearForm_finite_element_4();
+      return new solitarywave2d_1_finite_element_3();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SolitaryWave2DLinearForm::create_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_2();
+ufc::dof_map* solitarywave2d_form_1::create_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave2d_1_dof_map_0();
+      break;
+    case 1:
+      return new solitarywave2d_1_dof_map_1();
+      break;
+    case 2:
+      return new solitarywave2d_1_dof_map_2();
       break;
     case 3:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_3();
-      break;
-    case 4:
-      return new UFC_SolitaryWave2DLinearForm_dof_map_4();
+      return new solitarywave2d_1_dof_map_3();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SolitaryWave2DLinearForm::create_cell_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_cell_integral_0();
+ufc::cell_integral* solitarywave2d_form_1::create_cell_integral(unsigned int i) const
+{
+    return new solitarywave2d_1_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SolitaryWave2DLinearForm::create_exterior_facet_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave2DLinearForm_exterior_facet_integral_0();
+ufc::exterior_facet_integral* solitarywave2d_form_1::create_exterior_facet_integral(unsigned int i) const
+{
+    return new solitarywave2d_1_exterior_facet_integral_0();
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SolitaryWave2DLinearForm::create_interior_facet_integral(unsigned int i) const
-{
-    return 0;
-}
-
+ufc::interior_facet_integral* solitarywave2d_form_1::create_interior_facet_integral(unsigned int i) const
+{
+    return 0;
+}
+
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SolitaryWave2D.h
--- a/MADDs-4/cpp/SolitaryWave2D.h	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SolitaryWave2D.h	Sat Dec 05 22:52:18 2009 -0500
@@ -19,466 +19,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_0_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_0_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_0_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_0_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -489,466 +93,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_0_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_0_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_0_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_0_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -959,686 +167,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[6];
-    vertex_values[3] = dof_values[7];
-    vertex_values[5] = dof_values[8];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_finite_element_0_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_finite_element_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -1649,466 +241,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_1_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_1_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_1_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_1_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -2119,466 +315,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_1_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_1_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_1_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_1_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -2589,686 +389,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[6];
-    vertex_values[3] = dof_values[7];
-    vertex_values[5] = dof_values[8];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_finite_element_1_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_finite_element_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -3279,466 +463,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_2_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_2_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_2_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_2_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_2_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -3749,466 +537,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_2_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_2_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_2_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_2_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_2_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -4219,686 +611,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_2() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_2();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_2();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[6];
-    vertex_values[3] = dof_values[7];
-    vertex_values[5] = dof_values[8];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_finite_element_2_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_finite_element_2_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -4909,383 +685,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_3() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_3();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_3();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_3();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -5296,383 +759,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_finite_element_4() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_finite_element_4();
 
   /// Destructor
-  virtual ~solitarywave2d_0_finite_element_4()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_finite_element_4();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_0_finite_element_4();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -5688,172 +838,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_0_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_0_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_0_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_0_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -5869,172 +914,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_0_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_0_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_0_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_0_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -6050,210 +990,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 12;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-    offset = offset + m.num_entities[1];
-    dofs[6] = offset + c.entity_indices[0][0];
-    dofs[7] = offset + c.entity_indices[0][1];
-    dofs[8] = offset + c.entity_indices[0][2];
-    offset = offset + m.num_entities[0];
-    dofs[9] = offset + c.entity_indices[1][0];
-    dofs[10] = offset + c.entity_indices[1][1];
-    dofs[11] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 7;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 10;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      dofs[3] = 6;
-      dofs[4] = 7;
-      dofs[5] = 11;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[6][0] = x[0][0];
-    coordinates[6][1] = x[0][1];
-    coordinates[7][0] = x[1][0];
-    coordinates[7][1] = x[1][1];
-    coordinates[8][0] = x[2][0];
-    coordinates[8][1] = x[2][1];
-    coordinates[9][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[9][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[10][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[10][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[11][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[11][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_dof_map_0_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_dof_map_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -6269,172 +1066,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_1_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_1_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_1_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_1_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -6450,172 +1142,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_1_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_1_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_1_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_1_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -6631,210 +1218,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 12;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-    offset = offset + m.num_entities[1];
-    dofs[6] = offset + c.entity_indices[0][0];
-    dofs[7] = offset + c.entity_indices[0][1];
-    dofs[8] = offset + c.entity_indices[0][2];
-    offset = offset + m.num_entities[0];
-    dofs[9] = offset + c.entity_indices[1][0];
-    dofs[10] = offset + c.entity_indices[1][1];
-    dofs[11] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 7;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 10;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      dofs[3] = 6;
-      dofs[4] = 7;
-      dofs[5] = 11;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[6][0] = x[0][0];
-    coordinates[6][1] = x[0][1];
-    coordinates[7][0] = x[1][0];
-    coordinates[7][1] = x[1][1];
-    coordinates[8][0] = x[2][0];
-    coordinates[8][1] = x[2][1];
-    coordinates[9][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[9][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[10][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[10][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[11][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[11][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_dof_map_1_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_dof_map_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -6850,172 +1294,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_2_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_2_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_2_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_2_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_2_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7031,172 +1370,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_2_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_2_1();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_2_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_2_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_2_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7212,210 +1446,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_2() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_2();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_2();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 12;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-    offset = offset + m.num_entities[1];
-    dofs[6] = offset + c.entity_indices[0][0];
-    dofs[7] = offset + c.entity_indices[0][1];
-    dofs[8] = offset + c.entity_indices[0][2];
-    offset = offset + m.num_entities[0];
-    dofs[9] = offset + c.entity_indices[1][0];
-    dofs[10] = offset + c.entity_indices[1][1];
-    dofs[11] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 7;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 10;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      dofs[3] = 6;
-      dofs[4] = 7;
-      dofs[5] = 11;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[6][0] = x[0][0];
-    coordinates[6][1] = x[0][1];
-    coordinates[7][0] = x[1][0];
-    coordinates[7][1] = x[1][1];
-    coordinates[8][0] = x[2][0];
-    coordinates[8][1] = x[2][1];
-    coordinates[9][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[9][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[10][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[10][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[11][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[11][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_dof_map_2_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_dof_map_2_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7431,150 +1522,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_3() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_3();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_3();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[2];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[2][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_3();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7590,150 +1598,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_dof_map_4() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_0_dof_map_4();
 
   /// Destructor
-  virtual ~solitarywave2d_0_dof_map_4()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_dof_map_4();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[2];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[2][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_0_dof_map_4();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7746,247 +1671,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_cell_integral_0_quadrature() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_cell_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave2d_0_cell_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_cell_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = x[1][0] - x[0][0];
-    const double J_01 = x[2][0] - x[0][0];
-    const double J_10 = x[1][1] - x[0][1];
-    const double J_11 = x[2][1] - x[0][1];
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    const double Jinv_00 =  J_11 / detJ;
-    const double Jinv_01 = -J_01 / detJ;
-    const double Jinv_10 = -J_10 / detJ;
-    const double Jinv_11 =  J_00 / detJ;
-    
-    // Set scale factor
-    const double det = std::abs(detJ);
-    
-    
-    // Array of quadrature weights
-    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
-    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE1_C0[25][6] = \
-    {{0.759842524889054, -0.0409849230988148, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
-    {0.404143384962011, -0.0347905350890822, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
-    {0.03820389372017, -0.0249744559383749, -0.0543309414249183, 0.0461882014671774, 0.938423301877431, 0.0564900002985142},
-    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218535},
-    {-0.0762735703276687, -0.00457955736373819, 0.723813068870285, 0.0166673234982246, 0.338636367163553, 0.00173636815934486},
-    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
-    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
-    {-0.0585120870225412, -0.0960538647466012, -0.0543309414249183, 0.227214213208259, 0.75739729013635, 0.224285389849452},
-    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372835},
-    {-0.0643063527627087, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032842},
-    {-0.0191125161665052, -0.0191125161665052, -0.036640207614552, 0.0764500646660208, 0.0764500646660207, 0.921965110615521},
-    {-0.07940205210781, -0.0794020521078101, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
-    {-0.123076437918076, -0.123076437918076, -0.0543309414249183, 0.492305751672304, 0.492305751672304, 0.315872313916462},
-    {-0.105896858921168, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.092742008804029},
-    {-0.0444129613327222, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330889, 0.00970916313338224},
-    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877737, 0.65464206627708},
-    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320686},
-    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249183, 0.75739729013635, 0.227214213208259, 0.224285389849452},
-    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.651676269947229, 0.19549860142211, 0.0658515377372836},
-    {-0.0217044058396819, -0.0643063527627086, 0.723813068870285, 0.273311911925214, 0.0819917787365633, 0.00689399907032842},
-    {-0.0409849230988148, 0.759842524889054, -0.036640207614552, 0.145727572487076, 0.00717255684496521, 0.164882476492272},
-    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.0297980510461639, 0.115025523822223},
-    {-0.024974455938375, 0.0382038937201699, -0.0543309414249183, 0.938423301877431, 0.0461882014671775, 0.0564900002985145},
-    {-0.0138776265525464, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743822, 0.0165858034218536},
-    {-0.00457955736373822, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982245, 0.00173636815934486}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {0, 1, 2, 3, 4, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
-    static const double FE1_C0_D01[25][5] = \
-    {{-2.66059019751491, -0.840760571794125, 0.180170374279215, 3.50135076930903, -0.180170374279215},
-    {-2.05746131912512, -0.207946328505567, 0.150485009380445, 2.26540764763069, -0.150485009380445},
-    {-1.14264217923257, 0.751899240989545, 0.105458579777884, 0.390742938243026, -0.105458579777884},
-    {-0.16099972900317, 1.78185709341454, 0.0571431775822861, -1.62085736441137, -0.0571431775822855},
-    {0.624348810664881, 2.60585965680469, 0.0184891538601872, -3.23020846746957, -0.018489153860186},
-    {-1.95444613358461, -0.840760571794126, 0.886314438209517, 2.79520670537873, -0.886314438209516},
-    {-1.46766348743601, -0.207946328505567, 0.740282841069557, 1.67560981594158, -0.740282841069557},
-    {-0.729317011881439, 0.751899240989545, 0.518783747129016, -0.0225822291081061, -0.518783747129016},
-    {0.0629622614476711, 1.78185709341454, 0.281105168033127, -1.84481935486222, -0.281105168033127},
-    {0.696813589059751, 2.60585965680469, 0.0909539322550576, -3.30267324586444, -0.0909539322550564},
-    {-0.920380285897062, -0.840760571794126, 1.92038028589706, 1.76114085769119, -1.92038028589706},
-    {-0.603973164252783, -0.207946328505567, 1.60397316425278, 0.811919492758351, -1.60397316425278},
-    {-0.124050379505228, 0.751899240989545, 1.12405037950523, -0.627848861484317, -1.12405037950523},
-    {0.390928546707272, 1.78185709341454, 0.609071453292728, -2.17278564012182, -0.609071453292728},
-    {0.802929828402348, 2.60585965680469, 0.197070171597654, -3.40878948520704, -0.197070171597653},
-    {0.113685561790484, -0.840760571794125, 2.95444613358461, 0.727075010003642, -2.95444613358461},
-    {0.259717158930443, -0.207946328505567, 2.46766348743601, -0.0517708304248748, -2.46766348743601},
-    {0.481216252870984, 0.751899240989544, 1.72931701188144, -1.23311549386053, -1.72931701188144},
-    {0.718894831966874, 1.78185709341454, 0.937037738552329, -2.50075192538142, -0.937037738552329},
-    {0.909046067744945, 2.60585965680469, 0.303186410940251, -3.51490572454964, -0.30318641094025},
-    {0.819829625720786, -0.840760571794125, 3.66059019751491, 0.0209309460733398, -3.66059019751491},
-    {0.849514990619556, -0.207946328505567, 3.05746131912512, -0.641568662113988, -3.05746131912512},
-    {0.894541420222117, 0.751899240989544, 2.14264217923257, -1.64644066121166, -2.14264217923257},
-    {0.942856822417715, 1.78185709341454, 1.16099972900317, -2.72471391583226, -1.16099972900317},
-    {0.981510846139815, 2.60585965680469, 0.375651189335121, -3.58737050294451, -0.37565118933512}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
-    static const double FE1_C0_D10[25][5] = \
-    {{-2.66059019751491, -0.819829625720785, 0.159239428205874, -0.159239428205874, 3.4804198232357},
-    {-2.05746131912512, -0.849514990619555, 0.792053671494433, -0.792053671494433, 2.90697630974468},
-    {-1.14264217923257, -0.894541420222116, 1.75189924098954, -1.75189924098954, 2.03718359945469},
-    {-0.16099972900317, -0.942856822417714, 2.78185709341454, -2.78185709341454, 1.10385655142088},
-    {0.624348810664881, -0.981510846139815, 3.60585965680469, -3.60585965680469, 0.357162035474934},
-    {-1.95444613358461, -0.113685561790483, 0.159239428205875, -0.159239428205875, 2.06813169537509},
-    {-1.46766348743601, -0.259717158930442, 0.792053671494433, -0.792053671494433, 1.72738064636645},
-    {-0.729317011881439, -0.481216252870983, 1.75189924098954, -1.75189924098954, 1.21053326475242},
-    {0.0629622614476713, -0.718894831966873, 2.78185709341454, -2.78185709341454, 0.655932570519202},
-    {0.696813589059752, -0.909046067744944, 3.60585965680469, -3.60585965680469, 0.212232478685193},
-    {-0.920380285897062, 0.920380285897063, 0.159239428205875, -0.159239428205875, 0},
-    {-0.603973164252783, 0.603973164252784, 0.792053671494433, -0.792053671494433, 0},
-    {-0.124050379505228, 0.124050379505228, 1.75189924098954, -1.75189924098954, 0},
-    {0.390928546707273, -0.390928546707272, 2.78185709341454, -2.78185709341454, 0},
-    {0.802929828402348, -0.802929828402348, 3.60585965680469, -3.60585965680469, 0},
-    {0.113685561790483, 1.95444613358461, 0.159239428205875, -0.159239428205875, -2.06813169537509},
-    {0.259717158930442, 1.46766348743601, 0.792053671494433, -0.792053671494433, -1.72738064636645},
-    {0.481216252870984, 0.729317011881439, 1.75189924098954, -1.75189924098954, -1.21053326475242},
-    {0.718894831966873, -0.0629622614476713, 2.78185709341454, -2.78185709341454, -0.655932570519202},
-    {0.909046067744945, -0.696813589059751, 3.60585965680469, -3.60585965680469, -0.212232478685194},
-    {0.819829625720786, 2.66059019751491, 0.159239428205876, -0.159239428205876, -3.4804198232357},
-    {0.849514990619555, 2.05746131912512, 0.792053671494433, -0.792053671494433, -2.90697630974468},
-    {0.894541420222116, 1.14264217923257, 1.75189924098954, -1.75189924098954, -2.03718359945469},
-    {0.942856822417715, 0.16099972900317, 2.78185709341454, -2.78185709341454, -1.10385655142088},
-    {0.981510846139815, -0.624348810664881, 3.60585965680469, -3.60585965680469, -0.357162035474935}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
-    
-    // Number of operations to compute geometry constants: 35
-    const double G0 = 3*det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
-    const double G1 = -3*Jinv_01*det;
-    const double G2 = 3*det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
-    const double G3 = -0.5*det*w[1][0]*w[2][0];
-    const double G4 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
-    const double G5 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
-    const double G6 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
-    const double G7 = det*w[2][0];
-    const double G8 = -3*Jinv_11*det;
-    const double G9 = 3*det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 21660
-    
-    // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 21625
-    for (unsigned int ip = 0; ip < 25; ip++)
-    {
-      
-      // Function declarations
-      double F0 = 0;
-      double F1 = 0;
-      double F2 = 0;
-      
-      // Total number of operations to compute function values = 20
-      for (unsigned int r = 0; r < 5; r++)
-      {
-        F1 += FE1_C0_D10[ip][r]*w[0][nzc2[r]];
-        F2 += FE1_C0_D01[ip][r]*w[0][nzc1[r]];
-      }// end loop over 'r'
-      
-      // Total number of operations to compute function values = 12
-      for (unsigned int r = 0; r < 6; r++)
-      {
-        F0 += FE1_C0[ip][r]*w[0][nzc3[r]];
-      }// end loop over 'r'
-      
-      // Number of operations to compute ip constants: 29
-      // Number of operations: 7
-      const double Gip0 = F0*F0*W25[ip]*(G1 + F1*G0 + F2*G2);
-      
-      // Number of operations: 1
-      const double Gip1 = G3*W25[ip];
-      
-      // Number of operations: 4
-      const double Gip2 = F0*F0*F0*G4*W25[ip];
-      
-      // Number of operations: 4
-      const double Gip3 = F0*F0*F0*G5*W25[ip];
-      
-      // Number of operations: 1
-      const double Gip4 = W25[ip]*det;
-      
-      // Number of operations: 4
-      const double Gip5 = F0*F0*F0*G6*W25[ip];
-      
-      // Number of operations: 1
-      const double Gip6 = G7*W25[ip];
-      
-      // Number of operations: 7
-      const double Gip7 = F0*F0*W25[ip]*(G8 + F1*G2 + F2*G9);
-      
-      
-      // Number of operations for primary indices: 324
-      for (unsigned int j = 0; j < 6; j++)
-      {
-        for (unsigned int k = 0; k < 6; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*12 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip1;
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*12 + nzc3[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip4;
-          // Number of operations to compute entry: 3
-          A[nzc0[j]*12 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip6;
-        }// end loop over 'k'
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 180
-      for (unsigned int j = 0; j < 5; j++)
-      {
-        for (unsigned int k = 0; k < 6; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*12 + nzc3[k]] += FE1_C0[ip][k]*FE1_C0_D10[ip][j]*Gip0;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*12 + nzc3[k]] += FE1_C0[ip][k]*FE1_C0_D01[ip][j]*Gip7;
-        }// end loop over 'k'
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 300
-      for (unsigned int j = 0; j < 5; j++)
-      {
-        for (unsigned int k = 0; k < 5; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*12 + nzc2[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip2;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*12 + nzc1[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip3;
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*12 + nzc1[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip5;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*12 + nzc2[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip5;
-        }// end loop over 'k'
-      }// end loop over 'j'
-    }// end loop over 'ip'
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -8003,29 +1696,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_cell_integral_0() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_cell_integral_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_cell_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_cell_integral_0();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 144; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c);
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -8038,190 +1717,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_exterior_facet_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave2d_0_exterior_facet_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_exterior_facet_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    
-    // Compute determinant of Jacobian
-    
-    // Compute inverse of Jacobian
-    
-    // Vertices on edges
-    static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
-    
-    // Get vertices
-    const unsigned int v0 = edge_vertices[facet][0];
-    const unsigned int v1 = edge_vertices[facet][1];
-    
-    // Compute scale factor (length of edge scaled by length of reference interval)
-    const double dx0 = x[v1][0] - x[v0][0];
-    const double dx1 = x[v1][1] - x[v0][1];
-    const double det = std::sqrt(dx0*dx0 + dx1*dx1);
-    
-    const bool direction = dx1*(x[facet][0] - x[v0][0]) - dx0*(x[facet][1] - x[v0][1]) < 0;
-    
-    // Compute facet normals from the facet scale factor constants
-    const double n1 = direction ? -dx0 / det : dx0 / det;
-    
-    
-    // Array of quadrature weights
-    static const double W5[5] = {0.118463442528094, 0.239314335249683, 0.284444444444444, 0.239314335249683, 0.118463442528094};
-    // Quadrature points on the UFC reference element: (0.046910077030668), (0.230765344947158), (0.5), (0.769234655052841), (0.953089922969332)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE0_f0_C0[5][3] = \
-    {{0.863670879562042, -0.0425089663766216, 0.178838086814579},
-    {0.414209254015687, -0.124260056089996, 0.71005080207431},
-    {0, 0, 1},
-    {-0.124260056089996, 0.414209254015687, 0.71005080207431},
-    {-0.0425089663766216, 0.863670879562042, 0.178838086814579}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[3] = {7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc0[3] = {1, 2, 3};
-    // Array of non-zero columns
-    static const unsigned int nzc5[3] = {6, 7, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc4[3] = {0, 1, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc2[3] = {0, 2, 4};
-    // Array of non-zero columns
-    static const unsigned int nzc3[3] = {6, 8, 10};
-    
-    // Number of operations to compute geometry constants: 2
-    // Should be added to total operation count.
-    const double G0 = 3*det*n1;
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    switch ( facet )
-    {
-    case 0:
-      {
-      // Total number of operations to compute element tensor (from this point): 180
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 180
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 27
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          for (unsigned int k = 0; k < 3; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc0[j]*12 + nzc1[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 1:
-      {
-      // Total number of operations to compute element tensor (from this point): 180
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 180
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 27
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          for (unsigned int k = 0; k < 3; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc2[j]*12 + nzc3[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 2:
-      {
-      // Total number of operations to compute element tensor (from this point): 180
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 180
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 27
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          for (unsigned int k = 0; k < 3; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc4[j]*12 + nzc5[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    }
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -8238,30 +1743,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_0_exterior_facet_integral_0();
 
   /// Destructor
-  virtual ~solitarywave2d_0_exterior_facet_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_0_exterior_facet_integral_0();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 144; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c, facet);
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -8285,118 +1776,43 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_form_0() : ufc::form()
-  {
-    // Do nothing
-  }
+  solitarywave2d_form_0();
 
   /// Destructor
-  virtual ~solitarywave2d_form_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_form_0();
 
   /// Return a string identifying the form
-  virtual const char* signature() const
-  {
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1, Space(2)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2}))))))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('triangle', 1, Space(2))), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Measure('exterior_facet', 0, None))])";
-  }
+  virtual const char* signature() const;
 
   /// Return the rank of the global tensor (r)
-  virtual unsigned int rank() const
-  {
-    return 2;
-  }
+  virtual unsigned int rank() const;
 
   /// Return the number of coefficients (n)
-  virtual unsigned int num_coefficients() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_coefficients() const;
 
   /// Return the number of cell integrals
-  virtual unsigned int num_cell_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_cell_integrals() const;
 
   /// Return the number of exterior facet integrals
-  virtual unsigned int num_exterior_facet_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_exterior_facet_integrals() const;
 
   /// Return the number of interior facet integrals
-  virtual unsigned int num_interior_facet_integrals() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_interior_facet_integrals() const;
 
   /// Create a new finite element for argument function i
-  virtual ufc::finite_element* create_finite_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_finite_element_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_finite_element_1();
-      break;
-    case 2:
-      return new solitarywave2d_0_finite_element_2();
-      break;
-    case 3:
-      return new solitarywave2d_0_finite_element_3();
-      break;
-    case 4:
-      return new solitarywave2d_0_finite_element_4();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_finite_element(unsigned int i) const;
 
   /// Create a new dof map for argument function i
-  virtual ufc::dof_map* create_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_0_dof_map_0();
-      break;
-    case 1:
-      return new solitarywave2d_0_dof_map_1();
-      break;
-    case 2:
-      return new solitarywave2d_0_dof_map_2();
-      break;
-    case 3:
-      return new solitarywave2d_0_dof_map_3();
-      break;
-    case 4:
-      return new solitarywave2d_0_dof_map_4();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_dof_map(unsigned int i) const;
 
   /// Create a new cell integral on sub domain i
-  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
-  {
-    return new solitarywave2d_0_cell_integral_0();
-  }
+  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const;
 
   /// Create a new exterior facet integral on sub domain i
-  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
-  {
-    return new solitarywave2d_0_exterior_facet_integral_0();
-  }
+  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const;
 
   /// Create a new interior facet integral on sub domain i
-  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
-  {
-    return 0;
-  }
+  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const;
 
 };
 
@@ -8407,466 +1823,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_0_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_0_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_0_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_0_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -8877,466 +1897,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_0_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_0_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_0_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_0_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -9347,686 +1971,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[6];
-    vertex_values[3] = dof_values[7];
-    vertex_values[5] = dof_values[8];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_finite_element_0_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_finite_element_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -10037,466 +2045,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_1_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_1_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_1_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_1_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -10507,466 +2119,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_1_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_1_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_1_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-    const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-    const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-    const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-    const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[6][6] = \
-    {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-    {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-    {0, 0, 0.2, 0, 0, 0.163299316185545},
-    {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-    {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-    {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {4.89897948556636, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0},
-    {0, 9.48683298050514, 0, 0, 0, 0},
-    {4, 0, 7.07106781186548, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[6][6] = \
-    {{0, 0, 0, 0, 0, 0},
-    {2.44948974278318, 0, 0, 0, 0, 0},
-    {4.24264068711928, 0, 0, 0, 0, 0},
-    {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-    {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-    {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[6][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[6][1] = {{1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[6][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_1_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -10977,686 +2193,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 5)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (6 <= i && i <= 11)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 6;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-      const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0;
-      const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
-      const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0;
-      const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1;
-      const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[6][6] =   \
-      {{0, -0.173205080756888, -0.1, 0.121716123890037, 0.0942809041582064, 0.0544331053951817},
-      {0, 0.173205080756888, -0.1, 0.121716123890037, -0.0942809041582063, 0.0544331053951818},
-      {0, 0, 0.2, 0, 0, 0.163299316185545},
-      {0.471404520791032, 0.23094010767585, 0.133333333333333, 0, 0.188561808316413, -0.163299316185545},
-      {0.471404520791032, -0.23094010767585, 0.133333333333333, 0, -0.188561808316413, -0.163299316185545},
-      {0.471404520791032, 0, -0.266666666666667, -0.243432247780074, 0, 0.0544331053951817}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {4.89897948556636, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0},
-      {0, 9.48683298050514, 0, 0, 0, 0},
-      {4, 0, 7.07106781186548, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[6][6] =   \
-      {{0, 0, 0, 0, 0, 0},
-      {2.44948974278318, 0, 0, 0, 0, 0},
-      {4.24264068711928, 0, 0, 0, 0, 0},
-      {2.58198889747161, 4.74341649025257, -0.912870929175277, 0, 0, 0},
-      {2, 6.12372435695795, 3.53553390593274, 0, 0, 0},
-      {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[12][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}, {{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.5, 0.5}}, {{0, 0.5}}, {{0.5, 0}}};
-    static const double W[12][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[12][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[6];
-    vertex_values[3] = dof_values[7];
-    vertex_values[5] = dof_values[8];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_finite_element_1_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_finite_element_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -11667,383 +2267,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_2() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_2();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_2();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_2();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -12054,383 +2341,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_finite_element_3() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_finite_element_3();
 
   /// Destructor
-  virtual ~solitarywave2d_1_finite_element_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_finite_element_3();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::triangle;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    
-    // Compute determinant of Jacobian
-    const double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    
-    // Get coordinates and map to the reference (UFC) element
-    double x = (element_coordinates[0][1]*element_coordinates[2][0] -\
-                element_coordinates[0][0]*element_coordinates[2][1] +\
-                J_11*coordinates[0] - J_01*coordinates[1]) / detJ;
-    double y = (element_coordinates[1][1]*element_coordinates[0][0] -\
-                element_coordinates[1][0]*element_coordinates[0][1] -\
-                J_10*coordinates[0] + J_00*coordinates[1]) / detJ;
-    
-    // Map coordinates to the reference square
-    if (std::abs(y - 1.0) < 1e-14)
-      x = -1.0;
-    else
-      x = 2.0 *x/(1.0 - y) - 1.0;
-    y = 2.0*y - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 2;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 1)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[2][2] =  {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.41421356237309}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][2] = {{{0.333333333333333, 0.333333333333333}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    
-    // Compute affine mapping y = F(X)
-    double y[2];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave2d_1_finite_element_3();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -12446,172 +2420,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_0_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_0_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_0_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_0_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -12627,172 +2496,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_0_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_0_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_0_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_0_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -12808,210 +2572,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 12;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-    offset = offset + m.num_entities[1];
-    dofs[6] = offset + c.entity_indices[0][0];
-    dofs[7] = offset + c.entity_indices[0][1];
-    dofs[8] = offset + c.entity_indices[0][2];
-    offset = offset + m.num_entities[0];
-    dofs[9] = offset + c.entity_indices[1][0];
-    dofs[10] = offset + c.entity_indices[1][1];
-    dofs[11] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 7;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 10;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      dofs[3] = 6;
-      dofs[4] = 7;
-      dofs[5] = 11;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[6][0] = x[0][0];
-    coordinates[6][1] = x[0][1];
-    coordinates[7][0] = x[1][0];
-    coordinates[7][1] = x[1][1];
-    coordinates[8][0] = x[2][0];
-    coordinates[8][1] = x[2][1];
-    coordinates[9][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[9][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[10][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[10][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[11][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[11][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_dof_map_0_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_dof_map_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13027,172 +2648,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_1_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_1_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_1_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_1_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13208,172 +2724,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_1_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_1_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_1_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 6;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 6;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_1_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13389,210 +2800,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_1();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 12;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 12;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    unsigned int offset = m.num_entities[0];
-    dofs[3] = offset + c.entity_indices[1][0];
-    dofs[4] = offset + c.entity_indices[1][1];
-    dofs[5] = offset + c.entity_indices[1][2];
-    offset = offset + m.num_entities[1];
-    dofs[6] = offset + c.entity_indices[0][0];
-    dofs[7] = offset + c.entity_indices[0][1];
-    dofs[8] = offset + c.entity_indices[0][2];
-    offset = offset + m.num_entities[0];
-    dofs[9] = offset + c.entity_indices[1][0];
-    dofs[10] = offset + c.entity_indices[1][1];
-    dofs[11] = offset + c.entity_indices[1][2];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 7;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 4;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 10;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 5;
-      dofs[3] = 6;
-      dofs[4] = 7;
-      dofs[5] = 11;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[3][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[3][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[4][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[4][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[5][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[5][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[6][0] = x[0][0];
-    coordinates[6][1] = x[0][1];
-    coordinates[7][0] = x[1][0];
-    coordinates[7][1] = x[1][1];
-    coordinates[8][0] = x[2][0];
-    coordinates[8][1] = x[2][1];
-    coordinates[9][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[9][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[10][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[10][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[11][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[11][1] = 0.5*x[0][1] + 0.5*x[1][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_dof_map_1_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_dof_map_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13608,150 +2876,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_2() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_2();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_2();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[2];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[2][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_2();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13767,150 +2952,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_dof_map_3() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave2d_1_dof_map_3();
 
   /// Destructor
-  virtual ~solitarywave2d_1_dof_map_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_dof_map_3();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[2];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 2;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[2][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.333333333333333*x[0][0] + 0.333333333333333*x[1][0] + 0.333333333333333*x[2][0];
-    coordinates[0][1] = 0.333333333333333*x[0][1] + 0.333333333333333*x[1][1] + 0.333333333333333*x[2][1];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave2d_1_dof_map_3();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -13923,210 +3025,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_cell_integral_0_quadrature() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_cell_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave2d_1_cell_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_cell_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = x[1][0] - x[0][0];
-    const double J_01 = x[2][0] - x[0][0];
-    const double J_10 = x[1][1] - x[0][1];
-    const double J_11 = x[2][1] - x[0][1];
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*J_11 - J_01*J_10;
-    
-    // Compute inverse of Jacobian
-    const double Jinv_00 =  J_11 / detJ;
-    const double Jinv_01 = -J_01 / detJ;
-    const double Jinv_10 = -J_10 / detJ;
-    const double Jinv_11 =  J_00 / detJ;
-    
-    // Set scale factor
-    const double det = std::abs(detJ);
-    
-    
-    // Array of quadrature weights
-    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
-    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE1_C0[25][6] = \
-    {{0.759842524889054, -0.0409849230988148, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
-    {0.404143384962011, -0.0347905350890822, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
-    {0.03820389372017, -0.0249744559383749, -0.0543309414249183, 0.0461882014671774, 0.938423301877431, 0.0564900002985142},
-    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218535},
-    {-0.0762735703276687, -0.00457955736373819, 0.723813068870285, 0.0166673234982246, 0.338636367163553, 0.00173636815934486},
-    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
-    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
-    {-0.0585120870225412, -0.0960538647466012, -0.0543309414249183, 0.227214213208259, 0.75739729013635, 0.224285389849452},
-    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372835},
-    {-0.0643063527627087, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032842},
-    {-0.0191125161665052, -0.0191125161665052, -0.036640207614552, 0.0764500646660208, 0.0764500646660207, 0.921965110615521},
-    {-0.07940205210781, -0.0794020521078101, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
-    {-0.123076437918076, -0.123076437918076, -0.0543309414249183, 0.492305751672304, 0.492305751672304, 0.315872313916462},
-    {-0.105896858921168, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.092742008804029},
-    {-0.0444129613327222, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330889, 0.00970916313338224},
-    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877737, 0.65464206627708},
-    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320686},
-    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249183, 0.75739729013635, 0.227214213208259, 0.224285389849452},
-    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.651676269947229, 0.19549860142211, 0.0658515377372836},
-    {-0.0217044058396819, -0.0643063527627086, 0.723813068870285, 0.273311911925214, 0.0819917787365633, 0.00689399907032842},
-    {-0.0409849230988148, 0.759842524889054, -0.036640207614552, 0.145727572487076, 0.00717255684496521, 0.164882476492272},
-    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.0297980510461639, 0.115025523822223},
-    {-0.024974455938375, 0.0382038937201699, -0.0543309414249183, 0.938423301877431, 0.0461882014671775, 0.0564900002985145},
-    {-0.0138776265525464, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743822, 0.0165858034218536},
-    {-0.00457955736373822, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982245, 0.00173636815934486}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {0, 1, 2, 3, 4, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
-    static const double FE1_C0_D01[25][5] = \
-    {{-2.66059019751491, -0.840760571794125, 0.180170374279215, 3.50135076930903, -0.180170374279215},
-    {-2.05746131912512, -0.207946328505567, 0.150485009380445, 2.26540764763069, -0.150485009380445},
-    {-1.14264217923257, 0.751899240989545, 0.105458579777884, 0.390742938243026, -0.105458579777884},
-    {-0.16099972900317, 1.78185709341454, 0.0571431775822861, -1.62085736441137, -0.0571431775822855},
-    {0.624348810664881, 2.60585965680469, 0.0184891538601872, -3.23020846746957, -0.018489153860186},
-    {-1.95444613358461, -0.840760571794126, 0.886314438209517, 2.79520670537873, -0.886314438209516},
-    {-1.46766348743601, -0.207946328505567, 0.740282841069557, 1.67560981594158, -0.740282841069557},
-    {-0.729317011881439, 0.751899240989545, 0.518783747129016, -0.0225822291081061, -0.518783747129016},
-    {0.0629622614476711, 1.78185709341454, 0.281105168033127, -1.84481935486222, -0.281105168033127},
-    {0.696813589059751, 2.60585965680469, 0.0909539322550576, -3.30267324586444, -0.0909539322550564},
-    {-0.920380285897062, -0.840760571794126, 1.92038028589706, 1.76114085769119, -1.92038028589706},
-    {-0.603973164252783, -0.207946328505567, 1.60397316425278, 0.811919492758351, -1.60397316425278},
-    {-0.124050379505228, 0.751899240989545, 1.12405037950523, -0.627848861484317, -1.12405037950523},
-    {0.390928546707272, 1.78185709341454, 0.609071453292728, -2.17278564012182, -0.609071453292728},
-    {0.802929828402348, 2.60585965680469, 0.197070171597654, -3.40878948520704, -0.197070171597653},
-    {0.113685561790484, -0.840760571794125, 2.95444613358461, 0.727075010003642, -2.95444613358461},
-    {0.259717158930443, -0.207946328505567, 2.46766348743601, -0.0517708304248748, -2.46766348743601},
-    {0.481216252870984, 0.751899240989544, 1.72931701188144, -1.23311549386053, -1.72931701188144},
-    {0.718894831966874, 1.78185709341454, 0.937037738552329, -2.50075192538142, -0.937037738552329},
-    {0.909046067744945, 2.60585965680469, 0.303186410940251, -3.51490572454964, -0.30318641094025},
-    {0.819829625720786, -0.840760571794125, 3.66059019751491, 0.0209309460733398, -3.66059019751491},
-    {0.849514990619556, -0.207946328505567, 3.05746131912512, -0.641568662113988, -3.05746131912512},
-    {0.894541420222117, 0.751899240989544, 2.14264217923257, -1.64644066121166, -2.14264217923257},
-    {0.942856822417715, 1.78185709341454, 1.16099972900317, -2.72471391583226, -1.16099972900317},
-    {0.981510846139815, 2.60585965680469, 0.375651189335121, -3.58737050294451, -0.37565118933512}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
-    static const double FE1_C0_D10[25][5] = \
-    {{-2.66059019751491, -0.819829625720785, 0.159239428205874, -0.159239428205874, 3.4804198232357},
-    {-2.05746131912512, -0.849514990619555, 0.792053671494433, -0.792053671494433, 2.90697630974468},
-    {-1.14264217923257, -0.894541420222116, 1.75189924098954, -1.75189924098954, 2.03718359945469},
-    {-0.16099972900317, -0.942856822417714, 2.78185709341454, -2.78185709341454, 1.10385655142088},
-    {0.624348810664881, -0.981510846139815, 3.60585965680469, -3.60585965680469, 0.357162035474934},
-    {-1.95444613358461, -0.113685561790483, 0.159239428205875, -0.159239428205875, 2.06813169537509},
-    {-1.46766348743601, -0.259717158930442, 0.792053671494433, -0.792053671494433, 1.72738064636645},
-    {-0.729317011881439, -0.481216252870983, 1.75189924098954, -1.75189924098954, 1.21053326475242},
-    {0.0629622614476713, -0.718894831966873, 2.78185709341454, -2.78185709341454, 0.655932570519202},
-    {0.696813589059752, -0.909046067744944, 3.60585965680469, -3.60585965680469, 0.212232478685193},
-    {-0.920380285897062, 0.920380285897063, 0.159239428205875, -0.159239428205875, 0},
-    {-0.603973164252783, 0.603973164252784, 0.792053671494433, -0.792053671494433, 0},
-    {-0.124050379505228, 0.124050379505228, 1.75189924098954, -1.75189924098954, 0},
-    {0.390928546707273, -0.390928546707272, 2.78185709341454, -2.78185709341454, 0},
-    {0.802929828402348, -0.802929828402348, 3.60585965680469, -3.60585965680469, 0},
-    {0.113685561790483, 1.95444613358461, 0.159239428205875, -0.159239428205875, -2.06813169537509},
-    {0.259717158930442, 1.46766348743601, 0.792053671494433, -0.792053671494433, -1.72738064636645},
-    {0.481216252870984, 0.729317011881439, 1.75189924098954, -1.75189924098954, -1.21053326475242},
-    {0.718894831966873, -0.0629622614476713, 2.78185709341454, -2.78185709341454, -0.655932570519202},
-    {0.909046067744945, -0.696813589059751, 3.60585965680469, -3.60585965680469, -0.212232478685194},
-    {0.819829625720786, 2.66059019751491, 0.159239428205876, -0.159239428205876, -3.4804198232357},
-    {0.849514990619555, 2.05746131912512, 0.792053671494433, -0.792053671494433, -2.90697630974468},
-    {0.894541420222116, 1.14264217923257, 1.75189924098954, -1.75189924098954, -2.03718359945469},
-    {0.942856822417715, 0.16099972900317, 2.78185709341454, -2.78185709341454, -1.10385655142088},
-    {0.981510846139815, -0.624348810664881, 3.60585965680469, -3.60585965680469, -0.357162035474935}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
-    
-    // Number of operations to compute geometry constants: 18
-    const double G0 = det*w[2][0];
-    const double G1 = -0.5*det*w[1][0]*w[2][0];
-    const double G2 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
-    const double G3 = -Jinv_11*det;
-    const double G4 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
-    const double G5 = -Jinv_01*det;
-    const double G6 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 2768
-    
-    // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 2750
-    for (unsigned int ip = 0; ip < 25; ip++)
-    {
-      
-      // Function declarations
-      double F0 = 0;
-      double F1 = 0;
-      double F2 = 0;
-      double F3 = 0;
-      
-      // Total number of operations to compute function values = 20
-      for (unsigned int r = 0; r < 5; r++)
-      {
-        F2 += FE1_C0_D10[ip][r]*w[0][nzc2[r]];
-        F3 += FE1_C0_D01[ip][r]*w[0][nzc1[r]];
-      }// end loop over 'r'
-      
-      // Total number of operations to compute function values = 24
-      for (unsigned int r = 0; r < 6; r++)
-      {
-        F0 += FE1_C0[ip][r]*w[0][nzc3[r]];
-        F1 += FE1_C0[ip][r]*w[0][nzc0[r]];
-      }// end loop over 'r'
-      
-      // Number of operations to compute ip constants: 22
-      // Number of operations: 2
-      const double Gip0 = F1*G0*W25[ip];
-      
-      // Number of operations: 4
-      const double Gip1 = W25[ip]*(F0*det + F1*G1);
-      
-      // Number of operations: 8
-      const double Gip2 = F0*F0*F0*W25[ip]*(G3 + F2*G4 + F3*G2);
-      
-      // Number of operations: 8
-      const double Gip3 = F0*F0*F0*W25[ip]*(G5 + F2*G6 + F3*G4);
-      
-      
-      // Number of operations for primary indices: 20
-      for (unsigned int j = 0; j < 5; j++)
-      {
-        // Number of operations to compute entry: 2
-        A[nzc1[j]] += FE1_C0_D01[ip][j]*Gip2;
-        // Number of operations to compute entry: 2
-        A[nzc2[j]] += FE1_C0_D10[ip][j]*Gip3;
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 24
-      for (unsigned int j = 0; j < 6; j++)
-      {
-        // Number of operations to compute entry: 2
-        A[nzc0[j]] += FE1_C0[ip][j]*Gip0;
-        // Number of operations to compute entry: 2
-        A[nzc3[j]] += FE1_C0[ip][j]*Gip1;
-      }// end loop over 'j'
-    }// end loop over 'ip'
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -14143,29 +3050,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_cell_integral_0() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_cell_integral_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_cell_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_cell_integral_0();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 12; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c);
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -14178,181 +3071,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_exterior_facet_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave2d_1_exterior_facet_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_exterior_facet_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    
-    // Compute determinant of Jacobian
-    
-    // Compute inverse of Jacobian
-    
-    // Vertices on edges
-    static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
-    
-    // Get vertices
-    const unsigned int v0 = edge_vertices[facet][0];
-    const unsigned int v1 = edge_vertices[facet][1];
-    
-    // Compute scale factor (length of edge scaled by length of reference interval)
-    const double dx0 = x[v1][0] - x[v0][0];
-    const double dx1 = x[v1][1] - x[v0][1];
-    const double det = std::sqrt(dx0*dx0 + dx1*dx1);
-    
-    const bool direction = dx1*(x[facet][0] - x[v0][0]) - dx0*(x[facet][1] - x[v0][1]) < 0;
-    
-    // Compute facet normals from the facet scale factor constants
-    const double n1 = direction ? -dx0 / det : dx0 / det;
-    
-    
-    // Array of quadrature weights
-    static const double W5[5] = {0.118463442528094, 0.239314335249683, 0.284444444444444, 0.239314335249683, 0.118463442528094};
-    // Quadrature points on the UFC reference element: (0.046910077030668), (0.230765344947158), (0.5), (0.769234655052841), (0.953089922969332)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE0_f0_C0[5][3] = \
-    {{0.863670879562042, -0.0425089663766216, 0.178838086814579},
-    {0.414209254015687, -0.124260056089996, 0.71005080207431},
-    {0, 0, 1},
-    {-0.124260056089996, 0.414209254015687, 0.71005080207431},
-    {-0.0425089663766216, 0.863670879562042, 0.178838086814579}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[3] = {7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc0[3] = {1, 2, 3};
-    // Array of non-zero columns
-    static const unsigned int nzc5[3] = {6, 7, 11};
-    // Array of non-zero columns
-    static const unsigned int nzc4[3] = {0, 1, 5};
-    // Array of non-zero columns
-    static const unsigned int nzc2[3] = {0, 2, 4};
-    // Array of non-zero columns
-    static const unsigned int nzc3[3] = {6, 8, 10};
-    
-    // Number of operations to compute geometry constants: 1
-    // Should be added to total operation count.
-    const double G0 = det*n1;
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    switch ( facet )
-    {
-    case 0:
-      {
-      // Total number of operations to compute element tensor (from this point): 80
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 80
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 6
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc0[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 1:
-      {
-      // Total number of operations to compute element tensor (from this point): 80
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 80
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 6
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc2[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 2:
-      {
-      // Total number of operations to compute element tensor (from this point): 80
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 80
-      for (unsigned int ip = 0; ip < 5; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 6
-        for (unsigned int r = 0; r < 3; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W5[ip];
-        
-        
-        // Number of operations for primary indices: 6
-        for (unsigned int j = 0; j < 3; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc4[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    }
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -14369,30 +3097,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_1_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave2d_1_exterior_facet_integral_0();
 
   /// Destructor
-  virtual ~solitarywave2d_1_exterior_facet_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_1_exterior_facet_integral_0();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 12; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c, facet);
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -14416,112 +3130,43 @@ public:
 public:
 
   /// Constructor
-  solitarywave2d_form_1() : ufc::form()
-  {
-    // Do nothing
-  }
+  solitarywave2d_form_1();
 
   /// Destructor
-  virtual ~solitarywave2d_form_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave2d_form_1();
 
   /// Return a string identifying the form
-  virtual const char* signature() const
-  {
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('triangle', 1, Space(2)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(1),), {Index(1): 2})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(1),), {Index(1): 2}))), MultiIndex((Index(1),), {Index(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('triangle', 1, Space(2)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2}))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('triangle', 1, Space(2))), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, None))])";
-  }
+  virtual const char* signature() const;
 
   /// Return the rank of the global tensor (r)
-  virtual unsigned int rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int rank() const;
 
   /// Return the number of coefficients (n)
-  virtual unsigned int num_coefficients() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_coefficients() const;
 
   /// Return the number of cell integrals
-  virtual unsigned int num_cell_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_cell_integrals() const;
 
   /// Return the number of exterior facet integrals
-  virtual unsigned int num_exterior_facet_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_exterior_facet_integrals() const;
 
   /// Return the number of interior facet integrals
-  virtual unsigned int num_interior_facet_integrals() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_interior_facet_integrals() const;
 
   /// Create a new finite element for argument function i
-  virtual ufc::finite_element* create_finite_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_finite_element_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_finite_element_1();
-      break;
-    case 2:
-      return new solitarywave2d_1_finite_element_2();
-      break;
-    case 3:
-      return new solitarywave2d_1_finite_element_3();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_finite_element(unsigned int i) const;
 
   /// Create a new dof map for argument function i
-  virtual ufc::dof_map* create_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave2d_1_dof_map_0();
-      break;
-    case 1:
-      return new solitarywave2d_1_dof_map_1();
-      break;
-    case 2:
-      return new solitarywave2d_1_dof_map_2();
-      break;
-    case 3:
-      return new solitarywave2d_1_dof_map_3();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_dof_map(unsigned int i) const;
 
   /// Create a new cell integral on sub domain i
-  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
-  {
-    return new solitarywave2d_1_cell_integral_0();
-  }
+  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const;
 
   /// Create a new exterior facet integral on sub domain i
-  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
-  {
-    return new solitarywave2d_1_exterior_facet_integral_0();
-  }
+  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const;
 
   /// Create a new interior facet integral on sub domain i
-  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
-  {
-    return 0;
-  }
+  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const;
 
 };
 
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SolitaryWave3D.cpp
--- a/MADDs-4/cpp/SolitaryWave3D.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SolitaryWave3D.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -1,49 +1,49 @@
 #include "SolitaryWave3D.h"
 
 /// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0_0::UFC_SolitaryWave3DBilinearForm_finite_element_0_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0_0::~UFC_SolitaryWave3DBilinearForm_finite_element_0_0()
+solitarywave3d_0_finite_element_0_0::solitarywave3d_0_finite_element_0_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_0_0::~solitarywave3d_0_finite_element_0_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_0_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_0_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_0_0::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_0_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_0::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_0_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_0::value_rank() const
+unsigned int solitarywave3d_0_finite_element_0_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_0_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_0_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -61,20 +61,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -161,7 +161,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -190,7 +190,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_0_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -198,7 +198,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -217,20 +217,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -274,14 +274,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -306,7 +306,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -377,7 +377,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -391,7 +391,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -403,7 +403,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -415,7 +415,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -553,7 +553,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -562,14 +562,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_0_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -598,14 +598,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_0_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -613,7 +613,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -625,62 +625,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_0::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_0_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_0_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0_1::UFC_SolitaryWave3DBilinearForm_finite_element_0_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0_1::~UFC_SolitaryWave3DBilinearForm_finite_element_0_1()
+ufc::finite_element* solitarywave3d_0_finite_element_0_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_0_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_0_1::solitarywave3d_0_finite_element_0_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_0_1::~solitarywave3d_0_finite_element_0_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_0_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_0_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_0_1::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_0_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_1::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_0_1::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_1::value_rank() const
+unsigned int solitarywave3d_0_finite_element_0_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_0_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_0_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -698,20 +698,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -798,7 +798,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -827,7 +827,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_0_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -835,7 +835,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -854,20 +854,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -911,14 +911,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -943,7 +943,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -1014,7 +1014,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -1028,7 +1028,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1040,7 +1040,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1052,7 +1052,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1190,7 +1190,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -1199,14 +1199,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_0_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -1235,14 +1235,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_0_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -1250,7 +1250,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -1262,62 +1262,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0_1::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_0_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_0_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0::UFC_SolitaryWave3DBilinearForm_finite_element_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_0::~UFC_SolitaryWave3DBilinearForm_finite_element_0()
+ufc::finite_element* solitarywave3d_0_finite_element_0_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_0_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_0::solitarywave3d_0_finite_element_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_0::~solitarywave3d_0_finite_element_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_0::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_finite_element_0::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_0::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_0::space_dimension() const
 {
     return 20;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0::value_rank() const
+unsigned int solitarywave3d_0_finite_element_0::value_rank() const
 {
     return 1;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_0::value_dimension(unsigned int i) const
 {
     return 2;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -1335,20 +1335,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -1438,7 +1438,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -1517,7 +1517,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -1548,7 +1548,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -1556,7 +1556,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -1575,20 +1575,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -1632,14 +1632,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -1664,7 +1664,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -1737,7 +1737,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -1751,7 +1751,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1763,7 +1763,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1775,7 +1775,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1963,7 +1963,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -1977,7 +1977,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -1989,7 +1989,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -2001,7 +2001,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -2141,7 +2141,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -2150,14 +2150,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -2186,14 +2186,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -2201,7 +2201,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -2218,71 +2218,71 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_0::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_0::num_sub_elements() const
 {
     return 2;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_0::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1_0::UFC_SolitaryWave3DBilinearForm_finite_element_1_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1_0::~UFC_SolitaryWave3DBilinearForm_finite_element_1_0()
+ufc::finite_element* solitarywave3d_0_finite_element_0::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_finite_element_0_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_finite_element_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_1_0::solitarywave3d_0_finite_element_1_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_1_0::~solitarywave3d_0_finite_element_1_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_1_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_1_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_1_0::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_1_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_0::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_1_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_0::value_rank() const
+unsigned int solitarywave3d_0_finite_element_1_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_1_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_1_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -2300,20 +2300,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -2400,7 +2400,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -2429,7 +2429,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_1_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -2437,7 +2437,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -2456,20 +2456,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -2513,14 +2513,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -2545,7 +2545,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -2616,7 +2616,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -2630,7 +2630,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -2642,7 +2642,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -2654,7 +2654,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -2792,7 +2792,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -2801,14 +2801,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_1_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -2837,14 +2837,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_1_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -2852,7 +2852,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -2864,62 +2864,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_0::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_1_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_1_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1_1::UFC_SolitaryWave3DBilinearForm_finite_element_1_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1_1::~UFC_SolitaryWave3DBilinearForm_finite_element_1_1()
+ufc::finite_element* solitarywave3d_0_finite_element_1_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_1_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_1_1::solitarywave3d_0_finite_element_1_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_1_1::~solitarywave3d_0_finite_element_1_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_1_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_1_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_1_1::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_1_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_1::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_1_1::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_1::value_rank() const
+unsigned int solitarywave3d_0_finite_element_1_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_1_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_1_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -2937,20 +2937,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -3037,7 +3037,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -3066,7 +3066,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_1_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -3074,7 +3074,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -3093,20 +3093,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -3150,14 +3150,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -3182,7 +3182,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -3253,7 +3253,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -3267,7 +3267,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -3279,7 +3279,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -3291,7 +3291,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -3429,7 +3429,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -3438,14 +3438,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_1_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -3474,14 +3474,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_1_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -3489,7 +3489,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -3501,62 +3501,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1_1::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_1_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_1_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1::UFC_SolitaryWave3DBilinearForm_finite_element_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_1::~UFC_SolitaryWave3DBilinearForm_finite_element_1()
+ufc::finite_element* solitarywave3d_0_finite_element_1_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_1_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_1::solitarywave3d_0_finite_element_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_1::~solitarywave3d_0_finite_element_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_1::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_finite_element_1::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_1::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_1::space_dimension() const
 {
     return 20;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1::value_rank() const
+unsigned int solitarywave3d_0_finite_element_1::value_rank() const
 {
     return 1;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_1::value_dimension(unsigned int i) const
 {
     return 2;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -3574,20 +3574,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -3677,7 +3677,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -3756,7 +3756,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -3787,7 +3787,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -3795,7 +3795,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -3814,20 +3814,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -3871,14 +3871,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -3903,7 +3903,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -3976,7 +3976,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -3990,7 +3990,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4002,7 +4002,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4014,7 +4014,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4202,7 +4202,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -4216,7 +4216,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4228,7 +4228,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4240,7 +4240,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4380,7 +4380,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -4389,14 +4389,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -4425,14 +4425,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -4440,7 +4440,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -4457,71 +4457,71 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_1::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_1::num_sub_elements() const
 {
     return 2;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_1::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2_0::UFC_SolitaryWave3DBilinearForm_finite_element_2_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2_0::~UFC_SolitaryWave3DBilinearForm_finite_element_2_0()
+ufc::finite_element* solitarywave3d_0_finite_element_1::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_finite_element_1_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_finite_element_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_2_0::solitarywave3d_0_finite_element_2_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_2_0::~solitarywave3d_0_finite_element_2_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_2_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_2_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_2_0::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_2_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_0::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_2_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_0::value_rank() const
+unsigned int solitarywave3d_0_finite_element_2_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_2_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_2_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -4539,20 +4539,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -4639,7 +4639,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -4668,7 +4668,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_2_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -4676,7 +4676,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_2_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -4695,20 +4695,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -4752,14 +4752,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -4784,7 +4784,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -4855,7 +4855,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -4869,7 +4869,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4881,7 +4881,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -4893,7 +4893,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -5031,7 +5031,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_2_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -5040,14 +5040,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_2_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -5076,14 +5076,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_2_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -5091,7 +5091,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_2_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -5103,62 +5103,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_0::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_2_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_2_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_2_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2_1::UFC_SolitaryWave3DBilinearForm_finite_element_2_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2_1::~UFC_SolitaryWave3DBilinearForm_finite_element_2_1()
+ufc::finite_element* solitarywave3d_0_finite_element_2_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_2_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_2_1::solitarywave3d_0_finite_element_2_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_2_1::~solitarywave3d_0_finite_element_2_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_2_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_finite_element_2_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_2_1::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_2_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_1::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_2_1::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_1::value_rank() const
+unsigned int solitarywave3d_0_finite_element_2_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_2_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_2_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -5176,20 +5176,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -5276,7 +5276,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -5305,7 +5305,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_2_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -5313,7 +5313,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_2_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -5332,20 +5332,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -5389,14 +5389,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -5421,7 +5421,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -5492,7 +5492,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -5506,7 +5506,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -5518,7 +5518,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -5530,7 +5530,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -5668,7 +5668,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_2_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -5677,14 +5677,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_2_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -5713,14 +5713,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_2_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -5728,7 +5728,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_2_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_2_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -5740,62 +5740,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2_1::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_2_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_2_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_2_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2::UFC_SolitaryWave3DBilinearForm_finite_element_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_2::~UFC_SolitaryWave3DBilinearForm_finite_element_2()
+ufc::finite_element* solitarywave3d_0_finite_element_2_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_2_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_2::solitarywave3d_0_finite_element_2() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_2::~solitarywave3d_0_finite_element_2()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_2::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_finite_element_2::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_2::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_2::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_2::space_dimension() const
 {
     return 20;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2::value_rank() const
+unsigned int solitarywave3d_0_finite_element_2::value_rank() const
 {
     return 1;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_2::value_dimension(unsigned int i) const
 {
     return 2;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_2::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -5813,20 +5813,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -5916,7 +5916,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -5995,7 +5995,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -6026,7 +6026,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_2::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -6034,7 +6034,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_2::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -6053,20 +6053,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -6110,14 +6110,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -6142,7 +6142,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -6215,7 +6215,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -6229,7 +6229,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6241,7 +6241,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6253,7 +6253,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6441,7 +6441,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -6455,7 +6455,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6467,7 +6467,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6479,7 +6479,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -6619,7 +6619,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -6628,14 +6628,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_2::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -6664,14 +6664,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_2::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -6679,7 +6679,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_2::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_2::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -6696,71 +6696,71 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_2::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_2::num_sub_elements() const
 {
     return 2;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_2::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_2_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_2_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_3::UFC_SolitaryWave3DBilinearForm_finite_element_3() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_3::~UFC_SolitaryWave3DBilinearForm_finite_element_3()
+ufc::finite_element* solitarywave3d_0_finite_element_2::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_finite_element_2_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_finite_element_2_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_3::solitarywave3d_0_finite_element_3() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_3::~solitarywave3d_0_finite_element_3()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_3::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_0_finite_element_3::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_3::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_3::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_3::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_3::space_dimension() const
 {
     return 1;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_3::value_rank() const
+unsigned int solitarywave3d_0_finite_element_3::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_3::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_3::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_3::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -6778,20 +6778,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -6849,7 +6849,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Extract relevant coefficients
@@ -6860,7 +6860,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_3::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -6868,7 +6868,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_3::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -6887,20 +6887,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -6944,14 +6944,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -6976,7 +6976,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -7018,18 +7018,18 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
-    const static double dmats2[1][1] = \
+    static const double dmats2[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -7095,7 +7095,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -7104,14 +7104,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_3::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -7140,14 +7140,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_3::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -7155,7 +7155,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_3::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_3::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -7167,62 +7167,62 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_3::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_3::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_3::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_4::UFC_SolitaryWave3DBilinearForm_finite_element_4() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_4::~UFC_SolitaryWave3DBilinearForm_finite_element_4()
+ufc::finite_element* solitarywave3d_0_finite_element_3::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_3();
+}
+
+
+/// Constructor
+solitarywave3d_0_finite_element_4::solitarywave3d_0_finite_element_4() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_finite_element_4::~solitarywave3d_0_finite_element_4()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_4::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_0_finite_element_4::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_4::cell_shape() const
+ufc::shape solitarywave3d_0_finite_element_4::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_4::space_dimension() const
+unsigned int solitarywave3d_0_finite_element_4::space_dimension() const
 {
     return 1;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_4::value_rank() const
+unsigned int solitarywave3d_0_finite_element_4::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_4::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_0_finite_element_4::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_basis(unsigned int i,
+void solitarywave3d_0_finite_element_4::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -7240,20 +7240,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -7311,7 +7311,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Extract relevant coefficients
@@ -7322,7 +7322,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_basis_all(double* values,
+void solitarywave3d_0_finite_element_4::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -7330,7 +7330,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_0_finite_element_4::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -7349,20 +7349,20 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -7406,14 +7406,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -7438,7 +7438,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -7480,18 +7480,18 @@ void UFC_SolitaryWave3DBilinearForm_fini
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
-    const static double dmats2[1][1] = \
+    static const double dmats2[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -7557,7 +7557,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_0_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -7566,14 +7566,14 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_dof(unsigned int i,
+double solitarywave3d_0_finite_element_4::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -7602,14 +7602,14 @@ double UFC_SolitaryWave3DBilinearForm_fi
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::evaluate_dofs(double* values,
+void solitarywave3d_0_finite_element_4::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -7617,7 +7617,7 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_4::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_0_finite_element_4::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -7629,2179 +7629,39 @@ void UFC_SolitaryWave3DBilinearForm_fini
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_4::num_sub_elements() const
+unsigned int solitarywave3d_0_finite_element_4::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_4::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_4();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_0::UFC_SolitaryWave3DBilinearForm_finite_element_5_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_0::~UFC_SolitaryWave3DBilinearForm_finite_element_5_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_5_0::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_5_0::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_0::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_0::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_5_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_5_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_1::UFC_SolitaryWave3DBilinearForm_finite_element_5_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_1::~UFC_SolitaryWave3DBilinearForm_finite_element_5_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_5_1::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_5_1::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_1::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_1::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_5_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_5_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_2::UFC_SolitaryWave3DBilinearForm_finite_element_5_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5_2::~UFC_SolitaryWave3DBilinearForm_finite_element_5_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_5_2::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_5_2::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_2::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_2::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_2::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_5_2::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5_2::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_5_2::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_finite_element_5_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5::UFC_SolitaryWave3DBilinearForm_finite_element_5() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_finite_element_5::~UFC_SolitaryWave3DBilinearForm_finite_element_5()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DBilinearForm_finite_element_5::signature() const
-{
-    return "MixedElement([FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DBilinearForm_finite_element_5::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5::space_dimension() const
-{
-    return 3;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5::value_dimension(unsigned int i) const
-{
-    return 3;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    values[2] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0;
-    }
-    
-    if (2 <= i && i <= 2)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 2;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[2] = coeff0_0*basisvalue0;
-    }
-    
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 3*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (2 <= i && i <= 2)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 2;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[2*num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[3][1][3] = {{{0.25, 0.25, 0.25}}, {{0.25, 0.25, 0.25}}, {{0.25, 0.25, 0.25}}};
-    const static double W[3][1] = {{1}, {1}, {1}};
-    const static double D[3][1][3] = {{{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[3];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 3; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DBilinearForm_finite_element_5::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-    vertex_values[6] = dof_values[0];
-    vertex_values[9] = dof_values[0];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[1];
-    vertex_values[4] = dof_values[1];
-    vertex_values[7] = dof_values[1];
-    vertex_values[10] = dof_values[1];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[2] = dof_values[2];
-    vertex_values[5] = dof_values[2];
-    vertex_values[8] = dof_values[2];
-    vertex_values[11] = dof_values[2];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_finite_element_5::num_sub_elements() const
-{
-    return 3;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm_finite_element_5::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_5_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_5_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_5_2();
-      break;
-    }
-    return 0;
-}
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0_0::UFC_SolitaryWave3DBilinearForm_dof_map_0_0() : ufc::dof_map()
+ufc::finite_element* solitarywave3d_0_finite_element_4::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_0_finite_element_4();
+}
+
+/// Constructor
+solitarywave3d_0_dof_map_0_0::solitarywave3d_0_dof_map_0_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0_0::~UFC_SolitaryWave3DBilinearForm_dof_map_0_0()
+solitarywave3d_0_dof_map_0_0::~solitarywave3d_0_dof_map_0_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_0_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_0_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_0_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -9820,57 +7680,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_0_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_0_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::init_cell_finalize()
+void solitarywave3d_0_dof_map_0_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_0_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_0_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_0_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_0_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_0_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_0_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -9888,10 +7754,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -9929,14 +7795,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_0_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -9973,40 +7839,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_0_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_0_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0_1::UFC_SolitaryWave3DBilinearForm_dof_map_0_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_0_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_0_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_0_1::solitarywave3d_0_dof_map_0_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0_1::~UFC_SolitaryWave3DBilinearForm_dof_map_0_1()
+solitarywave3d_0_dof_map_0_1::~solitarywave3d_0_dof_map_0_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_0_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_0_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_0_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -10025,57 +7891,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_0_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_0_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::init_cell_finalize()
+void solitarywave3d_0_dof_map_0_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_0_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_0_1::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_0_1::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_0_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_0_1::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_0_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -10093,10 +7965,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -10134,14 +8006,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_0_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -10178,40 +8050,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_0_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_0_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0::UFC_SolitaryWave3DBilinearForm_dof_map_0() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_0_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_0_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_0::solitarywave3d_0_dof_map_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_0::~UFC_SolitaryWave3DBilinearForm_dof_map_0()
+solitarywave3d_0_dof_map_0::~solitarywave3d_0_dof_map_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_0::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_dof_map_0::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -10230,57 +8102,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::init_cell_finalize()
+void solitarywave3d_0_dof_map_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_0::local_dimension(const ufc::cell& c) const
 {
     return 20;
 }
 
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_0::max_local_dimension() const
+{
+    return 20;
+}
+
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_0::num_facet_dofs() const
 {
     return 12;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -10310,10 +8188,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -10375,14 +8253,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -10449,49 +8327,49 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_0::num_sub_dof_maps() const
 {
     return 2;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1_0::UFC_SolitaryWave3DBilinearForm_dof_map_1_0() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_0::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_dof_map_0_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_dof_map_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_1_0::solitarywave3d_0_dof_map_1_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1_0::~UFC_SolitaryWave3DBilinearForm_dof_map_1_0()
+solitarywave3d_0_dof_map_1_0::~solitarywave3d_0_dof_map_1_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_1_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_1_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_1_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -10510,57 +8388,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_1_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_1_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::init_cell_finalize()
+void solitarywave3d_0_dof_map_1_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_1_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_1_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_1_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_1_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_1_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_1_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -10578,10 +8462,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -10619,14 +8503,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_1_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -10663,40 +8547,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_1_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_1_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1_1::UFC_SolitaryWave3DBilinearForm_dof_map_1_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_1_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_1_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_1_1::solitarywave3d_0_dof_map_1_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1_1::~UFC_SolitaryWave3DBilinearForm_dof_map_1_1()
+solitarywave3d_0_dof_map_1_1::~solitarywave3d_0_dof_map_1_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_1_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_1_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_1_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -10715,57 +8599,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_1_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_1_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::init_cell_finalize()
+void solitarywave3d_0_dof_map_1_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_1_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_1_1::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_1_1::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_1_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_1_1::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_1_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -10783,10 +8673,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -10824,14 +8714,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_1_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -10868,40 +8758,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_1_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_1_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1::UFC_SolitaryWave3DBilinearForm_dof_map_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_1_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_1_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_1::solitarywave3d_0_dof_map_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_1::~UFC_SolitaryWave3DBilinearForm_dof_map_1()
+solitarywave3d_0_dof_map_1::~solitarywave3d_0_dof_map_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_1::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_dof_map_1::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -10920,57 +8810,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::init_cell_finalize()
+void solitarywave3d_0_dof_map_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_1::local_dimension(const ufc::cell& c) const
 {
     return 20;
 }
 
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_1::max_local_dimension() const
+{
+    return 20;
+}
+
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_1::num_facet_dofs() const
 {
     return 12;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -11000,10 +8896,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -11065,14 +8961,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -11139,49 +9035,49 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_1::num_sub_dof_maps() const
 {
     return 2;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2_0::UFC_SolitaryWave3DBilinearForm_dof_map_2_0() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_1::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_dof_map_1_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_dof_map_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_2_0::solitarywave3d_0_dof_map_2_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2_0::~UFC_SolitaryWave3DBilinearForm_dof_map_2_0()
+solitarywave3d_0_dof_map_2_0::~solitarywave3d_0_dof_map_2_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_2_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_2_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_2_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -11200,57 +9096,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_2_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_2_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::init_cell_finalize()
+void solitarywave3d_0_dof_map_2_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_2_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_2_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_2_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_2_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_2_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_2_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -11268,10 +9170,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -11309,14 +9211,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_2_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -11353,40 +9255,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_2_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_2_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_2_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2_1::UFC_SolitaryWave3DBilinearForm_dof_map_2_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_2_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_2_0();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_2_1::solitarywave3d_0_dof_map_2_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2_1::~UFC_SolitaryWave3DBilinearForm_dof_map_2_1()
+solitarywave3d_0_dof_map_2_1::~solitarywave3d_0_dof_map_2_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_2_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_0_dof_map_2_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_2_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -11405,57 +9307,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_2_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_2_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::init_cell_finalize()
+void solitarywave3d_0_dof_map_2_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_2_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_2_1::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_2_1::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_2_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_2_1::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_2_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -11473,10 +9381,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -11514,14 +9422,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_2_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -11558,40 +9466,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_2_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_2_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_2_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2::UFC_SolitaryWave3DBilinearForm_dof_map_2() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_2_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_2_1();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_2::solitarywave3d_0_dof_map_2() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_2::~UFC_SolitaryWave3DBilinearForm_dof_map_2()
+solitarywave3d_0_dof_map_2::~solitarywave3d_0_dof_map_2()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_2::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_0_dof_map_2::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_2::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -11610,57 +9518,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_2::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_2::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_2::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::init_cell_finalize()
+void solitarywave3d_0_dof_map_2::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_2::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_2::local_dimension(const ufc::cell& c) const
 {
     return 20;
 }
 
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_2::max_local_dimension() const
+{
+    return 20;
+}
+
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_2::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_2::num_facet_dofs() const
 {
     return 12;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_2::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -11690,10 +9604,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -11755,14 +9669,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_2::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_2::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -11829,49 +9743,49 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_2::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_2::num_sub_dof_maps() const
 {
     return 2;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_2::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_2_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_2_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_3::UFC_SolitaryWave3DBilinearForm_dof_map_3() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_2::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_dof_map_2_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_dof_map_2_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_3::solitarywave3d_0_dof_map_3() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_3::~UFC_SolitaryWave3DBilinearForm_dof_map_3()
+solitarywave3d_0_dof_map_3::~solitarywave3d_0_dof_map_3()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_3::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_0_dof_map_3::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_3::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_3::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return false;
@@ -11890,57 +9804,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_3::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_3::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[3];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_3::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::init_cell_finalize()
+void solitarywave3d_0_dof_map_3::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_3::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_3::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_3::max_local_dimension() const
 {
     return 1;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_3::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_3::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_3::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_3::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -11948,10 +9868,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -11969,14 +9889,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_3::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_3::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -11986,40 +9906,40 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_3::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_3::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_3::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_4::UFC_SolitaryWave3DBilinearForm_dof_map_4() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_0_dof_map_3::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_3();
+}
+
+
+/// Constructor
+solitarywave3d_0_dof_map_4::solitarywave3d_0_dof_map_4() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_4::~UFC_SolitaryWave3DBilinearForm_dof_map_4()
+solitarywave3d_0_dof_map_4::~solitarywave3d_0_dof_map_4()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_4::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_0_dof_map_4::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_4::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_0_dof_map_4::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return false;
@@ -12038,57 +9958,63 @@ bool UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_4::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_0_dof_map_4::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[3];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::init_cell(const ufc::mesh& m,
+void solitarywave3d_0_dof_map_4::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::init_cell_finalize()
+void solitarywave3d_0_dof_map_4::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::global_dimension() const
+unsigned int solitarywave3d_0_dof_map_4::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_0_dof_map_4::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_0_dof_map_4::max_local_dimension() const
 {
     return 1;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::geometric_dimension() const
+unsigned int solitarywave3d_0_dof_map_4::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::num_facet_dofs() const
+unsigned int solitarywave3d_0_dof_map_4::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_0_dof_map_4::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_4::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -12096,10 +10022,10 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -12117,14 +10043,14 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_0_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_4::tabulate_coordinates(double** coordinates,
+void solitarywave3d_0_dof_map_4::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -12134,646 +10060,32 @@ void UFC_SolitaryWave3DBilinearForm_dof_
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_4::num_sub_dof_maps() const
+unsigned int solitarywave3d_0_dof_map_4::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_4::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_4();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_0::UFC_SolitaryWave3DBilinearForm_dof_map_5_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_0::~UFC_SolitaryWave3DBilinearForm_dof_map_5_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_5_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_0::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_5_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_5_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_1::UFC_SolitaryWave3DBilinearForm_dof_map_5_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_1::~UFC_SolitaryWave3DBilinearForm_dof_map_5_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_5_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_1::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_5_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_5_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_2::UFC_SolitaryWave3DBilinearForm_dof_map_5_2() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5_2::~UFC_SolitaryWave3DBilinearForm_dof_map_5_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_5_2::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5_2::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5_2::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5_2::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_5_2::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_dof_map_5_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5::UFC_SolitaryWave3DBilinearForm_dof_map_5() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_dof_map_5::~UFC_SolitaryWave3DBilinearForm_dof_map_5()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DBilinearForm_dof_map_5::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DBilinearForm_dof_map_5::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = 3*m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::local_dimension() const
-{
-    return 3;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-    unsigned int offset = m.num_entities[3];
-    dofs[1] = offset + c.entity_indices[3][0];
-    offset = offset + m.num_entities[3];
-    dofs[2] = offset + c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DBilinearForm_dof_map_5::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-    coordinates[1][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[1][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[1][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-    coordinates[2][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[2][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[2][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DBilinearForm_dof_map_5::num_sub_dof_maps() const
-{
-    return 3;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm_dof_map_5::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_5_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_5_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_5_2();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DBilinearForm_cell_integral_0_quadrature::UFC_SolitaryWave3DBilinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_cell_integral_0_quadrature::~UFC_SolitaryWave3DBilinearForm_cell_integral_0_quadrature()
+ufc::dof_map* solitarywave3d_0_dof_map_4::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_0_dof_map_4();
+}
+
+
+/// Constructor
+solitarywave3d_0_cell_integral_0_quadrature::solitarywave3d_0_cell_integral_0_quadrature() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_cell_integral_0_quadrature::~solitarywave3d_0_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave3DBilinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave3d_0_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -12790,7 +10102,7 @@ void UFC_SolitaryWave3DBilinearForm_cell
     const double J_20 = x[1][2] - x[0][2];
     const double J_21 = x[2][2] - x[0][2];
     const double J_22 = x[3][2] - x[0][2];
-      
+    
     // Compute sub determinants
     const double d_00 = J_11*J_22 - J_12*J_21;
     const double d_01 = J_12*J_20 - J_10*J_22;
@@ -12803,10 +10115,10 @@ void UFC_SolitaryWave3DBilinearForm_cell
     const double d_20 = J_01*J_12 - J_02*J_11;
     const double d_21 = J_02*J_10 - J_00*J_12;
     const double d_22 = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
-      
+    
     // Compute inverse of Jacobian
     const double Jinv_00 = d_00 / detJ;
     const double Jinv_01 = d_10 / detJ;
@@ -12823,167 +10135,555 @@ void UFC_SolitaryWave3DBilinearForm_cell
     
     
     // Array of quadrature weights
-    const static double W27[27] = {0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384, 0.0140327598874417, 0.0130602412264747, 0.00267468981037392, 0.0160098281154818, 0.0149002918071527, 0.00305152546397085, 0.0048766033448291, 0.00453863791300947, 0.000929496505339815, 0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384};
-    
-    
-    const static double FE0_C1_D100[27][7] = \
-    {{-1.99865811288677, -0.619120480633141, 0.2919760962926, 0.328486271453771, -0.2919760962926, -0.328486271453771, 2.61777859351991},
-    {-1.11229755309379, -0.731703032991766, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, 1.84400058608555},
-    {0.0457477733980357, -0.878794075302896, 2.82000883955399, 0.104533009146939, -2.82000883955399, -0.104533009146939, 0.833046301904861},
-    {-0.942926908148453, -0.753215925563414, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, 1.69614283371187},
-    {-0.368625431583845, -0.82616177738479, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, 1.19478720896864},
-    {0.381709331831541, -0.921466788258062, 2.82000883955399, 0.483167280535609, -2.82000883955399, -0.48316728053561, 0.539757456426521},
-    {0.301373419046404, -0.911262789436721, 0.291976096292599, 2.92066011219053, -0.291976096292599, -2.92066011219053, 0.609889370390317},
-    {0.507877469881381, -0.937492242968394, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, 0.429614773087013},
-    {0.77767856643167, -0.971761475441781, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, 0.194082909010111},
-    {-0.689768816126815, 0.689768816126816, 0.2919760962926, 0.32848627145377, -0.2919760962926, -0.32848627145377, 0},
-    {-0.19029726005101, 0.190297260051011, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, 0},
-    {0.462270924350466, -0.462270924350466, 2.82000883955399, 0.104533009146939, -2.82000883955399, -0.104533009146939, 0},
-    {-0.0948554912925193, 0.09485549129252, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, 0},
-    {0.228768172900473, -0.228768172900473, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, 0},
-    {0.651588060044801, -0.651588060044802, 2.82000883955399, 0.48316728053561, -2.82000883955399, -0.48316728053561, 0},
-    {0.606318104241563, -0.606318104241563, 0.291976096292599, 2.92066011219053, -0.291976096292599, -2.92066011219053, 0},
-    {0.722684856424887, -0.722684856424888, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, 0},
-    {0.874720020936725, -0.874720020936726, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, 0},
-    {0.619120480633142, 1.99865811288677, 0.291976096292599, 0.328486271453769, -0.291976096292599, -0.328486271453769, -2.61777859351991},
-    {0.731703032991767, 1.11229755309379, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, -1.84400058608555},
-    {0.878794075302896, -0.0457477733980358, 2.82000883955399, 0.10453300914694, -2.82000883955399, -0.10453300914694, -0.833046301904861},
-    {0.753215925563415, 0.942926908148454, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, -1.69614283371187},
-    {0.82616177738479, 0.368625431583845, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, -1.19478720896864},
-    {0.921466788258061, -0.381709331831542, 2.82000883955399, 0.483167280535611, -2.82000883955399, -0.483167280535611, -0.53975745642652},
-    {0.911262789436721, -0.301373419046404, 0.291976096292599, 2.92066011219053, -0.291976096292599, -2.92066011219053, -0.609889370390318},
-    {0.937492242968393, -0.507877469881382, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, -0.429614773087011},
-    {0.97176147544178, -0.777678566431672, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, -0.194082909010108}};
-    // Array of non-zero columns
-    static const unsigned int nzc2[7] = {10, 11, 15, 16, 17, 18, 19};
+    static const double W125[125] = {0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565251, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.00225090157446143, 0.00347412941301361, 0.00245558995953753, 0.00088245817276838, 0.000113249435042247, 0.00388807060532275, 0.00600100004508522, 0.00424163688396193, 0.00152430462570915, 0.00019562019257218, 0.0034046010087031, 0.0052547941847441, 0.00371420241029555, 0.00133476204345558, 0.000171295424533231, 0.00171893840164765, 0.00265307667295562, 0.00187525208922536, 0.000673903851785402, 8.64848134932762e-05, 0.000366257730507922, 0.000565296487744311, 0.00039956380849458, 0.000143590075769372, 1.8427496577589e-05, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565252, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06};
+    // Quadrature points on the UFC reference element: (0.0434850684329929, 0.0384332743963333, 0.034578939918215), (0.0372285899889251, 0.0329036302803046, 0.173480320771696), (0.0274810994988124, 0.0242885357160768, 0.389886387065519), (0.0164705687743685, 0.0145571321830714, 0.634333472630887), (0.0067089045501621, 0.00592951049099777, 0.851054212947016), (0.0363203493206216, 0.191166323793956, 0.034578939918215), (0.0310947054204484, 0.163661986623795, 0.173480320771696), (0.0229532381913956, 0.120810681788372, 0.389886387065519), (0.0137568327003139, 0.0724068788863314, 0.634333472630887), (0.00560352704046152, 0.0294932643722359, 0.851054212947016), (0.025452983470971, 0.42283010559815, 0.034578939918215), (0.0217908978824722, 0.361994799675747, 0.173480320771696), (0.0160854287808059, 0.267214393854326, 0.389886387065519), (0.00964066816216436, 0.160152727938308, 0.634333472630887), (0.00392690279162666, 0.0652345028216781, 0.851054212947016), (0.0137918067694829, 0.671415856030076, 0.034578939918215), (0.0118074902013492, 0.574814908126993, 0.173480320771696), (0.00871595763232119, 0.42431222048264, 0.389886387065519), (0.00522383682733774, 0.254308005746508, 0.634333472630887), (0.00212780888992548, 0.103586473561889, 0.851054212947016), (0.00446245462992895, 0.870293213094632, 0.034578939918215), (0.00382041237943087, 0.745078491721125, 0.173480320771696), (0.00282012111543484, 0.54999601573695, 0.389886387065519), (0.00169021617151183, 0.329635544721039, 0.634333472630887), (0.000688470393412244, 0.134269401146344, 0.851054212947016), (0.213916656125506, 0.0384332743963333, 0.034578939918215), (0.183139081291086, 0.0329036302803046, 0.173480320771696), (0.135188126023001, 0.0242885357160768, 0.389886387065519), (0.0810238806942951, 0.0145571321830714, 0.634333472630887), (0.0330032003938849, 0.00592951049099777, 0.851054212947016), (0.178671161296432, 0.191166323793956, 0.034578939918215), (0.152964584084757, 0.163661986623795, 0.173480320771696), (0.112914159689587, 0.120810681788372, 0.389886387065519), (0.0676741639412116, 0.0724068788863314, 0.634333472630887), (0.027565502601231, 0.0294932643722359, 0.851054212947016), (0.125211188776624, 0.42283010559815, 0.034578939918215), (0.107196244066483, 0.361994799675747, 0.173480320771696), (0.0791292565731431, 0.267214393854326, 0.389886387065519), (0.0474254628170509, 0.160152727938308, 0.634333472630887), (0.0193176633816068, 0.0652345028216781, 0.851054212947016), (0.0678462123292524, 0.671415856030076, 0.034578939918215), (0.0580847383280397, 0.574814908126993, 0.173480320771696), (0.0428765224208113, 0.42431222048264, 0.389886387065519), (0.0256976876550462, 0.254308005746508, 0.634333472630887), (0.0104673576243388, 0.103586473561889, 0.851054212947016), (0.0219522104240708, 0.870293213094632, 0.034578939918215), (0.0187938037280005, 0.745078491721125, 0.173480320771696), (0.0138730580546826, 0.54999601573695, 0.389886387065519), (0.00831470213956798, 0.329635544721039, 0.634333472630887), (0.00338680125632329, 0.134269401146344, 0.851054212947016), (0.463493892842726, 0.0384332743963333, 0.034578939918215), (0.396808024474, 0.0329036302803046, 0.173480320771696), (0.292912538609202, 0.0242885357160768, 0.389886387065519), (0.175554697593021, 0.0145571321830714, 0.634333472630887), (0.0715081382809929, 0.00592951049099777, 0.851054212947016), (0.387127368143914, 0.191166323793956, 0.034578939918215), (0.331428846302255, 0.163661986623795, 0.173480320771696), (0.244651465573054, 0.120810681788372, 0.389886387065519), (0.146629824241391, 0.0724068788863314, 0.634333472630887), (0.0597262613403738, 0.0294932643722359, 0.851054212947016), (0.271295477241817, 0.42283010559815, 0.034578939918215), (0.232262439776279, 0.361994799675747, 0.173480320771696), (0.171449609540077, 0.267214393854326, 0.389886387065519), (0.102756899715403, 0.160152727938308, 0.634333472630887), (0.0418556421156527, 0.0652345028216781, 0.851054212947016), (0.147002602025855, 0.671415856030076, 0.034578939918215), (0.125852385550656, 0.574814908126993, 0.173480320771696), (0.0929006962259202, 0.42431222048264, 0.389886387065519), (0.0556792608113027, 0.254308005746508, 0.634333472630887), (0.0226796567455474, 0.103586473561889, 0.851054212947016), (0.0475639234935763, 0.870293213094632, 0.034578939918215), (0.0407205937535897, 0.745078491721125, 0.173480320771696), (0.0300587985987655, 0.54999601573695, 0.389886387065519), (0.0180154913240372, 0.329635544721039, 0.634333472630887), (0.00733819295331972, 0.134269401146344, 0.851054212947016), (0.713071129559946, 0.0384332743963333, 0.034578939918215), (0.610476967656914, 0.0329036302803046, 0.173480320771696), (0.450636951195403, 0.0242885357160768, 0.389886387065519), (0.270085514491747, 0.0145571321830714, 0.634333472630887), (0.110013076168101, 0.00592951049099777, 0.851054212947016), (0.595583574991397, 0.191166323793956, 0.034578939918215), (0.509893108519752, 0.163661986623795, 0.173480320771696), (0.376388771456521, 0.120810681788372, 0.389886387065519), (0.22558548454157, 0.0724068788863314, 0.634333472630887), (0.0918870200795167, 0.0294932643722359, 0.851054212947016), (0.417379765707011, 0.42283010559815, 0.034578939918215), (0.357328635486074, 0.361994799675747, 0.173480320771696), (0.263769962507011, 0.267214393854326, 0.389886387065519), (0.158088336613754, 0.160152727938308, 0.634333472630887), (0.0643936208496987, 0.0652345028216781, 0.851054212947016), (0.226158991722457, 0.671415856030076, 0.034578939918215), (0.193620032773272, 0.574814908126993, 0.173480320771696), (0.142924870031029, 0.42431222048264, 0.389886387065519), (0.0856608339675592, 0.254308005746508, 0.634333472630887), (0.0348919558667561, 0.103586473561889, 0.851054212947016), (0.0731756365630818, 0.870293213094632, 0.034578939918215), (0.062647383779179, 0.745078491721125, 0.173480320771696), (0.0462445391428484, 0.54999601573695, 0.389886387065519), (0.0277162805085065, 0.329635544721039, 0.634333472630887), (0.0112895846503162, 0.134269401146344, 0.851054212947016), (0.883502717252459, 0.0384332743963333, 0.034578939918215), (0.756387458959075, 0.0329036302803046, 0.173480320771696), (0.558343977719591, 0.0242885357160768, 0.389886387065519), (0.334638826411673, 0.0145571321830714, 0.634333472630887), (0.136307372011824, 0.00592951049099777, 0.851054212947016), (0.737934386967207, 0.191166323793956, 0.034578939918215), (0.631762987184061, 0.163661986623795, 0.173480320771696), (0.466349692954713, 0.120810681788372, 0.389886387065519), (0.279502815782468, 0.0724068788863314, 0.634333472630887), (0.113848995640286, 0.0294932643722359, 0.851054212947016), (0.517137971012664, 0.42283010559815, 0.034578939918215), (0.442733981670085, 0.361994799675747, 0.173480320771696), (0.326813790299348, 0.267214393854326, 0.389886387065519), (0.195873131268641, 0.160152727938308, 0.634333472630887), (0.0797843814396788, 0.0652345028216781, 0.851054212947016), (0.280213397282226, 0.671415856030076, 0.034578939918215), (0.239897280899962, 0.574814908126993, 0.173480320771696), (0.177085434819519, 0.42431222048264, 0.389886387065519), (0.106134684795268, 0.254308005746508, 0.634333472630887), (0.0432315046011695, 0.103586473561889, 0.851054212947016), (0.0906653923572237, 0.870293213094632, 0.034578939918215), (0.0776207751277486, 0.745078491721125, 0.173480320771696), (0.0572974760820962, 0.54999601573695, 0.389886387065519), (0.0343407664765626, 0.329635544721039, 0.634333472630887), (0.0139879155132272, 0.134269401146344, 0.851054212947016)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE1_C0[125][10] = \
+    {{0.677651385532498, -0.0397031660797488, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.00601467027473595, 0.00668509426891429, 0.12220234950981, 0.135823609448279, 0.153676704481833},
+    {0.387856517182057, -0.0344566541637981, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.0258337109326268, 0.00489982304341057, 0.524873356031632, 0.0995515731929938, 0.112636954329409},
+    {0.0651520171918798, -0.0259706778394852, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.0428580263847204, 0.00266990266677583, 0.870762864851529, 0.0542454305787948, 0.0613756256250992},
+    {-0.110672538127309, -0.015928009502866, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.0417913323474042, 0.000959056987115393, 0.849090435339365, 0.0194855265186504, 0.0220467672199497},
+    {-0.0991479726822843, -0.00661888574963566, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.0228385659266996, 0.000159122079653143, 0.464019852825595, 0.00323294396937779, 0.0036578925932431},
+    {0.351159931970128, -0.0336820137710776, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0050236767078656, 0.0277729106341423, 0.102067955322095, 0.564272815830671, 0.107208138841391},
+    {0.166485956767395, -0.0291609440100794, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.0215772778825633, 0.0203560850503691, 0.438393782673502, 0.413582342231706, 0.0785779359281236},
+    {-0.0313856207168029, -0.0218995359044537, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.0357966204395903, 0.0110919854206136, 0.727293587580909, 0.225360097430627, 0.0428169423314949},
+    {-0.123259167721812, -0.013378331808425, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.0349056778367692, 0.00398435727676459, 0.709191966981616, 0.080951706122999, 0.0153802939039443},
+    {-0.0879258080236823, -0.00554072800987512, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0190756211805894, 0.000661065217685219, 0.387566669517808, 0.01343111410773, 0.00255182370239899},
+    {0.0177253911135257, -0.0241572747358239, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0035205487447283, 0.0430491507552746, 0.071528331316298, 0.874646011568391, 0.0526508169135872},
+    {-0.0507072246191906, -0.0208412114214236, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0151211678182184, 0.0315527668548808, 0.307222532626625, 0.641069596017233, 0.0385902839346927},
+    {-0.113199283239695, -0.0155679467426812, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.0250859588469928, 0.0171930324062, 0.509680991772005, 0.349317395512301, 0.0210277597937817},
+    {-0.119140564162676, -0.00945478319693843, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.0244615940551512, 0.00617591722127442, 0.49699553421089, 0.125478465209964, 0.00755339144178017},
+    {-0.0670532863962545, -0.00389606166055687, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0133680286585892, 0.00102467820496327, 0.271603335806442, 0.0208187778246103, 0.00125322204081482},
+    {-0.123174301249333, -0.0134113789015495, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00190762423058253, 0.0370401509933353, 0.038757928915604, 0.752558872029367, 0.0154585961181473},
+    {-0.124795870133571, -0.0115286565516393, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.00819346875055506, 0.0271484855811957, 0.166469828971132, 0.551586133921709, 0.0113303391742265},
+    {-0.114366932369083, -0.00856402179742438, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0135929329243276, 0.0147931493464113, 0.276172801534836, 0.300558056253616, 0.00617387658875252},
+    {-0.083605542162086, -0.00516925988494044, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0132546182205693, 0.00531385410362168, 0.269299132691067, 0.107963600123275, 0.00221772110036569},
+    {-0.0394935786210076, -0.00211875374858136, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.00724352288046892, 0.00088164887728405, 0.147169416491454, 0.0179127964336388, 0.000367953519260986},
+    {-0.0742249656146451, -0.00442262762728059, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.000617227802144495, 0.0155345759126796, 0.0125404526199273, 0.315621902524215, 0.00161836079959531},
+    {-0.0655708056648836, -0.00379122127793308, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.00265106546025557, 0.0113860283736764, 0.0538627078708379, 0.23133428023363, 0.00118617348079641},
+    {-0.0507314745513395, -0.00280421494922342, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.00439810733113653, 0.00620422150953917, 0.0893580237504861, 0.126053534227744, 0.000646343288641082},
+    {-0.0319821899921671, -0.00168450251009896, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0042886427742881, 0.00222862131357039, 0.0871339906075373, 0.0452797490545588, 0.000232173275363283},
+    {-0.0135965919524168, -0.000687522410446964, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.00234370251521121, 0.000369762029721776, 0.0476178977115156, 0.00751259615698667, 3.85210627857485e-05},
+    {0.303869742063848, -0.12239598458967, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0295880447986775, 0.0328860701712706, 0.0986289749858682, 0.109622633545923, 0.610151166460404},
+    {0.134887288422247, -0.1160592350988, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.127084106272845, 0.0241037624827062, 0.423622960691414, 0.0803476337536982, 0.447208764024221},
+    {-0.0444896276300268, -0.0986364671877792, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.210832040117064, 0.0131340865091965, 0.702788851119186, 0.0437812467363741, 0.2436830597953},
+    {-0.124193144215204, -0.0678941422087684, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.205584638427372, 0.004717901365009, 0.685297129259398, 0.0157266821407568, 0.0875335060137464},
+    {-0.0858073223121642, -0.030824777921407, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.112350050943802, 0.000782771291888182, 0.374508367808493, 0.00260929475714278, 0.0145231343948943},
+    {0.113856014607669, -0.114824393538401, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0247130374063482, 0.136623636292144, 0.0823785946236127, 0.45542209017267, 0.425654435971174},
+    {0.0100888557121195, -0.106168256116312, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.106145380454931, 0.100137950857575, 0.353825680101135, 0.333800476424499, 0.311982349089632},
+    {-0.0930517568994226, -0.0874149447727761, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.17609477507965, 0.0545649464626408, 0.58699543294085, 0.1818871363886, 0.169998487382437},
+    {-0.12380786286986, -0.0585145790109275, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.171711949680883, 0.0196002999689002, 0.572385695137502, 0.0653357634308634, 0.0610652362544955},
+    {-0.0750005711613296, -0.026045788733914, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0938389484831186, 0.00325198662308666, 0.312803342215279, 0.0108401927023285, 0.0101316475640852},
+    {-0.0689680280637322, -0.0938555051869132, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0173186806951808, 0.211772240689959, 0.0577301993658455, 0.705922921633706, 0.209042466541935},
+    {-0.101961128009395, -0.084214174582561, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0743857552246981, 0.155217931587356, 0.247957945220146, 0.517404431284758, 0.153217150486034},
+    {-0.124620776265111, -0.0666063780815064, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.123405679825933, 0.0845779053253436, 0.411361270793064, 0.281932522593157, 0.0834876841580225},
+    {-0.108104492267147, -0.0429271137702279, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.120334234079468, 0.03038126897555, 0.401122894186573, 0.101273113455689, 0.0299896501195402},
+    {-0.0561005440374291, -0.0185713191445566, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0657615152208353, 0.00504071266550263, 0.219209849244195, 0.0168027433640709, 0.00497573716598929},
+    {-0.12386321264862, -0.0586399952744004, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00938420039924693, 0.182212090917773, 0.0312813527469397, 0.607386932104929, 0.0613761238902858},
+    {-0.118642598591026, -0.051337064674766, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0403062361483535, 0.13355189410245, 0.134357061573334, 0.445182725400454, 0.0449854757548079},
+    {-0.102069833084256, -0.0391997300710066, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0668678896663356, 0.0727721297397925, 0.222897844792828, 0.242579075860235, 0.0245124855775079},
+    {-0.0709852770155237, -0.0243769453534135, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0652036137952374, 0.0261405107994058, 0.217350137116399, 0.0871369434274908, 0.00880514142227651},
+    {-0.0324570586983408, -0.0102482264730672, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0356331552184666, 0.00433710665526561, 0.118779784153456, 0.0144573386556573, 0.00146090632108002},
+    {-0.0624662889902574, -0.0209884113390654, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00303633666130402, 0.0764194389779763, 0.0101213437607678, 0.254737039458918, 0.00642546788699245},
+    {-0.0547979943904275, -0.0180873896108673, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0130414203970155, 0.0560114357414459, 0.043472352934078, 0.18670887286586, 0.00470953053927457},
+    {-0.0419674243417796, -0.0134881345751054, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0216356659299618, 0.0305205066246512, 0.0721204651516608, 0.101737249112632, 0.00256621270496322},
+    {-0.0261798960980541, -0.00817643359622851, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0210971755283347, 0.0109632854758787, 0.0703254578534908, 0.0365450848922505, 0.000921810467379901},
+    {-0.0110346752071629, -0.00336386041082359, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0115294059104329, 0.00181897510595286, 0.0384321943162941, 0.00606338308075562, 0.000152942317908342},
+    {-0.0338407154377174, -0.0338407154377172, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0641085098922729, 0.0712543518585967, 0.0641085098922728, 0.0712543518585967, 0.859306354810017},
+    {-0.0818948079000829, -0.0818948079000828, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.27535353348213, 0.0522256981182022, 0.275353533482129, 0.0522256981182022, 0.629826433147834},
+    {-0.121317028060228, -0.121317028060227, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.456810445618125, 0.0284576666227853, 0.456810445618125, 0.0284576666227853, 0.343191021097949},
+    {-0.113915793899067, -0.113915793899067, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.445440883843385, 0.0102222917528829, 0.445440883843385, 0.0102222917528829, 0.123277807387908},
+    {-0.0612813106001657, -0.0612813106001656, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.243429209376147, 0.00169603302451547, 0.243429209376147, 0.00169603302451546, 0.0204536553616545},
+    {-0.0873921698118468, -0.0873921698118467, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0535458160149806, 0.296022863232407, 0.0535458160149805, 0.296022863232407, 0.599470396664135},
+    {-0.111738685979768, -0.111738685979767, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.229985530278033, 0.216969213641037, 0.229985530278033, 0.216969213641037, 0.439380320644974},
+    {-0.124942786358968, -0.124942786358967, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.38154510401025, 0.118226041425621, 0.38154510401025, 0.118226041425621, 0.239417358428173},
+    {-0.103629213527269, -0.103629213527268, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.372048822409193, 0.0424680316998818, 0.372048822409192, 0.0424680316998817, 0.0860012214282448},
+    {-0.0525918087529765, -0.0525918087529765, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.203321145349199, 0.00704608966270762, 0.203321145349198, 0.00704608966270757, 0.0142689051747946},
+    {-0.124093005298086, -0.124093005298086, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0375244400305132, 0.458847581161833, 0.037524440030513, 0.458847581161833, 0.294404943887462},
+    {-0.12437075791462, -0.12437075791462, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.161171850222422, 0.336311181436057, 0.161171850222422, 0.336311181436057, 0.215783363723318},
+    {-0.112659672317187, -0.112659672317187, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.267383475309499, 0.183255213959251, 0.267383475309499, 0.18325521395925, 0.11757987444578},
+    {-0.08163893883716, -0.0816389388371599, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.260728564133021, 0.0658271912156194, 0.26072856413302, 0.0658271912156194, 0.0422359217564853},
+    {-0.0383518525618255, -0.0383518525618255, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.142485682232515, 0.0109217280147868, 0.142485682232515, 0.0109217280147868, 0.00700757910765451},
+    {-0.103783072021111, -0.103783072021111, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0203327765730934, 0.394799511511351, 0.0203327765730932, 0.394799511511351, 0.0864390600094873},
+    {-0.094174739653074, -0.0941747396530738, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0873316488608436, 0.289367309751452, 0.0873316488608435, 0.289367309751452, 0.0633552917951636},
+    {-0.0756396175073989, -0.0756396175073988, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.144882867229582, 0.157675602800014, 0.144882867229582, 0.157675602800014, 0.0345221574370429},
+    {-0.0494789006423166, -0.0494789006423165, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.141276875455818, 0.0566387271134483, 0.141276875455818, 0.0566387271134482, 0.0124007203379724},
+    {-0.0216509230853557, -0.0216509230853557, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0772064696859616, 0.00939722265546143, 0.0772064696859615, 0.00939722265546143, 0.00205746732038352},
+    {-0.0430392698573708, -0.0430392698573707, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00657884021103599, 0.165578239218447, 0.00657884021103578, 0.165578239218447, 0.00904930727241116},
+    {-0.0374042602423, -0.0374042602422999, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0282568866655468, 0.121360154303653, 0.0282568866655467, 0.121360154303653, 0.00663266702257968},
+    {-0.0282517358523633, -0.0282517358523632, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0468780655408114, 0.0661288778686417, 0.0468780655408113, 0.0661288778686419, 0.0036141254928047},
+    {-0.0173663754687444, -0.0173663754687443, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0457113166909128, 0.0237541851840646, 0.0457113166909126, 0.0237541851840646, 0.00129823171058596},
+    {-0.00723049480167941, -0.00723049480167938, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0249808001133636, 0.00394117909335424, 0.0249808001133633, 0.00394117909335422, 0.000215396303280713},
+    {-0.12239598458967, 0.303869742063848, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0986289749858684, 0.109622633545923, 0.0295880447986773, 0.0328860701712705, 0.610151166460404},
+    {-0.1160592350988, 0.134887288422247, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.423622960691414, 0.0803476337536981, 0.127084106272845, 0.0241037624827062, 0.447208764024221},
+    {-0.0986364671877794, -0.0444896276300268, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.702788851119186, 0.0437812467363741, 0.210832040117064, 0.0131340865091965, 0.2436830597953},
+    {-0.0678941422087684, -0.124193144215204, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.685297129259398, 0.0157266821407568, 0.205584638427371, 0.00471790136500898, 0.0875335060137464},
+    {-0.030824777921407, -0.0858073223121641, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.374508367808493, 0.00260929475714279, 0.112350050943801, 0.000782771291888154, 0.0145231343948942},
+    {-0.114824393538401, 0.113856014607669, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0823785946236129, 0.45542209017267, 0.0247130374063481, 0.136623636292144, 0.425654435971174},
+    {-0.106168256116312, 0.0100888557121194, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.353825680101135, 0.333800476424499, 0.106145380454931, 0.100137950857575, 0.311982349089632},
+    {-0.0874149447727762, -0.0930517568994225, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.58699543294085, 0.1818871363886, 0.17609477507965, 0.0545649464626407, 0.169998487382437},
+    {-0.0585145790109276, -0.12380786286986, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.572385695137502, 0.0653357634308634, 0.171711949680883, 0.0196002999689001, 0.0610652362544955},
+    {-0.026045788733914, -0.0750005711613296, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.312803342215279, 0.0108401927023285, 0.0938389484831182, 0.00325198662308662, 0.0101316475640852},
+    {-0.0938555051869133, -0.0689680280637323, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0577301993658456, 0.705922921633706, 0.0173186806951807, 0.211772240689959, 0.209042466541935},
+    {-0.0842141745825612, -0.101961128009395, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.247957945220146, 0.517404431284758, 0.0743857552246979, 0.155217931587356, 0.153217150486034},
+    {-0.0666063780815065, -0.124620776265111, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.411361270793064, 0.281932522593158, 0.123405679825933, 0.0845779053253435, 0.0834876841580226},
+    {-0.042927113770228, -0.108104492267147, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.401122894186574, 0.101273113455689, 0.120334234079468, 0.0303812689755499, 0.0299896501195402},
+    {-0.0185713191445567, -0.0561005440374291, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.219209849244196, 0.016802743364071, 0.065761515220835, 0.00504071266550261, 0.00497573716598929},
+    {-0.0586399952744005, -0.12386321264862, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0312813527469399, 0.607386932104929, 0.00938420039924669, 0.182212090917773, 0.0613761238902859},
+    {-0.0513370646747661, -0.118642598591026, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.134357061573334, 0.445182725400454, 0.0403062361483534, 0.13355189410245, 0.0449854757548079},
+    {-0.0391997300710068, -0.102069833084256, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.222897844792828, 0.242579075860235, 0.0668678896663356, 0.0727721297397927, 0.024512485577508},
+    {-0.0243769453534136, -0.0709852770155237, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.217350137116399, 0.0871369434274908, 0.0652036137952371, 0.0261405107994057, 0.00880514142227651},
+    {-0.0102482264730672, -0.0324570586983408, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.118779784153457, 0.0144573386556573, 0.0356331552184663, 0.0043371066552656, 0.00146090632108002},
+    {-0.0209884113390655, -0.0624662889902573, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.010121343760768, 0.254737039458918, 0.00303633666130378, 0.0764194389779762, 0.00642546788699245},
+    {-0.0180873896108673, -0.0547979943904275, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0434723529340782, 0.186708872865861, 0.0130414203970153, 0.0560114357414458, 0.00470953053927457},
+    {-0.0134881345751056, -0.0419674243417795, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0721204651516608, 0.101737249112632, 0.0216356659299618, 0.0305205066246514, 0.00256621270496323},
+    {-0.00817643359622858, -0.0261798960980541, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0703254578534909, 0.0365450848922505, 0.0210971755283345, 0.0109632854758786, 0.000921810467379901},
+    {-0.00336386041082355, -0.0110346752071629, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0384321943162945, 0.00606338308075567, 0.0115294059104325, 0.00181897510595279, 0.000152942317908342},
+    {-0.0397031660797491, 0.677651385532497, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.12220234950981, 0.135823609448279, 0.00601467027473575, 0.00668509426891421, 0.153676704481834},
+    {-0.0344566541637982, 0.387856517182057, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.524873356031632, 0.0995515731929938, 0.0258337109326267, 0.00489982304341049, 0.112636954329409},
+    {-0.0259706778394854, 0.0651520171918798, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.870762864851529, 0.0542454305787948, 0.0428580263847204, 0.00266990266677576, 0.0613756256250995},
+    {-0.0159280095028661, -0.110672538127309, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.849090435339365, 0.0194855265186504, 0.0417913323474039, 0.000959056987115348, 0.0220467672199497},
+    {-0.00661888574963571, -0.0991479726822842, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.464019852825596, 0.0032329439693778, 0.0228385659266992, 0.000159122079653129, 0.00365789259324308},
+    {-0.0336820137710778, 0.351159931970128, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.102067955322096, 0.564272815830671, 0.00502367670786549, 0.0277729106341421, 0.107208138841391},
+    {-0.0291609440100797, 0.166485956767395, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.438393782673502, 0.413582342231706, 0.0215772778825632, 0.0203560850503691, 0.0785779359281241},
+    {-0.0218995359044539, -0.0313856207168029, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.727293587580909, 0.225360097430628, 0.0357966204395903, 0.0110919854206135, 0.0428169423314951},
+    {-0.0133783318084251, -0.123259167721811, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.709191966981616, 0.080951706122999, 0.034905677836769, 0.00398435727676454, 0.0153802939039443},
+    {-0.00554072800987505, -0.0879258080236823, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.387566669517808, 0.01343111410773, 0.0190756211805888, 0.000661065217685206, 0.00255182370239895},
+    {-0.0241572747358242, 0.0177253911135256, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0715283313162981, 0.874646011568391, 0.00352054874472815, 0.0430491507552746, 0.0526508169135876},
+    {-0.0208412114214238, -0.0507072246191906, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.307222532626626, 0.641069596017233, 0.0151211678182183, 0.0315527668548808, 0.0385902839346929},
+    {-0.0155679467426813, -0.113199283239695, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.509680991772005, 0.349317395512301, 0.0250859588469928, 0.0171930324062, 0.0210277597937819},
+    {-0.00945478319693848, -0.119140564162676, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.49699553421089, 0.125478465209964, 0.024461594055151, 0.00617591722127439, 0.00755339144178018},
+    {-0.00389606166055691, -0.0670532863962544, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.271603335806442, 0.0208187778246103, 0.013368028658589, 0.0010246782049633, 0.00125322204081482},
+    {-0.0134113789015497, -0.123174301249333, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0387579289156042, 0.752558872029367, 0.00190762423058235, 0.0370401509933354, 0.0154585961181475},
+    {-0.0115286565516395, -0.124795870133571, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.166469828971132, 0.551586133921708, 0.00819346875055494, 0.0271484855811958, 0.0113303391742266},
+    {-0.00856402179742457, -0.114366932369083, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.276172801534836, 0.300558056253616, 0.0135929329243277, 0.0147931493464114, 0.00617387658875262},
+    {-0.00516925988494049, -0.083605542162086, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.269299132691067, 0.107963600123275, 0.013254618220569, 0.0053138541036216, 0.00221772110036569},
+    {-0.00211875374858132, -0.0394935786210076, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.147169416491455, 0.0179127964336388, 0.00724352288046848, 0.000881648877284022, 0.000367953519260972},
+    {-0.00442262762728068, -0.074224965614645, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.0125404526199275, 0.315621902524215, 0.000617227802144259, 0.0155345759126795, 0.00161836079959531},
+    {-0.00379122127793318, -0.0655708056648835, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0538627078708381, 0.23133428023363, 0.00265106546025538, 0.0113860283736764, 0.00118617348079642},
+    {-0.00280421494922354, -0.0507314745513394, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0893580237504861, 0.126053534227744, 0.0043981073311365, 0.00620422150953936, 0.000646343288641096},
+    {-0.001684502510099, -0.031982189992167, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0871339906075375, 0.0452797490545588, 0.00428864277428789, 0.00222862131357036, 0.000232173275363283},
+    {-0.000687522410446992, -0.0135965919524168, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0476178977115159, 0.0075125961569867, 0.00234370251521104, 0.000369762029721762, 3.85210627857485e-05}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc0[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc4[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+    static const double FE1_C0_D001[125][7] = \
+    {{-2.53401086900984, -0.86168424032714, 0.153733097585334, 0.173940273731973, 3.39569510933698, -0.153733097585335, -0.173940273731971},
+    {-2.0255498358363, -0.306078716913217, 0.131614521121219, 0.148914359955701, 2.33162855274952, -0.131614521121219, -0.1489143599557},
+    {-1.23337591087837, 0.559545548262077, 0.0971541428643073, 0.10992439799525, 0.673830362616288, -0.097154142864307, -0.109924397995249},
+    {-0.338555305646693, 1.53733389052355, 0.0582285287322854, 0.0658822750974736, -1.19877858487685, -0.0582285287322848, -0.065882275097473},
+    {0.454770511952704, 2.40421685178806, 0.0237180419639913, 0.0268356182006482, -2.85898736374077, -0.0237180419639906, -0.0268356182006476},
+    {-1.95173754786883, -0.86168424032714, 0.764665295175825, 0.145281397282487, 2.81342178819597, -0.764665295175825, -0.145281397282486},
+    {-1.52705194873624, -0.306078716913217, 0.654647946495179, 0.124378821681794, 1.83313066564946, -0.654647946495179, -0.124378821681793},
+    {-0.865398771818851, 0.559545548262077, 0.483242727153488, 0.0918129527655822, 0.305853223556774, -0.483242727153488, -0.0918129527655815},
+    {-0.118011263129872, 1.53733389052355, 0.289627515545325, 0.0550273308012554, -1.41932262739368, -0.289627515545325, -0.0550273308012548},
+    {0.544604017438855, 2.40421685178806, 0.117973057488944, 0.0224141081618458, -2.94882086922692, -0.117973057488943, -0.0224141081618453},
+    {-1.06855188405066, -0.86168424032714, 1.6913204223926, 0.101811933883884, 1.9302361243778, -1.6913204223926, -0.101811933883883},
+    {-0.77093592668034, -0.306078716913217, 1.44797919870299, 0.0871635915298887, 1.07701464359356, -1.44797919870299, -0.0871635915298881},
+    {-0.307255161197394, 0.559545548262077, 1.0688575754173, 0.0643417151232234, -0.252290387064684, -1.0688575754173, -0.0643417151232229},
+    {0.216507474925436, 1.53733389052355, 0.640610911753232, 0.0385626726486572, -1.75384136544898, -0.640610911753231, -0.0385626726486566},
+    {0.680862474241284, 2.40421685178806, 0.260938011286713, 0.0157076111665065, -3.08507932602935, -0.260938011286712, -0.0157076111665059},
+    {-0.120853589128906, -0.86168424032714, 2.6856634241203, 0.0551672270779314, 0.982537829456046, -2.6856634241203, -0.0551672270779307},
+    {0.0404108764001508, -0.306078716913217, 2.29925963250797, 0.0472299608053964, 0.265667840513066, -2.29925963250797, -0.0472299608053958},
+    {0.291658260721922, 0.559545548262078, 1.69724888193056, 0.0348638305292845, -0.851203808984, -1.69724888193056, -0.034863830529284},
+    {0.575461260818928, 1.53733389052355, 1.01723202298603, 0.0208953473093509, -2.11279515134248, -1.01723202298603, -0.0208953473093502},
+    {0.827073981595321, 2.40421685178806, 0.414345894247555, 0.00851123555970183, -3.23129083338339, -0.414345894247554, -0.0085112355597012},
+    {0.637338430571104, -0.861684240327141, 3.48117285237853, 0.0178498185197156, 0.224345809756035, -3.48117285237853, -0.0178498185197148},
+    {0.689516899489004, -0.306078716913217, 2.9803139668845, 0.0152816495177237, -0.383438182575788, -2.9803139668845, -0.0152816495177229},
+    {0.770810095671614, 0.559545548262077, 2.1999840629478, 0.0112804844617394, -1.33035564393369, -2.1999840629478, -0.0112804844617387},
+    {0.862636934093748, 1.53733389052355, 1.31854217888416, 0.00676086468604747, -2.3999708246173, -1.31854217888415, -0.00676086468604671},
+    {0.94404833794709, 2.40421685178807, 0.537077604585377, 0.00275388157364889, -3.34826518973516, -0.537077604585376, -0.00275388157364832},
+    {-1.85228451823978, -0.86168424032714, 0.153733097585334, 0.855666624502025, 2.71396875856692, -0.153733097585334, -0.855666624502024},
+    {-1.44190787062765, -0.306078716913217, 0.131614521121219, 0.732556325164345, 1.74798658754087, -0.131614521121219, -0.732556325164345},
+    {-0.802547804781613, 0.559545548262077, 0.0971541428643073, 0.540752504092003, 0.243002256519535, -0.0971541428643072, -0.540752504092002},
+    {-0.0803420579669869, 1.53733389052355, 0.0582285287322856, 0.32409552277718, -1.45699183255656, -0.058228528732285, -0.32409552277718},
+    {0.559947695327595, 2.40421685178806, 0.0237180419639915, 0.132012801575539, -2.96416454711566, -0.0237180419639908, -0.132012801575539},
+    {-1.38233429996559, -0.86168424032714, 0.764665295175825, 0.714684645185728, 2.24401854029273, -0.764665295175825, -0.714684645185728},
+    {-1.03957243407901, -0.306078716913217, 0.654647946495179, 0.611858336339029, 1.34565115099223, -0.654647946495179, -0.611858336339028},
+    {-0.505555085826084, 0.559545548262077, 0.483242727153489, 0.45165663875835, -0.0539904624359933, -0.483242727153488, -0.451656638758349},
+    {0.0976580618337187, 1.53733389052355, 0.289627515545326, 0.270696655764846, -1.63499195235727, -0.289627515545325, -0.270696655764845},
+    {0.632451919681933, 2.40421685178806, 0.117973057488944, 0.110262010404924, -3.03666877147, -0.117973057488943, -0.110262010404923},
+    {-0.669519062828044, -0.86168424032714, 1.6913204223926, 0.500844755106496, 1.53120330315518, -1.6913204223926, -0.500844755106495},
+    {-0.429314541944297, -0.306078716913217, 1.44797919870299, 0.428784976265932, 0.735393258857514, -1.44797919870299, -0.428784976265932},
+    {-0.0550798500280451, 0.559545548262077, 1.06885757541731, 0.316517026292572, -0.504465698234032, -1.0688575754173, -0.316517026292572},
+    {0.367646653544982, 1.53733389052355, 0.640610911753232, 0.189701851268203, -1.90498054406853, -0.640610911753231, -0.189701851268203},
+    {0.742425516601204, 2.40421685178806, 0.260938011286713, 0.0772706535264272, -3.14664236838927, -0.260938011286712, -0.0772706535264267},
+    {0.0953640331101715, -0.86168424032714, 2.6856634241203, 0.271384849317009, 0.766320207216968, -2.6856634241203, -0.271384849317009},
+    {0.225519868906913, -0.306078716913217, 2.29925963250797, 0.232338953312159, 0.0805588480063039, -2.29925963250797, -0.232338953312158},
+    {0.428300519875882, 0.559545548262077, 1.69724888193056, 0.171506089683245, -0.98784606813796, -1.69724888193056, -0.171506089683244},
+    {0.657356664129762, 1.53733389052355, 1.01723202298603, 0.102790750620185, -2.19469055465331, -1.01723202298603, -0.102790750620184},
+    {0.860432176532974, 2.40421685178806, 0.414345894247555, 0.0418694304973552, -3.26464902832104, -0.414345894247554, -0.0418694304973546},
+    {0.707297453747672, -0.861684240327141, 3.48117285237853, 0.0878088416962831, 0.154386786579467, -3.48117285237853, -0.0878088416962823},
+    {0.749410464883283, -0.306078716913217, 2.9803139668845, 0.0751752149120021, -0.443331747970066, -2.9803139668845, -0.0751752149120014},
+    {0.815021843428605, 0.559545548262077, 2.1999840629478, 0.0554922322187304, -1.37456739169068, -2.1999840629478, -0.0554922322187298},
+    {0.889134877965972, 1.53733389052355, 1.31854217888416, 0.0332588085582721, -2.42646876848952, -1.31854217888415, -0.0332588085582713},
+    {0.954841661398734, 2.40421685178807, 0.537077604585377, 0.0135472050252931, -3.3590585131868, -0.537077604585376, -0.0135472050252925},
+    {-0.853975571370904, -0.86168424032714, 0.153733097585333, 1.8539755713709, 1.71565981169804, -0.153733097585333, -1.8539755713709},
+    {-0.587232097896, -0.306078716913217, 0.131614521121218, 1.587232097896, 0.893310814809216, -0.131614521121218, -1.587232097896},
+    {-0.171650154436808, 0.559545548262077, 0.0971541428643073, 1.17165015443681, -0.387895393825269, -0.0971541428643073, -1.17165015443681},
+    {0.297781209627916, 1.53733389052355, 0.0582285287322859, 0.702218790372083, -1.83511510015146, -0.0582285287322854, -0.702218790372083},
+    {0.713967446876027, 2.40421685178806, 0.0237180419639917, 0.286032553123971, -3.11818429866409, -0.023718041963991, -0.286032553123971},
+    {-0.548509472575658, -0.86168424032714, 0.764665295175825, 1.54850947257566, 1.4101937129028, -0.764665295175825, -1.54850947257566},
+    {-0.325715385209019, -0.306078716913217, 0.654647946495179, 1.32571538520902, 0.631794102122236, -0.654647946495179, -1.32571538520902},
+    {0.0213941377077832, 0.559545548262077, 0.483242727153489, 0.978605862292217, -0.58093968596986, -0.483242727153489, -0.978605862292217},
+    {0.413480703034436, 1.53733389052355, 0.289627515545326, 0.586519296965564, -1.95081459355798, -0.289627515545326, -0.586519296965563},
+    {0.761094954638504, 2.40421685178806, 0.117973057488944, 0.238905045361495, -3.16531180642657, -0.117973057488944, -0.238905045361495},
+    {-0.0851819089672699, -0.86168424032714, 1.6913204223926, 1.08518190896727, 0.94686614929441, -1.6913204223926, -1.08518190896727},
+    {0.0709502408948852, -0.306078716913217, 1.44797919870299, 0.929049759105114, 0.235128476018332, -1.44797919870299, -0.929049759105114},
+    {0.314201561839691, 0.559545548262077, 1.06885757541731, 0.685798438160309, -0.873747110101769, -1.06885757541731, -0.685798438160308},
+    {0.588972401138389, 1.53733389052355, 0.640610911753232, 0.41102759886161, -2.12630629166194, -0.640610911753232, -0.41102759886161},
+    {0.832577431537388, 2.40421685178806, 0.260938011286713, 0.167422568462611, -3.23679428332545, -0.260938011286712, -0.16742256846261},
+    {0.411989591896581, -0.86168424032714, 2.6856634241203, 0.588010408103419, 0.449694648430559, -2.6856634241203, -0.588010408103418},
+    {0.496590457797377, -0.306078716913217, 2.29925963250797, 0.503409542202622, -0.19051174088416, -2.29925963250797, -0.503409542202622},
+    {0.628397215096318, 0.559545548262078, 1.69724888193056, 0.371602784903681, -1.1879427633584, -1.69724888193056, -0.37160278490368},
+    {0.777282956754788, 1.53733389052355, 1.01723202298603, 0.222717043245211, -2.31461684727834, -1.01723202298603, -0.22271704324521},
+    {0.909281373017809, 2.40421685178806, 0.414345894247555, 0.0907186269821898, -3.31349822480587, -0.414345894247555, -0.0907186269821892},
+    {0.809744306025694, -0.861684240327141, 3.48117285237853, 0.190255693974305, 0.0519399343014455, -3.48117285237853, -0.190255693974305},
+    {0.83711762498564, -0.306078716913217, 2.9803139668845, 0.162882375014359, -0.531038908072423, -2.9803139668845, -0.162882375014358},
+    {0.879764805604936, 0.559545548262077, 2.1999840629478, 0.120235194395062, -1.43931035386701, -2.1999840629478, -0.120235194395062},
+    {0.92793803470385, 1.53733389052355, 1.31854217888416, 0.0720619652961492, -2.4652719252274, -1.31854217888415, -0.0720619652961484},
+    {0.97064722818672, 2.40421685178807, 0.537077604585377, 0.0293527718132788, -3.37486407997479, -0.537077604585376, -0.0293527718132783},
+    {0.144333375497976, -0.86168424032714, 0.153733097585332, 2.85228451823978, 0.717350864829163, -0.153733097585332, -2.85228451823978},
+    {0.267443674835655, -0.306078716913217, 0.131614521121218, 2.44190787062765, 0.0386350420775617, -0.131614521121218, -2.44190787062765},
+    {0.459247495907997, 0.559545548262077, 0.0971541428643074, 1.80254780478161, -1.01879304417007, -0.0971541428643074, -1.80254780478161},
+    {0.675904477222819, 1.53733389052355, 0.0582285287322862, 1.08034205796699, -2.21323836774637, -0.0582285287322857, -1.08034205796699},
+    {0.86798719842446, 2.40421685178806, 0.0237180419639919, 0.440052304672404, -3.27220405021253, -0.0237180419639913, -0.440052304672404},
+    {0.285315354814272, -0.86168424032714, 0.764665295175825, 2.38233429996559, 0.576368885512868, -0.764665295175825, -2.38233429996559},
+    {0.388141663660971, -0.306078716913217, 0.654647946495179, 2.03957243407901, -0.0820629467477537, -0.654647946495179, -2.03957243407901},
+    {0.54834336124165, 0.559545548262077, 0.483242727153489, 1.50555508582608, -1.10788890950373, -0.483242727153489, -1.50555508582608},
+    {0.729303344235153, 1.53733389052355, 0.289627515545326, 0.902341938166281, -2.2666372347587, -0.289627515545326, -0.902341938166281},
+    {0.889737989595075, 2.40421685178806, 0.117973057488944, 0.367548080318067, -3.29395484138314, -0.117973057488944, -0.367548080318066},
+    {0.499155244893504, -0.86168424032714, 1.6913204223926, 1.66951906282804, 0.362528995433636, -1.6913204223926, -1.66951906282804},
+    {0.571215023734067, -0.306078716913217, 1.44797919870299, 1.4293145419443, -0.26513630682085, -1.44797919870299, -1.4293145419443},
+    {0.683482973707427, 0.559545548262077, 1.06885757541731, 1.05507985002804, -1.2430285219695, -1.06885757541731, -1.05507985002804},
+    {0.810298148731796, 1.53733389052355, 0.640610911753232, 0.632353346455017, -2.34763203925534, -0.640610911753232, -0.632353346455017},
+    {0.922729346473571, 2.40421685178806, 0.260938011286713, 0.257574483398795, -3.32694619826164, -0.260938011286712, -0.257574483398794},
+    {0.72861515068299, -0.86168424032714, 2.6856634241203, 0.904635966889828, 0.13306908964415, -2.6856634241203, -0.904635966889828},
+    {0.76766104668784, -0.306078716913217, 2.29925963250797, 0.774480131093086, -0.461582329774624, -2.29925963250797, -0.774480131093086},
+    {0.828493910316754, 0.559545548262078, 1.69724888193056, 0.571699480124117, -1.38803945857883, -1.69724888193056, -0.571699480124116},
+    {0.897209249379814, 1.53733389052355, 1.01723202298603, 0.342643335870237, -2.43454313990336, -1.01723202298603, -0.342643335870237},
+    {0.958130569502644, 2.40421685178806, 0.414345894247555, 0.139567823467025, -3.36234742129071, -0.414345894247555, -0.139567823467024},
+    {0.912191158303716, -0.861684240327141, 3.48117285237853, 0.292702546252328, -0.0505069179765767, -3.48117285237853, -0.292702546252327},
+    {0.924824785087997, -0.306078716913217, 2.9803139668845, 0.250589535116716, -0.61874606817478, -2.9803139668845, -0.250589535116716},
+    {0.944507767781268, 0.559545548262077, 2.1999840629478, 0.184978156571394, -1.50405331604335, -2.1999840629478, -0.184978156571393},
+    {0.966741191441727, 1.53733389052355, 1.31854217888416, 0.110865122034026, -2.50407508196527, -1.31854217888415, -0.110865122034026},
+    {0.986452794974706, 2.40421685178807, 0.537077604585377, 0.0451583386012648, -3.39066964676277, -0.537077604585376, -0.0451583386012643},
+    {0.826059726268027, -0.86168424032714, 0.153733097585331, 3.53401086900984, 0.0356245140591109, -0.153733097585331, -3.53401086900983},
+    {0.8510856400443, -0.306078716913217, 0.131614521121218, 3.0255498358363, -0.545006923131083, -0.131614521121218, -3.0255498358363},
+    {0.890075602004749, 0.559545548262077, 0.0971541428643075, 2.23337591087837, -1.44962115026683, -0.0971541428643075, -2.23337591087836},
+    {0.934117724902526, 1.53733389052355, 0.0582285287322864, 1.33855530564669, -2.47145161542607, -0.058228528732286, -1.33855530564669},
+    {0.973164381799351, 2.40421685178806, 0.023718041963992, 0.545229488047295, -3.37738123358742, -0.0237180419639914, -0.545229488047295},
+    {0.854718602717513, -0.86168424032714, 0.764665295175825, 2.95173754786883, 0.00696563760962579, -0.764665295175825, -2.95173754786883},
+    {0.875621178318205, -0.306078716913217, 0.654647946495179, 2.52705194873624, -0.569542461404989, -0.654647946495179, -2.52705194873624},
+    {0.908187047234417, 0.559545548262077, 0.483242727153489, 1.86539877181885, -1.46773259549649, -0.483242727153489, -1.86539877181885},
+    {0.944972669198744, 1.53733389052355, 0.289627515545326, 1.11801126312987, -2.48230655972229, -0.289627515545326, -1.11801126312987},
+    {0.977585891838153, 2.40421685178806, 0.117973057488945, 0.455395982561145, -3.38180274362622, -0.117973057488944, -0.455395982561144},
+    {0.898188066116116, -0.86168424032714, 1.6913204223926, 2.06855188405066, -0.0365038257889762, -1.6913204223926, -2.06855188405065},
+    {0.91283640847011, -0.306078716913217, 1.44797919870299, 1.77093592668034, -0.606757691556893, -1.44797919870299, -1.77093592668034},
+    {0.935658284876775, 0.559545548262077, 1.06885757541731, 1.30725516119739, -1.49520383313885, -1.06885757541731, -1.30725516119739},
+    {0.961437327351342, 1.53733389052355, 0.640610911753233, 0.783492525074564, -2.49877121787489, -0.640610911753232, -0.783492525074563},
+    {0.984292388833492, 2.40421685178806, 0.260938011286713, 0.319137525758715, -3.38850924062156, -0.260938011286713, -0.319137525758715},
+    {0.944832772922068, -0.86168424032714, 2.6856634241203, 1.12085358912891, -0.083148532594928, -2.6856634241203, -1.12085358912891},
+    {0.952770039194602, -0.306078716913217, 2.29925963250797, 0.959589123599848, -0.646691322281386, -2.29925963250797, -0.959589123599848},
+    {0.965136169470714, 0.559545548262077, 1.69724888193056, 0.708341739278077, -1.52468171773279, -1.69724888193056, -0.708341739278077},
+    {0.979104652690648, 1.53733389052355, 1.01723202298603, 0.424538739181071, -2.5164385432142, -1.01723202298603, -0.42453873918107},
+    {0.991488764440297, 2.40421685178806, 0.414345894247555, 0.172926018404678, -3.39570561622836, -0.414345894247555, -0.172926018404678},
+    {0.982150181480283, -0.861684240327141, 3.48117285237853, 0.362661569428895, -0.120465941153144, -3.48117285237853, -0.362661569428894},
+    {0.984718350482275, -0.306078716913217, 2.9803139668845, 0.310483100510995, -0.678639633569059, -2.9803139668845, -0.310483100510994},
+    {0.988719515538259, 0.559545548262077, 2.1999840629478, 0.229189904328385, -1.54826506380034, -2.1999840629478, -0.229189904328384},
+    {0.993239135313951, 1.53733389052355, 1.31854217888416, 0.137363065906251, -2.5305730258375, -1.31854217888415, -0.13736306590625},
+    {0.997246118426349, 2.40421685178807, 0.537077604585377, 0.0559516620529087, -3.40146297021442, -0.537077604585376, -0.0559516620529083}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[7] = {0, 3, 4, 5, 7, 8, 9};
+    static const double FE1_C0_D010[125][7] = \
+    {{-2.53401086900984, -0.846266902414667, 0.138315759672862, 0.173940273731974, -0.138315759672862, 3.3802777714245, -0.173940273731973},
+    {-2.0255498358363, -0.868385478878781, 0.693921283086784, 0.148914359955701, -0.693921283086783, 2.89393531471508, -0.1489143599557},
+    {-1.23337591087837, -0.902845857135692, 1.55954554826208, 0.109924397995249, -1.55954554826208, 2.13622176801406, -0.109924397995249},
+    {-0.338555305646693, -0.941771471267714, 2.53733389052355, 0.0658822750974729, -2.53733389052355, 1.28032677691441, -0.0658822750974728},
+    {0.454770511952705, -0.976281958036009, 3.40421685178806, 0.0268356182006483, -3.40421685178806, 0.521511446083304, -0.0268356182006486},
+    {-1.95173754786883, -0.235334704824175, 0.138315759672861, 0.145281397282487, -0.138315759672861, 2.187072252693, -0.145281397282487},
+    {-1.52705194873624, -0.345352053504821, 0.693921283086783, 0.124378821681794, -0.693921283086783, 1.87240400224106, -0.124378821681793},
+    {-0.865398771818851, -0.516757272846511, 1.55954554826208, 0.0918129527655814, -1.55954554826208, 1.38215604466536, -0.0918129527655814},
+    {-0.118011263129871, -0.710372484454674, 2.53733389052355, 0.0550273308012546, -2.53733389052355, 0.828383747584545, -0.0550273308012547},
+    {0.544604017438855, -0.882026942511056, 3.40421685178806, 0.0224141081618461, -3.40421685178806, 0.337422925072202, -0.0224141081618462},
+    {-1.06855188405066, 0.6913204223926, 0.138315759672859, 0.101811933883883, -0.13831575967286, 0.377231461658056, -0.101811933883884},
+    {-0.77093592668034, 0.447979198702987, 0.693921283086782, 0.087163591529888, -0.693921283086782, 0.322956727977352, -0.0871635915298885},
+    {-0.307255161197393, 0.068857575417305, 1.55954554826208, 0.0643417151232226, -1.55954554826208, 0.238397585780088, -0.0643417151232226},
+    {0.216507474925436, -0.359389088246769, 2.53733389052355, 0.0385626726486567, -2.53733389052355, 0.142881613321332, -0.0385626726486567},
+    {0.680862474241284, -0.739061988713288, 3.40421685178806, 0.0157076111665069, -3.40421685178806, 0.058199514472004, -0.015707611166507},
+    {-0.120853589128906, 1.6856634241203, 0.138315759672859, 0.0551672270779302, -0.138315759672859, -1.5648098349914, -0.0551672270779314},
+    {0.0404108764001513, 1.29925963250797, 0.693921283086782, 0.0472299608053953, -0.693921283086782, -1.33967050890812, -0.047229960805396},
+    {0.291658260721923, 0.69724888193056, 1.55954554826208, 0.0348638305292839, -1.55954554826208, -0.988907142652483, -0.034863830529284},
+    {0.575461260818929, 0.0172320229860304, 2.53733389052355, 0.0208953473093506, -2.53733389052355, -0.59269328380496, -0.0208953473093506},
+    {0.827073981595321, -0.585654105752446, 3.40421685178807, 0.00851123555970239, -3.40421685178807, -0.241419875842875, -0.00851123555970248},
+    {0.637338430571105, 2.48117285237853, 0.138315759672859, 0.0178498185197144, -0.138315759672859, -3.11851128294963, -0.0178498185197154},
+    {0.689516899489005, 1.9803139668845, 0.693921283086782, 0.0152816495177227, -0.693921283086782, -2.6698308663735, -0.0152816495177232},
+    {0.770810095671614, 1.1999840629478, 1.55954554826208, 0.0112804844617389, -1.55954554826208, -1.97079415861941, -0.011280484461739},
+    {0.862636934093749, 0.318542178884154, 2.53733389052355, 0.00676086468604743, -2.53733389052355, -1.1811791129779, -0.00676086468604731},
+    {0.94404833794709, -0.462922395414624, 3.40421685178807, 0.00275388157364971, -3.40421685178807, -0.481125942532466, -0.00275388157364974},
+    {-1.85228451823978, -0.846266902414667, 0.138315759672862, 0.855666624502025, -0.138315759672862, 2.69855142065445, -0.855666624502025},
+    {-1.44190787062765, -0.868385478878781, 0.693921283086783, 0.732556325164345, -0.693921283086783, 2.31029334950644, -0.732556325164345},
+    {-0.802547804781612, -0.902845857135692, 1.55954554826208, 0.540752504092002, -1.55954554826208, 1.7053936619173, -0.540752504092002},
+    {-0.0803420579669867, -0.941771471267714, 2.53733389052355, 0.32409552277718, -2.53733389052355, 1.0221135292347, -0.32409552277718},
+    {0.559947695327596, -0.976281958036009, 3.40421685178806, 0.13201280157554, -3.40421685178806, 0.416334262708413, -0.13201280157554},
+    {-1.38233429996559, -0.235334704824175, 0.138315759672861, 0.714684645185728, -0.138315759672861, 1.61766900478976, -0.714684645185729},
+    {-1.03957243407901, -0.345352053504821, 0.693921283086783, 0.611858336339028, -0.693921283086783, 1.38492448758383, -0.611858336339029},
+    {-0.505555085826084, -0.516757272846511, 1.55954554826208, 0.451656638758349, -1.55954554826208, 1.02231235867259, -0.451656638758349},
+    {0.097658061833719, -0.710372484454674, 2.53733389052355, 0.270696655764845, -2.53733389052355, 0.612714422620955, -0.270696655764845},
+    {0.632451919681933, -0.882026942511056, 3.40421685178806, 0.110262010404924, -3.40421685178806, 0.249575022829124, -0.110262010404924},
+    {-0.669519062828044, 0.6913204223926, 0.13831575967286, 0.500844755106495, -0.13831575967286, -0.0218013595645561, -0.500844755106496},
+    {-0.429314541944297, 0.447979198702988, 0.693921283086782, 0.428784976265931, -0.693921283086782, -0.0186646567586911, -0.428784976265932},
+    {-0.0550798500280447, 0.0688575754173051, 1.55954554826208, 0.316517026292572, -1.55954554826208, -0.0137777253892607, -0.316517026292571},
+    {0.367646653544982, -0.359389088246769, 2.53733389052355, 0.189701851268203, -2.53733389052355, -0.00825756529821425, -0.189701851268203},
+    {0.742425516601205, -0.739061988713288, 3.40421685178806, 0.0772706535264277, -3.40421685178806, -0.00336352788791668, -0.0772706535264278},
+    {0.0953640331101717, 1.6856634241203, 0.138315759672859, 0.271384849317008, -0.138315759672859, -1.78102745723047, -0.271384849317009},
+    {0.225519868906913, 1.29925963250797, 0.693921283086782, 0.232338953312158, -0.693921283086782, -1.52477950141488, -0.232338953312158},
+    {0.428300519875883, 0.69724888193056, 1.55954554826208, 0.171506089683245, -1.55954554826208, -1.12554940180644, -0.171506089683245},
+    {0.657356664129763, 0.0172320229860304, 2.53733389052355, 0.102790750620184, -2.53733389052355, -0.674588687115793, -0.102790750620184},
+    {0.860432176532975, -0.585654105752446, 3.40421685178807, 0.0418694304973558, -3.40421685178807, -0.274778070780529, -0.0418694304973559},
+    {0.707297453747672, 2.48117285237853, 0.138315759672859, 0.087808841696282, -0.138315759672859, -3.1884703061262, -0.0878088416962829},
+    {0.749410464883284, 1.9803139668845, 0.693921283086782, 0.0751752149120012, -0.693921283086783, -2.72972443176778, -0.0751752149120016},
+    {0.815021843428605, 1.1999840629478, 1.55954554826208, 0.05549223221873, -1.55954554826208, -2.0150059063764, -0.0554922322187299},
+    {0.889134877965973, 0.318542178884154, 2.53733389052355, 0.0332588085582721, -2.53733389052355, -1.20767705685013, -0.033258808558272},
+    {0.954841661398734, -0.462922395414624, 3.40421685178807, 0.0135472050252939, -3.40421685178807, -0.49191926598411, -0.013547205025294},
+    {-0.853975571370904, -0.846266902414667, 0.138315759672861, 1.8539755713709, -0.138315759672861, 1.70024247378557, -1.8539755713709},
+    {-0.587232097895999, -0.868385478878781, 0.693921283086783, 1.587232097896, -0.693921283086783, 1.45561757677478, -1.587232097896},
+    {-0.171650154436808, -0.902845857135692, 1.55954554826208, 1.17165015443681, -1.55954554826208, 1.0744960115725, -1.17165015443681},
+    {0.297781209627916, -0.941771471267714, 2.53733389052355, 0.702218790372083, -2.53733389052355, 0.643990261639798, -0.702218790372083},
+    {0.713967446876028, -0.976281958036009, 3.40421685178806, 0.286032553123972, -3.40421685178806, 0.262314511159981, -0.286032553123972},
+    {-0.548509472575657, -0.235334704824175, 0.13831575967286, 1.54850947257566, -0.13831575967286, 0.783844177399832, -1.54850947257566},
+    {-0.325715385209019, -0.345352053504821, 0.693921283086783, 1.32571538520902, -0.693921283086783, 0.67106743871384, -1.32571538520902},
+    {0.0213941377077833, -0.516757272846511, 1.55954554826208, 0.978605862292217, -1.55954554826208, 0.495363135138727, -0.978605862292217},
+    {0.413480703034436, -0.710372484454674, 2.53733389052355, 0.586519296965563, -2.53733389052355, 0.296891781420238, -0.586519296965563},
+    {0.761094954638504, -0.882026942511056, 3.40421685178806, 0.238905045361496, -3.40421685178806, 0.120931987872552, -0.238905045361496},
+    {-0.08518190896727, 0.6913204223926, 0.13831575967286, 1.08518190896727, -0.13831575967286, -0.60613851342533, -1.08518190896727},
+    {0.0709502408948853, 0.447979198702988, 0.693921283086783, 0.929049759105114, -0.693921283086783, -0.518929439597874, -0.929049759105114},
+    {0.314201561839691, 0.0688575754173052, 1.55954554826208, 0.685798438160308, -1.55954554826208, -0.383059137256997, -0.685798438160308},
+    {0.588972401138389, -0.359389088246769, 2.53733389052355, 0.41102759886161, -2.53733389052355, -0.229583312891621, -0.41102759886161},
+    {0.832577431537388, -0.739061988713288, 3.40421685178806, 0.167422568462611, -3.40421685178806, -0.0935154428241002, -0.167422568462612},
+    {0.411989591896581, 1.6856634241203, 0.138315759672859, 0.588010408103418, -0.138315759672859, -2.09765301601688, -0.588010408103419},
+    {0.496590457797377, 1.29925963250797, 0.693921283086782, 0.503409542202622, -0.693921283086782, -1.79585009030535, -0.503409542202622},
+    {0.628397215096319, 0.69724888193056, 1.55954554826208, 0.37160278490368, -1.55954554826208, -1.32564609702688, -0.37160278490368},
+    {0.777282956754789, 0.0172320229860305, 2.53733389052355, 0.222717043245211, -2.53733389052355, -0.79451497974082, -0.222717043245211},
+    {0.909281373017809, -0.585654105752446, 3.40421685178807, 0.0907186269821904, -3.40421685178807, -0.323627267265363, -0.0907186269821905},
+    {0.809744306025694, 2.48117285237853, 0.138315759672859, 0.190255693974304, -0.138315759672859, -3.29091715840422, -0.190255693974305},
+    {0.83711762498564, 1.9803139668845, 0.693921283086782, 0.162882375014358, -0.693921283086783, -2.81743159187014, -0.162882375014359},
+    {0.879764805604937, 1.1999840629478, 1.55954554826208, 0.120235194395062, -1.55954554826208, -2.07974886855273, -0.120235194395062},
+    {0.92793803470385, 0.318542178884154, 2.53733389052355, 0.0720619652961492, -2.53733389052355, -1.246480213588, -0.0720619652961491},
+    {0.97064722818672, -0.462922395414624, 3.40421685178807, 0.0293527718132797, -3.40421685178807, -0.507724832772096, -0.0293527718132797},
+    {0.144333375497976, -0.846266902414667, 0.13831575967286, 2.85228451823978, -0.13831575967286, 0.701933526916691, -2.85228451823978},
+    {0.267443674835655, -0.868385478878781, 0.693921283086782, 2.44190787062765, -0.693921283086783, 0.600941804043126, -2.44190787062765},
+    {0.459247495907997, -0.902845857135692, 1.55954554826208, 1.80254780478161, -1.55954554826208, 0.443598361227695, -1.80254780478161},
+    {0.675904477222819, -0.941771471267714, 2.53733389052355, 1.08034205796699, -2.53733389052355, 0.265866994044895, -1.08034205796699},
+    {0.86798719842446, -0.976281958036009, 3.40421685178806, 0.440052304672404, -3.40421685178806, 0.108294759611549, -0.440052304672405},
+    {0.285315354814272, -0.235334704824175, 0.13831575967286, 2.38233429996559, -0.13831575967286, -0.0499806499900974, -2.38233429996559},
+    {0.388141663660971, -0.345352053504821, 0.693921283086783, 2.03957243407901, -0.693921283086783, -0.0427896101561506, -2.03957243407901},
+    {0.54834336124165, -0.516757272846511, 1.55954554826208, 1.50555508582608, -1.55954554826208, -0.0315860883951393, -1.50555508582608},
+    {0.729303344235153, -0.710372484454674, 2.53733389052355, 0.902341938166281, -2.53733389052355, -0.0189308597804795, -0.902341938166281},
+    {0.889737989595075, -0.882026942511056, 3.40421685178807, 0.367548080318067, -3.40421685178807, -0.00771104708401874, -0.367548080318067},
+    {0.499155244893504, 0.691320422392601, 0.13831575967286, 1.66951906282804, -0.13831575967286, -1.1904756672861, -1.66951906282804},
+    {0.571215023734067, 0.447979198702988, 0.693921283086783, 1.4293145419443, -0.693921283086783, -1.01919422243706, -1.4293145419443},
+    {0.683482973707427, 0.0688575754173054, 1.55954554826208, 1.05507985002804, -1.55954554826208, -0.752340549124733, -1.05507985002804},
+    {0.810298148731796, -0.359389088246769, 2.53733389052355, 0.632353346455017, -2.53733389052355, -0.450909060485028, -0.632353346455017},
+    {0.922729346473572, -0.739061988713288, 3.40421685178806, 0.257574483398795, -3.40421685178806, -0.183667357760284, -0.257574483398796},
+    {0.72861515068299, 1.6856634241203, 0.138315759672859, 0.904635966889828, -0.13831575967286, -2.41427857480329, -0.904635966889828},
+    {0.767661046687841, 1.29925963250797, 0.693921283086783, 0.774480131093086, -0.693921283086783, -2.06692067919581, -0.774480131093086},
+    {0.828493910316754, 0.69724888193056, 1.55954554826208, 0.571699480124116, -1.55954554826208, -1.52574279224731, -0.571699480124116},
+    {0.897209249379815, 0.0172320229860305, 2.53733389052355, 0.342643335870237, -2.53733389052355, -0.914441272365846, -0.342643335870237},
+    {0.958130569502644, -0.585654105752446, 3.40421685178807, 0.139567823467025, -3.40421685178807, -0.372476463750198, -0.139567823467025},
+    {0.912191158303716, 2.48117285237853, 0.138315759672859, 0.292702546252327, -0.138315759672859, -3.39336401068225, -0.292702546252327},
+    {0.924824785087997, 1.9803139668845, 0.693921283086783, 0.250589535116716, -0.693921283086783, -2.9051387519725, -0.250589535116716},
+    {0.944507767781269, 1.1999840629478, 1.55954554826208, 0.184978156571394, -1.55954554826208, -2.14449183072907, -0.184978156571394},
+    {0.966741191441727, 0.318542178884154, 2.53733389052355, 0.110865122034026, -2.53733389052355, -1.28528337032588, -0.110865122034026},
+    {0.986452794974706, -0.462922395414624, 3.40421685178807, 0.0451583386012656, -3.40421685178807, -0.523530399560082, -0.0451583386012656},
+    {0.826059726268028, -0.846266902414667, 0.138315759672859, 3.53401086900983, -0.138315759672859, 0.0202071761466383, -3.53401086900983},
+    {0.8510856400443, -0.868385478878782, 0.693921283086782, 3.0255498358363, -0.693921283086782, 0.0172998388344806, -3.0255498358363},
+    {0.89007560200475, -0.902845857135692, 1.55954554826208, 2.23337591087836, -1.55954554826208, 0.012770255130942, -2.23337591087836},
+    {0.934117724902525, -0.941771471267714, 2.53733389052355, 1.33855530564669, -2.53733389052355, 0.00765374636518801, -1.33855530564669},
+    {0.973164381799351, -0.976281958036009, 3.40421685178806, 0.545229488047295, -3.40421685178806, 0.00311757623665807, -0.545229488047296},
+    {0.854718602717513, -0.235334704824175, 0.138315759672859, 2.95173754786883, -0.13831575967286, -0.61938389789334, -2.95173754786883},
+    {0.875621178318206, -0.345352053504821, 0.693921283086783, 2.52705194873624, -0.693921283086783, -0.530269124813386, -2.52705194873624},
+    {0.908187047234417, -0.516757272846511, 1.55954554826208, 1.86539877181885, -1.55954554826208, -0.391429774387907, -1.86539877181885},
+    {0.944972669198744, -0.710372484454674, 2.53733389052355, 1.11801126312987, -2.53733389052355, -0.23460018474407, -1.11801126312987},
+    {0.977585891838153, -0.882026942511056, 3.40421685178807, 0.455395982561145, -3.40421685178807, -0.0955589493270969, -0.455395982561146},
+    {0.898188066116116, 0.691320422392601, 0.13831575967286, 2.06855188405065, -0.13831575967286, -1.58950848850872, -2.06855188405066},
+    {0.91283640847011, 0.447979198702988, 0.693921283086783, 1.77093592668034, -0.693921283086783, -1.3608156071731, -1.77093592668034},
+    {0.935658284876775, 0.0688575754173054, 1.55954554826208, 1.30725516119739, -1.55954554826208, -1.00451586029408, -1.30725516119739},
+    {0.961437327351342, -0.359389088246768, 2.53733389052355, 0.783492525074564, -2.53733389052355, -0.602048239104574, -0.783492525074564},
+    {0.984292388833492, -0.739061988713288, 3.40421685178807, 0.319137525758716, -3.40421685178807, -0.245230400120204, -0.319137525758716},
+    {0.944832772922068, 1.6856634241203, 0.138315759672859, 1.12085358912891, -0.13831575967286, -2.63049619704237, -1.12085358912891},
+    {0.952770039194603, 1.29925963250797, 0.693921283086783, 0.959589123599848, -0.693921283086783, -2.25202967170258, -0.959589123599848},
+    {0.965136169470714, 0.69724888193056, 1.55954554826208, 0.708341739278077, -1.55954554826208, -1.66238505140128, -0.708341739278077},
+    {0.979104652690649, 0.0172320229860305, 2.53733389052355, 0.424538739181071, -2.53733389052355, -0.996336675676679, -0.424538739181071},
+    {0.991488764440297, -0.585654105752446, 3.40421685178807, 0.172926018404679, -3.40421685178807, -0.405834658687851, -0.172926018404679},
+    {0.982150181480284, 2.48117285237853, 0.138315759672859, 0.362661569428894, -0.13831575967286, -3.46332303385881, -0.362661569428895},
+    {0.984718350482276, 1.9803139668845, 0.693921283086783, 0.310483100510994, -0.693921283086783, -2.96503231736678, -0.310483100510994},
+    {0.98871951553826, 1.1999840629478, 1.55954554826208, 0.229189904328385, -1.55954554826208, -2.18870357848606, -0.229189904328385},
+    {0.993239135313952, 0.318542178884154, 2.53733389052355, 0.137363065906251, -2.53733389052355, -1.31178131419811, -0.137363065906251},
+    {0.99724611842635, -0.462922395414624, 3.40421685178807, 0.0559516620529096, -3.40421685178807, -0.534323723011726, -0.0559516620529098}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc2[7] = {0, 2, 4, 6, 7, 8, 9};
+    static const double FE1_C0_D100[125][7] = \
+    {{-2.53401086900984, -0.82605972626803, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 3.36007059527787},
+    {-2.0255498358363, -0.8510856400443, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.13161452112122, 2.8766354758806},
+    {-1.23337591087837, -0.89007560200475, 1.55954554826208, 0.0971541428643071, -1.55954554826208, -0.0971541428643071, 2.12345151288312},
+    {-0.338555305646693, -0.934117724902525, 2.53733389052355, 0.0582285287322848, -2.53733389052355, -0.0582285287322848, 1.27267303054922},
+    {0.454770511952704, -0.973164381799351, 3.40421685178806, 0.0237180419639906, -3.40421685178806, -0.0237180419639906, 0.518393869846646},
+    {-1.95173754786883, -0.854718602717514, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175826, 2.80645615058634},
+    {-1.52705194873624, -0.875621178318207, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 2.40267312705445},
+    {-0.865398771818852, -0.908187047234418, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.77358581905327},
+    {-0.118011263129872, -0.944972669198744, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 1.06298393232862},
+    {0.544604017438855, -0.977585891838153, 3.40421685178807, 0.117973057488943, -3.40421685178807, -0.117973057488943, 0.432981874399299},
+    {-1.06855188405066, -0.898188066116116, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.96673995016677},
+    {-0.77093592668034, -0.912836408470111, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.68377233515045},
+    {-0.307255161197394, -0.935658284876776, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.0688575754173, 1.24291344607417},
+    {0.216507474925436, -0.961437327351342, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753231, 0.744929852425906},
+    {0.680862474241284, -0.984292388833493, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.303429914592209},
+    {-0.120853589128906, -0.944832772922068, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 1.06568636205097},
+    {0.0404108764001512, -0.952770039194603, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.912359162794452},
+    {0.291658260721922, -0.965136169470715, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.673477908748793},
+    {0.575461260818929, -0.979104652690649, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.40364339187172},
+    {0.827073981595321, -0.991488764440298, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.164414782844977},
+    {0.637338430571105, -0.982150181480284, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.344811750909179},
+    {0.689516899489005, -0.984718350482277, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.295201450993271},
+    {0.770810095671615, -0.988719515538262, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.217909419866647},
+    {0.862636934093749, -0.993239135313953, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.130602201220204},
+    {0.94404833794709, -0.997246118426351, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0531977804792609},
+    {-1.85228451823978, -0.144333375497977, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 1.99661789373776},
+    {-1.44190787062765, -0.267443674835656, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 1.70935154546331},
+    {-0.802547804781613, -0.459247495907997, 1.55954554826208, 0.0971541428643072, -1.55954554826208, -0.0971541428643073, 1.26179530068961},
+    {-0.0803420579669868, -0.675904477222819, 2.53733389052355, 0.0582285287322851, -2.53733389052355, -0.0582285287322851, 0.756246535189806},
+    {0.559947695327596, -0.86798719842446, 3.40421685178806, 0.0237180419639908, -3.40421685178806, -0.0237180419639908, 0.308039503096864},
+    {-1.38233429996559, -0.285315354814272, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175825, 1.66764965477986},
+    {-1.03957243407901, -0.388141663660972, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 1.42771409773998},
+    {-0.505555085826084, -0.54834336124165, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.05389844706773},
+    {0.0976580618337188, -0.729303344235153, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 0.631645282401435},
+    {0.632451919681933, -0.889737989595075, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0.257286069913143},
+    {-0.669519062828044, -0.499155244893504, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.16867430772155},
+    {-0.429314541944297, -0.571215023734068, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.00052956567836},
+    {-0.0550798500280449, -0.683482973707428, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.06885757541731, 0.738562823735472},
+    {0.367646653544982, -0.810298148731796, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753232, 0.442651495186814},
+    {0.742425516601204, -0.922729346473572, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.180303829872368},
+    {0.0953640331101717, -0.72861515068299, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 0.633251117572818},
+    {0.225519868906913, -0.767661046687841, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.542141177780928},
+    {0.428300519875883, -0.828493910316755, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.400193390440872},
+    {0.657356664129763, -0.897209249379815, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.239852585250053},
+    {0.860432176532975, -0.958130569502645, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.09769839296967},
+    {0.707297453747673, -0.912191158303717, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.204893704556044},
+    {0.749410464883284, -0.924824785087998, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.175414320204714},
+    {0.815021843428606, -0.944507767781271, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.129485924352665},
+    {0.889134877965973, -0.966741191441729, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.0776063134757552},
+    {0.954841661398734, -0.986452794974707, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0316111335759726},
+    {-0.853975571370903, 0.853975571370903, 0.138315759672861, 0.153733097585334, -0.138315759672861, -0.153733097585334, 0},
+    {-0.587232097895999, 0.587232097895999, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 0},
+    {-0.171650154436808, 0.171650154436808, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643074, 0},
+    {0.297781209627916, -0.297781209627916, 2.53733389052355, 0.0582285287322856, -2.53733389052355, -0.0582285287322856, 0},
+    {0.713967446876028, -0.713967446876028, 3.40421685178807, 0.0237180419639911, -3.40421685178807, -0.0237180419639911, 0},
+    {-0.548509472575657, 0.548509472575658, 0.13831575967286, 0.764665295175825, -0.13831575967286, -0.764665295175825, 0},
+    {-0.325715385209019, 0.325715385209019, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 0},
+    {0.0213941377077832, -0.0213941377077827, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153489, 0},
+    {0.413480703034436, -0.413480703034436, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, 0},
+    {0.761094954638504, -0.761094954638504, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0},
+    {-0.0851819089672702, 0.0851819089672698, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 0},
+    {0.0709502408948851, -0.0709502408948855, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, 0},
+    {0.314201561839691, -0.314201561839691, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, 0},
+    {0.588972401138389, -0.58897240113839, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753232, 0},
+    {0.832577431537388, -0.832577431537389, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, 0},
+    {0.411989591896581, -0.411989591896581, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, 0},
+    {0.496590457797377, -0.496590457797378, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0},
+    {0.628397215096318, -0.62839721509632, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0},
+    {0.777282956754789, -0.777282956754789, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0},
+    {0.909281373017809, -0.90928137301781, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0},
+    {0.809744306025695, -0.809744306025695, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, 0},
+    {0.837117624985641, -0.837117624985642, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0},
+    {0.879764805604937, -0.879764805604939, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0},
+    {0.92793803470385, -0.927938034703852, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0},
+    {0.97064722818672, -0.970647228186721, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0},
+    {0.144333375497977, 1.85228451823978, 0.13831575967286, 0.153733097585332, -0.13831575967286, -0.153733097585333, -1.99661789373776},
+    {0.267443674835656, 1.44190787062765, 0.693921283086783, 0.131614521121218, -0.693921283086783, -0.131614521121218, -1.70935154546331},
+    {0.459247495907997, 0.802547804781612, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -1.26179530068961},
+    {0.675904477222819, 0.0803420579669871, 2.53733389052355, 0.058228528732286, -2.53733389052355, -0.058228528732286, -0.756246535189806},
+    {0.86798719842446, -0.559947695327595, 3.40421685178807, 0.0237180419639914, -3.40421685178807, -0.0237180419639914, -0.308039503096864},
+    {0.285315354814272, 1.38233429996559, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175825, -1.66764965477986},
+    {0.388141663660971, 1.03957243407901, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -1.42771409773998},
+    {0.54834336124165, 0.505555085826084, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.05389844706773},
+    {0.729303344235153, -0.0976580618337189, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -0.631645282401434},
+    {0.889737989595075, -0.632451919681933, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.257286069913142},
+    {0.499155244893504, 0.669519062828043, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.16867430772155},
+    {0.571215023734067, 0.429314541944296, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.00052956567836},
+    {0.683482973707427, 0.0550798500280444, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -0.738562823735472},
+    {0.810298148731796, -0.367646653544983, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753233, -0.442651495186813},
+    {0.922729346473572, -0.742425516601205, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.180303829872367},
+    {0.72861515068299, -0.0953640331101723, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -0.633251117572818},
+    {0.767661046687841, -0.225519868906914, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.542141177780927},
+    {0.828493910316754, -0.428300519875884, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.40019339044087},
+    {0.897209249379815, -0.657356664129763, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.239852585250051},
+    {0.958130569502644, -0.860432176532975, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.0976983929696685},
+    {0.912191158303717, -0.707297453747673, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.204893704556044},
+    {0.924824785087998, -0.749410464883284, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.175414320204714},
+    {0.944507767781269, -0.815021843428607, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.129485924352662},
+    {0.966741191441727, -0.889134877965975, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.0776063134757529},
+    {0.986452794974706, -0.954841661398735, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0316111335759707},
+    {0.826059726268029, 2.53401086900983, 0.138315759672859, 0.153733097585331, -0.138315759672859, -0.153733097585332, -3.36007059527786},
+    {0.851085640044301, 2.0255498358363, 0.693921283086782, 0.131614521121218, -0.693921283086782, -0.131614521121218, -2.8766354758806},
+    {0.89007560200475, 1.23337591087837, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -2.12345151288312},
+    {0.934117724902526, 0.338555305646693, 2.53733389052355, 0.0582285287322862, -2.53733389052355, -0.0582285287322862, -1.27267303054922},
+    {0.973164381799351, -0.454770511952705, 3.40421685178807, 0.0237180419639916, -3.40421685178807, -0.0237180419639916, -0.518393869846646},
+    {0.854718602717514, 1.95173754786883, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175824, -2.80645615058634},
+    {0.875621178318206, 1.52705194873624, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -2.40267312705445},
+    {0.908187047234417, 0.865398771818851, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.77358581905327},
+    {0.944972669198744, 0.118011263129871, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -1.06298393232862},
+    {0.977585891838153, -0.544604017438855, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.432981874399298},
+    {0.898188066116116, 1.06855188405065, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.96673995016677},
+    {0.91283640847011, 0.77093592668034, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.68377233515045},
+    {0.935658284876776, 0.307255161197392, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -1.24291344607417},
+    {0.961437327351342, -0.216507474925437, 2.53733389052355, 0.640610911753233, -2.53733389052355, -0.640610911753233, -0.744929852425905},
+    {0.984292388833492, -0.680862474241285, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.303429914592208},
+    {0.944832772922068, 0.120853589128905, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -1.06568636205097},
+    {0.952770039194603, -0.0404108764001523, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.912359162794451},
+    {0.965136169470714, -0.291658260721924, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.673477908748791},
+    {0.979104652690648, -0.57546126081893, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.403643391871719},
+    {0.991488764440297, -0.827073981595322, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.164414782844975},
+    {0.982150181480284, -0.637338430571106, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.344811750909179},
+    {0.984718350482276, -0.689516899489006, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.29520145099327},
+    {0.98871951553826, -0.770810095671616, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.217909419866644},
+    {0.993239135313952, -0.86263693409375, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.130602201220202},
+    {0.99724611842635, -0.944048337947091, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0531977804792586}};
+    
     // Array of non-zero columns
     static const unsigned int nzc3[7] = {0, 1, 5, 6, 7, 8, 9};
     
-    const static double FE0_C1_D010[27][7] = \
-    {{-1.99865811288677, -0.67151372854623, 0.291976096292601, 0.380879519366861, -0.2919760962926, 2.670171841433, -0.380879519366861},
-    {-1.11229755309379, -0.768609584255429, 1.38801506415341, 0.268296967008234, -1.38801506415341, 1.88090713734922, -0.268296967008233},
-    {0.045747773398036, -0.89546699085306, 2.82000883955399, 0.121205924697102, -2.82000883955399, 0.849719217455024, -0.121205924697102},
-    {-0.942926908148453, 0.518312921122362, 0.291976096292599, 0.246784074436585, -0.291976096292599, 0.424613987026092, -0.246784074436586},
-    {-0.368625431583845, 0.0695212816475372, 1.38801506415341, 0.173838222615209, -1.38801506415341, 0.299104149936307, -0.173838222615209},
-    {0.381709331831541, -0.51683271946439, 2.82000883955399, 0.0785332117419376, -2.82000883955399, 0.135123387632849, -0.0785332117419376},
-    {0.301373419046404, 1.92066011219053, 0.291976096292598, 0.0887372105632775, -0.291976096292598, -2.22203353123693, -0.0887372105632783},
-    {0.507877469881381, 1.05735464869637, 1.38801506415341, 0.0625077570316057, -1.38801506415341, -1.56523211857775, -0.0625077570316058},
-    {0.777678566431671, -0.0705687976805426, 2.82000883955399, 0.0282385245582192, -2.82000883955399, -0.707109768751129, -0.0282385245582191},
-    {-0.689768816126815, -0.67151372854623, 0.2919760962926, 1.68976881612682, -0.2919760962926, 1.36128254467305, -1.68976881612682},
-    {-0.19029726005101, -0.768609584255429, 1.38801506415341, 1.19029726005101, -1.38801506415341, 0.958906844306439, -1.19029726005101},
-    {0.462270924350466, -0.89546699085306, 2.82000883955399, 0.537729075649533, -2.82000883955399, 0.433196066502594, -0.537729075649533},
-    {-0.0948554912925191, 0.518312921122362, 0.291976096292599, 1.09485549129252, -0.291976096292599, -0.423457429829843, -1.09485549129252},
-    {0.228768172900473, 0.0695212816475375, 1.38801506415341, 0.771231827099527, -1.38801506415341, -0.298289454548011, -0.771231827099527},
-    {0.651588060044801, -0.51683271946439, 2.82000883955399, 0.348411939955198, -2.82000883955399, -0.134755340580411, -0.348411939955198},
-    {0.606318104241562, 1.92066011219053, 0.291976096292598, 0.393681895758437, -0.291976096292599, -2.52697821643209, -0.393681895758437},
-    {0.722684856424887, 1.05735464869637, 1.38801506415341, 0.277315143575112, -1.38801506415341, -1.78003950512125, -0.277315143575112},
-    {0.874720020936725, -0.0705687976805425, 2.82000883955399, 0.125279979063274, -2.82000883955399, -0.804151223256183, -0.125279979063274},
-    {0.619120480633141, -0.67151372854623, 0.291976096292599, 2.99865811288677, -0.291976096292599, 0.0523932479130882, -2.99865811288677},
-    {0.731703032991766, -0.768609584255429, 1.38801506415341, 2.11229755309379, -1.38801506415341, 0.0369065512636619, -2.11229755309379},
-    {0.878794075302896, -0.89546699085306, 2.82000883955399, 0.954252226601964, -2.82000883955399, 0.0166729155501636, -0.954252226601964},
-    {0.753215925563415, 0.518312921122363, 0.291976096292599, 1.94292690814845, -0.291976096292599, -1.27152884668578, -1.94292690814845},
-    {0.82616177738479, 0.0695212816475378, 1.38801506415341, 1.36862543158385, -1.38801506415341, -0.895683059032329, -1.36862543158384},
-    {0.921466788258061, -0.51683271946439, 2.82000883955399, 0.618290668168459, -2.82000883955399, -0.404634068793672, -0.618290668168458},
-    {0.911262789436721, 1.92066011219053, 0.291976096292599, 0.698626580953596, -0.291976096292599, -2.83192290162725, -0.698626580953596},
-    {0.937492242968393, 1.05735464869637, 1.38801506415341, 0.492122530118618, -1.38801506415341, -1.99484689166476, -0.492122530118618},
-    {0.97176147544178, -0.0705687976805424, 2.82000883955399, 0.222321433568329, -2.82000883955399, -0.901192677761238, -0.222321433568329}};
-    // Array of non-zero columns
-    static const unsigned int nzc1[7] = {10, 12, 14, 16, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc4[7] = {0, 2, 4, 6, 7, 8, 9};
-    
-    const static double FE0_C1[27][10] = \
-    {{0.374329281526014, -0.0770862288075737, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.0278019288056344, 0.031278423297481, 0.218884122479203, 0.246254505716693, 0.285531865195462},
-    {0.0296507308273034, -0.0580763339388314, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.0931000579685249, 0.0155203366847607, 0.73297520591714, 0.122191352246653, 0.141680756728494},
-    {-0.12473839265364, -0.0284651216515657, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.0854504447630367, 0.00316750500875634, 0.672749928545405, 0.0249377141829676, 0.0289152558798902},
-    {-0.0138611057361999, -0.0540832211847061, -0.0914189644747005, -0.0623377689723666, 0.11082776991498, 0.0180137626702943, 0.0936738622360728, 0.141822053505759, 0.737492757359529, 0.119870854681338},
-    {-0.108014411398703, -0.0396820896985505, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.0603225179288914, 0.0464809196626873, 0.474918179055459, 0.365943506420742, 0.0594798531131275},
-    {-0.10678724824909, -0.0188623697671714, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.0553660878277078, 0.00948616958726982, 0.435896287412199, 0.0746844551798748, 0.0121390879903345},
-    {-0.113646757786535, -0.0212000160735007, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.00647728608404027, 0.0647928078398051, 0.050995565468269, 0.510112697076803, 0.0154985435047957},
-    {-0.0927575594483608, -0.0151385367967613, 0.0147498566399773, -0.106180538748753, 0.71390981117415, 0.0216904270965779, 0.0321501561271397, 0.170768371303483, 0.253117643766939, 0.00769036888560861},
-    {-0.0494020059140976, -0.00695995435590164, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.0199082222175353, 0.00656144145796828, 0.156737101971251, 0.0516581193256994, 0.00156950731540954},
-    {-0.0655273725373765, -0.0655273725373763, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.123343025642419, 0.138766464507087, 0.123343025642419, 0.138766464507087, 0.713829662988655},
-    {-0.120473369102135, -0.120473369102135, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.413037631942832, 0.0688558444657068, 0.413037631942832, 0.0688558444657067, 0.354201891821236},
-    {-0.0982881990625207, -0.0982881990625206, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.379100186654221, 0.014052609595862, 0.379100186654221, 0.014052609595862, 0.0722881396997255},
-    {-0.123875304471457, -0.123875304471457, -0.0914189644747004, -0.0623377689723666, 0.11082776991498, 0.0799179080880265, 0.415583309797801, 0.0799179080880263, 0.415583309797801, 0.299677136703346},
-    {-0.118458140383472, -0.118458140383472, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.267620348492175, 0.206212213041715, 0.267620348492175, 0.206212213041715, 0.148699632782819},
-    {-0.0719291250008815, -0.0719291250008814, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.245631187619954, 0.0420853123835723, 0.245631187619953, 0.0420853123835723, 0.0303477199758362},
-    {-0.0790472945586147, -0.0790472945586147, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.0287364257761548, 0.287452752458304, 0.0287364257761545, 0.287452752458304, 0.0387463587619893},
-    {-0.0597158247867675, -0.0597158247867675, 0.0147498566399773, -0.106180538748753, 0.71390981117415, 0.0962293992000305, 0.14263389994704, 0.0962293992000302, 0.142633899947039, 0.0192259222140214},
-    {-0.0293581106215567, -0.0293581106215567, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.0883226620943931, 0.0291097803918338, 0.0883226620943929, 0.0291097803918338, 0.0039237682885237},
-    {-0.0770862288075736, 0.374329281526014, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.218884122479203, 0.246254505716693, 0.0278019288056342, 0.0312784232974809, 0.285531865195462},
-    {-0.0580763339388314, 0.0296507308273036, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.73297520591714, 0.122191352246653, 0.0931000579685245, 0.0155203366847606, 0.141680756728494},
-    {-0.0284651216515658, -0.12473839265364, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.672749928545405, 0.0249377141829676, 0.0854504447630365, 0.00316750500875629, 0.0289152558798902},
-    {-0.0540832211847061, -0.0138611057361997, -0.0914189644747004, -0.0623377689723666, 0.11082776991498, 0.141822053505759, 0.737492757359529, 0.018013762670294, 0.0936738622360724, 0.119870854681338},
-    {-0.0396820896985505, -0.108014411398703, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.474918179055459, 0.365943506420742, 0.060322517928891, 0.0464809196626871, 0.0594798531131275},
-    {-0.0188623697671715, -0.10678724824909, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.435896287412199, 0.0746844551798748, 0.0553660878277076, 0.00948616958726979, 0.0121390879903345},
-    {-0.0212000160735007, -0.113646757786535, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.0509955654682693, 0.510112697076803, 0.00647728608404007, 0.0647928078398048, 0.0154985435047957},
-    {-0.0151385367967613, -0.0927575594483608, 0.0147498566399774, -0.106180538748753, 0.71390981117415, 0.170768371303483, 0.25311764376694, 0.0216904270965777, 0.0321501561271395, 0.00769036888560861},
-    {-0.00695995435590172, -0.0494020059140976, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.156737101971251, 0.0516581193256993, 0.0199082222175352, 0.00656144145796827, 0.00156950731540955}};
-    // Array of non-zero columns
-    static const unsigned int nzc6[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc7[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    
-    const static double FE0_C1_D001[27][7] = \
-    {{-1.99865811288677, -0.708023903707401, 0.328486271453771, 0.38087951936686, 2.70668201659417, -0.328486271453771, -0.380879519366859},
-    {-1.11229755309379, 0.388015064153407, 0.231390415744571, 0.268296967008234, 0.72428248894038, -0.231390415744571, -0.268296967008234},
-    {0.0457477733980357, 1.82000883955399, 0.104533009146939, 0.121205924697103, -1.86575661295203, -0.104533009146939, -0.121205924697102},
-    {-0.942926908148453, -0.708023903707401, 1.51831292112236, 0.246784074436586, 1.65095081185585, -1.51831292112236, -0.246784074436585},
-    {-0.368625431583845, 0.388015064153408, 1.06952128164754, 0.173838222615209, -0.0193896325695626, -1.06952128164754, -0.173838222615209},
-    {0.381709331831541, 1.82000883955399, 0.48316728053561, 0.0785332117419377, -2.20171817138554, -0.48316728053561, -0.0785332117419371},
-    {0.301373419046404, -0.708023903707401, 2.92066011219053, 0.0887372105632787, 0.406650484660997, -2.92066011219052, -0.0887372105632779},
-    {0.507877469881381, 0.388015064153408, 2.05735464869637, 0.0625077570316064, -0.895892534034789, -2.05735464869637, -0.0625077570316058},
-    {0.77767856643167, 1.82000883955399, 0.929431202319458, 0.0282385245582191, -2.59768740598566, -0.929431202319458, -0.0282385245582184},
-    {-0.689768816126815, -0.708023903707401, 0.32848627145377, 1.68976881612682, 1.39779271983422, -0.32848627145377, -1.68976881612682},
-    {-0.19029726005101, 0.388015064153408, 0.231390415744571, 1.19029726005101, -0.197717804102397, -0.231390415744571, -1.19029726005101},
-    {0.462270924350466, 1.82000883955399, 0.10453300914694, 0.537729075649533, -2.28227976390446, -0.104533009146939, -0.537729075649533},
-    {-0.0948554912925191, -0.708023903707401, 1.51831292112236, 1.09485549129252, 0.80287939499992, -1.51831292112236, -1.09485549129252},
-    {0.228768172900472, 0.388015064153408, 1.06952128164754, 0.771231827099527, -0.61678323705388, -1.06952128164754, -0.771231827099527},
-    {0.651588060044801, 1.82000883955399, 0.48316728053561, 0.348411939955198, -2.47159689959879, -0.48316728053561, -0.348411939955198},
-    {0.606318104241562, -0.708023903707401, 2.92066011219053, 0.393681895758437, 0.101705799465838, -2.92066011219053, -0.393681895758437},
-    {0.722684856424887, 0.388015064153408, 2.05735464869637, 0.277315143575113, -1.11069992057829, -2.05735464869637, -0.277315143575112},
-    {0.874720020936725, 1.82000883955399, 0.929431202319459, 0.125279979063274, -2.69472886049072, -0.929431202319458, -0.125279979063273},
-    {0.619120480633141, -0.708023903707401, 0.328486271453769, 2.99865811288677, 0.0889034230742589, -0.328486271453769, -2.99865811288677},
-    {0.731703032991766, 0.388015064153408, 0.231390415744571, 2.11229755309379, -1.11971809714517, -0.231390415744571, -2.11229755309379},
-    {0.878794075302896, 1.82000883955399, 0.10453300914694, 0.954252226601964, -2.69880291485689, -0.10453300914694, -0.954252226601964},
-    {0.753215925563415, -0.708023903707401, 1.51831292112236, 1.94292690814845, -0.0451920218560143, -1.51831292112236, -1.94292690814845},
-    {0.82616177738479, 0.388015064153408, 1.06952128164754, 1.36862543158385, -1.2141768415382, -1.06952128164754, -1.36862543158385},
-    {0.921466788258061, 1.82000883955399, 0.483167280535611, 0.618290668168458, -2.74147562781205, -0.48316728053561, -0.618290668168458},
-    {0.911262789436721, -0.708023903707402, 2.92066011219053, 0.698626580953597, -0.203238885729321, -2.92066011219053, -0.698626580953596},
-    {0.937492242968393, 0.388015064153408, 2.05735464869637, 0.492122530118619, -1.3255073071218, -2.05735464869637, -0.492122530118618},
-    {0.971761475441779, 1.82000883955399, 0.929431202319459, 0.222321433568329, -2.79177031499577, -0.929431202319459, -0.222321433568328}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[7] = {10, 13, 14, 15, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc5[7] = {0, 3, 4, 5, 7, 8, 9};
-    
-    // Number of operations to compute geometry constants: 104
-    const double G0 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
-    const double G1 = det*w[2][0];
-    const double G2 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
-    const double G3 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
-    const double G4 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
-    const double G5 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
-    const double G6 = det*(3*Jinv_00*Jinv_20 + 3*Jinv_01*Jinv_21 + 3*Jinv_02*Jinv_22);
-    const double G7 = det*(3*Jinv_00*Jinv_10 + 3*Jinv_01*Jinv_11 + 3*Jinv_02*Jinv_12);
-    const double G8 =  - 3*Jinv_02*det;
-    const double G9 = det*(3*Jinv_00*Jinv_00 + 3*Jinv_01*Jinv_01 + 3*Jinv_02*Jinv_02);
-    const double G10 =  - 0.5*det*w[1][0]*w[2][0];
-    const double G11 = det*(3*Jinv_10*Jinv_20 + 3*Jinv_11*Jinv_21 + 3*Jinv_12*Jinv_22);
-    const double G12 = det*(3*Jinv_10*Jinv_10 + 3*Jinv_11*Jinv_11 + 3*Jinv_12*Jinv_12);
-    const double G13 =  - 3*Jinv_12*det;
-    const double G14 = det*(3*Jinv_20*Jinv_20 + 3*Jinv_21*Jinv_21 + 3*Jinv_22*Jinv_22);
-    const double G15 =  - 3*Jinv_22*det;
-    const double G16 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
+    // Number of operations to compute geometry constants: 88
+    const double G0 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
+    const double G1 = -3*Jinv_22*det;
+    const double G2 = 3*det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
+    const double G3 = 3*det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
+    const double G4 = 3*det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
+    const double G5 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
+    const double G6 = det*w[2][0];
+    const double G7 = -3*Jinv_02*det;
+    const double G8 = 3*det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
+    const double G9 = 3*det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
+    const double G10 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
+    const double G11 = -3*Jinv_12*det;
+    const double G12 = 3*det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
+    const double G13 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
+    const double G14 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
+    const double G15 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
+    const double G16 = -0.5*det*w[1][0]*w[2][0];
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 80267
+    // Total number of operations to compute element tensor: 371213
     
     // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 80163
-    for (unsigned int ip = 0; ip < 27; ip++)
+    // Number of operations to compute element tensor for following IP loop = 371125
+    for (unsigned int ip = 0; ip < 125; ip++)
     {
       
       // Function declarations
@@ -12995,548 +10695,150 @@ void UFC_SolitaryWave3DBilinearForm_cell
       // Total number of operations to compute function values = 20
       for (unsigned int r = 0; r < 10; r++)
       {
-        F0 += FE0_C1[ip][r]*w[0][nzc6[r]];
+        F0 += FE1_C0[ip][r]*w[0][nzc4[r]];
       }// end loop over 'r'
       
       // Total number of operations to compute function values = 42
       for (unsigned int r = 0; r < 7; r++)
       {
-        F1 += FE0_C1_D100[ip][r]*w[0][nzc3[r]];
-        F2 += FE0_C1_D010[ip][r]*w[0][nzc4[r]];
-        F3 += FE0_C1_D001[ip][r]*w[0][nzc5[r]];
+        F1 += FE1_C0_D100[ip][r]*w[0][nzc3[r]];
+        F2 += FE1_C0_D010[ip][r]*w[0][nzc2[r]];
+        F3 += FE1_C0_D001[ip][r]*w[0][nzc1[r]];
       }// end loop over 'r'
       
       // Number of operations to compute ip constants: 54
       // Number of operations: 4
-      const double Gip0 = F0*F0*F0*W27[ip]*G0;
+      const double Gip0 = F0*F0*F0*G0*W125[ip];
       
       // Number of operations: 1
-      const double Gip1 = W27[ip]*G1;
+      const double Gip1 = W125[ip]*det;
+      
+      // Number of operations: 9
+      const double Gip2 = F0*F0*W125[ip]*(G1 + F1*G3 + F2*G4 + F3*G2);
       
       // Number of operations: 4
-      const double Gip2 = F0*F0*F0*W27[ip]*G2;
+      const double Gip3 = F0*F0*F0*G5*W125[ip];
+      
+      // Number of operations: 1
+      const double Gip4 = G6*W125[ip];
+      
+      // Number of operations: 9
+      const double Gip5 = F0*F0*W125[ip]*(G7 + F1*G8 + F2*G9 + F3*G3);
       
       // Number of operations: 4
-      const double Gip3 = F0*F0*F0*W27[ip]*G3;
+      const double Gip6 = F0*F0*F0*G10*W125[ip];
+      
+      // Number of operations: 9
+      const double Gip7 = F0*F0*W125[ip]*(G11 + F1*G9 + F2*G12 + F3*G4);
       
       // Number of operations: 4
-      const double Gip4 = F0*F0*F0*W27[ip]*G4;
+      const double Gip8 = F0*F0*F0*G13*W125[ip];
       
       // Number of operations: 4
-      const double Gip5 = F0*F0*F0*W27[ip]*G5;
-      
-      // Number of operations: 9
-      const double Gip6 = F0*F0*W27[ip]*(G8 + F1*G9 + F2*G7 + F3*G6);
+      const double Gip9 = F0*F0*F0*G14*W125[ip];
+      
+      // Number of operations: 4
+      const double Gip10 = F0*F0*F0*G15*W125[ip];
       
       // Number of operations: 1
-      const double Gip7 = W27[ip]*det;
-      
-      // Number of operations: 1
-      const double Gip8 = W27[ip]*G10;
-      
-      // Number of operations: 9
-      const double Gip9 = F0*F0*W27[ip]*(G13 + F1*G7 + F2*G12 + F3*G11);
-      
-      // Number of operations: 9
-      const double Gip10 = F0*F0*W27[ip]*(G15 + F1*G6 + F2*G11 + F3*G14);
-      
-      // Number of operations: 4
-      const double Gip11 = F0*F0*F0*W27[ip]*G16;
-      
-      
-      // Number of operations for primary indices = 1323
+      const double Gip11 = G16*W125[ip];
+      
+      
+      // Number of operations for primary indices: 1323
       for (unsigned int j = 0; j < 7; j++)
       {
         for (unsigned int k = 0; k < 7; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*20 + nzc3[k]] += FE0_C1_D010[ip][j]*FE0_C1_D100[ip][k]*Gip0;
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*20 + nzc3[k]] += FE0_C1_D100[ip][j]*FE0_C1_D100[ip][k]*Gip2;
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*20 + nzc5[k]] += FE0_C1_D001[ip][k]*FE0_C1_D010[ip][j]*Gip3;
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*20 + nzc5[k]] += FE0_C1_D001[ip][k]*FE0_C1_D100[ip][j]*Gip4;
-          // Number of operations to compute entry = 3
-          A[nzc5[j]*20 + nzc5[k]] += FE0_C1_D001[ip][j]*FE0_C1_D001[ip][k]*Gip5;
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*20 + nzc4[k]] += FE0_C1_D010[ip][k]*FE0_C1_D100[ip][j]*Gip0;
-          // Number of operations to compute entry = 3
-          A[nzc5[j]*20 + nzc3[k]] += FE0_C1_D001[ip][j]*FE0_C1_D100[ip][k]*Gip4;
-          // Number of operations to compute entry = 3
-          A[nzc5[j]*20 + nzc4[k]] += FE0_C1_D001[ip][j]*FE0_C1_D010[ip][k]*Gip3;
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*20 + nzc4[k]] += FE0_C1_D010[ip][j]*FE0_C1_D010[ip][k]*Gip11;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*20 + nzc1[k]] += FE1_C0_D001[ip][k]*FE1_C0_D010[ip][j]*Gip0;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*20 + nzc3[k]] += FE1_C0_D100[ip][j]*FE1_C0_D100[ip][k]*Gip3;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*20 + nzc3[k]] += FE1_C0_D010[ip][j]*FE1_C0_D100[ip][k]*Gip6;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*20 + nzc2[k]] += FE1_C0_D010[ip][k]*FE1_C0_D100[ip][j]*Gip6;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*20 + nzc2[k]] += FE1_C0_D001[ip][j]*FE1_C0_D010[ip][k]*Gip0;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*20 + nzc2[k]] += FE1_C0_D010[ip][j]*FE1_C0_D010[ip][k]*Gip8;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*20 + nzc1[k]] += FE1_C0_D001[ip][j]*FE1_C0_D001[ip][k]*Gip9;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*20 + nzc1[k]] += FE1_C0_D001[ip][k]*FE1_C0_D100[ip][j]*Gip10;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*20 + nzc3[k]] += FE1_C0_D001[ip][j]*FE1_C0_D100[ip][k]*Gip10;
         }// end loop over 'k'
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 900
+      // Number of operations for primary indices: 900
       for (unsigned int j = 0; j < 10; j++)
       {
         for (unsigned int k = 0; k < 10; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc7[j]*20 + nzc7[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip1;
-          // Number of operations to compute entry = 3
-          A[nzc6[j]*20 + nzc6[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip7;
-          // Number of operations to compute entry = 3
-          A[nzc6[j]*20 + nzc7[k]] += FE0_C1[ip][j]*FE0_C1[ip][k]*Gip8;
+          // Number of operations to compute entry: 3
+          A[nzc4[j]*20 + nzc4[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip1;
+          // Number of operations to compute entry: 3
+          A[nzc0[j]*20 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip4;
+          // Number of operations to compute entry: 3
+          A[nzc4[j]*20 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip11;
         }// end loop over 'k'
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 630
+      // Number of operations for primary indices: 630
       for (unsigned int j = 0; j < 7; j++)
       {
         for (unsigned int k = 0; k < 10; k++)
         {
-          // Number of operations to compute entry = 3
-          A[nzc3[j]*20 + nzc6[k]] += FE0_C1[ip][k]*FE0_C1_D100[ip][j]*Gip6;
-          // Number of operations to compute entry = 3
-          A[nzc4[j]*20 + nzc6[k]] += FE0_C1[ip][k]*FE0_C1_D010[ip][j]*Gip9;
-          // Number of operations to compute entry = 3
-          A[nzc5[j]*20 + nzc6[k]] += FE0_C1[ip][k]*FE0_C1_D001[ip][j]*Gip10;
+          // Number of operations to compute entry: 3
+          A[nzc1[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D001[ip][j]*Gip2;
+          // Number of operations to compute entry: 3
+          A[nzc3[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D100[ip][j]*Gip5;
+          // Number of operations to compute entry: 3
+          A[nzc2[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D010[ip][j]*Gip7;
         }// end loop over 'k'
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SolitaryWave3DBilinearForm_cell_integral_0::UFC_SolitaryWave3DBilinearForm_cell_integral_0() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_cell_integral_0::~UFC_SolitaryWave3DBilinearForm_cell_integral_0()
+solitarywave3d_0_cell_integral_0::solitarywave3d_0_cell_integral_0() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_cell_integral_0::~solitarywave3d_0_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave3DBilinearForm_cell_integral_0::tabulate_tensor(double* A,
+void solitarywave3d_0_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
-    A[20] = 0;
-    A[21] = 0;
-    A[22] = 0;
-    A[23] = 0;
-    A[24] = 0;
-    A[25] = 0;
-    A[26] = 0;
-    A[27] = 0;
-    A[28] = 0;
-    A[29] = 0;
-    A[30] = 0;
-    A[31] = 0;
-    A[32] = 0;
-    A[33] = 0;
-    A[34] = 0;
-    A[35] = 0;
-    A[36] = 0;
-    A[37] = 0;
-    A[38] = 0;
-    A[39] = 0;
-    A[40] = 0;
-    A[41] = 0;
-    A[42] = 0;
-    A[43] = 0;
-    A[44] = 0;
-    A[45] = 0;
-    A[46] = 0;
-    A[47] = 0;
-    A[48] = 0;
-    A[49] = 0;
-    A[50] = 0;
-    A[51] = 0;
-    A[52] = 0;
-    A[53] = 0;
-    A[54] = 0;
-    A[55] = 0;
-    A[56] = 0;
-    A[57] = 0;
-    A[58] = 0;
-    A[59] = 0;
-    A[60] = 0;
-    A[61] = 0;
-    A[62] = 0;
-    A[63] = 0;
-    A[64] = 0;
-    A[65] = 0;
-    A[66] = 0;
-    A[67] = 0;
-    A[68] = 0;
-    A[69] = 0;
-    A[70] = 0;
-    A[71] = 0;
-    A[72] = 0;
-    A[73] = 0;
-    A[74] = 0;
-    A[75] = 0;
-    A[76] = 0;
-    A[77] = 0;
-    A[78] = 0;
-    A[79] = 0;
-    A[80] = 0;
-    A[81] = 0;
-    A[82] = 0;
-    A[83] = 0;
-    A[84] = 0;
-    A[85] = 0;
-    A[86] = 0;
-    A[87] = 0;
-    A[88] = 0;
-    A[89] = 0;
-    A[90] = 0;
-    A[91] = 0;
-    A[92] = 0;
-    A[93] = 0;
-    A[94] = 0;
-    A[95] = 0;
-    A[96] = 0;
-    A[97] = 0;
-    A[98] = 0;
-    A[99] = 0;
-    A[100] = 0;
-    A[101] = 0;
-    A[102] = 0;
-    A[103] = 0;
-    A[104] = 0;
-    A[105] = 0;
-    A[106] = 0;
-    A[107] = 0;
-    A[108] = 0;
-    A[109] = 0;
-    A[110] = 0;
-    A[111] = 0;
-    A[112] = 0;
-    A[113] = 0;
-    A[114] = 0;
-    A[115] = 0;
-    A[116] = 0;
-    A[117] = 0;
-    A[118] = 0;
-    A[119] = 0;
-    A[120] = 0;
-    A[121] = 0;
-    A[122] = 0;
-    A[123] = 0;
-    A[124] = 0;
-    A[125] = 0;
-    A[126] = 0;
-    A[127] = 0;
-    A[128] = 0;
-    A[129] = 0;
-    A[130] = 0;
-    A[131] = 0;
-    A[132] = 0;
-    A[133] = 0;
-    A[134] = 0;
-    A[135] = 0;
-    A[136] = 0;
-    A[137] = 0;
-    A[138] = 0;
-    A[139] = 0;
-    A[140] = 0;
-    A[141] = 0;
-    A[142] = 0;
-    A[143] = 0;
-    A[144] = 0;
-    A[145] = 0;
-    A[146] = 0;
-    A[147] = 0;
-    A[148] = 0;
-    A[149] = 0;
-    A[150] = 0;
-    A[151] = 0;
-    A[152] = 0;
-    A[153] = 0;
-    A[154] = 0;
-    A[155] = 0;
-    A[156] = 0;
-    A[157] = 0;
-    A[158] = 0;
-    A[159] = 0;
-    A[160] = 0;
-    A[161] = 0;
-    A[162] = 0;
-    A[163] = 0;
-    A[164] = 0;
-    A[165] = 0;
-    A[166] = 0;
-    A[167] = 0;
-    A[168] = 0;
-    A[169] = 0;
-    A[170] = 0;
-    A[171] = 0;
-    A[172] = 0;
-    A[173] = 0;
-    A[174] = 0;
-    A[175] = 0;
-    A[176] = 0;
-    A[177] = 0;
-    A[178] = 0;
-    A[179] = 0;
-    A[180] = 0;
-    A[181] = 0;
-    A[182] = 0;
-    A[183] = 0;
-    A[184] = 0;
-    A[185] = 0;
-    A[186] = 0;
-    A[187] = 0;
-    A[188] = 0;
-    A[189] = 0;
-    A[190] = 0;
-    A[191] = 0;
-    A[192] = 0;
-    A[193] = 0;
-    A[194] = 0;
-    A[195] = 0;
-    A[196] = 0;
-    A[197] = 0;
-    A[198] = 0;
-    A[199] = 0;
-    A[200] = 0;
-    A[201] = 0;
-    A[202] = 0;
-    A[203] = 0;
-    A[204] = 0;
-    A[205] = 0;
-    A[206] = 0;
-    A[207] = 0;
-    A[208] = 0;
-    A[209] = 0;
-    A[210] = 0;
-    A[211] = 0;
-    A[212] = 0;
-    A[213] = 0;
-    A[214] = 0;
-    A[215] = 0;
-    A[216] = 0;
-    A[217] = 0;
-    A[218] = 0;
-    A[219] = 0;
-    A[220] = 0;
-    A[221] = 0;
-    A[222] = 0;
-    A[223] = 0;
-    A[224] = 0;
-    A[225] = 0;
-    A[226] = 0;
-    A[227] = 0;
-    A[228] = 0;
-    A[229] = 0;
-    A[230] = 0;
-    A[231] = 0;
-    A[232] = 0;
-    A[233] = 0;
-    A[234] = 0;
-    A[235] = 0;
-    A[236] = 0;
-    A[237] = 0;
-    A[238] = 0;
-    A[239] = 0;
-    A[240] = 0;
-    A[241] = 0;
-    A[242] = 0;
-    A[243] = 0;
-    A[244] = 0;
-    A[245] = 0;
-    A[246] = 0;
-    A[247] = 0;
-    A[248] = 0;
-    A[249] = 0;
-    A[250] = 0;
-    A[251] = 0;
-    A[252] = 0;
-    A[253] = 0;
-    A[254] = 0;
-    A[255] = 0;
-    A[256] = 0;
-    A[257] = 0;
-    A[258] = 0;
-    A[259] = 0;
-    A[260] = 0;
-    A[261] = 0;
-    A[262] = 0;
-    A[263] = 0;
-    A[264] = 0;
-    A[265] = 0;
-    A[266] = 0;
-    A[267] = 0;
-    A[268] = 0;
-    A[269] = 0;
-    A[270] = 0;
-    A[271] = 0;
-    A[272] = 0;
-    A[273] = 0;
-    A[274] = 0;
-    A[275] = 0;
-    A[276] = 0;
-    A[277] = 0;
-    A[278] = 0;
-    A[279] = 0;
-    A[280] = 0;
-    A[281] = 0;
-    A[282] = 0;
-    A[283] = 0;
-    A[284] = 0;
-    A[285] = 0;
-    A[286] = 0;
-    A[287] = 0;
-    A[288] = 0;
-    A[289] = 0;
-    A[290] = 0;
-    A[291] = 0;
-    A[292] = 0;
-    A[293] = 0;
-    A[294] = 0;
-    A[295] = 0;
-    A[296] = 0;
-    A[297] = 0;
-    A[298] = 0;
-    A[299] = 0;
-    A[300] = 0;
-    A[301] = 0;
-    A[302] = 0;
-    A[303] = 0;
-    A[304] = 0;
-    A[305] = 0;
-    A[306] = 0;
-    A[307] = 0;
-    A[308] = 0;
-    A[309] = 0;
-    A[310] = 0;
-    A[311] = 0;
-    A[312] = 0;
-    A[313] = 0;
-    A[314] = 0;
-    A[315] = 0;
-    A[316] = 0;
-    A[317] = 0;
-    A[318] = 0;
-    A[319] = 0;
-    A[320] = 0;
-    A[321] = 0;
-    A[322] = 0;
-    A[323] = 0;
-    A[324] = 0;
-    A[325] = 0;
-    A[326] = 0;
-    A[327] = 0;
-    A[328] = 0;
-    A[329] = 0;
-    A[330] = 0;
-    A[331] = 0;
-    A[332] = 0;
-    A[333] = 0;
-    A[334] = 0;
-    A[335] = 0;
-    A[336] = 0;
-    A[337] = 0;
-    A[338] = 0;
-    A[339] = 0;
-    A[340] = 0;
-    A[341] = 0;
-    A[342] = 0;
-    A[343] = 0;
-    A[344] = 0;
-    A[345] = 0;
-    A[346] = 0;
-    A[347] = 0;
-    A[348] = 0;
-    A[349] = 0;
-    A[350] = 0;
-    A[351] = 0;
-    A[352] = 0;
-    A[353] = 0;
-    A[354] = 0;
-    A[355] = 0;
-    A[356] = 0;
-    A[357] = 0;
-    A[358] = 0;
-    A[359] = 0;
-    A[360] = 0;
-    A[361] = 0;
-    A[362] = 0;
-    A[363] = 0;
-    A[364] = 0;
-    A[365] = 0;
-    A[366] = 0;
-    A[367] = 0;
-    A[368] = 0;
-    A[369] = 0;
-    A[370] = 0;
-    A[371] = 0;
-    A[372] = 0;
-    A[373] = 0;
-    A[374] = 0;
-    A[375] = 0;
-    A[376] = 0;
-    A[377] = 0;
-    A[378] = 0;
-    A[379] = 0;
-    A[380] = 0;
-    A[381] = 0;
-    A[382] = 0;
-    A[383] = 0;
-    A[384] = 0;
-    A[385] = 0;
-    A[386] = 0;
-    A[387] = 0;
-    A[388] = 0;
-    A[389] = 0;
-    A[390] = 0;
-    A[391] = 0;
-    A[392] = 0;
-    A[393] = 0;
-    A[394] = 0;
-    A[395] = 0;
-    A[396] = 0;
-    A[397] = 0;
-    A[398] = 0;
-    A[399] = 0;
+    for (unsigned int j = 0; j < 400; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0_quadrature::UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0_quadrature::~UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0_quadrature()
+solitarywave3d_0_exterior_facet_integral_0_quadrature::solitarywave3d_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_exterior_facet_integral_0_quadrature::~solitarywave3d_0_exterior_facet_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave3d_0_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
@@ -13545,13 +10847,13 @@ void UFC_SolitaryWave3DBilinearForm_exte
     const double * const * x = c.coordinates;
     
     // Compute Jacobian of affine map from reference cell
-      
-    // Compute sub determinants
-    
-    
-      
-    // Compute determinant of Jacobian
-      
+    
+    // Compute sub determinants
+    
+    
+    
+    // Compute determinant of Jacobian
+    
     // Compute inverse of Jacobian
     
     // Vertices on faces
@@ -13571,41 +10873,63 @@ void UFC_SolitaryWave3DBilinearForm_exte
                   - (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
     const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
     
+    const bool direction = a0*(x[facet][0] - x[v0][0]) + a1*(x[facet][1] - x[v0][1])  + a2*(x[facet][2] - x[v0][2]) < 0;
+    // Compute facet normals from the facet scale factor constants
+    const double n2 = direction ? a2 / det : -a2 / det;
+    
     
     // Array of quadrature weights
-    const static double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
-    
-    
-    const static double FE0_f0_C1[9][6] = \
-    {{0.499278833175498, -0.0816158215904471, -0.072892306371455, 0.0363981897820603, 0.286562341986258, 0.332268763018086},
-    {0.0251290590975513, -0.0576951799472843, -0.0741406382908806, 0.109006741895514, 0.858208263567717, 0.139491753677383},
-    {-0.117413197449647, -0.0227857341019971, 0.453155393641927, 0.0753983311062781, 0.593609805131561, 0.0180354016718773},
-    {-0.0403700664710396, -0.0403700664710397, -0.072892306371455, 0.161480265884159, 0.161480265884159, 0.830671907545217},
-    {-0.120901875682904, -0.120901875682904, -0.0741406382908806, 0.483607502731615, 0.483607502731616, 0.348729384193458},
-    {-0.0836260170297298, -0.0836260170297299, 0.453155393641927, 0.33450406811892, 0.33450406811892, 0.0450885041796932},
-    {-0.0816158215904472, 0.499278833175498, -0.072892306371455, 0.286562341986258, 0.0363981897820605, 0.332268763018087},
-    {-0.0576951799472843, 0.0251290590975512, -0.0741406382908807, 0.858208263567716, 0.109006741895515, 0.139491753677383},
-    {-0.0227857341019971, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.0753983311062786, 0.0180354016718773}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {11, 12, 13, 14, 15, 16};
-    // Array of non-zero columns
-    static const unsigned int nzc1[6] = {1, 2, 3, 4, 5, 6};
-    // Array of non-zero columns
-    static const unsigned int nzc2[6] = {10, 11, 13, 15, 17, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {0, 1, 3, 5, 7, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc9[6] = {0, 1, 2, 6, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc10[6] = {10, 11, 12, 16, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc8[6] = {10, 12, 13, 14, 17, 18};
-    // Array of non-zero columns
-    static const unsigned int nzc7[6] = {0, 2, 3, 4, 7, 8};
+    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
+    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE0_f0_C0[25][6] = \
+    {{0.759842524889053, -0.0409849230988147, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
+    {0.404143384962011, -0.0347905350890821, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
+    {0.0382038937201701, -0.0249744559383749, -0.0543309414249184, 0.0461882014671774, 0.938423301877432, 0.0564900002985142},
+    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218534},
+    {-0.0762735703276686, -0.00457955736373825, 0.723813068870285, 0.0166673234982245, 0.338636367163553, 0.00173636815934473},
+    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
+    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
+    {-0.0585120870225411, -0.0960538647466012, -0.0543309414249184, 0.227214213208259, 0.75739729013635, 0.224285389849452},
+    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372834},
+    {-0.0643063527627086, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032827},
+    {-0.0191125161665051, -0.0191125161665051, -0.036640207614552, 0.0764500646660208, 0.0764500646660208, 0.921965110615521},
+    {-0.0794020521078099, -0.07940205210781, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
+    {-0.123076437918076, -0.123076437918076, -0.0543309414249184, 0.492305751672305, 0.492305751672305, 0.315872313916461},
+    {-0.105896858921167, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.0927420088040289},
+    {-0.0444129613327221, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330888, 0.0097091631333821},
+    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877739, 0.65464206627708},
+    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320685},
+    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249184, 0.75739729013635, 0.227214213208259, 0.224285389849452},
+    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.65167626994723, 0.195498601422111, 0.0658515377372834},
+    {-0.0217044058396818, -0.0643063527627087, 0.723813068870285, 0.273311911925214, 0.0819917787365635, 0.00689399907032831},
+    {-0.0409849230988147, 0.759842524889053, -0.036640207614552, 0.145727572487076, 0.00717255684496533, 0.164882476492272},
+    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.029798051046164, 0.115025523822223},
+    {-0.024974455938375, 0.0382038937201699, -0.0543309414249184, 0.938423301877431, 0.0461882014671778, 0.0564900002985144},
+    {-0.0138776265525463, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743823, 0.0165858034218534},
+    {-0.00457955736373818, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982247, 0.00173636815934472}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[6] = {11, 12, 13, 14, 15, 16};
+    // Array of non-zero columns
+    static const unsigned int nzc0[6] = {1, 2, 3, 4, 5, 6};
+    // Array of non-zero columns
+    static const unsigned int nzc5[6] = {10, 11, 13, 15, 17, 19};
+    // Array of non-zero columns
+    static const unsigned int nzc4[6] = {0, 1, 3, 5, 7, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc2[6] = {0, 2, 3, 4, 7, 8};
+    // Array of non-zero columns
+    static const unsigned int nzc3[6] = {10, 12, 13, 14, 17, 18};
+    // Array of non-zero columns
+    static const unsigned int nzc6[6] = {0, 1, 2, 6, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc7[6] = {10, 11, 12, 16, 18, 19};
     
     // Number of operations to compute geometry constants: 2
     // Should be added to total operation count.
-    const double G0 = 3*det*w[3][2];
+    const double G0 = 3*det*n2;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
@@ -13613,11 +10937,11 @@ void UFC_SolitaryWave3DBilinearForm_exte
     {
     case 0:
       {
-      // Total number of operations to compute element tensor (from this point): 1107
+      // Total number of operations to compute element tensor (from this point): 3075
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 1107
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 3075
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -13626,21 +10950,21 @@ void UFC_SolitaryWave3DBilinearForm_exte
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc0[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 108
+        const double Gip0 = F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 108
         for (unsigned int j = 0; j < 6; j++)
         {
           for (unsigned int k = 0; k < 6; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc1[j]*20 + nzc0[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc0[j]*20 + nzc1[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -13648,11 +10972,11 @@ void UFC_SolitaryWave3DBilinearForm_exte
       break;
     case 1:
       {
-      // Total number of operations to compute element tensor (from this point): 1107
+      // Total number of operations to compute element tensor (from this point): 3075
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 1107
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 3075
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -13661,21 +10985,21 @@ void UFC_SolitaryWave3DBilinearForm_exte
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc8[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 108
+        const double Gip0 = F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 108
         for (unsigned int j = 0; j < 6; j++)
         {
           for (unsigned int k = 0; k < 6; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc7[j]*20 + nzc8[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc2[j]*20 + nzc3[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -13683,11 +11007,11 @@ void UFC_SolitaryWave3DBilinearForm_exte
       break;
     case 2:
       {
-      // Total number of operations to compute element tensor (from this point): 1107
+      // Total number of operations to compute element tensor (from this point): 3075
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 1107
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 3075
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -13696,21 +11020,21 @@ void UFC_SolitaryWave3DBilinearForm_exte
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc2[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 108
+        const double Gip0 = F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 108
         for (unsigned int j = 0; j < 6; j++)
         {
           for (unsigned int k = 0; k < 6; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc3[j]*20 + nzc2[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc4[j]*20 + nzc5[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -13718,11 +11042,11 @@ void UFC_SolitaryWave3DBilinearForm_exte
       break;
     case 3:
       {
-      // Total number of operations to compute element tensor (from this point): 1107
+      // Total number of operations to compute element tensor (from this point): 3075
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 1107
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 3075
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -13731,21 +11055,21 @@ void UFC_SolitaryWave3DBilinearForm_exte
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc10[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc7[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 3
         // Number of operations: 3
-        const double Gip0 = F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 108
+        const double Gip0 = F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 108
         for (unsigned int j = 0; j < 6; j++)
         {
           for (unsigned int k = 0; k < 6; k++)
           {
-            // Number of operations to compute entry = 3
-            A[nzc9[j]*20 + nzc10[k]] += FE0_f0_C1[ip][j]*FE0_f0_C1[ip][k]*Gip0;
+            // Number of operations to compute entry: 3
+            A[nzc6[j]*20 + nzc7[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
           }// end loop over 'k'
         }// end loop over 'j'
       }// end loop over 'ip'
@@ -13755,594 +11079,190 @@ void UFC_SolitaryWave3DBilinearForm_exte
 }
 
 /// Constructor
-UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0::UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0::~UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0()
+solitarywave3d_0_exterior_facet_integral_0::solitarywave3d_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_0_exterior_facet_integral_0::~solitarywave3d_0_exterior_facet_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0::tabulate_tensor(double* A,
+void solitarywave3d_0_exterior_facet_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
-    A[20] = 0;
-    A[21] = 0;
-    A[22] = 0;
-    A[23] = 0;
-    A[24] = 0;
-    A[25] = 0;
-    A[26] = 0;
-    A[27] = 0;
-    A[28] = 0;
-    A[29] = 0;
-    A[30] = 0;
-    A[31] = 0;
-    A[32] = 0;
-    A[33] = 0;
-    A[34] = 0;
-    A[35] = 0;
-    A[36] = 0;
-    A[37] = 0;
-    A[38] = 0;
-    A[39] = 0;
-    A[40] = 0;
-    A[41] = 0;
-    A[42] = 0;
-    A[43] = 0;
-    A[44] = 0;
-    A[45] = 0;
-    A[46] = 0;
-    A[47] = 0;
-    A[48] = 0;
-    A[49] = 0;
-    A[50] = 0;
-    A[51] = 0;
-    A[52] = 0;
-    A[53] = 0;
-    A[54] = 0;
-    A[55] = 0;
-    A[56] = 0;
-    A[57] = 0;
-    A[58] = 0;
-    A[59] = 0;
-    A[60] = 0;
-    A[61] = 0;
-    A[62] = 0;
-    A[63] = 0;
-    A[64] = 0;
-    A[65] = 0;
-    A[66] = 0;
-    A[67] = 0;
-    A[68] = 0;
-    A[69] = 0;
-    A[70] = 0;
-    A[71] = 0;
-    A[72] = 0;
-    A[73] = 0;
-    A[74] = 0;
-    A[75] = 0;
-    A[76] = 0;
-    A[77] = 0;
-    A[78] = 0;
-    A[79] = 0;
-    A[80] = 0;
-    A[81] = 0;
-    A[82] = 0;
-    A[83] = 0;
-    A[84] = 0;
-    A[85] = 0;
-    A[86] = 0;
-    A[87] = 0;
-    A[88] = 0;
-    A[89] = 0;
-    A[90] = 0;
-    A[91] = 0;
-    A[92] = 0;
-    A[93] = 0;
-    A[94] = 0;
-    A[95] = 0;
-    A[96] = 0;
-    A[97] = 0;
-    A[98] = 0;
-    A[99] = 0;
-    A[100] = 0;
-    A[101] = 0;
-    A[102] = 0;
-    A[103] = 0;
-    A[104] = 0;
-    A[105] = 0;
-    A[106] = 0;
-    A[107] = 0;
-    A[108] = 0;
-    A[109] = 0;
-    A[110] = 0;
-    A[111] = 0;
-    A[112] = 0;
-    A[113] = 0;
-    A[114] = 0;
-    A[115] = 0;
-    A[116] = 0;
-    A[117] = 0;
-    A[118] = 0;
-    A[119] = 0;
-    A[120] = 0;
-    A[121] = 0;
-    A[122] = 0;
-    A[123] = 0;
-    A[124] = 0;
-    A[125] = 0;
-    A[126] = 0;
-    A[127] = 0;
-    A[128] = 0;
-    A[129] = 0;
-    A[130] = 0;
-    A[131] = 0;
-    A[132] = 0;
-    A[133] = 0;
-    A[134] = 0;
-    A[135] = 0;
-    A[136] = 0;
-    A[137] = 0;
-    A[138] = 0;
-    A[139] = 0;
-    A[140] = 0;
-    A[141] = 0;
-    A[142] = 0;
-    A[143] = 0;
-    A[144] = 0;
-    A[145] = 0;
-    A[146] = 0;
-    A[147] = 0;
-    A[148] = 0;
-    A[149] = 0;
-    A[150] = 0;
-    A[151] = 0;
-    A[152] = 0;
-    A[153] = 0;
-    A[154] = 0;
-    A[155] = 0;
-    A[156] = 0;
-    A[157] = 0;
-    A[158] = 0;
-    A[159] = 0;
-    A[160] = 0;
-    A[161] = 0;
-    A[162] = 0;
-    A[163] = 0;
-    A[164] = 0;
-    A[165] = 0;
-    A[166] = 0;
-    A[167] = 0;
-    A[168] = 0;
-    A[169] = 0;
-    A[170] = 0;
-    A[171] = 0;
-    A[172] = 0;
-    A[173] = 0;
-    A[174] = 0;
-    A[175] = 0;
-    A[176] = 0;
-    A[177] = 0;
-    A[178] = 0;
-    A[179] = 0;
-    A[180] = 0;
-    A[181] = 0;
-    A[182] = 0;
-    A[183] = 0;
-    A[184] = 0;
-    A[185] = 0;
-    A[186] = 0;
-    A[187] = 0;
-    A[188] = 0;
-    A[189] = 0;
-    A[190] = 0;
-    A[191] = 0;
-    A[192] = 0;
-    A[193] = 0;
-    A[194] = 0;
-    A[195] = 0;
-    A[196] = 0;
-    A[197] = 0;
-    A[198] = 0;
-    A[199] = 0;
-    A[200] = 0;
-    A[201] = 0;
-    A[202] = 0;
-    A[203] = 0;
-    A[204] = 0;
-    A[205] = 0;
-    A[206] = 0;
-    A[207] = 0;
-    A[208] = 0;
-    A[209] = 0;
-    A[210] = 0;
-    A[211] = 0;
-    A[212] = 0;
-    A[213] = 0;
-    A[214] = 0;
-    A[215] = 0;
-    A[216] = 0;
-    A[217] = 0;
-    A[218] = 0;
-    A[219] = 0;
-    A[220] = 0;
-    A[221] = 0;
-    A[222] = 0;
-    A[223] = 0;
-    A[224] = 0;
-    A[225] = 0;
-    A[226] = 0;
-    A[227] = 0;
-    A[228] = 0;
-    A[229] = 0;
-    A[230] = 0;
-    A[231] = 0;
-    A[232] = 0;
-    A[233] = 0;
-    A[234] = 0;
-    A[235] = 0;
-    A[236] = 0;
-    A[237] = 0;
-    A[238] = 0;
-    A[239] = 0;
-    A[240] = 0;
-    A[241] = 0;
-    A[242] = 0;
-    A[243] = 0;
-    A[244] = 0;
-    A[245] = 0;
-    A[246] = 0;
-    A[247] = 0;
-    A[248] = 0;
-    A[249] = 0;
-    A[250] = 0;
-    A[251] = 0;
-    A[252] = 0;
-    A[253] = 0;
-    A[254] = 0;
-    A[255] = 0;
-    A[256] = 0;
-    A[257] = 0;
-    A[258] = 0;
-    A[259] = 0;
-    A[260] = 0;
-    A[261] = 0;
-    A[262] = 0;
-    A[263] = 0;
-    A[264] = 0;
-    A[265] = 0;
-    A[266] = 0;
-    A[267] = 0;
-    A[268] = 0;
-    A[269] = 0;
-    A[270] = 0;
-    A[271] = 0;
-    A[272] = 0;
-    A[273] = 0;
-    A[274] = 0;
-    A[275] = 0;
-    A[276] = 0;
-    A[277] = 0;
-    A[278] = 0;
-    A[279] = 0;
-    A[280] = 0;
-    A[281] = 0;
-    A[282] = 0;
-    A[283] = 0;
-    A[284] = 0;
-    A[285] = 0;
-    A[286] = 0;
-    A[287] = 0;
-    A[288] = 0;
-    A[289] = 0;
-    A[290] = 0;
-    A[291] = 0;
-    A[292] = 0;
-    A[293] = 0;
-    A[294] = 0;
-    A[295] = 0;
-    A[296] = 0;
-    A[297] = 0;
-    A[298] = 0;
-    A[299] = 0;
-    A[300] = 0;
-    A[301] = 0;
-    A[302] = 0;
-    A[303] = 0;
-    A[304] = 0;
-    A[305] = 0;
-    A[306] = 0;
-    A[307] = 0;
-    A[308] = 0;
-    A[309] = 0;
-    A[310] = 0;
-    A[311] = 0;
-    A[312] = 0;
-    A[313] = 0;
-    A[314] = 0;
-    A[315] = 0;
-    A[316] = 0;
-    A[317] = 0;
-    A[318] = 0;
-    A[319] = 0;
-    A[320] = 0;
-    A[321] = 0;
-    A[322] = 0;
-    A[323] = 0;
-    A[324] = 0;
-    A[325] = 0;
-    A[326] = 0;
-    A[327] = 0;
-    A[328] = 0;
-    A[329] = 0;
-    A[330] = 0;
-    A[331] = 0;
-    A[332] = 0;
-    A[333] = 0;
-    A[334] = 0;
-    A[335] = 0;
-    A[336] = 0;
-    A[337] = 0;
-    A[338] = 0;
-    A[339] = 0;
-    A[340] = 0;
-    A[341] = 0;
-    A[342] = 0;
-    A[343] = 0;
-    A[344] = 0;
-    A[345] = 0;
-    A[346] = 0;
-    A[347] = 0;
-    A[348] = 0;
-    A[349] = 0;
-    A[350] = 0;
-    A[351] = 0;
-    A[352] = 0;
-    A[353] = 0;
-    A[354] = 0;
-    A[355] = 0;
-    A[356] = 0;
-    A[357] = 0;
-    A[358] = 0;
-    A[359] = 0;
-    A[360] = 0;
-    A[361] = 0;
-    A[362] = 0;
-    A[363] = 0;
-    A[364] = 0;
-    A[365] = 0;
-    A[366] = 0;
-    A[367] = 0;
-    A[368] = 0;
-    A[369] = 0;
-    A[370] = 0;
-    A[371] = 0;
-    A[372] = 0;
-    A[373] = 0;
-    A[374] = 0;
-    A[375] = 0;
-    A[376] = 0;
-    A[377] = 0;
-    A[378] = 0;
-    A[379] = 0;
-    A[380] = 0;
-    A[381] = 0;
-    A[382] = 0;
-    A[383] = 0;
-    A[384] = 0;
-    A[385] = 0;
-    A[386] = 0;
-    A[387] = 0;
-    A[388] = 0;
-    A[389] = 0;
-    A[390] = 0;
-    A[391] = 0;
-    A[392] = 0;
-    A[393] = 0;
-    A[394] = 0;
-    A[395] = 0;
-    A[396] = 0;
-    A[397] = 0;
-    A[398] = 0;
-    A[399] = 0;
+    for (unsigned int j = 0; j < 400; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c, facet);
 }
 
 /// Constructor
-UFC_SolitaryWave3DBilinearForm::UFC_SolitaryWave3DBilinearForm() : ufc::form()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DBilinearForm::~UFC_SolitaryWave3DBilinearForm()
+solitarywave3d_form_0::solitarywave3d_form_0() : ufc::form()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_form_0::~solitarywave3d_form_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SolitaryWave3DBilinearForm::signature() const
-{
-    return "Form([Integral(Sum(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),)))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('tetrahedron', 1), 2), Product(Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1), 1)), Product(IntValue(-1, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(0),))), MultiIndex((Index(1),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(2),))), MultiIndex((Index(1),)))), MultiIndex((Index(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))), Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),))), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))))))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(3),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(3),))), MultiIndex((Index(4),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(5),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(5),))), MultiIndex((Index(4),)))), MultiIndex((Index(4),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {})))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('tetrahedron', 1), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),)))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4})), Integral(Product(Indexed(VectorConstant(Cell('tetrahedron', 1), 3, 3), MultiIndex((FixedIndex(2),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(3, (), (), {}), Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),)))))))), Measure('exterior_facet', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+const char* solitarywave3d_form_0::signature() const
+{
+    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1, Space(3)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2}))))))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('tetrahedron', 1, Space(3))), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Measure('exterior_facet', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SolitaryWave3DBilinearForm::rank() const
+unsigned int solitarywave3d_form_0::rank() const
 {
     return 2;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SolitaryWave3DBilinearForm::num_coefficients() const
-{
-    return 4;
+unsigned int solitarywave3d_form_0::num_coefficients() const
+{
+    return 3;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SolitaryWave3DBilinearForm::num_cell_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave3d_form_0::num_cell_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SolitaryWave3DBilinearForm::num_exterior_facet_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave3d_form_0::num_exterior_facet_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SolitaryWave3DBilinearForm::num_interior_facet_integrals() const
+unsigned int solitarywave3d_form_0::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SolitaryWave3DBilinearForm::create_finite_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_2();
-      break;
-    case 3:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_3();
+ufc::finite_element* solitarywave3d_form_0::create_finite_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_finite_element_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_finite_element_1();
+      break;
+    case 2:
+      return new solitarywave3d_0_finite_element_2();
+      break;
+    case 3:
+      return new solitarywave3d_0_finite_element_3();
       break;
     case 4:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_4();
-      break;
-    case 5:
-      return new UFC_SolitaryWave3DBilinearForm_finite_element_5();
+      return new solitarywave3d_0_finite_element_4();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SolitaryWave3DBilinearForm::create_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_2();
-      break;
-    case 3:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_3();
+ufc::dof_map* solitarywave3d_form_0::create_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_0_dof_map_0();
+      break;
+    case 1:
+      return new solitarywave3d_0_dof_map_1();
+      break;
+    case 2:
+      return new solitarywave3d_0_dof_map_2();
+      break;
+    case 3:
+      return new solitarywave3d_0_dof_map_3();
       break;
     case 4:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_4();
-      break;
-    case 5:
-      return new UFC_SolitaryWave3DBilinearForm_dof_map_5();
+      return new solitarywave3d_0_dof_map_4();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SolitaryWave3DBilinearForm::create_cell_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_cell_integral_0();
+ufc::cell_integral* solitarywave3d_form_0::create_cell_integral(unsigned int i) const
+{
+    return new solitarywave3d_0_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SolitaryWave3DBilinearForm::create_exterior_facet_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DBilinearForm_exterior_facet_integral_0();
+ufc::exterior_facet_integral* solitarywave3d_form_0::create_exterior_facet_integral(unsigned int i) const
+{
+    return new solitarywave3d_0_exterior_facet_integral_0();
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SolitaryWave3DBilinearForm::create_interior_facet_integral(unsigned int i) const
-{
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_0_0::UFC_SolitaryWave3DLinearForm_finite_element_0_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_0_0::~UFC_SolitaryWave3DLinearForm_finite_element_0_0()
+ufc::interior_facet_integral* solitarywave3d_form_0::create_interior_facet_integral(unsigned int i) const
+{
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_0_0::solitarywave3d_1_finite_element_0_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_0_0::~solitarywave3d_1_finite_element_0_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_0_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_finite_element_0_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_0_0::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_0_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_0::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_0_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_0::value_rank() const
+unsigned int solitarywave3d_1_finite_element_0_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_0_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_0_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -14360,20 +11280,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -14460,7 +11380,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -14489,7 +11409,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_0_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -14497,7 +11417,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_0_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -14516,20 +11436,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -14573,14 +11493,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -14605,7 +11525,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -14676,7 +11596,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -14690,7 +11610,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -14702,7 +11622,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -14714,7 +11634,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -14852,7 +11772,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_0_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -14861,14 +11781,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_0_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -14897,14 +11817,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_0_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -14912,7 +11832,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_0_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -14924,62 +11844,62 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_0::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_0_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_0_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_0_1::UFC_SolitaryWave3DLinearForm_finite_element_0_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_0_1::~UFC_SolitaryWave3DLinearForm_finite_element_0_1()
+ufc::finite_element* solitarywave3d_1_finite_element_0_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_0_0();
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_0_1::solitarywave3d_1_finite_element_0_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_0_1::~solitarywave3d_1_finite_element_0_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_0_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_finite_element_0_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_0_1::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_0_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_1::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_0_1::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_1::value_rank() const
+unsigned int solitarywave3d_1_finite_element_0_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_0_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_0_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -14997,20 +11917,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -15097,7 +12017,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -15126,7 +12046,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_0_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -15134,7 +12054,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_0_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -15153,20 +12073,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -15210,14 +12130,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -15242,7 +12162,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -15313,7 +12233,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -15327,7 +12247,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -15339,7 +12259,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -15351,7 +12271,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -15489,7 +12409,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_0_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -15498,14 +12418,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_0_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -15534,14 +12454,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_0_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -15549,7 +12469,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_0_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -15561,62 +12481,62 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0_1::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_0_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_0_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_0::UFC_SolitaryWave3DLinearForm_finite_element_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_0::~UFC_SolitaryWave3DLinearForm_finite_element_0()
+ufc::finite_element* solitarywave3d_1_finite_element_0_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_0_1();
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_0::solitarywave3d_1_finite_element_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_0::~solitarywave3d_1_finite_element_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_0::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_1_finite_element_0::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_0::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_0::space_dimension() const
 {
     return 20;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0::value_rank() const
+unsigned int solitarywave3d_1_finite_element_0::value_rank() const
 {
     return 1;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_0::value_dimension(unsigned int i) const
 {
     return 2;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -15634,20 +12554,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -15737,7 +12657,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -15816,7 +12736,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -15847,7 +12767,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -15855,7 +12775,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -15874,20 +12794,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -15931,14 +12851,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -15963,7 +12883,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -16036,7 +12956,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -16050,7 +12970,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16062,7 +12982,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16074,7 +12994,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16262,7 +13182,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -16276,7 +13196,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16288,7 +13208,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16300,7 +13220,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16440,7 +13360,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -16449,14 +13369,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -16485,14 +13405,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_0::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -16500,7 +13420,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -16517,71 +13437,71 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_0::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_0::num_sub_elements() const
 {
     return 2;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_0::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_1_0::UFC_SolitaryWave3DLinearForm_finite_element_1_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_1_0::~UFC_SolitaryWave3DLinearForm_finite_element_1_0()
+ufc::finite_element* solitarywave3d_1_finite_element_0::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_finite_element_0_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_finite_element_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_1_0::solitarywave3d_1_finite_element_1_0() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_1_0::~solitarywave3d_1_finite_element_1_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_1_0::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_finite_element_1_0::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_1_0::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_1_0::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_0::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_1_0::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_0::value_rank() const
+unsigned int solitarywave3d_1_finite_element_1_0::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_0::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_1_0::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_1_0::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -16599,20 +13519,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -16699,7 +13619,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -16728,7 +13648,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_1_0::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -16736,7 +13656,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_1_0::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -16755,20 +13675,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -16812,14 +13732,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -16844,7 +13764,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -16915,7 +13835,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -16929,7 +13849,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16941,7 +13861,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -16953,7 +13873,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -17091,7 +14011,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_1_0::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -17100,14 +14020,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_1_0::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -17136,14 +14056,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_1_0::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -17151,7 +14071,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_1_0::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -17163,62 +14083,62 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_0::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_1_0::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_1_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_1_1::UFC_SolitaryWave3DLinearForm_finite_element_1_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_1_1::~UFC_SolitaryWave3DLinearForm_finite_element_1_1()
+ufc::finite_element* solitarywave3d_1_finite_element_1_0::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_1_0();
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_1_1::solitarywave3d_1_finite_element_1_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_1_1::~solitarywave3d_1_finite_element_1_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_1_1::signature() const
-{
-    return "FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_finite_element_1_1::signature() const
+{
+    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_1_1::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_1_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_1::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_1_1::space_dimension() const
 {
     return 10;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_1::value_rank() const
+unsigned int solitarywave3d_1_finite_element_1_1::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_1_1::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_1_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -17236,20 +14156,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -17336,7 +14256,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -17365,7 +14285,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_1_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -17373,7 +14293,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_1_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -17392,20 +14312,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -17449,14 +14369,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -17481,7 +14401,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -17552,7 +14472,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
     // Table(s) of coefficients
-    const static double coefficients0[10][10] = \
+    static const double coefficients0[10][10] = \
     {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
     {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -17566,7 +14486,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[10][10] = \
+    static const double dmats0[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -17578,7 +14498,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats1[10][10] = \
+    static const double dmats1[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -17590,7 +14510,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-    const static double dmats2[10][10] = \
+    static const double dmats2[10][10] = \
     {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
     {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -17728,7 +14648,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_1_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -17737,14 +14657,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_1_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
+    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -17773,14 +14693,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_1_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -17788,7 +14708,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_1_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -17800,62 +14720,62 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1_1::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_1_1::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_1_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_1::UFC_SolitaryWave3DLinearForm_finite_element_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_1::~UFC_SolitaryWave3DLinearForm_finite_element_1()
+ufc::finite_element* solitarywave3d_1_finite_element_1_1::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_1_1();
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_1::solitarywave3d_1_finite_element_1() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_1::~solitarywave3d_1_finite_element_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_1::signature() const
-{
-    return "MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_1_finite_element_1::signature() const
+{
+    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_1::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_1::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_1::space_dimension() const
 {
     return 20;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1::value_rank() const
+unsigned int solitarywave3d_1_finite_element_1::value_rank() const
 {
     return 1;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_1::value_dimension(unsigned int i) const
 {
     return 2;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_1::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -17873,20 +14793,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -17976,7 +14896,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -18055,7 +14975,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -18086,7 +15006,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_1::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -18094,7 +15014,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_1::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -18113,20 +15033,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -18170,14 +15090,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -18202,7 +15122,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -18275,7 +15195,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -18289,7 +15209,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18301,7 +15221,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18313,7 +15233,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18501,7 +15421,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
     
       // Table(s) of coefficients
-      const static double coefficients0[10][10] =   \
+      static const double coefficients0[10][10] =   \
       {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
       {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
@@ -18515,7 +15435,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     
       // Interesting (new) part
       // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[10][10] =   \
+      static const double dmats0[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18527,7 +15447,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats1[10][10] =   \
+      static const double dmats1[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18539,7 +15459,7 @@ void UFC_SolitaryWave3DLinearForm_finite
       {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
       {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
     
-      const static double dmats2[10][10] =   \
+      static const double dmats2[10][10] =   \
       {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
       {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -18679,7 +15599,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_1::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -18688,14 +15608,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_1::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    const static double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    const static double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
+    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
+    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -18724,14 +15644,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 2; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_1::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_1::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -18739,7 +15659,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_1::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_1::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -18756,71 +15676,71 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_1::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_1::num_sub_elements() const
 {
     return 2;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_1::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_2::UFC_SolitaryWave3DLinearForm_finite_element_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_2::~UFC_SolitaryWave3DLinearForm_finite_element_2()
+ufc::finite_element* solitarywave3d_1_finite_element_1::create_sub_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_finite_element_1_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_finite_element_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_2::solitarywave3d_1_finite_element_2() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_2::~solitarywave3d_1_finite_element_2()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_2::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_1_finite_element_2::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_2::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_2::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_2::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_2::space_dimension() const
 {
     return 1;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_2::value_rank() const
+unsigned int solitarywave3d_1_finite_element_2::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_2::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_2::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_2::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -18838,20 +15758,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -18909,7 +15829,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Extract relevant coefficients
@@ -18920,7 +15840,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_2::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -18928,7 +15848,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_2::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -18947,20 +15867,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -19004,14 +15924,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -19036,7 +15956,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -19078,18 +15998,18 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
-    const static double dmats2[1][1] = \
+    static const double dmats2[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -19155,7 +16075,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_2::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -19164,14 +16084,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_2::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -19200,14 +16120,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_2::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_2::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -19215,7 +16135,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_2::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_2::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -19227,62 +16147,62 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_2::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_2::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_2::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_3::UFC_SolitaryWave3DLinearForm_finite_element_3() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_3::~UFC_SolitaryWave3DLinearForm_finite_element_3()
+ufc::finite_element* solitarywave3d_1_finite_element_2::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_2();
+}
+
+
+/// Constructor
+solitarywave3d_1_finite_element_3::solitarywave3d_1_finite_element_3() : ufc::finite_element()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_finite_element_3::~solitarywave3d_1_finite_element_3()
 {
     // Do nothing
 }
 
 /// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_3::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_1_finite_element_3::signature() const
+{
+    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_3::cell_shape() const
+ufc::shape solitarywave3d_1_finite_element_3::cell_shape() const
 {
     return ufc::tetrahedron;
 }
 
 /// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_3::space_dimension() const
+unsigned int solitarywave3d_1_finite_element_3::space_dimension() const
 {
     return 1;
 }
 
 /// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_3::value_rank() const
+unsigned int solitarywave3d_1_finite_element_3::value_rank() const
 {
     return 0;
 }
 
 /// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_3::value_dimension(unsigned int i) const
+unsigned int solitarywave3d_1_finite_element_3::value_dimension(unsigned int i) const
 {
     return 1;
 }
 
 /// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_basis(unsigned int i,
+void solitarywave3d_1_finite_element_3::evaluate_basis(unsigned int i,
                                    double* values,
                                    const double* coordinates,
                                    const ufc::cell& c) const
@@ -19300,20 +16220,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -19371,7 +16291,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Extract relevant coefficients
@@ -19382,7 +16302,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_basis_all(double* values,
+void solitarywave3d_1_finite_element_3::evaluate_basis_all(double* values,
                                        const double* coordinates,
                                        const ufc::cell& c) const
 {
@@ -19390,7 +16310,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_basis_derivatives(unsigned int i,
+void solitarywave3d_1_finite_element_3::evaluate_basis_derivatives(unsigned int i,
                                                unsigned int n,
                                                double* values,
                                                const double* coordinates,
@@ -19409,20 +16329,20 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
     const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
     const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
+    
+    // Compute sub determinants
+    const double d00 = J_11*J_22 - J_12*J_21;
+    const double d01 = J_12*J_20 - J_10*J_22;
+    const double d02 = J_10*J_21 - J_11*J_20;
+    
+    const double d10 = J_02*J_21 - J_01*J_22;
+    const double d11 = J_00*J_22 - J_02*J_20;
+    const double d12 = J_01*J_20 - J_00*J_21;
+    
+    const double d20 = J_01*J_12 - J_02*J_11;
+    const double d21 = J_02*J_10 - J_00*J_12;
+    const double d22 = J_00*J_11 - J_01*J_10;
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d00 + J_10*d10 + J_20*d20;
     
@@ -19466,14 +16386,14 @@ void UFC_SolitaryWave3DLinearForm_finite
     
     // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
     unsigned int **combinations = new unsigned int *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       combinations[j] = new unsigned int [n];
       for (unsigned int k = 0; k < n; k++)
         combinations[j][k] = 0;
     }
-        
+    
     // Generate combinations of derivatives
     for (unsigned int row = 1; row < num_derivatives; row++)
     {
@@ -19498,7 +16418,7 @@ void UFC_SolitaryWave3DLinearForm_finite
     // Declare transformation matrix
     // Declare pointer to two dimensional array and initialise
     double **transform = new double *[num_derivatives];
-        
+    
     for (unsigned int j = 0; j < num_derivatives; j++)
     {
       transform[j] = new double [num_derivatives];
@@ -19540,18 +16460,18 @@ void UFC_SolitaryWave3DLinearForm_finite
     const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
     
     // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
+    static const double coefficients0[1][1] = \
     {{1.15470053837925}};
     
     // Interesting (new) part
     // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
+    static const double dmats0[1][1] = \
     {{0}};
     
-    const static double dmats1[1][1] = \
+    static const double dmats1[1][1] = \
     {{0}};
     
-    const static double dmats2[1][1] = \
+    static const double dmats2[1][1] = \
     {{0}};
     
     // Compute reference derivatives
@@ -19617,7 +16537,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
+void solitarywave3d_1_finite_element_3::evaluate_basis_derivatives_all(unsigned int n,
                                                    double* values,
                                                    const double* coordinates,
                                                    const ufc::cell& c) const
@@ -19626,14 +16546,14 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_dof(unsigned int i,
+double solitarywave3d_1_finite_element_3::evaluate_dof(unsigned int i,
                                    const ufc::function& f,
                                    const ufc::cell& c) const
 {
     // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
+    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
+    static const double W[1][1] = {{1}};
+    static const double D[1][1][1] = {{{1}}};
     
     const double * const * x = c.coordinates;
     double result = 0.0;
@@ -19662,14 +16582,14 @@ double UFC_SolitaryWave3DLinearForm_fini
     // Take directional components
     for(int k = 0; k < 1; k++)
       result += values[k]*D[i][0][k];
-    // Multiply by weights 
+    // Multiply by weights
     result *= W[i][0];
     
     return result;
 }
 
 /// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_3::evaluate_dofs(double* values,
+void solitarywave3d_1_finite_element_3::evaluate_dofs(double* values,
                                   const ufc::function& f,
                                   const ufc::cell& c) const
 {
@@ -19677,7 +16597,7 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_3::interpolate_vertex_values(double* vertex_values,
+void solitarywave3d_1_finite_element_3::interpolate_vertex_values(double* vertex_values,
                                               const double* dof_values,
                                               const ufc::cell& c) const
 {
@@ -19689,2179 +16609,39 @@ void UFC_SolitaryWave3DLinearForm_finite
 }
 
 /// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_3::num_sub_elements() const
+unsigned int solitarywave3d_1_finite_element_3::num_sub_elements() const
 {
     return 1;
 }
 
 /// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_3::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_0::UFC_SolitaryWave3DLinearForm_finite_element_4_0() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_0::~UFC_SolitaryWave3DLinearForm_finite_element_4_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_4_0::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_4_0::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_0::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_0::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_0::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_4_0::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_0::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_4_0::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_4_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_1::UFC_SolitaryWave3DLinearForm_finite_element_4_1() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_1::~UFC_SolitaryWave3DLinearForm_finite_element_4_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_4_1::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_4_1::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_1::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_1::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_1::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_4_1::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_1::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_4_1::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_4_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_2::UFC_SolitaryWave3DLinearForm_finite_element_4_2() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_4_2::~UFC_SolitaryWave3DLinearForm_finite_element_4_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_4_2::signature() const
-{
-    return "FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_4_2::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_2::space_dimension() const
-{
-    return 1;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_2::value_rank() const
-{
-    return 0;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_2::value_dimension(unsigned int i) const
-{
-    return 1;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    const static double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    const static double dmats0[1][1] = \
-    {{0}};
-    
-    const static double dmats1[1][1] = \
-    {{0}};
-    
-    const static double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    const static double W[1][1] = {{1}};
-    const static double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_4_2::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4_2::num_sub_elements() const
-{
-    return 1;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_4_2::create_sub_element(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_finite_element_4_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_finite_element_4::UFC_SolitaryWave3DLinearForm_finite_element_4() : ufc::finite_element()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_finite_element_4::~UFC_SolitaryWave3DLinearForm_finite_element_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the finite element
-const char* UFC_SolitaryWave3DLinearForm_finite_element_4::signature() const
-{
-    return "MixedElement([FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)])";
-}
-
-/// Return the cell shape
-ufc::shape UFC_SolitaryWave3DLinearForm_finite_element_4::cell_shape() const
-{
-    return ufc::tetrahedron;
-}
-
-/// Return the dimension of the finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4::space_dimension() const
-{
-    return 3;
-}
-
-/// Return the rank of the value space
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4::value_rank() const
-{
-    return 1;
-}
-
-/// Return the dimension of the value space for axis i
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4::value_dimension(unsigned int i) const
-{
-    return 3;
-}
-
-/// Evaluate basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_basis(unsigned int i,
-                                   double* values,
-                                   const double* coordinates,
-                                   const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    values[2] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0;
-    }
-    
-    if (2 <= i && i <= 2)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 2;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-    
-      // Compute value(s)
-      values[2] = coeff0_0*basisvalue0;
-    }
-    
-}
-
-/// Evaluate all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_basis_all(double* values,
-                                       const double* coordinates,
-                                       const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-}
-
-/// Evaluate order n derivatives of basis function i at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_basis_derivatives(unsigned int i,
-                                               unsigned int n,
-                                               double* values,
-                                               const double* coordinates,
-                                               const ufc::cell& c) const
-{
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-      
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-      
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-        
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-        
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 3*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 0)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (1 <= i && i <= 1)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 1;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (2 <= i && i <= 2)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 2;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_z_0 = 1;
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-      // Table(s) of coefficients
-      const static double coefficients0[1][1] =   \
-      {{1.15470053837925}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      const static double dmats0[1][1] =   \
-      {{0}};
-    
-      const static double dmats1[1][1] =   \
-      {{0}};
-    
-      const static double dmats2[1][1] =   \
-      {{0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[2*num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-}
-
-/// Evaluate order n derivatives of all basis functions at given point in cell
-void UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
-                                                   double* values,
-                                                   const double* coordinates,
-                                                   const ufc::cell& c) const
-{
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-}
-
-/// Evaluate linear functional for dof i on the function f
-double UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_dof(unsigned int i,
-                                   const ufc::function& f,
-                                   const ufc::cell& c) const
-{
-    // The reference points, direction and weights:
-    const static double X[3][1][3] = {{{0.25, 0.25, 0.25}}, {{0.25, 0.25, 0.25}}, {{0.25, 0.25, 0.25}}};
-    const static double W[3][1] = {{1}, {1}, {1}};
-    const static double D[3][1][3] = {{{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[3];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 3; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights 
-    result *= W[i][0];
-    
-    return result;
-}
-
-/// Evaluate linear functionals for all dofs on the function f
-void UFC_SolitaryWave3DLinearForm_finite_element_4::evaluate_dofs(double* values,
-                                  const ufc::function& f,
-                                  const ufc::cell& c) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Interpolate vertex values from dof values
-void UFC_SolitaryWave3DLinearForm_finite_element_4::interpolate_vertex_values(double* vertex_values,
-                                              const double* dof_values,
-                                              const ufc::cell& c) const
-{
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-    vertex_values[6] = dof_values[0];
-    vertex_values[9] = dof_values[0];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[1];
-    vertex_values[4] = dof_values[1];
-    vertex_values[7] = dof_values[1];
-    vertex_values[10] = dof_values[1];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[2] = dof_values[2];
-    vertex_values[5] = dof_values[2];
-    vertex_values[8] = dof_values[2];
-    vertex_values[11] = dof_values[2];
-}
-
-/// Return the number of sub elements (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_finite_element_4::num_sub_elements() const
-{
-    return 3;
-}
-
-/// Create a new finite element for sub element i (for a mixed element)
-ufc::finite_element* UFC_SolitaryWave3DLinearForm_finite_element_4::create_sub_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_4_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_4_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_4_2();
-      break;
-    }
-    return 0;
-}
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_0_0::UFC_SolitaryWave3DLinearForm_dof_map_0_0() : ufc::dof_map()
+ufc::finite_element* solitarywave3d_1_finite_element_3::create_sub_element(unsigned int i) const
+{
+    return new solitarywave3d_1_finite_element_3();
+}
+
+/// Constructor
+solitarywave3d_1_dof_map_0_0::solitarywave3d_1_dof_map_0_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_0_0::~UFC_SolitaryWave3DLinearForm_dof_map_0_0()
+solitarywave3d_1_dof_map_0_0::~solitarywave3d_1_dof_map_0_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_0_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_dof_map_0_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_0_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_0_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -21880,57 +16660,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_0_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_0_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_0_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::init_cell_finalize()
+void solitarywave3d_1_dof_map_0_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_0_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_0_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_0_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_0_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_0_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_0_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -21948,10 +16734,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -21989,14 +16775,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_0_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -22033,40 +16819,40 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_0_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_0_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_0_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_0_1::UFC_SolitaryWave3DLinearForm_dof_map_0_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_0_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_0_0();
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_0_1::solitarywave3d_1_dof_map_0_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_0_1::~UFC_SolitaryWave3DLinearForm_dof_map_0_1()
+solitarywave3d_1_dof_map_0_1::~solitarywave3d_1_dof_map_0_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_0_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_dof_map_0_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_0_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_0_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -22085,57 +16871,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_0_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_0_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_0_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::init_cell_finalize()
+void solitarywave3d_1_dof_map_0_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_0_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_0_1::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_0_1::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_0_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_0_1::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_0_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -22153,10 +16945,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -22194,14 +16986,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_0_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -22238,40 +17030,40 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_0_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_0_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_0_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_0::UFC_SolitaryWave3DLinearForm_dof_map_0() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_0_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_0_1();
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_0::solitarywave3d_1_dof_map_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_0::~UFC_SolitaryWave3DLinearForm_dof_map_0()
+solitarywave3d_1_dof_map_0::~solitarywave3d_1_dof_map_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_0::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_1_dof_map_0::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -22290,57 +17082,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_0::init_cell_finalize()
+void solitarywave3d_1_dof_map_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_0::local_dimension(const ufc::cell& c) const
 {
     return 20;
 }
 
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_0::max_local_dimension() const
+{
+    return 20;
+}
+
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_0::num_facet_dofs() const
 {
     return 12;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -22370,10 +17168,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -22435,14 +17233,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -22509,49 +17307,49 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_0::num_sub_dof_maps() const
 {
     return 2;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_0::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_0_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_0_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_1_0::UFC_SolitaryWave3DLinearForm_dof_map_1_0() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_0::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_dof_map_0_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_dof_map_0_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_1_0::solitarywave3d_1_dof_map_1_0() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_1_0::~UFC_SolitaryWave3DLinearForm_dof_map_1_0()
+solitarywave3d_1_dof_map_1_0::~solitarywave3d_1_dof_map_1_0()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_1_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_dof_map_1_0::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_1_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_1_0::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -22570,57 +17368,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_1_0::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_1_0::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_1_0::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::init_cell_finalize()
+void solitarywave3d_1_dof_map_1_0::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_1_0::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_1_0::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_1_0::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_1_0::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_1_0::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_1_0::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_0::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -22638,10 +17442,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_0::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -22679,14 +17483,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_0::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_0::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_1_0::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -22723,40 +17527,40 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_0::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_1_0::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_1_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_1_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_1_1::UFC_SolitaryWave3DLinearForm_dof_map_1_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_1_0::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_1_0();
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_1_1::solitarywave3d_1_dof_map_1_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_1_1::~UFC_SolitaryWave3DLinearForm_dof_map_1_1()
+solitarywave3d_1_dof_map_1_1::~solitarywave3d_1_dof_map_1_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_1_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Lagrange', 'tetrahedron', 2)";
+const char* solitarywave3d_1_dof_map_1_1::signature() const
+{
+    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_1_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_1_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -22775,57 +17579,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_1_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_1_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[0] + m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_1_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::init_cell_finalize()
+void solitarywave3d_1_dof_map_1_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_1_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_1_1::local_dimension(const ufc::cell& c) const
+{
+    return 10;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_1_1::max_local_dimension() const
 {
     return 10;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_1_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_1_1::num_facet_dofs() const
 {
     return 6;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_1_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -22843,10 +17653,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -22884,14 +17694,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_1_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -22928,40 +17738,40 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_1_1::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_1_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_1_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_1::UFC_SolitaryWave3DLinearForm_dof_map_1() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_1_1::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_1_1();
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_1::solitarywave3d_1_dof_map_1() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_1::~UFC_SolitaryWave3DLinearForm_dof_map_1()
+solitarywave3d_1_dof_map_1::~solitarywave3d_1_dof_map_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_1::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Lagrange', 'tetrahedron', 2), FiniteElement('Lagrange', 'tetrahedron', 2)])";
+const char* solitarywave3d_1_dof_map_1::signature() const
+{
+    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_1::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return true;
@@ -22980,57 +17790,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_1::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_1::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_1::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_1::init_cell_finalize()
+void solitarywave3d_1_dof_map_1::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_1::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_1::local_dimension(const ufc::cell& c) const
 {
     return 20;
 }
 
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_1::max_local_dimension() const
+{
+    return 20;
+}
+
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_1::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_1::num_facet_dofs() const
 {
     return 12;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_1::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -23060,10 +17876,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       dofs[0] = 1;
@@ -23125,14 +17941,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_1::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_1::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_1::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -23199,49 +18015,49 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_1::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_1::num_sub_dof_maps() const
 {
     return 2;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_1::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_1_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_1_1();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_2::UFC_SolitaryWave3DLinearForm_dof_map_2() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_1::create_sub_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_dof_map_1_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_dof_map_1_1();
+      break;
+    }
+    return 0;
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_2::solitarywave3d_1_dof_map_2() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_2::~UFC_SolitaryWave3DLinearForm_dof_map_2()
+solitarywave3d_1_dof_map_2::~solitarywave3d_1_dof_map_2()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_2::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_1_dof_map_2::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_2::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return false;
@@ -23260,57 +18076,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_2::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_2::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[3];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_2::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_2::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_2::init_cell_finalize()
+void solitarywave3d_1_dof_map_2::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_2::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_2::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_2::max_local_dimension() const
 {
     return 1;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_2::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_2::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_2::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_2::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_2::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -23318,10 +18140,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_2::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -23339,14 +18161,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_2::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_2::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_2::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -23356,40 +18178,40 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_2::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_2::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_2::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_3::UFC_SolitaryWave3DLinearForm_dof_map_3() : ufc::dof_map()
+ufc::dof_map* solitarywave3d_1_dof_map_2::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_2();
+}
+
+
+/// Constructor
+solitarywave3d_1_dof_map_3::solitarywave3d_1_dof_map_3() : ufc::dof_map()
 {
     __global_dimension = 0;
 }
 
 /// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_3::~UFC_SolitaryWave3DLinearForm_dof_map_3()
+solitarywave3d_1_dof_map_3::~solitarywave3d_1_dof_map_3()
 {
     // Do nothing
 }
 
 /// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_3::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
+const char* solitarywave3d_1_dof_map_3::signature() const
+{
+    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
 }
 
 /// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_3::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
+bool solitarywave3d_1_dof_map_3::needs_mesh_entities(unsigned int d) const
+{
+    switch ( d )
     {
     case 0:
       return false;
@@ -23408,57 +18230,63 @@ bool UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_3::init_mesh(const ufc::mesh& m)
+bool solitarywave3d_1_dof_map_3::init_mesh(const ufc::mesh& m)
 {
     __global_dimension = m.num_entities[3];
     return false;
 }
 
 /// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_3::init_cell(const ufc::mesh& m,
+void solitarywave3d_1_dof_map_3::init_cell(const ufc::mesh& m,
                               const ufc::cell& c)
 {
     // Do nothing
 }
 
 /// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_3::init_cell_finalize()
+void solitarywave3d_1_dof_map_3::init_cell_finalize()
 {
     // Do nothing
 }
 
 /// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::global_dimension() const
+unsigned int solitarywave3d_1_dof_map_3::global_dimension() const
 {
     return __global_dimension;
 }
 
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::local_dimension() const
+/// Return the dimension of the local finite element function space for a cell
+unsigned int solitarywave3d_1_dof_map_3::local_dimension(const ufc::cell& c) const
+{
+    return 1;
+}
+
+/// Return the maximum dimension of the local finite element function space
+unsigned int solitarywave3d_1_dof_map_3::max_local_dimension() const
 {
     return 1;
 }
 
 // Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::geometric_dimension() const
+unsigned int solitarywave3d_1_dof_map_3::geometric_dimension() const
 {
     return 3;
 }
 
 /// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::num_facet_dofs() const
+unsigned int solitarywave3d_1_dof_map_3::num_facet_dofs() const
 {
     return 0;
 }
 
 /// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::num_entity_dofs(unsigned int d) const
+unsigned int solitarywave3d_1_dof_map_3::num_entity_dofs(unsigned int d) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_3::tabulate_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_3::tabulate_dofs(unsigned int* dofs,
                                   const ufc::mesh& m,
                                   const ufc::cell& c) const
 {
@@ -23466,10 +18294,10 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_3::tabulate_facet_dofs(unsigned int* dofs,
                                         unsigned int facet) const
 {
-    switch (facet)
+    switch ( facet )
     {
     case 0:
       
@@ -23487,14 +18315,14 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
+void solitarywave3d_1_dof_map_3::tabulate_entity_dofs(unsigned int* dofs,
                                   unsigned int d, unsigned int i) const
 {
     throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
 }
 
 /// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_3::tabulate_coordinates(double** coordinates,
+void solitarywave3d_1_dof_map_3::tabulate_coordinates(double** coordinates,
                                          const ufc::cell& c) const
 {
     const double * const * x = c.coordinates;
@@ -23504,646 +18332,32 @@ void UFC_SolitaryWave3DLinearForm_dof_ma
 }
 
 /// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_3::num_sub_dof_maps() const
+unsigned int solitarywave3d_1_dof_map_3::num_sub_dof_maps() const
 {
     return 1;
 }
 
 /// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_3::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_3();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_0::UFC_SolitaryWave3DLinearForm_dof_map_4_0() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_0::~UFC_SolitaryWave3DLinearForm_dof_map_4_0()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_4_0::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_0::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_0::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_0::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_0::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_4_0::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_4_0();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_1::UFC_SolitaryWave3DLinearForm_dof_map_4_1() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_1::~UFC_SolitaryWave3DLinearForm_dof_map_4_1()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_4_1::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_1::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_1::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_1::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_1::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_4_1::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_4_1();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_2::UFC_SolitaryWave3DLinearForm_dof_map_4_2() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_4_2::~UFC_SolitaryWave3DLinearForm_dof_map_4_2()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_4_2::signature() const
-{
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_2::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_4_2::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::local_dimension() const
-{
-    return 1;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4_2::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4_2::num_sub_dof_maps() const
-{
-    return 1;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_4_2::create_sub_dof_map(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_dof_map_4_2();
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_dof_map_4::UFC_SolitaryWave3DLinearForm_dof_map_4() : ufc::dof_map()
-{
-    __global_dimension = 0;
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_dof_map_4::~UFC_SolitaryWave3DLinearForm_dof_map_4()
-{
-    // Do nothing
-}
-
-/// Return a string identifying the dof map
-const char* UFC_SolitaryWave3DLinearForm_dof_map_4::signature() const
-{
-    return "FFC dof map for MixedElement([FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)])";
-}
-
-/// Return true iff mesh entities of topological dimension d are needed
-bool UFC_SolitaryWave3DLinearForm_dof_map_4::needs_mesh_entities(unsigned int d) const
-{
-    switch (d)
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-}
-
-/// Initialize dof map for mesh (return true iff init_cell() is needed)
-bool UFC_SolitaryWave3DLinearForm_dof_map_4::init_mesh(const ufc::mesh& m)
-{
-    __global_dimension = 3*m.num_entities[3];
-    return false;
-}
-
-/// Initialize dof map for given cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4::init_cell(const ufc::mesh& m,
-                              const ufc::cell& c)
-{
-    // Do nothing
-}
-
-/// Finish initialization of dof map for cells
-void UFC_SolitaryWave3DLinearForm_dof_map_4::init_cell_finalize()
-{
-    // Do nothing
-}
-
-/// Return the dimension of the global finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::global_dimension() const
-{
-    return __global_dimension;
-}
-
-/// Return the dimension of the local finite element function space
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::local_dimension() const
-{
-    return 3;
-}
-
-// Return the geometric dimension of the coordinates this dof map provides
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::geometric_dimension() const
-{
-    return 3;
-}
-
-/// Return the number of dofs on each cell facet
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::num_facet_dofs() const
-{
-    return 0;
-}
-
-/// Return the number of dofs associated with each cell entity of dimension d
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::num_entity_dofs(unsigned int d) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the local-to-global mapping of dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4::tabulate_dofs(unsigned int* dofs,
-                                  const ufc::mesh& m,
-                                  const ufc::cell& c) const
-{
-    dofs[0] = c.entity_indices[3][0];
-    unsigned int offset = m.num_entities[3];
-    dofs[1] = offset + c.entity_indices[3][0];
-    offset = offset + m.num_entities[3];
-    dofs[2] = offset + c.entity_indices[3][0];
-}
-
-/// Tabulate the local-to-local mapping from facet dofs to cell dofs
-void UFC_SolitaryWave3DLinearForm_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
-                                        unsigned int facet) const
-{
-    switch (facet)
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-}
-
-/// Tabulate the local-to-local mapping of dofs on entity (d, i)
-void UFC_SolitaryWave3DLinearForm_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
-                                  unsigned int d, unsigned int i) const
-{
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-}
-
-/// Tabulate the coordinates of all dofs on a cell
-void UFC_SolitaryWave3DLinearForm_dof_map_4::tabulate_coordinates(double** coordinates,
-                                         const ufc::cell& c) const
-{
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-    coordinates[1][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[1][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[1][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-    coordinates[2][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[2][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[2][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-}
-
-/// Return the number of sub dof maps (for a mixed element)
-unsigned int UFC_SolitaryWave3DLinearForm_dof_map_4::num_sub_dof_maps() const
-{
-    return 3;
-}
-
-/// Create a new dof_map for sub dof map i (for a mixed element)
-ufc::dof_map* UFC_SolitaryWave3DLinearForm_dof_map_4::create_sub_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_4_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_4_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_4_2();
-      break;
-    }
-    return 0;
-}
-
-
-/// Constructor
-UFC_SolitaryWave3DLinearForm_cell_integral_0_quadrature::UFC_SolitaryWave3DLinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_cell_integral_0_quadrature::~UFC_SolitaryWave3DLinearForm_cell_integral_0_quadrature()
+ufc::dof_map* solitarywave3d_1_dof_map_3::create_sub_dof_map(unsigned int i) const
+{
+    return new solitarywave3d_1_dof_map_3();
+}
+
+
+/// Constructor
+solitarywave3d_1_cell_integral_0_quadrature::solitarywave3d_1_cell_integral_0_quadrature() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_cell_integral_0_quadrature::~solitarywave3d_1_cell_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave3DLinearForm_cell_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave3d_1_cell_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
@@ -24160,7 +18374,7 @@ void UFC_SolitaryWave3DLinearForm_cell_i
     const double J_20 = x[1][2] - x[0][2];
     const double J_21 = x[2][2] - x[0][2];
     const double J_22 = x[3][2] - x[0][2];
-      
+    
     // Compute sub determinants
     const double d_00 = J_11*J_22 - J_12*J_21;
     const double d_01 = J_12*J_20 - J_10*J_22;
@@ -24173,10 +18387,10 @@ void UFC_SolitaryWave3DLinearForm_cell_i
     const double d_20 = J_01*J_12 - J_02*J_11;
     const double d_21 = J_02*J_10 - J_00*J_12;
     const double d_22 = J_00*J_11 - J_01*J_10;
-      
+    
     // Compute determinant of Jacobian
     double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
-      
+    
     // Compute inverse of Jacobian
     const double Jinv_00 = d_00 / detJ;
     const double Jinv_01 = d_10 / detJ;
@@ -24193,161 +18407,549 @@ void UFC_SolitaryWave3DLinearForm_cell_i
     
     
     // Array of quadrature weights
-    const static double W27[27] = {0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384, 0.0140327598874417, 0.0130602412264747, 0.00267468981037392, 0.0160098281154818, 0.0149002918071527, 0.00305152546397085, 0.0048766033448291, 0.00453863791300947, 0.000929496505339815, 0.00877047492965105, 0.00816265076654668, 0.0016716811314837, 0.0100061425721761, 0.00931268237947044, 0.00190720341498178, 0.00304787709051818, 0.00283664869563092, 0.000580935315837384};
-    
-    
-    const static double FE0_C1_D100[27][7] = \
-    {{-1.99865811288677, -0.619120480633141, 0.2919760962926, 0.328486271453771, -0.2919760962926, -0.328486271453771, 2.61777859351991},
-    {-1.11229755309379, -0.731703032991766, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, 1.84400058608555},
-    {0.0457477733980357, -0.878794075302896, 2.82000883955399, 0.104533009146939, -2.82000883955399, -0.104533009146939, 0.833046301904861},
-    {-0.942926908148453, -0.753215925563414, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, 1.69614283371187},
-    {-0.368625431583845, -0.82616177738479, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, 1.19478720896864},
-    {0.381709331831541, -0.921466788258062, 2.82000883955399, 0.483167280535609, -2.82000883955399, -0.48316728053561, 0.539757456426521},
-    {0.301373419046404, -0.911262789436721, 0.291976096292598, 2.92066011219053, -0.291976096292598, -2.92066011219053, 0.609889370390317},
-    {0.507877469881381, -0.937492242968394, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, 0.429614773087012},
-    {0.77767856643167, -0.971761475441781, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, 0.194082909010111},
-    {-0.689768816126815, 0.689768816126816, 0.2919760962926, 0.32848627145377, -0.2919760962926, -0.32848627145377, 0},
-    {-0.19029726005101, 0.190297260051011, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, 0},
-    {0.462270924350466, -0.462270924350466, 2.82000883955399, 0.104533009146939, -2.82000883955399, -0.104533009146939, 0},
-    {-0.0948554912925193, 0.09485549129252, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, 0},
-    {0.228768172900473, -0.228768172900473, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, 0},
-    {0.651588060044801, -0.651588060044802, 2.82000883955399, 0.48316728053561, -2.82000883955399, -0.48316728053561, 0},
-    {0.606318104241563, -0.606318104241563, 0.291976096292599, 2.92066011219053, -0.291976096292599, -2.92066011219053, 0},
-    {0.722684856424887, -0.722684856424888, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, 0},
-    {0.874720020936725, -0.874720020936726, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, 0},
-    {0.619120480633142, 1.99865811288677, 0.291976096292599, 0.328486271453769, -0.291976096292599, -0.328486271453769, -2.61777859351991},
-    {0.731703032991767, 1.11229755309379, 1.38801506415341, 0.231390415744571, -1.38801506415341, -0.231390415744571, -1.84400058608555},
-    {0.878794075302896, -0.0457477733980358, 2.82000883955399, 0.10453300914694, -2.82000883955399, -0.10453300914694, -0.833046301904861},
-    {0.753215925563415, 0.942926908148454, 0.291976096292599, 1.51831292112236, -0.291976096292599, -1.51831292112236, -1.69614283371187},
-    {0.82616177738479, 0.368625431583845, 1.38801506415341, 1.06952128164754, -1.38801506415341, -1.06952128164754, -1.19478720896864},
-    {0.921466788258061, -0.381709331831542, 2.82000883955399, 0.483167280535611, -2.82000883955399, -0.483167280535611, -0.53975745642652},
-    {0.911262789436721, -0.301373419046404, 0.291976096292599, 2.92066011219053, -0.291976096292599, -2.92066011219053, -0.609889370390318},
-    {0.937492242968393, -0.507877469881382, 1.38801506415341, 2.05735464869637, -1.38801506415341, -2.05735464869637, -0.429614773087012},
-    {0.97176147544178, -0.777678566431672, 2.82000883955399, 0.929431202319459, -2.82000883955399, -0.929431202319459, -0.194082909010108}};
-    // Array of non-zero columns
-    static const unsigned int nzc2[7] = {10, 11, 15, 16, 17, 18, 19};
+    static const double W125[125] = {0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565251, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.00225090157446143, 0.00347412941301361, 0.00245558995953753, 0.00088245817276838, 0.000113249435042247, 0.00388807060532275, 0.00600100004508522, 0.00424163688396193, 0.00152430462570915, 0.00019562019257218, 0.0034046010087031, 0.0052547941847441, 0.00371420241029555, 0.00133476204345558, 0.000171295424533231, 0.00171893840164765, 0.00265307667295562, 0.00187525208922536, 0.000673903851785402, 8.64848134932762e-05, 0.000366257730507922, 0.000565296487744311, 0.00039956380849458, 0.000143590075769372, 1.8427496577589e-05, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565252, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06};
+    // Quadrature points on the UFC reference element: (0.0434850684329929, 0.0384332743963333, 0.034578939918215), (0.0372285899889251, 0.0329036302803046, 0.173480320771696), (0.0274810994988124, 0.0242885357160768, 0.389886387065519), (0.0164705687743685, 0.0145571321830714, 0.634333472630887), (0.0067089045501621, 0.00592951049099777, 0.851054212947016), (0.0363203493206216, 0.191166323793956, 0.034578939918215), (0.0310947054204484, 0.163661986623795, 0.173480320771696), (0.0229532381913956, 0.120810681788372, 0.389886387065519), (0.0137568327003139, 0.0724068788863314, 0.634333472630887), (0.00560352704046152, 0.0294932643722359, 0.851054212947016), (0.025452983470971, 0.42283010559815, 0.034578939918215), (0.0217908978824722, 0.361994799675747, 0.173480320771696), (0.0160854287808059, 0.267214393854326, 0.389886387065519), (0.00964066816216436, 0.160152727938308, 0.634333472630887), (0.00392690279162666, 0.0652345028216781, 0.851054212947016), (0.0137918067694829, 0.671415856030076, 0.034578939918215), (0.0118074902013492, 0.574814908126993, 0.173480320771696), (0.00871595763232119, 0.42431222048264, 0.389886387065519), (0.00522383682733774, 0.254308005746508, 0.634333472630887), (0.00212780888992548, 0.103586473561889, 0.851054212947016), (0.00446245462992895, 0.870293213094632, 0.034578939918215), (0.00382041237943087, 0.745078491721125, 0.173480320771696), (0.00282012111543484, 0.54999601573695, 0.389886387065519), (0.00169021617151183, 0.329635544721039, 0.634333472630887), (0.000688470393412244, 0.134269401146344, 0.851054212947016), (0.213916656125506, 0.0384332743963333, 0.034578939918215), (0.183139081291086, 0.0329036302803046, 0.173480320771696), (0.135188126023001, 0.0242885357160768, 0.389886387065519), (0.0810238806942951, 0.0145571321830714, 0.634333472630887), (0.0330032003938849, 0.00592951049099777, 0.851054212947016), (0.178671161296432, 0.191166323793956, 0.034578939918215), (0.152964584084757, 0.163661986623795, 0.173480320771696), (0.112914159689587, 0.120810681788372, 0.389886387065519), (0.0676741639412116, 0.0724068788863314, 0.634333472630887), (0.027565502601231, 0.0294932643722359, 0.851054212947016), (0.125211188776624, 0.42283010559815, 0.034578939918215), (0.107196244066483, 0.361994799675747, 0.173480320771696), (0.0791292565731431, 0.267214393854326, 0.389886387065519), (0.0474254628170509, 0.160152727938308, 0.634333472630887), (0.0193176633816068, 0.0652345028216781, 0.851054212947016), (0.0678462123292524, 0.671415856030076, 0.034578939918215), (0.0580847383280397, 0.574814908126993, 0.173480320771696), (0.0428765224208113, 0.42431222048264, 0.389886387065519), (0.0256976876550462, 0.254308005746508, 0.634333472630887), (0.0104673576243388, 0.103586473561889, 0.851054212947016), (0.0219522104240708, 0.870293213094632, 0.034578939918215), (0.0187938037280005, 0.745078491721125, 0.173480320771696), (0.0138730580546826, 0.54999601573695, 0.389886387065519), (0.00831470213956798, 0.329635544721039, 0.634333472630887), (0.00338680125632329, 0.134269401146344, 0.851054212947016), (0.463493892842726, 0.0384332743963333, 0.034578939918215), (0.396808024474, 0.0329036302803046, 0.173480320771696), (0.292912538609202, 0.0242885357160768, 0.389886387065519), (0.175554697593021, 0.0145571321830714, 0.634333472630887), (0.0715081382809929, 0.00592951049099777, 0.851054212947016), (0.387127368143914, 0.191166323793956, 0.034578939918215), (0.331428846302255, 0.163661986623795, 0.173480320771696), (0.244651465573054, 0.120810681788372, 0.389886387065519), (0.146629824241391, 0.0724068788863314, 0.634333472630887), (0.0597262613403738, 0.0294932643722359, 0.851054212947016), (0.271295477241817, 0.42283010559815, 0.034578939918215), (0.232262439776279, 0.361994799675747, 0.173480320771696), (0.171449609540077, 0.267214393854326, 0.389886387065519), (0.102756899715403, 0.160152727938308, 0.634333472630887), (0.0418556421156527, 0.0652345028216781, 0.851054212947016), (0.147002602025855, 0.671415856030076, 0.034578939918215), (0.125852385550656, 0.574814908126993, 0.173480320771696), (0.0929006962259202, 0.42431222048264, 0.389886387065519), (0.0556792608113027, 0.254308005746508, 0.634333472630887), (0.0226796567455474, 0.103586473561889, 0.851054212947016), (0.0475639234935763, 0.870293213094632, 0.034578939918215), (0.0407205937535897, 0.745078491721125, 0.173480320771696), (0.0300587985987655, 0.54999601573695, 0.389886387065519), (0.0180154913240372, 0.329635544721039, 0.634333472630887), (0.00733819295331972, 0.134269401146344, 0.851054212947016), (0.713071129559946, 0.0384332743963333, 0.034578939918215), (0.610476967656914, 0.0329036302803046, 0.173480320771696), (0.450636951195403, 0.0242885357160768, 0.389886387065519), (0.270085514491747, 0.0145571321830714, 0.634333472630887), (0.110013076168101, 0.00592951049099777, 0.851054212947016), (0.595583574991397, 0.191166323793956, 0.034578939918215), (0.509893108519752, 0.163661986623795, 0.173480320771696), (0.376388771456521, 0.120810681788372, 0.389886387065519), (0.22558548454157, 0.0724068788863314, 0.634333472630887), (0.0918870200795167, 0.0294932643722359, 0.851054212947016), (0.417379765707011, 0.42283010559815, 0.034578939918215), (0.357328635486074, 0.361994799675747, 0.173480320771696), (0.263769962507011, 0.267214393854326, 0.389886387065519), (0.158088336613754, 0.160152727938308, 0.634333472630887), (0.0643936208496987, 0.0652345028216781, 0.851054212947016), (0.226158991722457, 0.671415856030076, 0.034578939918215), (0.193620032773272, 0.574814908126993, 0.173480320771696), (0.142924870031029, 0.42431222048264, 0.389886387065519), (0.0856608339675592, 0.254308005746508, 0.634333472630887), (0.0348919558667561, 0.103586473561889, 0.851054212947016), (0.0731756365630818, 0.870293213094632, 0.034578939918215), (0.062647383779179, 0.745078491721125, 0.173480320771696), (0.0462445391428484, 0.54999601573695, 0.389886387065519), (0.0277162805085065, 0.329635544721039, 0.634333472630887), (0.0112895846503162, 0.134269401146344, 0.851054212947016), (0.883502717252459, 0.0384332743963333, 0.034578939918215), (0.756387458959075, 0.0329036302803046, 0.173480320771696), (0.558343977719591, 0.0242885357160768, 0.389886387065519), (0.334638826411673, 0.0145571321830714, 0.634333472630887), (0.136307372011824, 0.00592951049099777, 0.851054212947016), (0.737934386967207, 0.191166323793956, 0.034578939918215), (0.631762987184061, 0.163661986623795, 0.173480320771696), (0.466349692954713, 0.120810681788372, 0.389886387065519), (0.279502815782468, 0.0724068788863314, 0.634333472630887), (0.113848995640286, 0.0294932643722359, 0.851054212947016), (0.517137971012664, 0.42283010559815, 0.034578939918215), (0.442733981670085, 0.361994799675747, 0.173480320771696), (0.326813790299348, 0.267214393854326, 0.389886387065519), (0.195873131268641, 0.160152727938308, 0.634333472630887), (0.0797843814396788, 0.0652345028216781, 0.851054212947016), (0.280213397282226, 0.671415856030076, 0.034578939918215), (0.239897280899962, 0.574814908126993, 0.173480320771696), (0.177085434819519, 0.42431222048264, 0.389886387065519), (0.106134684795268, 0.254308005746508, 0.634333472630887), (0.0432315046011695, 0.103586473561889, 0.851054212947016), (0.0906653923572237, 0.870293213094632, 0.034578939918215), (0.0776207751277486, 0.745078491721125, 0.173480320771696), (0.0572974760820962, 0.54999601573695, 0.389886387065519), (0.0343407664765626, 0.329635544721039, 0.634333472630887), (0.0139879155132272, 0.134269401146344, 0.851054212947016)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE1_C0[125][10] = \
+    {{0.677651385532498, -0.0397031660797488, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.00601467027473595, 0.00668509426891429, 0.12220234950981, 0.135823609448279, 0.153676704481833},
+    {0.387856517182057, -0.0344566541637981, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.0258337109326268, 0.00489982304341057, 0.524873356031632, 0.0995515731929938, 0.112636954329409},
+    {0.0651520171918798, -0.0259706778394852, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.0428580263847204, 0.00266990266677583, 0.870762864851529, 0.0542454305787948, 0.0613756256250992},
+    {-0.110672538127309, -0.015928009502866, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.0417913323474042, 0.000959056987115393, 0.849090435339365, 0.0194855265186504, 0.0220467672199497},
+    {-0.0991479726822843, -0.00661888574963566, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.0228385659266996, 0.000159122079653143, 0.464019852825595, 0.00323294396937779, 0.0036578925932431},
+    {0.351159931970128, -0.0336820137710776, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0050236767078656, 0.0277729106341423, 0.102067955322095, 0.564272815830671, 0.107208138841391},
+    {0.166485956767395, -0.0291609440100794, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.0215772778825633, 0.0203560850503691, 0.438393782673502, 0.413582342231706, 0.0785779359281236},
+    {-0.0313856207168029, -0.0218995359044537, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.0357966204395903, 0.0110919854206136, 0.727293587580909, 0.225360097430627, 0.0428169423314949},
+    {-0.123259167721812, -0.013378331808425, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.0349056778367692, 0.00398435727676459, 0.709191966981616, 0.080951706122999, 0.0153802939039443},
+    {-0.0879258080236823, -0.00554072800987512, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0190756211805894, 0.000661065217685219, 0.387566669517808, 0.01343111410773, 0.00255182370239899},
+    {0.0177253911135257, -0.0241572747358239, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0035205487447283, 0.0430491507552746, 0.071528331316298, 0.874646011568391, 0.0526508169135872},
+    {-0.0507072246191906, -0.0208412114214236, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0151211678182184, 0.0315527668548808, 0.307222532626625, 0.641069596017233, 0.0385902839346927},
+    {-0.113199283239695, -0.0155679467426812, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.0250859588469928, 0.0171930324062, 0.509680991772005, 0.349317395512301, 0.0210277597937817},
+    {-0.119140564162676, -0.00945478319693843, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.0244615940551512, 0.00617591722127442, 0.49699553421089, 0.125478465209964, 0.00755339144178017},
+    {-0.0670532863962545, -0.00389606166055687, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0133680286585892, 0.00102467820496327, 0.271603335806442, 0.0208187778246103, 0.00125322204081482},
+    {-0.123174301249333, -0.0134113789015495, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00190762423058253, 0.0370401509933353, 0.038757928915604, 0.752558872029367, 0.0154585961181473},
+    {-0.124795870133571, -0.0115286565516393, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.00819346875055506, 0.0271484855811957, 0.166469828971132, 0.551586133921709, 0.0113303391742265},
+    {-0.114366932369083, -0.00856402179742438, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0135929329243276, 0.0147931493464113, 0.276172801534836, 0.300558056253616, 0.00617387658875252},
+    {-0.083605542162086, -0.00516925988494044, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0132546182205693, 0.00531385410362168, 0.269299132691067, 0.107963600123275, 0.00221772110036569},
+    {-0.0394935786210076, -0.00211875374858136, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.00724352288046892, 0.00088164887728405, 0.147169416491454, 0.0179127964336388, 0.000367953519260986},
+    {-0.0742249656146451, -0.00442262762728059, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.000617227802144495, 0.0155345759126796, 0.0125404526199273, 0.315621902524215, 0.00161836079959531},
+    {-0.0655708056648836, -0.00379122127793308, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.00265106546025557, 0.0113860283736764, 0.0538627078708379, 0.23133428023363, 0.00118617348079641},
+    {-0.0507314745513395, -0.00280421494922342, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.00439810733113653, 0.00620422150953917, 0.0893580237504861, 0.126053534227744, 0.000646343288641082},
+    {-0.0319821899921671, -0.00168450251009896, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0042886427742881, 0.00222862131357039, 0.0871339906075373, 0.0452797490545588, 0.000232173275363283},
+    {-0.0135965919524168, -0.000687522410446964, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.00234370251521121, 0.000369762029721776, 0.0476178977115156, 0.00751259615698667, 3.85210627857485e-05},
+    {0.303869742063848, -0.12239598458967, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0295880447986775, 0.0328860701712706, 0.0986289749858682, 0.109622633545923, 0.610151166460404},
+    {0.134887288422247, -0.1160592350988, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.127084106272845, 0.0241037624827062, 0.423622960691414, 0.0803476337536982, 0.447208764024221},
+    {-0.0444896276300268, -0.0986364671877792, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.210832040117064, 0.0131340865091965, 0.702788851119186, 0.0437812467363741, 0.2436830597953},
+    {-0.124193144215204, -0.0678941422087684, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.205584638427372, 0.004717901365009, 0.685297129259398, 0.0157266821407568, 0.0875335060137464},
+    {-0.0858073223121642, -0.030824777921407, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.112350050943802, 0.000782771291888182, 0.374508367808493, 0.00260929475714278, 0.0145231343948943},
+    {0.113856014607669, -0.114824393538401, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0247130374063482, 0.136623636292144, 0.0823785946236127, 0.45542209017267, 0.425654435971174},
+    {0.0100888557121195, -0.106168256116312, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.106145380454931, 0.100137950857575, 0.353825680101135, 0.333800476424499, 0.311982349089632},
+    {-0.0930517568994226, -0.0874149447727761, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.17609477507965, 0.0545649464626408, 0.58699543294085, 0.1818871363886, 0.169998487382437},
+    {-0.12380786286986, -0.0585145790109275, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.171711949680883, 0.0196002999689002, 0.572385695137502, 0.0653357634308634, 0.0610652362544955},
+    {-0.0750005711613296, -0.026045788733914, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0938389484831186, 0.00325198662308666, 0.312803342215279, 0.0108401927023285, 0.0101316475640852},
+    {-0.0689680280637322, -0.0938555051869132, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0173186806951808, 0.211772240689959, 0.0577301993658455, 0.705922921633706, 0.209042466541935},
+    {-0.101961128009395, -0.084214174582561, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0743857552246981, 0.155217931587356, 0.247957945220146, 0.517404431284758, 0.153217150486034},
+    {-0.124620776265111, -0.0666063780815064, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.123405679825933, 0.0845779053253436, 0.411361270793064, 0.281932522593157, 0.0834876841580225},
+    {-0.108104492267147, -0.0429271137702279, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.120334234079468, 0.03038126897555, 0.401122894186573, 0.101273113455689, 0.0299896501195402},
+    {-0.0561005440374291, -0.0185713191445566, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0657615152208353, 0.00504071266550263, 0.219209849244195, 0.0168027433640709, 0.00497573716598929},
+    {-0.12386321264862, -0.0586399952744004, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00938420039924693, 0.182212090917773, 0.0312813527469397, 0.607386932104929, 0.0613761238902858},
+    {-0.118642598591026, -0.051337064674766, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0403062361483535, 0.13355189410245, 0.134357061573334, 0.445182725400454, 0.0449854757548079},
+    {-0.102069833084256, -0.0391997300710066, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0668678896663356, 0.0727721297397925, 0.222897844792828, 0.242579075860235, 0.0245124855775079},
+    {-0.0709852770155237, -0.0243769453534135, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0652036137952374, 0.0261405107994058, 0.217350137116399, 0.0871369434274908, 0.00880514142227651},
+    {-0.0324570586983408, -0.0102482264730672, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0356331552184666, 0.00433710665526561, 0.118779784153456, 0.0144573386556573, 0.00146090632108002},
+    {-0.0624662889902574, -0.0209884113390654, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00303633666130402, 0.0764194389779763, 0.0101213437607678, 0.254737039458918, 0.00642546788699245},
+    {-0.0547979943904275, -0.0180873896108673, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0130414203970155, 0.0560114357414459, 0.043472352934078, 0.18670887286586, 0.00470953053927457},
+    {-0.0419674243417796, -0.0134881345751054, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0216356659299618, 0.0305205066246512, 0.0721204651516608, 0.101737249112632, 0.00256621270496322},
+    {-0.0261798960980541, -0.00817643359622851, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0210971755283347, 0.0109632854758787, 0.0703254578534908, 0.0365450848922505, 0.000921810467379901},
+    {-0.0110346752071629, -0.00336386041082359, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0115294059104329, 0.00181897510595286, 0.0384321943162941, 0.00606338308075562, 0.000152942317908342},
+    {-0.0338407154377174, -0.0338407154377172, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0641085098922729, 0.0712543518585967, 0.0641085098922728, 0.0712543518585967, 0.859306354810017},
+    {-0.0818948079000829, -0.0818948079000828, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.27535353348213, 0.0522256981182022, 0.275353533482129, 0.0522256981182022, 0.629826433147834},
+    {-0.121317028060228, -0.121317028060227, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.456810445618125, 0.0284576666227853, 0.456810445618125, 0.0284576666227853, 0.343191021097949},
+    {-0.113915793899067, -0.113915793899067, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.445440883843385, 0.0102222917528829, 0.445440883843385, 0.0102222917528829, 0.123277807387908},
+    {-0.0612813106001657, -0.0612813106001656, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.243429209376147, 0.00169603302451547, 0.243429209376147, 0.00169603302451546, 0.0204536553616545},
+    {-0.0873921698118468, -0.0873921698118467, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0535458160149806, 0.296022863232407, 0.0535458160149805, 0.296022863232407, 0.599470396664135},
+    {-0.111738685979768, -0.111738685979767, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.229985530278033, 0.216969213641037, 0.229985530278033, 0.216969213641037, 0.439380320644974},
+    {-0.124942786358968, -0.124942786358967, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.38154510401025, 0.118226041425621, 0.38154510401025, 0.118226041425621, 0.239417358428173},
+    {-0.103629213527269, -0.103629213527268, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.372048822409193, 0.0424680316998818, 0.372048822409192, 0.0424680316998817, 0.0860012214282448},
+    {-0.0525918087529765, -0.0525918087529765, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.203321145349199, 0.00704608966270762, 0.203321145349198, 0.00704608966270757, 0.0142689051747946},
+    {-0.124093005298086, -0.124093005298086, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0375244400305132, 0.458847581161833, 0.037524440030513, 0.458847581161833, 0.294404943887462},
+    {-0.12437075791462, -0.12437075791462, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.161171850222422, 0.336311181436057, 0.161171850222422, 0.336311181436057, 0.215783363723318},
+    {-0.112659672317187, -0.112659672317187, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.267383475309499, 0.183255213959251, 0.267383475309499, 0.18325521395925, 0.11757987444578},
+    {-0.08163893883716, -0.0816389388371599, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.260728564133021, 0.0658271912156194, 0.26072856413302, 0.0658271912156194, 0.0422359217564853},
+    {-0.0383518525618255, -0.0383518525618255, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.142485682232515, 0.0109217280147868, 0.142485682232515, 0.0109217280147868, 0.00700757910765451},
+    {-0.103783072021111, -0.103783072021111, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0203327765730934, 0.394799511511351, 0.0203327765730932, 0.394799511511351, 0.0864390600094873},
+    {-0.094174739653074, -0.0941747396530738, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0873316488608436, 0.289367309751452, 0.0873316488608435, 0.289367309751452, 0.0633552917951636},
+    {-0.0756396175073989, -0.0756396175073988, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.144882867229582, 0.157675602800014, 0.144882867229582, 0.157675602800014, 0.0345221574370429},
+    {-0.0494789006423166, -0.0494789006423165, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.141276875455818, 0.0566387271134483, 0.141276875455818, 0.0566387271134482, 0.0124007203379724},
+    {-0.0216509230853557, -0.0216509230853557, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0772064696859616, 0.00939722265546143, 0.0772064696859615, 0.00939722265546143, 0.00205746732038352},
+    {-0.0430392698573708, -0.0430392698573707, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00657884021103599, 0.165578239218447, 0.00657884021103578, 0.165578239218447, 0.00904930727241116},
+    {-0.0374042602423, -0.0374042602422999, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0282568866655468, 0.121360154303653, 0.0282568866655467, 0.121360154303653, 0.00663266702257968},
+    {-0.0282517358523633, -0.0282517358523632, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0468780655408114, 0.0661288778686417, 0.0468780655408113, 0.0661288778686419, 0.0036141254928047},
+    {-0.0173663754687444, -0.0173663754687443, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0457113166909128, 0.0237541851840646, 0.0457113166909126, 0.0237541851840646, 0.00129823171058596},
+    {-0.00723049480167941, -0.00723049480167938, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0249808001133636, 0.00394117909335424, 0.0249808001133633, 0.00394117909335422, 0.000215396303280713},
+    {-0.12239598458967, 0.303869742063848, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0986289749858684, 0.109622633545923, 0.0295880447986773, 0.0328860701712705, 0.610151166460404},
+    {-0.1160592350988, 0.134887288422247, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.423622960691414, 0.0803476337536981, 0.127084106272845, 0.0241037624827062, 0.447208764024221},
+    {-0.0986364671877794, -0.0444896276300268, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.702788851119186, 0.0437812467363741, 0.210832040117064, 0.0131340865091965, 0.2436830597953},
+    {-0.0678941422087684, -0.124193144215204, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.685297129259398, 0.0157266821407568, 0.205584638427371, 0.00471790136500898, 0.0875335060137464},
+    {-0.030824777921407, -0.0858073223121641, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.374508367808493, 0.00260929475714279, 0.112350050943801, 0.000782771291888154, 0.0145231343948942},
+    {-0.114824393538401, 0.113856014607669, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0823785946236129, 0.45542209017267, 0.0247130374063481, 0.136623636292144, 0.425654435971174},
+    {-0.106168256116312, 0.0100888557121194, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.353825680101135, 0.333800476424499, 0.106145380454931, 0.100137950857575, 0.311982349089632},
+    {-0.0874149447727762, -0.0930517568994225, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.58699543294085, 0.1818871363886, 0.17609477507965, 0.0545649464626407, 0.169998487382437},
+    {-0.0585145790109276, -0.12380786286986, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.572385695137502, 0.0653357634308634, 0.171711949680883, 0.0196002999689001, 0.0610652362544955},
+    {-0.026045788733914, -0.0750005711613296, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.312803342215279, 0.0108401927023285, 0.0938389484831182, 0.00325198662308662, 0.0101316475640852},
+    {-0.0938555051869133, -0.0689680280637323, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0577301993658456, 0.705922921633706, 0.0173186806951807, 0.211772240689959, 0.209042466541935},
+    {-0.0842141745825612, -0.101961128009395, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.247957945220146, 0.517404431284758, 0.0743857552246979, 0.155217931587356, 0.153217150486034},
+    {-0.0666063780815065, -0.124620776265111, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.411361270793064, 0.281932522593158, 0.123405679825933, 0.0845779053253435, 0.0834876841580226},
+    {-0.042927113770228, -0.108104492267147, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.401122894186574, 0.101273113455689, 0.120334234079468, 0.0303812689755499, 0.0299896501195402},
+    {-0.0185713191445567, -0.0561005440374291, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.219209849244196, 0.016802743364071, 0.065761515220835, 0.00504071266550261, 0.00497573716598929},
+    {-0.0586399952744005, -0.12386321264862, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0312813527469399, 0.607386932104929, 0.00938420039924669, 0.182212090917773, 0.0613761238902859},
+    {-0.0513370646747661, -0.118642598591026, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.134357061573334, 0.445182725400454, 0.0403062361483534, 0.13355189410245, 0.0449854757548079},
+    {-0.0391997300710068, -0.102069833084256, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.222897844792828, 0.242579075860235, 0.0668678896663356, 0.0727721297397927, 0.024512485577508},
+    {-0.0243769453534136, -0.0709852770155237, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.217350137116399, 0.0871369434274908, 0.0652036137952371, 0.0261405107994057, 0.00880514142227651},
+    {-0.0102482264730672, -0.0324570586983408, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.118779784153457, 0.0144573386556573, 0.0356331552184663, 0.0043371066552656, 0.00146090632108002},
+    {-0.0209884113390655, -0.0624662889902573, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.010121343760768, 0.254737039458918, 0.00303633666130378, 0.0764194389779762, 0.00642546788699245},
+    {-0.0180873896108673, -0.0547979943904275, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0434723529340782, 0.186708872865861, 0.0130414203970153, 0.0560114357414458, 0.00470953053927457},
+    {-0.0134881345751056, -0.0419674243417795, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0721204651516608, 0.101737249112632, 0.0216356659299618, 0.0305205066246514, 0.00256621270496323},
+    {-0.00817643359622858, -0.0261798960980541, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0703254578534909, 0.0365450848922505, 0.0210971755283345, 0.0109632854758786, 0.000921810467379901},
+    {-0.00336386041082355, -0.0110346752071629, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0384321943162945, 0.00606338308075567, 0.0115294059104325, 0.00181897510595279, 0.000152942317908342},
+    {-0.0397031660797491, 0.677651385532497, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.12220234950981, 0.135823609448279, 0.00601467027473575, 0.00668509426891421, 0.153676704481834},
+    {-0.0344566541637982, 0.387856517182057, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.524873356031632, 0.0995515731929938, 0.0258337109326267, 0.00489982304341049, 0.112636954329409},
+    {-0.0259706778394854, 0.0651520171918798, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.870762864851529, 0.0542454305787948, 0.0428580263847204, 0.00266990266677576, 0.0613756256250995},
+    {-0.0159280095028661, -0.110672538127309, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.849090435339365, 0.0194855265186504, 0.0417913323474039, 0.000959056987115348, 0.0220467672199497},
+    {-0.00661888574963571, -0.0991479726822842, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.464019852825596, 0.0032329439693778, 0.0228385659266992, 0.000159122079653129, 0.00365789259324308},
+    {-0.0336820137710778, 0.351159931970128, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.102067955322096, 0.564272815830671, 0.00502367670786549, 0.0277729106341421, 0.107208138841391},
+    {-0.0291609440100797, 0.166485956767395, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.438393782673502, 0.413582342231706, 0.0215772778825632, 0.0203560850503691, 0.0785779359281241},
+    {-0.0218995359044539, -0.0313856207168029, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.727293587580909, 0.225360097430628, 0.0357966204395903, 0.0110919854206135, 0.0428169423314951},
+    {-0.0133783318084251, -0.123259167721811, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.709191966981616, 0.080951706122999, 0.034905677836769, 0.00398435727676454, 0.0153802939039443},
+    {-0.00554072800987505, -0.0879258080236823, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.387566669517808, 0.01343111410773, 0.0190756211805888, 0.000661065217685206, 0.00255182370239895},
+    {-0.0241572747358242, 0.0177253911135256, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0715283313162981, 0.874646011568391, 0.00352054874472815, 0.0430491507552746, 0.0526508169135876},
+    {-0.0208412114214238, -0.0507072246191906, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.307222532626626, 0.641069596017233, 0.0151211678182183, 0.0315527668548808, 0.0385902839346929},
+    {-0.0155679467426813, -0.113199283239695, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.509680991772005, 0.349317395512301, 0.0250859588469928, 0.0171930324062, 0.0210277597937819},
+    {-0.00945478319693848, -0.119140564162676, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.49699553421089, 0.125478465209964, 0.024461594055151, 0.00617591722127439, 0.00755339144178018},
+    {-0.00389606166055691, -0.0670532863962544, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.271603335806442, 0.0208187778246103, 0.013368028658589, 0.0010246782049633, 0.00125322204081482},
+    {-0.0134113789015497, -0.123174301249333, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0387579289156042, 0.752558872029367, 0.00190762423058235, 0.0370401509933354, 0.0154585961181475},
+    {-0.0115286565516395, -0.124795870133571, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.166469828971132, 0.551586133921708, 0.00819346875055494, 0.0271484855811958, 0.0113303391742266},
+    {-0.00856402179742457, -0.114366932369083, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.276172801534836, 0.300558056253616, 0.0135929329243277, 0.0147931493464114, 0.00617387658875262},
+    {-0.00516925988494049, -0.083605542162086, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.269299132691067, 0.107963600123275, 0.013254618220569, 0.0053138541036216, 0.00221772110036569},
+    {-0.00211875374858132, -0.0394935786210076, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.147169416491455, 0.0179127964336388, 0.00724352288046848, 0.000881648877284022, 0.000367953519260972},
+    {-0.00442262762728068, -0.074224965614645, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.0125404526199275, 0.315621902524215, 0.000617227802144259, 0.0155345759126795, 0.00161836079959531},
+    {-0.00379122127793318, -0.0655708056648835, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0538627078708381, 0.23133428023363, 0.00265106546025538, 0.0113860283736764, 0.00118617348079642},
+    {-0.00280421494922354, -0.0507314745513394, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0893580237504861, 0.126053534227744, 0.0043981073311365, 0.00620422150953936, 0.000646343288641096},
+    {-0.001684502510099, -0.031982189992167, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0871339906075375, 0.0452797490545588, 0.00428864277428789, 0.00222862131357036, 0.000232173275363283},
+    {-0.000687522410446992, -0.0135965919524168, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0476178977115159, 0.0075125961569867, 0.00234370251521104, 0.000369762029721762, 3.85210627857485e-05}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc0[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc4[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+    static const double FE1_C0_D001[125][7] = \
+    {{-2.53401086900984, -0.86168424032714, 0.153733097585334, 0.173940273731973, 3.39569510933698, -0.153733097585335, -0.173940273731971},
+    {-2.0255498358363, -0.306078716913217, 0.131614521121219, 0.148914359955701, 2.33162855274952, -0.131614521121219, -0.1489143599557},
+    {-1.23337591087837, 0.559545548262077, 0.0971541428643073, 0.10992439799525, 0.673830362616288, -0.097154142864307, -0.109924397995249},
+    {-0.338555305646693, 1.53733389052355, 0.0582285287322854, 0.0658822750974736, -1.19877858487685, -0.0582285287322848, -0.065882275097473},
+    {0.454770511952704, 2.40421685178806, 0.0237180419639913, 0.0268356182006482, -2.85898736374077, -0.0237180419639906, -0.0268356182006476},
+    {-1.95173754786883, -0.86168424032714, 0.764665295175825, 0.145281397282487, 2.81342178819597, -0.764665295175825, -0.145281397282486},
+    {-1.52705194873624, -0.306078716913217, 0.654647946495179, 0.124378821681794, 1.83313066564946, -0.654647946495179, -0.124378821681793},
+    {-0.865398771818851, 0.559545548262077, 0.483242727153488, 0.0918129527655822, 0.305853223556774, -0.483242727153488, -0.0918129527655815},
+    {-0.118011263129872, 1.53733389052355, 0.289627515545325, 0.0550273308012554, -1.41932262739368, -0.289627515545325, -0.0550273308012548},
+    {0.544604017438855, 2.40421685178806, 0.117973057488944, 0.0224141081618458, -2.94882086922692, -0.117973057488943, -0.0224141081618453},
+    {-1.06855188405066, -0.86168424032714, 1.6913204223926, 0.101811933883884, 1.9302361243778, -1.6913204223926, -0.101811933883883},
+    {-0.77093592668034, -0.306078716913217, 1.44797919870299, 0.0871635915298887, 1.07701464359356, -1.44797919870299, -0.0871635915298881},
+    {-0.307255161197394, 0.559545548262077, 1.0688575754173, 0.0643417151232234, -0.252290387064684, -1.0688575754173, -0.0643417151232229},
+    {0.216507474925436, 1.53733389052355, 0.640610911753232, 0.0385626726486572, -1.75384136544898, -0.640610911753231, -0.0385626726486566},
+    {0.680862474241284, 2.40421685178806, 0.260938011286713, 0.0157076111665065, -3.08507932602935, -0.260938011286712, -0.0157076111665059},
+    {-0.120853589128906, -0.86168424032714, 2.6856634241203, 0.0551672270779314, 0.982537829456046, -2.6856634241203, -0.0551672270779307},
+    {0.0404108764001508, -0.306078716913217, 2.29925963250797, 0.0472299608053964, 0.265667840513066, -2.29925963250797, -0.0472299608053958},
+    {0.291658260721922, 0.559545548262078, 1.69724888193056, 0.0348638305292845, -0.851203808984, -1.69724888193056, -0.034863830529284},
+    {0.575461260818928, 1.53733389052355, 1.01723202298603, 0.0208953473093509, -2.11279515134248, -1.01723202298603, -0.0208953473093502},
+    {0.827073981595321, 2.40421685178806, 0.414345894247555, 0.00851123555970183, -3.23129083338339, -0.414345894247554, -0.0085112355597012},
+    {0.637338430571104, -0.861684240327141, 3.48117285237853, 0.0178498185197156, 0.224345809756035, -3.48117285237853, -0.0178498185197148},
+    {0.689516899489004, -0.306078716913217, 2.9803139668845, 0.0152816495177237, -0.383438182575788, -2.9803139668845, -0.0152816495177229},
+    {0.770810095671614, 0.559545548262077, 2.1999840629478, 0.0112804844617394, -1.33035564393369, -2.1999840629478, -0.0112804844617387},
+    {0.862636934093748, 1.53733389052355, 1.31854217888416, 0.00676086468604747, -2.3999708246173, -1.31854217888415, -0.00676086468604671},
+    {0.94404833794709, 2.40421685178807, 0.537077604585377, 0.00275388157364889, -3.34826518973516, -0.537077604585376, -0.00275388157364832},
+    {-1.85228451823978, -0.86168424032714, 0.153733097585334, 0.855666624502025, 2.71396875856692, -0.153733097585334, -0.855666624502024},
+    {-1.44190787062765, -0.306078716913217, 0.131614521121219, 0.732556325164345, 1.74798658754087, -0.131614521121219, -0.732556325164345},
+    {-0.802547804781613, 0.559545548262077, 0.0971541428643073, 0.540752504092003, 0.243002256519535, -0.0971541428643072, -0.540752504092002},
+    {-0.0803420579669869, 1.53733389052355, 0.0582285287322856, 0.32409552277718, -1.45699183255656, -0.058228528732285, -0.32409552277718},
+    {0.559947695327595, 2.40421685178806, 0.0237180419639915, 0.132012801575539, -2.96416454711566, -0.0237180419639908, -0.132012801575539},
+    {-1.38233429996559, -0.86168424032714, 0.764665295175825, 0.714684645185728, 2.24401854029273, -0.764665295175825, -0.714684645185728},
+    {-1.03957243407901, -0.306078716913217, 0.654647946495179, 0.611858336339029, 1.34565115099223, -0.654647946495179, -0.611858336339028},
+    {-0.505555085826084, 0.559545548262077, 0.483242727153489, 0.45165663875835, -0.0539904624359933, -0.483242727153488, -0.451656638758349},
+    {0.0976580618337187, 1.53733389052355, 0.289627515545326, 0.270696655764846, -1.63499195235727, -0.289627515545325, -0.270696655764845},
+    {0.632451919681933, 2.40421685178806, 0.117973057488944, 0.110262010404924, -3.03666877147, -0.117973057488943, -0.110262010404923},
+    {-0.669519062828044, -0.86168424032714, 1.6913204223926, 0.500844755106496, 1.53120330315518, -1.6913204223926, -0.500844755106495},
+    {-0.429314541944297, -0.306078716913217, 1.44797919870299, 0.428784976265932, 0.735393258857514, -1.44797919870299, -0.428784976265932},
+    {-0.0550798500280451, 0.559545548262077, 1.06885757541731, 0.316517026292572, -0.504465698234032, -1.0688575754173, -0.316517026292572},
+    {0.367646653544982, 1.53733389052355, 0.640610911753232, 0.189701851268203, -1.90498054406853, -0.640610911753231, -0.189701851268203},
+    {0.742425516601204, 2.40421685178806, 0.260938011286713, 0.0772706535264272, -3.14664236838927, -0.260938011286712, -0.0772706535264267},
+    {0.0953640331101715, -0.86168424032714, 2.6856634241203, 0.271384849317009, 0.766320207216968, -2.6856634241203, -0.271384849317009},
+    {0.225519868906913, -0.306078716913217, 2.29925963250797, 0.232338953312159, 0.0805588480063039, -2.29925963250797, -0.232338953312158},
+    {0.428300519875882, 0.559545548262077, 1.69724888193056, 0.171506089683245, -0.98784606813796, -1.69724888193056, -0.171506089683244},
+    {0.657356664129762, 1.53733389052355, 1.01723202298603, 0.102790750620185, -2.19469055465331, -1.01723202298603, -0.102790750620184},
+    {0.860432176532974, 2.40421685178806, 0.414345894247555, 0.0418694304973552, -3.26464902832104, -0.414345894247554, -0.0418694304973546},
+    {0.707297453747672, -0.861684240327141, 3.48117285237853, 0.0878088416962831, 0.154386786579467, -3.48117285237853, -0.0878088416962823},
+    {0.749410464883283, -0.306078716913217, 2.9803139668845, 0.0751752149120021, -0.443331747970066, -2.9803139668845, -0.0751752149120014},
+    {0.815021843428605, 0.559545548262077, 2.1999840629478, 0.0554922322187304, -1.37456739169068, -2.1999840629478, -0.0554922322187298},
+    {0.889134877965972, 1.53733389052355, 1.31854217888416, 0.0332588085582721, -2.42646876848952, -1.31854217888415, -0.0332588085582713},
+    {0.954841661398734, 2.40421685178807, 0.537077604585377, 0.0135472050252931, -3.3590585131868, -0.537077604585376, -0.0135472050252925},
+    {-0.853975571370904, -0.86168424032714, 0.153733097585333, 1.8539755713709, 1.71565981169804, -0.153733097585333, -1.8539755713709},
+    {-0.587232097896, -0.306078716913217, 0.131614521121218, 1.587232097896, 0.893310814809216, -0.131614521121218, -1.587232097896},
+    {-0.171650154436808, 0.559545548262077, 0.0971541428643073, 1.17165015443681, -0.387895393825269, -0.0971541428643073, -1.17165015443681},
+    {0.297781209627916, 1.53733389052355, 0.0582285287322859, 0.702218790372083, -1.83511510015146, -0.0582285287322854, -0.702218790372083},
+    {0.713967446876027, 2.40421685178806, 0.0237180419639917, 0.286032553123971, -3.11818429866409, -0.023718041963991, -0.286032553123971},
+    {-0.548509472575658, -0.86168424032714, 0.764665295175825, 1.54850947257566, 1.4101937129028, -0.764665295175825, -1.54850947257566},
+    {-0.325715385209019, -0.306078716913217, 0.654647946495179, 1.32571538520902, 0.631794102122236, -0.654647946495179, -1.32571538520902},
+    {0.0213941377077832, 0.559545548262077, 0.483242727153489, 0.978605862292217, -0.58093968596986, -0.483242727153489, -0.978605862292217},
+    {0.413480703034436, 1.53733389052355, 0.289627515545326, 0.586519296965564, -1.95081459355798, -0.289627515545326, -0.586519296965563},
+    {0.761094954638504, 2.40421685178806, 0.117973057488944, 0.238905045361495, -3.16531180642657, -0.117973057488944, -0.238905045361495},
+    {-0.0851819089672699, -0.86168424032714, 1.6913204223926, 1.08518190896727, 0.94686614929441, -1.6913204223926, -1.08518190896727},
+    {0.0709502408948852, -0.306078716913217, 1.44797919870299, 0.929049759105114, 0.235128476018332, -1.44797919870299, -0.929049759105114},
+    {0.314201561839691, 0.559545548262077, 1.06885757541731, 0.685798438160309, -0.873747110101769, -1.06885757541731, -0.685798438160308},
+    {0.588972401138389, 1.53733389052355, 0.640610911753232, 0.41102759886161, -2.12630629166194, -0.640610911753232, -0.41102759886161},
+    {0.832577431537388, 2.40421685178806, 0.260938011286713, 0.167422568462611, -3.23679428332545, -0.260938011286712, -0.16742256846261},
+    {0.411989591896581, -0.86168424032714, 2.6856634241203, 0.588010408103419, 0.449694648430559, -2.6856634241203, -0.588010408103418},
+    {0.496590457797377, -0.306078716913217, 2.29925963250797, 0.503409542202622, -0.19051174088416, -2.29925963250797, -0.503409542202622},
+    {0.628397215096318, 0.559545548262078, 1.69724888193056, 0.371602784903681, -1.1879427633584, -1.69724888193056, -0.37160278490368},
+    {0.777282956754788, 1.53733389052355, 1.01723202298603, 0.222717043245211, -2.31461684727834, -1.01723202298603, -0.22271704324521},
+    {0.909281373017809, 2.40421685178806, 0.414345894247555, 0.0907186269821898, -3.31349822480587, -0.414345894247555, -0.0907186269821892},
+    {0.809744306025694, -0.861684240327141, 3.48117285237853, 0.190255693974305, 0.0519399343014455, -3.48117285237853, -0.190255693974305},
+    {0.83711762498564, -0.306078716913217, 2.9803139668845, 0.162882375014359, -0.531038908072423, -2.9803139668845, -0.162882375014358},
+    {0.879764805604936, 0.559545548262077, 2.1999840629478, 0.120235194395062, -1.43931035386701, -2.1999840629478, -0.120235194395062},
+    {0.92793803470385, 1.53733389052355, 1.31854217888416, 0.0720619652961492, -2.4652719252274, -1.31854217888415, -0.0720619652961484},
+    {0.97064722818672, 2.40421685178807, 0.537077604585377, 0.0293527718132788, -3.37486407997479, -0.537077604585376, -0.0293527718132783},
+    {0.144333375497976, -0.86168424032714, 0.153733097585332, 2.85228451823978, 0.717350864829163, -0.153733097585332, -2.85228451823978},
+    {0.267443674835655, -0.306078716913217, 0.131614521121218, 2.44190787062765, 0.0386350420775617, -0.131614521121218, -2.44190787062765},
+    {0.459247495907997, 0.559545548262077, 0.0971541428643074, 1.80254780478161, -1.01879304417007, -0.0971541428643074, -1.80254780478161},
+    {0.675904477222819, 1.53733389052355, 0.0582285287322862, 1.08034205796699, -2.21323836774637, -0.0582285287322857, -1.08034205796699},
+    {0.86798719842446, 2.40421685178806, 0.0237180419639919, 0.440052304672404, -3.27220405021253, -0.0237180419639913, -0.440052304672404},
+    {0.285315354814272, -0.86168424032714, 0.764665295175825, 2.38233429996559, 0.576368885512868, -0.764665295175825, -2.38233429996559},
+    {0.388141663660971, -0.306078716913217, 0.654647946495179, 2.03957243407901, -0.0820629467477537, -0.654647946495179, -2.03957243407901},
+    {0.54834336124165, 0.559545548262077, 0.483242727153489, 1.50555508582608, -1.10788890950373, -0.483242727153489, -1.50555508582608},
+    {0.729303344235153, 1.53733389052355, 0.289627515545326, 0.902341938166281, -2.2666372347587, -0.289627515545326, -0.902341938166281},
+    {0.889737989595075, 2.40421685178806, 0.117973057488944, 0.367548080318067, -3.29395484138314, -0.117973057488944, -0.367548080318066},
+    {0.499155244893504, -0.86168424032714, 1.6913204223926, 1.66951906282804, 0.362528995433636, -1.6913204223926, -1.66951906282804},
+    {0.571215023734067, -0.306078716913217, 1.44797919870299, 1.4293145419443, -0.26513630682085, -1.44797919870299, -1.4293145419443},
+    {0.683482973707427, 0.559545548262077, 1.06885757541731, 1.05507985002804, -1.2430285219695, -1.06885757541731, -1.05507985002804},
+    {0.810298148731796, 1.53733389052355, 0.640610911753232, 0.632353346455017, -2.34763203925534, -0.640610911753232, -0.632353346455017},
+    {0.922729346473571, 2.40421685178806, 0.260938011286713, 0.257574483398795, -3.32694619826164, -0.260938011286712, -0.257574483398794},
+    {0.72861515068299, -0.86168424032714, 2.6856634241203, 0.904635966889828, 0.13306908964415, -2.6856634241203, -0.904635966889828},
+    {0.76766104668784, -0.306078716913217, 2.29925963250797, 0.774480131093086, -0.461582329774624, -2.29925963250797, -0.774480131093086},
+    {0.828493910316754, 0.559545548262078, 1.69724888193056, 0.571699480124117, -1.38803945857883, -1.69724888193056, -0.571699480124116},
+    {0.897209249379814, 1.53733389052355, 1.01723202298603, 0.342643335870237, -2.43454313990336, -1.01723202298603, -0.342643335870237},
+    {0.958130569502644, 2.40421685178806, 0.414345894247555, 0.139567823467025, -3.36234742129071, -0.414345894247555, -0.139567823467024},
+    {0.912191158303716, -0.861684240327141, 3.48117285237853, 0.292702546252328, -0.0505069179765767, -3.48117285237853, -0.292702546252327},
+    {0.924824785087997, -0.306078716913217, 2.9803139668845, 0.250589535116716, -0.61874606817478, -2.9803139668845, -0.250589535116716},
+    {0.944507767781268, 0.559545548262077, 2.1999840629478, 0.184978156571394, -1.50405331604335, -2.1999840629478, -0.184978156571393},
+    {0.966741191441727, 1.53733389052355, 1.31854217888416, 0.110865122034026, -2.50407508196527, -1.31854217888415, -0.110865122034026},
+    {0.986452794974706, 2.40421685178807, 0.537077604585377, 0.0451583386012648, -3.39066964676277, -0.537077604585376, -0.0451583386012643},
+    {0.826059726268027, -0.86168424032714, 0.153733097585331, 3.53401086900984, 0.0356245140591109, -0.153733097585331, -3.53401086900983},
+    {0.8510856400443, -0.306078716913217, 0.131614521121218, 3.0255498358363, -0.545006923131083, -0.131614521121218, -3.0255498358363},
+    {0.890075602004749, 0.559545548262077, 0.0971541428643075, 2.23337591087837, -1.44962115026683, -0.0971541428643075, -2.23337591087836},
+    {0.934117724902526, 1.53733389052355, 0.0582285287322864, 1.33855530564669, -2.47145161542607, -0.058228528732286, -1.33855530564669},
+    {0.973164381799351, 2.40421685178806, 0.023718041963992, 0.545229488047295, -3.37738123358742, -0.0237180419639914, -0.545229488047295},
+    {0.854718602717513, -0.86168424032714, 0.764665295175825, 2.95173754786883, 0.00696563760962579, -0.764665295175825, -2.95173754786883},
+    {0.875621178318205, -0.306078716913217, 0.654647946495179, 2.52705194873624, -0.569542461404989, -0.654647946495179, -2.52705194873624},
+    {0.908187047234417, 0.559545548262077, 0.483242727153489, 1.86539877181885, -1.46773259549649, -0.483242727153489, -1.86539877181885},
+    {0.944972669198744, 1.53733389052355, 0.289627515545326, 1.11801126312987, -2.48230655972229, -0.289627515545326, -1.11801126312987},
+    {0.977585891838153, 2.40421685178806, 0.117973057488945, 0.455395982561145, -3.38180274362622, -0.117973057488944, -0.455395982561144},
+    {0.898188066116116, -0.86168424032714, 1.6913204223926, 2.06855188405066, -0.0365038257889762, -1.6913204223926, -2.06855188405065},
+    {0.91283640847011, -0.306078716913217, 1.44797919870299, 1.77093592668034, -0.606757691556893, -1.44797919870299, -1.77093592668034},
+    {0.935658284876775, 0.559545548262077, 1.06885757541731, 1.30725516119739, -1.49520383313885, -1.06885757541731, -1.30725516119739},
+    {0.961437327351342, 1.53733389052355, 0.640610911753233, 0.783492525074564, -2.49877121787489, -0.640610911753232, -0.783492525074563},
+    {0.984292388833492, 2.40421685178806, 0.260938011286713, 0.319137525758715, -3.38850924062156, -0.260938011286713, -0.319137525758715},
+    {0.944832772922068, -0.86168424032714, 2.6856634241203, 1.12085358912891, -0.083148532594928, -2.6856634241203, -1.12085358912891},
+    {0.952770039194602, -0.306078716913217, 2.29925963250797, 0.959589123599848, -0.646691322281386, -2.29925963250797, -0.959589123599848},
+    {0.965136169470714, 0.559545548262077, 1.69724888193056, 0.708341739278077, -1.52468171773279, -1.69724888193056, -0.708341739278077},
+    {0.979104652690648, 1.53733389052355, 1.01723202298603, 0.424538739181071, -2.5164385432142, -1.01723202298603, -0.42453873918107},
+    {0.991488764440297, 2.40421685178806, 0.414345894247555, 0.172926018404678, -3.39570561622836, -0.414345894247555, -0.172926018404678},
+    {0.982150181480283, -0.861684240327141, 3.48117285237853, 0.362661569428895, -0.120465941153144, -3.48117285237853, -0.362661569428894},
+    {0.984718350482275, -0.306078716913217, 2.9803139668845, 0.310483100510995, -0.678639633569059, -2.9803139668845, -0.310483100510994},
+    {0.988719515538259, 0.559545548262077, 2.1999840629478, 0.229189904328385, -1.54826506380034, -2.1999840629478, -0.229189904328384},
+    {0.993239135313951, 1.53733389052355, 1.31854217888416, 0.137363065906251, -2.5305730258375, -1.31854217888415, -0.13736306590625},
+    {0.997246118426349, 2.40421685178807, 0.537077604585377, 0.0559516620529087, -3.40146297021442, -0.537077604585376, -0.0559516620529083}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[7] = {0, 3, 4, 5, 7, 8, 9};
+    static const double FE1_C0_D010[125][7] = \
+    {{-2.53401086900984, -0.846266902414667, 0.138315759672862, 0.173940273731974, -0.138315759672862, 3.3802777714245, -0.173940273731973},
+    {-2.0255498358363, -0.868385478878781, 0.693921283086784, 0.148914359955701, -0.693921283086783, 2.89393531471508, -0.1489143599557},
+    {-1.23337591087837, -0.902845857135692, 1.55954554826208, 0.109924397995249, -1.55954554826208, 2.13622176801406, -0.109924397995249},
+    {-0.338555305646693, -0.941771471267714, 2.53733389052355, 0.0658822750974729, -2.53733389052355, 1.28032677691441, -0.0658822750974728},
+    {0.454770511952705, -0.976281958036009, 3.40421685178806, 0.0268356182006483, -3.40421685178806, 0.521511446083304, -0.0268356182006486},
+    {-1.95173754786883, -0.235334704824175, 0.138315759672861, 0.145281397282487, -0.138315759672861, 2.187072252693, -0.145281397282487},
+    {-1.52705194873624, -0.345352053504821, 0.693921283086783, 0.124378821681794, -0.693921283086783, 1.87240400224106, -0.124378821681793},
+    {-0.865398771818851, -0.516757272846511, 1.55954554826208, 0.0918129527655814, -1.55954554826208, 1.38215604466536, -0.0918129527655814},
+    {-0.118011263129871, -0.710372484454674, 2.53733389052355, 0.0550273308012546, -2.53733389052355, 0.828383747584545, -0.0550273308012547},
+    {0.544604017438855, -0.882026942511056, 3.40421685178806, 0.0224141081618461, -3.40421685178806, 0.337422925072202, -0.0224141081618462},
+    {-1.06855188405066, 0.6913204223926, 0.138315759672859, 0.101811933883883, -0.13831575967286, 0.377231461658056, -0.101811933883884},
+    {-0.77093592668034, 0.447979198702987, 0.693921283086782, 0.087163591529888, -0.693921283086782, 0.322956727977352, -0.0871635915298885},
+    {-0.307255161197393, 0.068857575417305, 1.55954554826208, 0.0643417151232226, -1.55954554826208, 0.238397585780088, -0.0643417151232226},
+    {0.216507474925436, -0.359389088246769, 2.53733389052355, 0.0385626726486567, -2.53733389052355, 0.142881613321332, -0.0385626726486567},
+    {0.680862474241284, -0.739061988713288, 3.40421685178806, 0.0157076111665069, -3.40421685178806, 0.058199514472004, -0.015707611166507},
+    {-0.120853589128906, 1.6856634241203, 0.138315759672859, 0.0551672270779302, -0.138315759672859, -1.5648098349914, -0.0551672270779314},
+    {0.0404108764001513, 1.29925963250797, 0.693921283086782, 0.0472299608053953, -0.693921283086782, -1.33967050890812, -0.047229960805396},
+    {0.291658260721923, 0.69724888193056, 1.55954554826208, 0.0348638305292839, -1.55954554826208, -0.988907142652483, -0.034863830529284},
+    {0.575461260818929, 0.0172320229860304, 2.53733389052355, 0.0208953473093506, -2.53733389052355, -0.59269328380496, -0.0208953473093506},
+    {0.827073981595321, -0.585654105752446, 3.40421685178807, 0.00851123555970239, -3.40421685178807, -0.241419875842875, -0.00851123555970248},
+    {0.637338430571105, 2.48117285237853, 0.138315759672859, 0.0178498185197144, -0.138315759672859, -3.11851128294963, -0.0178498185197154},
+    {0.689516899489005, 1.9803139668845, 0.693921283086782, 0.0152816495177227, -0.693921283086782, -2.6698308663735, -0.0152816495177232},
+    {0.770810095671614, 1.1999840629478, 1.55954554826208, 0.0112804844617389, -1.55954554826208, -1.97079415861941, -0.011280484461739},
+    {0.862636934093749, 0.318542178884154, 2.53733389052355, 0.00676086468604743, -2.53733389052355, -1.1811791129779, -0.00676086468604731},
+    {0.94404833794709, -0.462922395414624, 3.40421685178807, 0.00275388157364971, -3.40421685178807, -0.481125942532466, -0.00275388157364974},
+    {-1.85228451823978, -0.846266902414667, 0.138315759672862, 0.855666624502025, -0.138315759672862, 2.69855142065445, -0.855666624502025},
+    {-1.44190787062765, -0.868385478878781, 0.693921283086783, 0.732556325164345, -0.693921283086783, 2.31029334950644, -0.732556325164345},
+    {-0.802547804781612, -0.902845857135692, 1.55954554826208, 0.540752504092002, -1.55954554826208, 1.7053936619173, -0.540752504092002},
+    {-0.0803420579669867, -0.941771471267714, 2.53733389052355, 0.32409552277718, -2.53733389052355, 1.0221135292347, -0.32409552277718},
+    {0.559947695327596, -0.976281958036009, 3.40421685178806, 0.13201280157554, -3.40421685178806, 0.416334262708413, -0.13201280157554},
+    {-1.38233429996559, -0.235334704824175, 0.138315759672861, 0.714684645185728, -0.138315759672861, 1.61766900478976, -0.714684645185729},
+    {-1.03957243407901, -0.345352053504821, 0.693921283086783, 0.611858336339028, -0.693921283086783, 1.38492448758383, -0.611858336339029},
+    {-0.505555085826084, -0.516757272846511, 1.55954554826208, 0.451656638758349, -1.55954554826208, 1.02231235867259, -0.451656638758349},
+    {0.097658061833719, -0.710372484454674, 2.53733389052355, 0.270696655764845, -2.53733389052355, 0.612714422620955, -0.270696655764845},
+    {0.632451919681933, -0.882026942511056, 3.40421685178806, 0.110262010404924, -3.40421685178806, 0.249575022829124, -0.110262010404924},
+    {-0.669519062828044, 0.6913204223926, 0.13831575967286, 0.500844755106495, -0.13831575967286, -0.0218013595645561, -0.500844755106496},
+    {-0.429314541944297, 0.447979198702988, 0.693921283086782, 0.428784976265931, -0.693921283086782, -0.0186646567586911, -0.428784976265932},
+    {-0.0550798500280447, 0.0688575754173051, 1.55954554826208, 0.316517026292572, -1.55954554826208, -0.0137777253892607, -0.316517026292571},
+    {0.367646653544982, -0.359389088246769, 2.53733389052355, 0.189701851268203, -2.53733389052355, -0.00825756529821425, -0.189701851268203},
+    {0.742425516601205, -0.739061988713288, 3.40421685178806, 0.0772706535264277, -3.40421685178806, -0.00336352788791668, -0.0772706535264278},
+    {0.0953640331101717, 1.6856634241203, 0.138315759672859, 0.271384849317008, -0.138315759672859, -1.78102745723047, -0.271384849317009},
+    {0.225519868906913, 1.29925963250797, 0.693921283086782, 0.232338953312158, -0.693921283086782, -1.52477950141488, -0.232338953312158},
+    {0.428300519875883, 0.69724888193056, 1.55954554826208, 0.171506089683245, -1.55954554826208, -1.12554940180644, -0.171506089683245},
+    {0.657356664129763, 0.0172320229860304, 2.53733389052355, 0.102790750620184, -2.53733389052355, -0.674588687115793, -0.102790750620184},
+    {0.860432176532975, -0.585654105752446, 3.40421685178807, 0.0418694304973558, -3.40421685178807, -0.274778070780529, -0.0418694304973559},
+    {0.707297453747672, 2.48117285237853, 0.138315759672859, 0.087808841696282, -0.138315759672859, -3.1884703061262, -0.0878088416962829},
+    {0.749410464883284, 1.9803139668845, 0.693921283086782, 0.0751752149120012, -0.693921283086783, -2.72972443176778, -0.0751752149120016},
+    {0.815021843428605, 1.1999840629478, 1.55954554826208, 0.05549223221873, -1.55954554826208, -2.0150059063764, -0.0554922322187299},
+    {0.889134877965973, 0.318542178884154, 2.53733389052355, 0.0332588085582721, -2.53733389052355, -1.20767705685013, -0.033258808558272},
+    {0.954841661398734, -0.462922395414624, 3.40421685178807, 0.0135472050252939, -3.40421685178807, -0.49191926598411, -0.013547205025294},
+    {-0.853975571370904, -0.846266902414667, 0.138315759672861, 1.8539755713709, -0.138315759672861, 1.70024247378557, -1.8539755713709},
+    {-0.587232097895999, -0.868385478878781, 0.693921283086783, 1.587232097896, -0.693921283086783, 1.45561757677478, -1.587232097896},
+    {-0.171650154436808, -0.902845857135692, 1.55954554826208, 1.17165015443681, -1.55954554826208, 1.0744960115725, -1.17165015443681},
+    {0.297781209627916, -0.941771471267714, 2.53733389052355, 0.702218790372083, -2.53733389052355, 0.643990261639798, -0.702218790372083},
+    {0.713967446876028, -0.976281958036009, 3.40421685178806, 0.286032553123972, -3.40421685178806, 0.262314511159981, -0.286032553123972},
+    {-0.548509472575657, -0.235334704824175, 0.13831575967286, 1.54850947257566, -0.13831575967286, 0.783844177399832, -1.54850947257566},
+    {-0.325715385209019, -0.345352053504821, 0.693921283086783, 1.32571538520902, -0.693921283086783, 0.67106743871384, -1.32571538520902},
+    {0.0213941377077833, -0.516757272846511, 1.55954554826208, 0.978605862292217, -1.55954554826208, 0.495363135138727, -0.978605862292217},
+    {0.413480703034436, -0.710372484454674, 2.53733389052355, 0.586519296965563, -2.53733389052355, 0.296891781420238, -0.586519296965563},
+    {0.761094954638504, -0.882026942511056, 3.40421685178806, 0.238905045361496, -3.40421685178806, 0.120931987872552, -0.238905045361496},
+    {-0.08518190896727, 0.6913204223926, 0.13831575967286, 1.08518190896727, -0.13831575967286, -0.60613851342533, -1.08518190896727},
+    {0.0709502408948853, 0.447979198702988, 0.693921283086783, 0.929049759105114, -0.693921283086783, -0.518929439597874, -0.929049759105114},
+    {0.314201561839691, 0.0688575754173052, 1.55954554826208, 0.685798438160308, -1.55954554826208, -0.383059137256997, -0.685798438160308},
+    {0.588972401138389, -0.359389088246769, 2.53733389052355, 0.41102759886161, -2.53733389052355, -0.229583312891621, -0.41102759886161},
+    {0.832577431537388, -0.739061988713288, 3.40421685178806, 0.167422568462611, -3.40421685178806, -0.0935154428241002, -0.167422568462612},
+    {0.411989591896581, 1.6856634241203, 0.138315759672859, 0.588010408103418, -0.138315759672859, -2.09765301601688, -0.588010408103419},
+    {0.496590457797377, 1.29925963250797, 0.693921283086782, 0.503409542202622, -0.693921283086782, -1.79585009030535, -0.503409542202622},
+    {0.628397215096319, 0.69724888193056, 1.55954554826208, 0.37160278490368, -1.55954554826208, -1.32564609702688, -0.37160278490368},
+    {0.777282956754789, 0.0172320229860305, 2.53733389052355, 0.222717043245211, -2.53733389052355, -0.79451497974082, -0.222717043245211},
+    {0.909281373017809, -0.585654105752446, 3.40421685178807, 0.0907186269821904, -3.40421685178807, -0.323627267265363, -0.0907186269821905},
+    {0.809744306025694, 2.48117285237853, 0.138315759672859, 0.190255693974304, -0.138315759672859, -3.29091715840422, -0.190255693974305},
+    {0.83711762498564, 1.9803139668845, 0.693921283086782, 0.162882375014358, -0.693921283086783, -2.81743159187014, -0.162882375014359},
+    {0.879764805604937, 1.1999840629478, 1.55954554826208, 0.120235194395062, -1.55954554826208, -2.07974886855273, -0.120235194395062},
+    {0.92793803470385, 0.318542178884154, 2.53733389052355, 0.0720619652961492, -2.53733389052355, -1.246480213588, -0.0720619652961491},
+    {0.97064722818672, -0.462922395414624, 3.40421685178807, 0.0293527718132797, -3.40421685178807, -0.507724832772096, -0.0293527718132797},
+    {0.144333375497976, -0.846266902414667, 0.13831575967286, 2.85228451823978, -0.13831575967286, 0.701933526916691, -2.85228451823978},
+    {0.267443674835655, -0.868385478878781, 0.693921283086782, 2.44190787062765, -0.693921283086783, 0.600941804043126, -2.44190787062765},
+    {0.459247495907997, -0.902845857135692, 1.55954554826208, 1.80254780478161, -1.55954554826208, 0.443598361227695, -1.80254780478161},
+    {0.675904477222819, -0.941771471267714, 2.53733389052355, 1.08034205796699, -2.53733389052355, 0.265866994044895, -1.08034205796699},
+    {0.86798719842446, -0.976281958036009, 3.40421685178806, 0.440052304672404, -3.40421685178806, 0.108294759611549, -0.440052304672405},
+    {0.285315354814272, -0.235334704824175, 0.13831575967286, 2.38233429996559, -0.13831575967286, -0.0499806499900974, -2.38233429996559},
+    {0.388141663660971, -0.345352053504821, 0.693921283086783, 2.03957243407901, -0.693921283086783, -0.0427896101561506, -2.03957243407901},
+    {0.54834336124165, -0.516757272846511, 1.55954554826208, 1.50555508582608, -1.55954554826208, -0.0315860883951393, -1.50555508582608},
+    {0.729303344235153, -0.710372484454674, 2.53733389052355, 0.902341938166281, -2.53733389052355, -0.0189308597804795, -0.902341938166281},
+    {0.889737989595075, -0.882026942511056, 3.40421685178807, 0.367548080318067, -3.40421685178807, -0.00771104708401874, -0.367548080318067},
+    {0.499155244893504, 0.691320422392601, 0.13831575967286, 1.66951906282804, -0.13831575967286, -1.1904756672861, -1.66951906282804},
+    {0.571215023734067, 0.447979198702988, 0.693921283086783, 1.4293145419443, -0.693921283086783, -1.01919422243706, -1.4293145419443},
+    {0.683482973707427, 0.0688575754173054, 1.55954554826208, 1.05507985002804, -1.55954554826208, -0.752340549124733, -1.05507985002804},
+    {0.810298148731796, -0.359389088246769, 2.53733389052355, 0.632353346455017, -2.53733389052355, -0.450909060485028, -0.632353346455017},
+    {0.922729346473572, -0.739061988713288, 3.40421685178806, 0.257574483398795, -3.40421685178806, -0.183667357760284, -0.257574483398796},
+    {0.72861515068299, 1.6856634241203, 0.138315759672859, 0.904635966889828, -0.13831575967286, -2.41427857480329, -0.904635966889828},
+    {0.767661046687841, 1.29925963250797, 0.693921283086783, 0.774480131093086, -0.693921283086783, -2.06692067919581, -0.774480131093086},
+    {0.828493910316754, 0.69724888193056, 1.55954554826208, 0.571699480124116, -1.55954554826208, -1.52574279224731, -0.571699480124116},
+    {0.897209249379815, 0.0172320229860305, 2.53733389052355, 0.342643335870237, -2.53733389052355, -0.914441272365846, -0.342643335870237},
+    {0.958130569502644, -0.585654105752446, 3.40421685178807, 0.139567823467025, -3.40421685178807, -0.372476463750198, -0.139567823467025},
+    {0.912191158303716, 2.48117285237853, 0.138315759672859, 0.292702546252327, -0.138315759672859, -3.39336401068225, -0.292702546252327},
+    {0.924824785087997, 1.9803139668845, 0.693921283086783, 0.250589535116716, -0.693921283086783, -2.9051387519725, -0.250589535116716},
+    {0.944507767781269, 1.1999840629478, 1.55954554826208, 0.184978156571394, -1.55954554826208, -2.14449183072907, -0.184978156571394},
+    {0.966741191441727, 0.318542178884154, 2.53733389052355, 0.110865122034026, -2.53733389052355, -1.28528337032588, -0.110865122034026},
+    {0.986452794974706, -0.462922395414624, 3.40421685178807, 0.0451583386012656, -3.40421685178807, -0.523530399560082, -0.0451583386012656},
+    {0.826059726268028, -0.846266902414667, 0.138315759672859, 3.53401086900983, -0.138315759672859, 0.0202071761466383, -3.53401086900983},
+    {0.8510856400443, -0.868385478878782, 0.693921283086782, 3.0255498358363, -0.693921283086782, 0.0172998388344806, -3.0255498358363},
+    {0.89007560200475, -0.902845857135692, 1.55954554826208, 2.23337591087836, -1.55954554826208, 0.012770255130942, -2.23337591087836},
+    {0.934117724902525, -0.941771471267714, 2.53733389052355, 1.33855530564669, -2.53733389052355, 0.00765374636518801, -1.33855530564669},
+    {0.973164381799351, -0.976281958036009, 3.40421685178806, 0.545229488047295, -3.40421685178806, 0.00311757623665807, -0.545229488047296},
+    {0.854718602717513, -0.235334704824175, 0.138315759672859, 2.95173754786883, -0.13831575967286, -0.61938389789334, -2.95173754786883},
+    {0.875621178318206, -0.345352053504821, 0.693921283086783, 2.52705194873624, -0.693921283086783, -0.530269124813386, -2.52705194873624},
+    {0.908187047234417, -0.516757272846511, 1.55954554826208, 1.86539877181885, -1.55954554826208, -0.391429774387907, -1.86539877181885},
+    {0.944972669198744, -0.710372484454674, 2.53733389052355, 1.11801126312987, -2.53733389052355, -0.23460018474407, -1.11801126312987},
+    {0.977585891838153, -0.882026942511056, 3.40421685178807, 0.455395982561145, -3.40421685178807, -0.0955589493270969, -0.455395982561146},
+    {0.898188066116116, 0.691320422392601, 0.13831575967286, 2.06855188405065, -0.13831575967286, -1.58950848850872, -2.06855188405066},
+    {0.91283640847011, 0.447979198702988, 0.693921283086783, 1.77093592668034, -0.693921283086783, -1.3608156071731, -1.77093592668034},
+    {0.935658284876775, 0.0688575754173054, 1.55954554826208, 1.30725516119739, -1.55954554826208, -1.00451586029408, -1.30725516119739},
+    {0.961437327351342, -0.359389088246768, 2.53733389052355, 0.783492525074564, -2.53733389052355, -0.602048239104574, -0.783492525074564},
+    {0.984292388833492, -0.739061988713288, 3.40421685178807, 0.319137525758716, -3.40421685178807, -0.245230400120204, -0.319137525758716},
+    {0.944832772922068, 1.6856634241203, 0.138315759672859, 1.12085358912891, -0.13831575967286, -2.63049619704237, -1.12085358912891},
+    {0.952770039194603, 1.29925963250797, 0.693921283086783, 0.959589123599848, -0.693921283086783, -2.25202967170258, -0.959589123599848},
+    {0.965136169470714, 0.69724888193056, 1.55954554826208, 0.708341739278077, -1.55954554826208, -1.66238505140128, -0.708341739278077},
+    {0.979104652690649, 0.0172320229860305, 2.53733389052355, 0.424538739181071, -2.53733389052355, -0.996336675676679, -0.424538739181071},
+    {0.991488764440297, -0.585654105752446, 3.40421685178807, 0.172926018404679, -3.40421685178807, -0.405834658687851, -0.172926018404679},
+    {0.982150181480284, 2.48117285237853, 0.138315759672859, 0.362661569428894, -0.13831575967286, -3.46332303385881, -0.362661569428895},
+    {0.984718350482276, 1.9803139668845, 0.693921283086783, 0.310483100510994, -0.693921283086783, -2.96503231736678, -0.310483100510994},
+    {0.98871951553826, 1.1999840629478, 1.55954554826208, 0.229189904328385, -1.55954554826208, -2.18870357848606, -0.229189904328385},
+    {0.993239135313952, 0.318542178884154, 2.53733389052355, 0.137363065906251, -2.53733389052355, -1.31178131419811, -0.137363065906251},
+    {0.99724611842635, -0.462922395414624, 3.40421685178807, 0.0559516620529096, -3.40421685178807, -0.534323723011726, -0.0559516620529098}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc2[7] = {0, 2, 4, 6, 7, 8, 9};
+    static const double FE1_C0_D100[125][7] = \
+    {{-2.53401086900984, -0.82605972626803, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 3.36007059527787},
+    {-2.0255498358363, -0.8510856400443, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.13161452112122, 2.8766354758806},
+    {-1.23337591087837, -0.89007560200475, 1.55954554826208, 0.0971541428643071, -1.55954554826208, -0.0971541428643071, 2.12345151288312},
+    {-0.338555305646693, -0.934117724902525, 2.53733389052355, 0.0582285287322848, -2.53733389052355, -0.0582285287322848, 1.27267303054922},
+    {0.454770511952704, -0.973164381799351, 3.40421685178806, 0.0237180419639906, -3.40421685178806, -0.0237180419639906, 0.518393869846646},
+    {-1.95173754786883, -0.854718602717514, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175826, 2.80645615058634},
+    {-1.52705194873624, -0.875621178318207, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 2.40267312705445},
+    {-0.865398771818852, -0.908187047234418, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.77358581905327},
+    {-0.118011263129872, -0.944972669198744, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 1.06298393232862},
+    {0.544604017438855, -0.977585891838153, 3.40421685178807, 0.117973057488943, -3.40421685178807, -0.117973057488943, 0.432981874399299},
+    {-1.06855188405066, -0.898188066116116, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.96673995016677},
+    {-0.77093592668034, -0.912836408470111, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.68377233515045},
+    {-0.307255161197394, -0.935658284876776, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.0688575754173, 1.24291344607417},
+    {0.216507474925436, -0.961437327351342, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753231, 0.744929852425906},
+    {0.680862474241284, -0.984292388833493, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.303429914592209},
+    {-0.120853589128906, -0.944832772922068, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 1.06568636205097},
+    {0.0404108764001512, -0.952770039194603, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.912359162794452},
+    {0.291658260721922, -0.965136169470715, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.673477908748793},
+    {0.575461260818929, -0.979104652690649, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.40364339187172},
+    {0.827073981595321, -0.991488764440298, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.164414782844977},
+    {0.637338430571105, -0.982150181480284, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.344811750909179},
+    {0.689516899489005, -0.984718350482277, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.295201450993271},
+    {0.770810095671615, -0.988719515538262, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.217909419866647},
+    {0.862636934093749, -0.993239135313953, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.130602201220204},
+    {0.94404833794709, -0.997246118426351, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0531977804792609},
+    {-1.85228451823978, -0.144333375497977, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 1.99661789373776},
+    {-1.44190787062765, -0.267443674835656, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 1.70935154546331},
+    {-0.802547804781613, -0.459247495907997, 1.55954554826208, 0.0971541428643072, -1.55954554826208, -0.0971541428643073, 1.26179530068961},
+    {-0.0803420579669868, -0.675904477222819, 2.53733389052355, 0.0582285287322851, -2.53733389052355, -0.0582285287322851, 0.756246535189806},
+    {0.559947695327596, -0.86798719842446, 3.40421685178806, 0.0237180419639908, -3.40421685178806, -0.0237180419639908, 0.308039503096864},
+    {-1.38233429996559, -0.285315354814272, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175825, 1.66764965477986},
+    {-1.03957243407901, -0.388141663660972, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 1.42771409773998},
+    {-0.505555085826084, -0.54834336124165, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.05389844706773},
+    {0.0976580618337188, -0.729303344235153, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 0.631645282401435},
+    {0.632451919681933, -0.889737989595075, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0.257286069913143},
+    {-0.669519062828044, -0.499155244893504, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.16867430772155},
+    {-0.429314541944297, -0.571215023734068, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.00052956567836},
+    {-0.0550798500280449, -0.683482973707428, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.06885757541731, 0.738562823735472},
+    {0.367646653544982, -0.810298148731796, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753232, 0.442651495186814},
+    {0.742425516601204, -0.922729346473572, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.180303829872368},
+    {0.0953640331101717, -0.72861515068299, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 0.633251117572818},
+    {0.225519868906913, -0.767661046687841, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.542141177780928},
+    {0.428300519875883, -0.828493910316755, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.400193390440872},
+    {0.657356664129763, -0.897209249379815, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.239852585250053},
+    {0.860432176532975, -0.958130569502645, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.09769839296967},
+    {0.707297453747673, -0.912191158303717, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.204893704556044},
+    {0.749410464883284, -0.924824785087998, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.175414320204714},
+    {0.815021843428606, -0.944507767781271, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.129485924352665},
+    {0.889134877965973, -0.966741191441729, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.0776063134757552},
+    {0.954841661398734, -0.986452794974707, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0316111335759726},
+    {-0.853975571370903, 0.853975571370903, 0.138315759672861, 0.153733097585334, -0.138315759672861, -0.153733097585334, 0},
+    {-0.587232097895999, 0.587232097895999, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 0},
+    {-0.171650154436808, 0.171650154436808, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643074, 0},
+    {0.297781209627916, -0.297781209627916, 2.53733389052355, 0.0582285287322856, -2.53733389052355, -0.0582285287322856, 0},
+    {0.713967446876028, -0.713967446876028, 3.40421685178807, 0.0237180419639911, -3.40421685178807, -0.0237180419639911, 0},
+    {-0.548509472575657, 0.548509472575658, 0.13831575967286, 0.764665295175825, -0.13831575967286, -0.764665295175825, 0},
+    {-0.325715385209019, 0.325715385209019, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 0},
+    {0.0213941377077832, -0.0213941377077827, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153489, 0},
+    {0.413480703034436, -0.413480703034436, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, 0},
+    {0.761094954638504, -0.761094954638504, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0},
+    {-0.0851819089672702, 0.0851819089672698, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 0},
+    {0.0709502408948851, -0.0709502408948855, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, 0},
+    {0.314201561839691, -0.314201561839691, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, 0},
+    {0.588972401138389, -0.58897240113839, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753232, 0},
+    {0.832577431537388, -0.832577431537389, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, 0},
+    {0.411989591896581, -0.411989591896581, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, 0},
+    {0.496590457797377, -0.496590457797378, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0},
+    {0.628397215096318, -0.62839721509632, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0},
+    {0.777282956754789, -0.777282956754789, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0},
+    {0.909281373017809, -0.90928137301781, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0},
+    {0.809744306025695, -0.809744306025695, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, 0},
+    {0.837117624985641, -0.837117624985642, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0},
+    {0.879764805604937, -0.879764805604939, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0},
+    {0.92793803470385, -0.927938034703852, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0},
+    {0.97064722818672, -0.970647228186721, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0},
+    {0.144333375497977, 1.85228451823978, 0.13831575967286, 0.153733097585332, -0.13831575967286, -0.153733097585333, -1.99661789373776},
+    {0.267443674835656, 1.44190787062765, 0.693921283086783, 0.131614521121218, -0.693921283086783, -0.131614521121218, -1.70935154546331},
+    {0.459247495907997, 0.802547804781612, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -1.26179530068961},
+    {0.675904477222819, 0.0803420579669871, 2.53733389052355, 0.058228528732286, -2.53733389052355, -0.058228528732286, -0.756246535189806},
+    {0.86798719842446, -0.559947695327595, 3.40421685178807, 0.0237180419639914, -3.40421685178807, -0.0237180419639914, -0.308039503096864},
+    {0.285315354814272, 1.38233429996559, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175825, -1.66764965477986},
+    {0.388141663660971, 1.03957243407901, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -1.42771409773998},
+    {0.54834336124165, 0.505555085826084, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.05389844706773},
+    {0.729303344235153, -0.0976580618337189, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -0.631645282401434},
+    {0.889737989595075, -0.632451919681933, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.257286069913142},
+    {0.499155244893504, 0.669519062828043, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.16867430772155},
+    {0.571215023734067, 0.429314541944296, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.00052956567836},
+    {0.683482973707427, 0.0550798500280444, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -0.738562823735472},
+    {0.810298148731796, -0.367646653544983, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753233, -0.442651495186813},
+    {0.922729346473572, -0.742425516601205, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.180303829872367},
+    {0.72861515068299, -0.0953640331101723, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -0.633251117572818},
+    {0.767661046687841, -0.225519868906914, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.542141177780927},
+    {0.828493910316754, -0.428300519875884, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.40019339044087},
+    {0.897209249379815, -0.657356664129763, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.239852585250051},
+    {0.958130569502644, -0.860432176532975, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.0976983929696685},
+    {0.912191158303717, -0.707297453747673, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.204893704556044},
+    {0.924824785087998, -0.749410464883284, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.175414320204714},
+    {0.944507767781269, -0.815021843428607, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.129485924352662},
+    {0.966741191441727, -0.889134877965975, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.0776063134757529},
+    {0.986452794974706, -0.954841661398735, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0316111335759707},
+    {0.826059726268029, 2.53401086900983, 0.138315759672859, 0.153733097585331, -0.138315759672859, -0.153733097585332, -3.36007059527786},
+    {0.851085640044301, 2.0255498358363, 0.693921283086782, 0.131614521121218, -0.693921283086782, -0.131614521121218, -2.8766354758806},
+    {0.89007560200475, 1.23337591087837, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -2.12345151288312},
+    {0.934117724902526, 0.338555305646693, 2.53733389052355, 0.0582285287322862, -2.53733389052355, -0.0582285287322862, -1.27267303054922},
+    {0.973164381799351, -0.454770511952705, 3.40421685178807, 0.0237180419639916, -3.40421685178807, -0.0237180419639916, -0.518393869846646},
+    {0.854718602717514, 1.95173754786883, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175824, -2.80645615058634},
+    {0.875621178318206, 1.52705194873624, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -2.40267312705445},
+    {0.908187047234417, 0.865398771818851, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.77358581905327},
+    {0.944972669198744, 0.118011263129871, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -1.06298393232862},
+    {0.977585891838153, -0.544604017438855, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.432981874399298},
+    {0.898188066116116, 1.06855188405065, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.96673995016677},
+    {0.91283640847011, 0.77093592668034, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.68377233515045},
+    {0.935658284876776, 0.307255161197392, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -1.24291344607417},
+    {0.961437327351342, -0.216507474925437, 2.53733389052355, 0.640610911753233, -2.53733389052355, -0.640610911753233, -0.744929852425905},
+    {0.984292388833492, -0.680862474241285, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.303429914592208},
+    {0.944832772922068, 0.120853589128905, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -1.06568636205097},
+    {0.952770039194603, -0.0404108764001523, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.912359162794451},
+    {0.965136169470714, -0.291658260721924, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.673477908748791},
+    {0.979104652690648, -0.57546126081893, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.403643391871719},
+    {0.991488764440297, -0.827073981595322, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.164414782844975},
+    {0.982150181480284, -0.637338430571106, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.344811750909179},
+    {0.984718350482276, -0.689516899489006, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.29520145099327},
+    {0.98871951553826, -0.770810095671616, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.217909419866644},
+    {0.993239135313952, -0.86263693409375, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.130602201220202},
+    {0.99724611842635, -0.944048337947091, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0531977804792586}};
+    
     // Array of non-zero columns
     static const unsigned int nzc3[7] = {0, 1, 5, 6, 7, 8, 9};
     
-    const static double FE0_C1_D010[27][7] = \
-    {{-1.99865811288677, -0.67151372854623, 0.291976096292601, 0.380879519366861, -0.2919760962926, 2.670171841433, -0.380879519366861},
-    {-1.11229755309379, -0.768609584255429, 1.38801506415341, 0.268296967008234, -1.38801506415341, 1.88090713734922, -0.268296967008233},
-    {0.045747773398036, -0.89546699085306, 2.82000883955399, 0.121205924697102, -2.82000883955399, 0.849719217455024, -0.121205924697102},
-    {-0.942926908148453, 0.518312921122362, 0.291976096292599, 0.246784074436585, -0.291976096292599, 0.424613987026092, -0.246784074436586},
-    {-0.368625431583845, 0.0695212816475373, 1.38801506415341, 0.173838222615209, -1.38801506415341, 0.299104149936307, -0.173838222615209},
-    {0.381709331831541, -0.51683271946439, 2.82000883955399, 0.0785332117419375, -2.82000883955399, 0.135123387632849, -0.0785332117419376},
-    {0.301373419046404, 1.92066011219053, 0.291976096292598, 0.0887372105632775, -0.291976096292598, -2.22203353123693, -0.0887372105632784},
-    {0.507877469881381, 1.05735464869637, 1.38801506415341, 0.0625077570316057, -1.38801506415341, -1.56523211857775, -0.0625077570316059},
-    {0.777678566431671, -0.0705687976805426, 2.82000883955399, 0.0282385245582192, -2.82000883955399, -0.707109768751129, -0.0282385245582191},
-    {-0.689768816126815, -0.67151372854623, 0.2919760962926, 1.68976881612682, -0.2919760962926, 1.36128254467305, -1.68976881612682},
-    {-0.19029726005101, -0.768609584255429, 1.38801506415341, 1.19029726005101, -1.38801506415341, 0.958906844306439, -1.19029726005101},
-    {0.462270924350466, -0.89546699085306, 2.82000883955399, 0.537729075649533, -2.82000883955399, 0.433196066502594, -0.537729075649533},
-    {-0.0948554912925191, 0.518312921122362, 0.291976096292599, 1.09485549129252, -0.291976096292599, -0.423457429829843, -1.09485549129252},
-    {0.228768172900473, 0.0695212816475375, 1.38801506415341, 0.771231827099527, -1.38801506415341, -0.298289454548011, -0.771231827099527},
-    {0.651588060044801, -0.51683271946439, 2.82000883955399, 0.348411939955198, -2.82000883955399, -0.134755340580411, -0.348411939955198},
-    {0.606318104241562, 1.92066011219053, 0.291976096292598, 0.393681895758437, -0.291976096292599, -2.52697821643209, -0.393681895758437},
-    {0.722684856424887, 1.05735464869637, 1.38801506415341, 0.277315143575112, -1.38801506415341, -1.78003950512125, -0.277315143575112},
-    {0.874720020936725, -0.0705687976805425, 2.82000883955399, 0.125279979063274, -2.82000883955399, -0.804151223256183, -0.125279979063274},
-    {0.619120480633141, -0.67151372854623, 0.291976096292599, 2.99865811288677, -0.291976096292599, 0.0523932479130882, -2.99865811288677},
-    {0.731703032991766, -0.768609584255429, 1.38801506415341, 2.11229755309379, -1.38801506415341, 0.0369065512636619, -2.11229755309379},
-    {0.878794075302896, -0.89546699085306, 2.82000883955399, 0.954252226601964, -2.82000883955399, 0.0166729155501636, -0.954252226601964},
-    {0.753215925563415, 0.518312921122362, 0.291976096292599, 1.94292690814845, -0.291976096292599, -1.27152884668578, -1.94292690814845},
-    {0.82616177738479, 0.0695212816475377, 1.38801506415341, 1.36862543158385, -1.38801506415341, -0.895683059032329, -1.36862543158384},
-    {0.921466788258061, -0.51683271946439, 2.82000883955399, 0.618290668168459, -2.82000883955399, -0.404634068793672, -0.618290668168458},
-    {0.911262789436721, 1.92066011219053, 0.291976096292599, 0.698626580953596, -0.291976096292599, -2.83192290162725, -0.698626580953596},
-    {0.937492242968393, 1.05735464869637, 1.38801506415341, 0.492122530118618, -1.38801506415341, -1.99484689166476, -0.492122530118618},
-    {0.97176147544178, -0.0705687976805425, 2.82000883955399, 0.222321433568329, -2.82000883955399, -0.901192677761238, -0.222321433568329}};
-    // Array of non-zero columns
-    static const unsigned int nzc1[7] = {10, 12, 14, 16, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc4[7] = {0, 2, 4, 6, 7, 8, 9};
-    
-    const static double FE0_C1[27][10] = \
-    {{0.374329281526014, -0.0770862288075737, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.0278019288056344, 0.031278423297481, 0.218884122479203, 0.246254505716693, 0.285531865195462},
-    {0.0296507308273034, -0.0580763339388314, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.0931000579685249, 0.0155203366847607, 0.73297520591714, 0.122191352246653, 0.141680756728494},
-    {-0.12473839265364, -0.0284651216515657, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.0854504447630367, 0.00316750500875634, 0.672749928545405, 0.0249377141829676, 0.0289152558798902},
-    {-0.0138611057361999, -0.0540832211847061, -0.0914189644747004, -0.0623377689723666, 0.11082776991498, 0.0180137626702943, 0.0936738622360728, 0.141822053505759, 0.737492757359529, 0.119870854681338},
-    {-0.108014411398703, -0.0396820896985505, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.0603225179288914, 0.0464809196626873, 0.474918179055459, 0.365943506420742, 0.0594798531131275},
-    {-0.10678724824909, -0.0188623697671714, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.0553660878277078, 0.00948616958726982, 0.435896287412199, 0.0746844551798748, 0.0121390879903345},
-    {-0.113646757786535, -0.0212000160735007, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.00647728608404029, 0.0647928078398051, 0.050995565468269, 0.510112697076803, 0.0154985435047958},
-    {-0.0927575594483608, -0.0151385367967613, 0.0147498566399773, -0.106180538748753, 0.71390981117415, 0.0216904270965779, 0.0321501561271397, 0.170768371303483, 0.253117643766939, 0.00769036888560862},
-    {-0.0494020059140976, -0.00695995435590164, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.0199082222175353, 0.00656144145796828, 0.156737101971251, 0.0516581193256994, 0.00156950731540954},
-    {-0.0655273725373765, -0.0655273725373763, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.123343025642419, 0.138766464507087, 0.123343025642419, 0.138766464507087, 0.713829662988655},
-    {-0.120473369102135, -0.120473369102135, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.413037631942832, 0.0688558444657068, 0.413037631942832, 0.0688558444657067, 0.354201891821236},
-    {-0.0982881990625207, -0.0982881990625206, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.379100186654221, 0.014052609595862, 0.379100186654221, 0.014052609595862, 0.0722881396997255},
-    {-0.123875304471457, -0.123875304471457, -0.0914189644747004, -0.0623377689723666, 0.11082776991498, 0.0799179080880265, 0.415583309797801, 0.0799179080880263, 0.415583309797801, 0.299677136703346},
-    {-0.118458140383472, -0.118458140383472, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.267620348492175, 0.206212213041715, 0.267620348492175, 0.206212213041715, 0.148699632782819},
-    {-0.0719291250008815, -0.0719291250008814, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.245631187619954, 0.0420853123835723, 0.245631187619953, 0.0420853123835723, 0.0303477199758362},
-    {-0.0790472945586147, -0.0790472945586147, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.0287364257761548, 0.287452752458304, 0.0287364257761545, 0.287452752458304, 0.0387463587619893},
-    {-0.0597158247867675, -0.0597158247867675, 0.0147498566399773, -0.106180538748753, 0.71390981117415, 0.0962293992000305, 0.14263389994704, 0.0962293992000302, 0.142633899947039, 0.0192259222140214},
-    {-0.0293581106215567, -0.0293581106215567, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.0883226620943931, 0.0291097803918338, 0.0883226620943929, 0.0291097803918338, 0.0039237682885237},
-    {-0.0770862288075736, 0.374329281526014, -0.0686336640467425, -0.0623377689723666, 0.0239775348061957, 0.218884122479203, 0.246254505716693, 0.0278019288056342, 0.0312784232974808, 0.285531865195462},
-    {-0.0580763339388314, 0.0296507308273036, -0.051154913373837, -0.106180538748753, 0.080293345688546, 0.73297520591714, 0.122191352246653, 0.0931000579685245, 0.0155203366847606, 0.141680756728494},
-    {-0.0284651216515658, -0.12473839265364, -0.0247673585365706, 0.289054022006834, 0.073696002454887, 0.672749928545405, 0.0249377141829676, 0.0854504447630365, 0.00316750500875629, 0.0289152558798902},
-    {-0.0540832211847061, -0.0138611057361997, -0.0914189644747004, -0.0623377689723666, 0.11082776991498, 0.141822053505759, 0.737492757359529, 0.0180137626702941, 0.0936738622360724, 0.119870854681338},
-    {-0.0396820896985505, -0.108014411398703, -0.12439584892476, -0.106180538748753, 0.37112791258986, 0.474918179055459, 0.365943506420742, 0.060322517928891, 0.0464809196626871, 0.0594798531131275},
-    {-0.0188623697671715, -0.10678724824909, -0.0916104925113804, 0.289054022006834, 0.340634000523421, 0.435896287412199, 0.0746844551798748, 0.0553660878277076, 0.00948616958726979, 0.0121390879903345},
-    {-0.0212000160735007, -0.113646757786535, 0.336116908319966, -0.0623377689723666, 0.213190734538724, 0.0509955654682693, 0.510112697076803, 0.00647728608404007, 0.0647928078398048, 0.0154985435047957},
-    {-0.0151385367967613, -0.0927575594483608, 0.0147498566399773, -0.106180538748753, 0.71390981117415, 0.170768371303483, 0.25311764376694, 0.0216904270965777, 0.0321501561271395, 0.0076903688856086},
-    {-0.00695995435590172, -0.0494020059140976, -0.12437750559924, 0.289054022006834, 0.655251051574542, 0.156737101971251, 0.0516581193256993, 0.0199082222175352, 0.00656144145796827, 0.00156950731540955}};
-    // Array of non-zero columns
-    static const unsigned int nzc6[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc7[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    
-    const static double FE0_C1_D001[27][7] = \
-    {{-1.99865811288677, -0.708023903707401, 0.328486271453771, 0.38087951936686, 2.70668201659417, -0.328486271453771, -0.380879519366859},
-    {-1.11229755309379, 0.388015064153407, 0.231390415744571, 0.268296967008234, 0.72428248894038, -0.231390415744571, -0.268296967008234},
-    {0.0457477733980357, 1.82000883955399, 0.104533009146939, 0.121205924697103, -1.86575661295203, -0.104533009146939, -0.121205924697102},
-    {-0.942926908148453, -0.708023903707401, 1.51831292112236, 0.246784074436586, 1.65095081185585, -1.51831292112236, -0.246784074436585},
-    {-0.368625431583845, 0.388015064153408, 1.06952128164754, 0.173838222615209, -0.0193896325695626, -1.06952128164754, -0.173838222615209},
-    {0.381709331831541, 1.82000883955399, 0.48316728053561, 0.0785332117419377, -2.20171817138554, -0.483167280535609, -0.0785332117419371},
-    {0.301373419046404, -0.708023903707401, 2.92066011219053, 0.0887372105632786, 0.406650484660997, -2.92066011219052, -0.0887372105632779},
-    {0.507877469881381, 0.388015064153408, 2.05735464869637, 0.0625077570316064, -0.895892534034789, -2.05735464869637, -0.0625077570316058},
-    {0.77767856643167, 1.82000883955399, 0.929431202319458, 0.028238524558219, -2.59768740598566, -0.929431202319458, -0.0282385245582184},
-    {-0.689768816126815, -0.708023903707401, 0.32848627145377, 1.68976881612682, 1.39779271983422, -0.32848627145377, -1.68976881612682},
-    {-0.19029726005101, 0.388015064153407, 0.231390415744571, 1.19029726005101, -0.197717804102397, -0.231390415744571, -1.19029726005101},
-    {0.462270924350466, 1.82000883955399, 0.10453300914694, 0.537729075649533, -2.28227976390446, -0.104533009146939, -0.537729075649533},
-    {-0.0948554912925191, -0.708023903707401, 1.51831292112236, 1.09485549129252, 0.80287939499992, -1.51831292112236, -1.09485549129252},
-    {0.228768172900472, 0.388015064153408, 1.06952128164754, 0.771231827099527, -0.61678323705388, -1.06952128164754, -0.771231827099527},
-    {0.651588060044801, 1.82000883955399, 0.48316728053561, 0.348411939955198, -2.47159689959879, -0.48316728053561, -0.348411939955198},
-    {0.606318104241562, -0.708023903707401, 2.92066011219053, 0.393681895758437, 0.101705799465838, -2.92066011219053, -0.393681895758437},
-    {0.722684856424887, 0.388015064153408, 2.05735464869637, 0.277315143575113, -1.11069992057829, -2.05735464869637, -0.277315143575112},
-    {0.874720020936725, 1.82000883955399, 0.929431202319459, 0.125279979063274, -2.69472886049072, -0.929431202319458, -0.125279979063273},
-    {0.619120480633141, -0.708023903707401, 0.328486271453769, 2.99865811288677, 0.0889034230742589, -0.328486271453769, -2.99865811288677},
-    {0.731703032991766, 0.388015064153407, 0.231390415744571, 2.11229755309379, -1.11971809714517, -0.231390415744571, -2.11229755309379},
-    {0.878794075302896, 1.82000883955399, 0.10453300914694, 0.954252226601964, -2.69880291485689, -0.10453300914694, -0.954252226601964},
-    {0.753215925563415, -0.708023903707401, 1.51831292112236, 1.94292690814845, -0.0451920218560143, -1.51831292112236, -1.94292690814845},
-    {0.82616177738479, 0.388015064153408, 1.06952128164754, 1.36862543158385, -1.2141768415382, -1.06952128164754, -1.36862543158385},
-    {0.921466788258061, 1.82000883955399, 0.483167280535611, 0.618290668168458, -2.74147562781205, -0.48316728053561, -0.618290668168458},
-    {0.911262789436721, -0.708023903707401, 2.92066011219053, 0.698626580953597, -0.203238885729321, -2.92066011219053, -0.698626580953596},
-    {0.937492242968393, 0.388015064153408, 2.05735464869637, 0.492122530118619, -1.3255073071218, -2.05735464869637, -0.492122530118618},
-    {0.971761475441779, 1.82000883955399, 0.929431202319459, 0.222321433568329, -2.79177031499577, -0.929431202319458, -0.222321433568328}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[7] = {10, 13, 14, 15, 17, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc5[7] = {0, 3, 4, 5, 7, 8, 9};
-    
-    // Number of operations to compute geometry constants: 47
-    const double G0 =  - 0.5*det*w[1][0]*w[2][0];
-    const double G1 =  - Jinv_22*det;
-    const double G2 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
-    const double G3 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
-    const double G4 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
-    const double G5 =  - Jinv_02*det;
-    const double G6 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
-    const double G7 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
-    const double G8 = det*w[2][0];
-    const double G9 =  - Jinv_12*det;
-    const double G10 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
+    // Number of operations to compute geometry constants: 43
+    const double G0 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
+    const double G1 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
+    const double G2 = -Jinv_12*det;
+    const double G3 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
+    const double G4 = -0.5*det*w[1][0]*w[2][0];
+    const double G5 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
+    const double G6 = -Jinv_22*det;
+    const double G7 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
+    const double G8 = -Jinv_02*det;
+    const double G9 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
+    const double G10 = det*w[2][0];
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 5447
+    // Total number of operations to compute element tensor: 25043
     
     // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 5400
-    for (unsigned int ip = 0; ip < 27; ip++)
+    // Number of operations to compute element tensor for following IP loop = 25000
+    for (unsigned int ip = 0; ip < 125; ip++)
     {
       
       // Function declarations
@@ -24360,114 +18962,96 @@ void UFC_SolitaryWave3DLinearForm_cell_i
       // Total number of operations to compute function values = 40
       for (unsigned int r = 0; r < 10; r++)
       {
-        F0 += FE0_C1[ip][r]*w[0][nzc6[r]];
-        F1 += FE0_C1[ip][r]*w[0][nzc7[r]];
+        F0 += FE1_C0[ip][r]*w[0][nzc4[r]];
+        F1 += FE1_C0[ip][r]*w[0][nzc0[r]];
       }// end loop over 'r'
       
       // Total number of operations to compute function values = 42
       for (unsigned int r = 0; r < 7; r++)
       {
-        F2 += FE0_C1_D100[ip][r]*w[0][nzc3[r]];
-        F3 += FE0_C1_D010[ip][r]*w[0][nzc4[r]];
-        F4 += FE0_C1_D001[ip][r]*w[0][nzc5[r]];
+        F2 += FE1_C0_D100[ip][r]*w[0][nzc3[r]];
+        F3 += FE1_C0_D010[ip][r]*w[0][nzc2[r]];
+        F4 += FE1_C0_D001[ip][r]*w[0][nzc1[r]];
       }// end loop over 'r'
       
       // Number of operations to compute ip constants: 36
+      // Number of operations: 10
+      const double Gip0 = F0*F0*F0*W125[ip]*(G2 + F2*G3 + F3*G1 + F4*G0);
+      
       // Number of operations: 4
-      const double Gip0 = W27[ip]*(F0*det + F1*G0);
+      const double Gip1 = W125[ip]*(F0*det + F1*G4);
       
       // Number of operations: 10
-      const double Gip1 = F0*F0*F0*W27[ip]*(G1 + F2*G3 + F3*G4 + F4*G2);
+      const double Gip2 = F0*F0*F0*W125[ip]*(G6 + F2*G7 + F3*G0 + F4*G5);
       
       // Number of operations: 10
-      const double Gip2 = F0*F0*F0*W27[ip]*(G5 + F2*G6 + F3*G7 + F4*G3);
+      const double Gip3 = F0*F0*F0*W125[ip]*(G8 + F2*G9 + F3*G3 + F4*G7);
       
       // Number of operations: 2
-      const double Gip3 = F1*W27[ip]*G8;
-      
-      // Number of operations: 10
-      const double Gip4 = F0*F0*F0*W27[ip]*(G9 + F2*G7 + F3*G10 + F4*G4);
-      
-      
-      // Number of operations for primary indices = 40
+      const double Gip4 = F1*G10*W125[ip];
+      
+      
+      // Number of operations for primary indices: 40
       for (unsigned int j = 0; j < 10; j++)
       {
-        // Number of operations to compute entry = 2
-        A[nzc6[j]] += FE0_C1[ip][j]*Gip0;
-        // Number of operations to compute entry = 2
-        A[nzc7[j]] += FE0_C1[ip][j]*Gip3;
+        // Number of operations to compute entry: 2
+        A[nzc4[j]] += FE1_C0[ip][j]*Gip1;
+        // Number of operations to compute entry: 2
+        A[nzc0[j]] += FE1_C0[ip][j]*Gip4;
       }// end loop over 'j'
       
-      // Number of operations for primary indices = 42
+      // Number of operations for primary indices: 42
       for (unsigned int j = 0; j < 7; j++)
       {
-        // Number of operations to compute entry = 2
-        A[nzc5[j]] += FE0_C1_D001[ip][j]*Gip1;
-        // Number of operations to compute entry = 2
-        A[nzc3[j]] += FE0_C1_D100[ip][j]*Gip2;
-        // Number of operations to compute entry = 2
-        A[nzc4[j]] += FE0_C1_D010[ip][j]*Gip4;
+        // Number of operations to compute entry: 2
+        A[nzc2[j]] += FE1_C0_D010[ip][j]*Gip0;
+        // Number of operations to compute entry: 2
+        A[nzc1[j]] += FE1_C0_D001[ip][j]*Gip2;
+        // Number of operations to compute entry: 2
+        A[nzc3[j]] += FE1_C0_D100[ip][j]*Gip3;
       }// end loop over 'j'
     }// end loop over 'ip'
 }
 
 /// Constructor
-UFC_SolitaryWave3DLinearForm_cell_integral_0::UFC_SolitaryWave3DLinearForm_cell_integral_0() : ufc::cell_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_cell_integral_0::~UFC_SolitaryWave3DLinearForm_cell_integral_0()
+solitarywave3d_1_cell_integral_0::solitarywave3d_1_cell_integral_0() : ufc::cell_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_cell_integral_0::~solitarywave3d_1_cell_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local cell
-void UFC_SolitaryWave3DLinearForm_cell_integral_0::tabulate_tensor(double* A,
+void solitarywave3d_1_cell_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
+    for (unsigned int j = 0; j < 20; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c);
 }
 
 /// Constructor
-UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0_quadrature::UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0_quadrature::~UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0_quadrature()
+solitarywave3d_1_exterior_facet_integral_0_quadrature::solitarywave3d_1_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_exterior_facet_integral_0_quadrature::~solitarywave3d_1_exterior_facet_integral_0_quadrature()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
+void solitarywave3d_1_exterior_facet_integral_0_quadrature::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
@@ -24476,13 +19060,13 @@ void UFC_SolitaryWave3DLinearForm_exteri
     const double * const * x = c.coordinates;
     
     // Compute Jacobian of affine map from reference cell
-      
-    // Compute sub determinants
-    
-    
-      
-    // Compute determinant of Jacobian
-      
+    
+    // Compute sub determinants
+    
+    
+    
+    // Compute determinant of Jacobian
+    
     // Compute inverse of Jacobian
     
     // Vertices on faces
@@ -24502,41 +19086,63 @@ void UFC_SolitaryWave3DLinearForm_exteri
                   - (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
     const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
     
+    const bool direction = a0*(x[facet][0] - x[v0][0]) + a1*(x[facet][1] - x[v0][1])  + a2*(x[facet][2] - x[v0][2]) < 0;
+    // Compute facet normals from the facet scale factor constants
+    const double n2 = direction ? a2 / det : -a2 / det;
+    
     
     // Array of quadrature weights
-    const static double W9[9] = {0.0558144204830443, 0.063678085099885, 0.0193963833059595, 0.0893030727728709, 0.101884936159816, 0.0310342132895351, 0.0558144204830443, 0.063678085099885, 0.0193963833059595};
-    
-    
-    const static double FE0_f0_C1[9][6] = \
-    {{0.499278833175498, -0.0816158215904471, -0.072892306371455, 0.0363981897820603, 0.286562341986258, 0.332268763018086},
-    {0.0251290590975513, -0.0576951799472842, -0.0741406382908807, 0.109006741895514, 0.858208263567717, 0.139491753677383},
-    {-0.117413197449647, -0.0227857341019971, 0.453155393641927, 0.0753983311062781, 0.593609805131561, 0.0180354016718773},
-    {-0.0403700664710396, -0.0403700664710397, -0.072892306371455, 0.161480265884159, 0.161480265884159, 0.830671907545217},
-    {-0.120901875682904, -0.120901875682904, -0.0741406382908807, 0.483607502731615, 0.483607502731616, 0.348729384193458},
-    {-0.0836260170297298, -0.0836260170297299, 0.453155393641927, 0.33450406811892, 0.33450406811892, 0.0450885041796932},
-    {-0.0816158215904472, 0.499278833175498, -0.072892306371455, 0.286562341986258, 0.0363981897820605, 0.332268763018087},
-    {-0.0576951799472843, 0.0251290590975512, -0.0741406382908807, 0.858208263567716, 0.109006741895515, 0.139491753677383},
-    {-0.0227857341019971, -0.117413197449647, 0.453155393641927, 0.593609805131561, 0.0753983311062786, 0.0180354016718773}};
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {11, 12, 13, 14, 15, 16};
-    // Array of non-zero columns
-    static const unsigned int nzc1[6] = {1, 2, 3, 4, 5, 6};
-    // Array of non-zero columns
-    static const unsigned int nzc2[6] = {10, 11, 13, 15, 17, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {0, 1, 3, 5, 7, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc9[6] = {0, 1, 2, 6, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc10[6] = {10, 11, 12, 16, 18, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc8[6] = {10, 12, 13, 14, 17, 18};
-    // Array of non-zero columns
-    static const unsigned int nzc7[6] = {0, 2, 3, 4, 7, 8};
+    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
+    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
+    
+    // Value of basis functions at quadrature points.
+    static const double FE0_f0_C0[25][6] = \
+    {{0.759842524889053, -0.0409849230988147, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
+    {0.404143384962011, -0.0347905350890821, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
+    {0.0382038937201701, -0.0249744559383749, -0.0543309414249184, 0.0461882014671774, 0.938423301877432, 0.0564900002985142},
+    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218534},
+    {-0.0762735703276686, -0.00457955736373825, 0.723813068870285, 0.0166673234982245, 0.338636367163553, 0.00173636815934473},
+    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
+    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
+    {-0.0585120870225411, -0.0960538647466012, -0.0543309414249184, 0.227214213208259, 0.75739729013635, 0.224285389849452},
+    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372834},
+    {-0.0643063527627086, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032827},
+    {-0.0191125161665051, -0.0191125161665051, -0.036640207614552, 0.0764500646660208, 0.0764500646660208, 0.921965110615521},
+    {-0.0794020521078099, -0.07940205210781, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
+    {-0.123076437918076, -0.123076437918076, -0.0543309414249184, 0.492305751672305, 0.492305751672305, 0.315872313916461},
+    {-0.105896858921167, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.0927420088040289},
+    {-0.0444129613327221, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330888, 0.0097091631333821},
+    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877739, 0.65464206627708},
+    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320685},
+    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249184, 0.75739729013635, 0.227214213208259, 0.224285389849452},
+    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.65167626994723, 0.195498601422111, 0.0658515377372834},
+    {-0.0217044058396818, -0.0643063527627087, 0.723813068870285, 0.273311911925214, 0.0819917787365635, 0.00689399907032831},
+    {-0.0409849230988147, 0.759842524889053, -0.036640207614552, 0.145727572487076, 0.00717255684496533, 0.164882476492272},
+    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.029798051046164, 0.115025523822223},
+    {-0.024974455938375, 0.0382038937201699, -0.0543309414249184, 0.938423301877431, 0.0461882014671778, 0.0564900002985144},
+    {-0.0138776265525463, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743823, 0.0165858034218534},
+    {-0.00457955736373818, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982247, 0.00173636815934472}};
+    
+    // Array of non-zero columns
+    static const unsigned int nzc1[6] = {11, 12, 13, 14, 15, 16};
+    // Array of non-zero columns
+    static const unsigned int nzc0[6] = {1, 2, 3, 4, 5, 6};
+    // Array of non-zero columns
+    static const unsigned int nzc5[6] = {10, 11, 13, 15, 17, 19};
+    // Array of non-zero columns
+    static const unsigned int nzc4[6] = {0, 1, 3, 5, 7, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc2[6] = {0, 2, 3, 4, 7, 8};
+    // Array of non-zero columns
+    static const unsigned int nzc3[6] = {10, 12, 13, 14, 17, 18};
+    // Array of non-zero columns
+    static const unsigned int nzc6[6] = {0, 1, 2, 6, 8, 9};
+    // Array of non-zero columns
+    static const unsigned int nzc7[6] = {10, 11, 12, 16, 18, 19};
     
     // Number of operations to compute geometry constants: 1
     // Should be added to total operation count.
-    const double G0 = det*w[3][2];
+    const double G0 = det*n2;
     
     // Compute element tensor using UFL quadrature representation
     // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
@@ -24544,11 +19150,11 @@ void UFC_SolitaryWave3DLinearForm_exteri
     {
     case 0:
       {
-      // Total number of operations to compute element tensor (from this point): 252
+      // Total number of operations to compute element tensor (from this point): 700
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 252
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 700
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -24557,30 +19163,30 @@ void UFC_SolitaryWave3DLinearForm_exteri
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc0[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 12
+        const double Gip0 = F0*F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 12
         for (unsigned int j = 0; j < 6; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc1[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc0[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
       break;
     case 1:
       {
-      // Total number of operations to compute element tensor (from this point): 252
+      // Total number of operations to compute element tensor (from this point): 700
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 252
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 700
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -24589,30 +19195,30 @@ void UFC_SolitaryWave3DLinearForm_exteri
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc8[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 12
+        const double Gip0 = F0*F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 12
         for (unsigned int j = 0; j < 6; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc7[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc2[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
       break;
     case 2:
       {
-      // Total number of operations to compute element tensor (from this point): 252
+      // Total number of operations to compute element tensor (from this point): 700
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 252
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 700
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -24621,30 +19227,30 @@ void UFC_SolitaryWave3DLinearForm_exteri
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc2[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 12
+        const double Gip0 = F0*F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 12
         for (unsigned int j = 0; j < 6; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc3[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc4[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
       break;
     case 3:
       {
-      // Total number of operations to compute element tensor (from this point): 252
+      // Total number of operations to compute element tensor (from this point): 700
       
       // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 252
-      for (unsigned int ip = 0; ip < 9; ip++)
+      // Number of operations to compute element tensor for following IP loop = 700
+      for (unsigned int ip = 0; ip < 25; ip++)
       {
         
         // Function declarations
@@ -24653,19 +19259,19 @@ void UFC_SolitaryWave3DLinearForm_exteri
         // Total number of operations to compute function values = 12
         for (unsigned int r = 0; r < 6; r++)
         {
-          F0 += FE0_f0_C1[ip][r]*w[0][nzc10[r]];
+          F0 += FE0_f0_C0[ip][r]*w[0][nzc7[r]];
         }// end loop over 'r'
         
         // Number of operations to compute ip constants: 4
         // Number of operations: 4
-        const double Gip0 = F0*F0*F0*W9[ip]*G0;
-        
-        
-        // Number of operations for primary indices = 12
+        const double Gip0 = F0*F0*F0*G0*W25[ip];
+        
+        
+        // Number of operations for primary indices: 12
         for (unsigned int j = 0; j < 6; j++)
         {
-          // Number of operations to compute entry = 2
-          A[nzc9[j]] += FE0_f0_C1[ip][j]*Gip0;
+          // Number of operations to compute entry: 2
+          A[nzc6[j]] += FE0_f0_C0[ip][j]*Gip0;
         }// end loop over 'j'
       }// end loop over 'ip'
       }
@@ -24674,160 +19280,136 @@ void UFC_SolitaryWave3DLinearForm_exteri
 }
 
 /// Constructor
-UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0::UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0::~UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0()
+solitarywave3d_1_exterior_facet_integral_0::solitarywave3d_1_exterior_facet_integral_0() : ufc::exterior_facet_integral()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_1_exterior_facet_integral_0::~solitarywave3d_1_exterior_facet_integral_0()
 {
     // Do nothing
 }
 
 /// Tabulate the tensor for the contribution from a local exterior facet
-void UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0::tabulate_tensor(double* A,
+void solitarywave3d_1_exterior_facet_integral_0::tabulate_tensor(double* A,
                                     const double * const * w,
                                     const ufc::cell& c,
                                     unsigned int facet) const
 {
     // Reset values of the element tensor block
-    A[0] = 0;
-    A[1] = 0;
-    A[2] = 0;
-    A[3] = 0;
-    A[4] = 0;
-    A[5] = 0;
-    A[6] = 0;
-    A[7] = 0;
-    A[8] = 0;
-    A[9] = 0;
-    A[10] = 0;
-    A[11] = 0;
-    A[12] = 0;
-    A[13] = 0;
-    A[14] = 0;
-    A[15] = 0;
-    A[16] = 0;
-    A[17] = 0;
-    A[18] = 0;
-    A[19] = 0;
+    for (unsigned int j = 0; j < 20; j++)
+      A[j] = 0;
     
     // Add all contributions to element tensor
     integral_0_quadrature.tabulate_tensor(A, w, c, facet);
 }
 
 /// Constructor
-UFC_SolitaryWave3DLinearForm::UFC_SolitaryWave3DLinearForm() : ufc::form()
-{
-    // Do nothing
-}
-
-/// Destructor
-UFC_SolitaryWave3DLinearForm::~UFC_SolitaryWave3DLinearForm()
+solitarywave3d_form_1::solitarywave3d_form_1() : ufc::form()
+{
+    // Do nothing
+}
+
+/// Destructor
+solitarywave3d_form_1::~solitarywave3d_form_1()
 {
     // Do nothing
 }
 
 /// Return a string identifying the form
-const char* UFC_SolitaryWave3DLinearForm::signature() const
-{
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('tetrahedron', 1), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),))), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(0),))), MultiIndex((Index(1),))), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),))), MultiIndex((FixedIndex(0),))), MultiIndex((Index(2),))), MultiIndex((Index(1),)))), MultiIndex((Index(1),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Constant(Cell('tetrahedron', 1), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),)))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4})), Integral(Product(Indexed(VectorConstant(Cell('tetrahedron', 1), 3, 3), MultiIndex((FixedIndex(2),))), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),))), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+const char* solitarywave3d_form_1::signature() const
+{
+    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1, Space(3)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2}))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('tetrahedron', 1, Space(3))), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, None))])";
 }
 
 /// Return the rank of the global tensor (r)
-unsigned int UFC_SolitaryWave3DLinearForm::rank() const
+unsigned int solitarywave3d_form_1::rank() const
 {
     return 1;
 }
 
 /// Return the number of coefficients (n)
-unsigned int UFC_SolitaryWave3DLinearForm::num_coefficients() const
-{
-    return 4;
+unsigned int solitarywave3d_form_1::num_coefficients() const
+{
+    return 3;
 }
 
 /// Return the number of cell integrals
-unsigned int UFC_SolitaryWave3DLinearForm::num_cell_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave3d_form_1::num_cell_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of exterior facet integrals
-unsigned int UFC_SolitaryWave3DLinearForm::num_exterior_facet_integrals() const
-{
-    return 1;
-}
-  
+unsigned int solitarywave3d_form_1::num_exterior_facet_integrals() const
+{
+    return 1;
+}
+
 /// Return the number of interior facet integrals
-unsigned int UFC_SolitaryWave3DLinearForm::num_interior_facet_integrals() const
+unsigned int solitarywave3d_form_1::num_interior_facet_integrals() const
 {
     return 0;
 }
 
 /// Create a new finite element for argument function i
-ufc::finite_element* UFC_SolitaryWave3DLinearForm::create_finite_element(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_2();
-      break;
-    case 3:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_3();
-      break;
-    case 4:
-      return new UFC_SolitaryWave3DLinearForm_finite_element_4();
+ufc::finite_element* solitarywave3d_form_1::create_finite_element(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_finite_element_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_finite_element_1();
+      break;
+    case 2:
+      return new solitarywave3d_1_finite_element_2();
+      break;
+    case 3:
+      return new solitarywave3d_1_finite_element_3();
       break;
     }
     return 0;
 }
 
 /// Create a new dof map for argument function i
-ufc::dof_map* UFC_SolitaryWave3DLinearForm::create_dof_map(unsigned int i) const
-{
-    switch (i)
-    {
-    case 0:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_0();
-      break;
-    case 1:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_1();
-      break;
-    case 2:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_2();
-      break;
-    case 3:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_3();
-      break;
-    case 4:
-      return new UFC_SolitaryWave3DLinearForm_dof_map_4();
+ufc::dof_map* solitarywave3d_form_1::create_dof_map(unsigned int i) const
+{
+    switch ( i )
+    {
+    case 0:
+      return new solitarywave3d_1_dof_map_0();
+      break;
+    case 1:
+      return new solitarywave3d_1_dof_map_1();
+      break;
+    case 2:
+      return new solitarywave3d_1_dof_map_2();
+      break;
+    case 3:
+      return new solitarywave3d_1_dof_map_3();
       break;
     }
     return 0;
 }
 
 /// Create a new cell integral on sub domain i
-ufc::cell_integral* UFC_SolitaryWave3DLinearForm::create_cell_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_cell_integral_0();
+ufc::cell_integral* solitarywave3d_form_1::create_cell_integral(unsigned int i) const
+{
+    return new solitarywave3d_1_cell_integral_0();
 }
 
 /// Create a new exterior facet integral on sub domain i
-ufc::exterior_facet_integral* UFC_SolitaryWave3DLinearForm::create_exterior_facet_integral(unsigned int i) const
-{
-    return new UFC_SolitaryWave3DLinearForm_exterior_facet_integral_0();
+ufc::exterior_facet_integral* solitarywave3d_form_1::create_exterior_facet_integral(unsigned int i) const
+{
+    return new solitarywave3d_1_exterior_facet_integral_0();
 }
 
 /// Create a new interior facet integral on sub domain i
-ufc::interior_facet_integral* UFC_SolitaryWave3DLinearForm::create_interior_facet_integral(unsigned int i) const
-{
-    return 0;
-}
-
+ufc::interior_facet_integral* solitarywave3d_form_1::create_interior_facet_integral(unsigned int i) const
+{
+    return 0;
+}
+
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/SolitaryWave3D.h
--- a/MADDs-4/cpp/SolitaryWave3D.h	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/SolitaryWave3D.h	Sat Dec 05 22:52:18 2009 -0500
@@ -19,640 +19,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_0_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_0_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_0_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_0_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -663,640 +93,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_0_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_0_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_0_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_0_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -1307,968 +167,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    vertex_values[6] = dof_values[3];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[10];
-    vertex_values[3] = dof_values[11];
-    vertex_values[5] = dof_values[12];
-    vertex_values[7] = dof_values[13];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_finite_element_0_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_finite_element_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -2279,640 +241,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_1_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_1_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_1_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_1_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -2923,640 +315,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_1_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_1_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_1_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_1_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -3567,968 +389,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    vertex_values[6] = dof_values[3];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[10];
-    vertex_values[3] = dof_values[11];
-    vertex_values[5] = dof_values[12];
-    vertex_values[7] = dof_values[13];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_finite_element_1_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_finite_element_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -4539,640 +463,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_2_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_2_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_2_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_2_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_2_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -5183,640 +537,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_2_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_2_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_2_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_2_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_2_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -5827,968 +611,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_2() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_2();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_2();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    vertex_values[6] = dof_values[3];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[10];
-    vertex_values[3] = dof_values[11];
-    vertex_values[5] = dof_values[12];
-    vertex_values[7] = dof_values[13];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_finite_element_2_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_finite_element_2_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -6799,465 +685,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_3() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_3();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_3();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    static const double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_3();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -7268,465 +759,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_finite_element_4() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_finite_element_4();
 
   /// Destructor
-  virtual ~solitarywave3d_0_finite_element_4()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_finite_element_4();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    static const double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_0_finite_element_4();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -7742,214 +838,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_0_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_0_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_0_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_0_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -7965,214 +914,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_0_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_0_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_0_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_0_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -8188,289 +990,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 20;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 12;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-    offset = offset + m.num_entities[1];
-    dofs[10] = offset + c.entity_indices[0][0];
-    dofs[11] = offset + c.entity_indices[0][1];
-    dofs[12] = offset + c.entity_indices[0][2];
-    dofs[13] = offset + c.entity_indices[0][3];
-    offset = offset + m.num_entities[0];
-    dofs[14] = offset + c.entity_indices[1][0];
-    dofs[15] = offset + c.entity_indices[1][1];
-    dofs[16] = offset + c.entity_indices[1][2];
-    dofs[17] = offset + c.entity_indices[1][3];
-    dofs[18] = offset + c.entity_indices[1][4];
-    dofs[19] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      dofs[6] = 11;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 15;
-      dofs[11] = 16;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      dofs[6] = 10;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 17;
-      dofs[11] = 18;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 13;
-      dofs[9] = 15;
-      dofs[10] = 17;
-      dofs[11] = 19;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 12;
-      dofs[9] = 16;
-      dofs[10] = 18;
-      dofs[11] = 19;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-    coordinates[10][0] = x[0][0];
-    coordinates[10][1] = x[0][1];
-    coordinates[10][2] = x[0][2];
-    coordinates[11][0] = x[1][0];
-    coordinates[11][1] = x[1][1];
-    coordinates[11][2] = x[1][2];
-    coordinates[12][0] = x[2][0];
-    coordinates[12][1] = x[2][1];
-    coordinates[12][2] = x[2][2];
-    coordinates[13][0] = x[3][0];
-    coordinates[13][1] = x[3][1];
-    coordinates[13][2] = x[3][2];
-    coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_dof_map_0_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_dof_map_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -8486,214 +1066,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_1_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_1_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_1_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_1_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -8709,214 +1142,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_1_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_1_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_1_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_1_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -8932,289 +1218,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 20;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 12;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-    offset = offset + m.num_entities[1];
-    dofs[10] = offset + c.entity_indices[0][0];
-    dofs[11] = offset + c.entity_indices[0][1];
-    dofs[12] = offset + c.entity_indices[0][2];
-    dofs[13] = offset + c.entity_indices[0][3];
-    offset = offset + m.num_entities[0];
-    dofs[14] = offset + c.entity_indices[1][0];
-    dofs[15] = offset + c.entity_indices[1][1];
-    dofs[16] = offset + c.entity_indices[1][2];
-    dofs[17] = offset + c.entity_indices[1][3];
-    dofs[18] = offset + c.entity_indices[1][4];
-    dofs[19] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      dofs[6] = 11;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 15;
-      dofs[11] = 16;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      dofs[6] = 10;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 17;
-      dofs[11] = 18;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 13;
-      dofs[9] = 15;
-      dofs[10] = 17;
-      dofs[11] = 19;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 12;
-      dofs[9] = 16;
-      dofs[10] = 18;
-      dofs[11] = 19;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-    coordinates[10][0] = x[0][0];
-    coordinates[10][1] = x[0][1];
-    coordinates[10][2] = x[0][2];
-    coordinates[11][0] = x[1][0];
-    coordinates[11][1] = x[1][1];
-    coordinates[11][2] = x[1][2];
-    coordinates[12][0] = x[2][0];
-    coordinates[12][1] = x[2][1];
-    coordinates[12][2] = x[2][2];
-    coordinates[13][0] = x[3][0];
-    coordinates[13][1] = x[3][1];
-    coordinates[13][2] = x[3][2];
-    coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_dof_map_1_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_dof_map_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -9230,214 +1294,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_2_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_2_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_2_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_2_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_2_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -9453,214 +1370,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_2_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_2_1();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_2_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_2_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_2_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -9676,289 +1446,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_2() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_2();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_2();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 20;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 12;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-    offset = offset + m.num_entities[1];
-    dofs[10] = offset + c.entity_indices[0][0];
-    dofs[11] = offset + c.entity_indices[0][1];
-    dofs[12] = offset + c.entity_indices[0][2];
-    dofs[13] = offset + c.entity_indices[0][3];
-    offset = offset + m.num_entities[0];
-    dofs[14] = offset + c.entity_indices[1][0];
-    dofs[15] = offset + c.entity_indices[1][1];
-    dofs[16] = offset + c.entity_indices[1][2];
-    dofs[17] = offset + c.entity_indices[1][3];
-    dofs[18] = offset + c.entity_indices[1][4];
-    dofs[19] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      dofs[6] = 11;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 15;
-      dofs[11] = 16;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      dofs[6] = 10;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 17;
-      dofs[11] = 18;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 13;
-      dofs[9] = 15;
-      dofs[10] = 17;
-      dofs[11] = 19;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 12;
-      dofs[9] = 16;
-      dofs[10] = 18;
-      dofs[11] = 19;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-    coordinates[10][0] = x[0][0];
-    coordinates[10][1] = x[0][1];
-    coordinates[10][2] = x[0][2];
-    coordinates[11][0] = x[1][0];
-    coordinates[11][1] = x[1][1];
-    coordinates[11][2] = x[1][2];
-    coordinates[12][0] = x[2][0];
-    coordinates[12][1] = x[2][1];
-    coordinates[12][2] = x[2][2];
-    coordinates[13][0] = x[3][0];
-    coordinates[13][1] = x[3][1];
-    coordinates[13][2] = x[3][2];
-    coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_dof_map_2_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_dof_map_2_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -9974,157 +1522,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_3() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_3();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_3();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[3];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[3][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_3();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -10140,157 +1598,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_dof_map_4() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_0_dof_map_4();
 
   /// Destructor
-  virtual ~solitarywave3d_0_dof_map_4()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_dof_map_4();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[3];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[3][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_0_dof_map_4();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -10303,732 +1671,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_cell_integral_0_quadrature() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_cell_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave3d_0_cell_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_cell_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = x[1][0] - x[0][0];
-    const double J_01 = x[2][0] - x[0][0];
-    const double J_02 = x[3][0] - x[0][0];
-    const double J_10 = x[1][1] - x[0][1];
-    const double J_11 = x[2][1] - x[0][1];
-    const double J_12 = x[3][1] - x[0][1];
-    const double J_20 = x[1][2] - x[0][2];
-    const double J_21 = x[2][2] - x[0][2];
-    const double J_22 = x[3][2] - x[0][2];
-    
-    // Compute sub determinants
-    const double d_00 = J_11*J_22 - J_12*J_21;
-    const double d_01 = J_12*J_20 - J_10*J_22;
-    const double d_02 = J_10*J_21 - J_11*J_20;
-    
-    const double d_10 = J_02*J_21 - J_01*J_22;
-    const double d_11 = J_00*J_22 - J_02*J_20;
-    const double d_12 = J_01*J_20 - J_00*J_21;
-    
-    const double d_20 = J_01*J_12 - J_02*J_11;
-    const double d_21 = J_02*J_10 - J_00*J_12;
-    const double d_22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
-    
-    // Compute inverse of Jacobian
-    const double Jinv_00 = d_00 / detJ;
-    const double Jinv_01 = d_10 / detJ;
-    const double Jinv_02 = d_20 / detJ;
-    const double Jinv_10 = d_01 / detJ;
-    const double Jinv_11 = d_11 / detJ;
-    const double Jinv_12 = d_21 / detJ;
-    const double Jinv_20 = d_02 / detJ;
-    const double Jinv_21 = d_12 / detJ;
-    const double Jinv_22 = d_22 / detJ;
-    
-    // Set scale factor
-    const double det = std::abs(detJ);
-    
-    
-    // Array of quadrature weights
-    static const double W125[125] = {0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565251, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.00225090157446143, 0.00347412941301361, 0.00245558995953753, 0.00088245817276838, 0.000113249435042247, 0.00388807060532275, 0.00600100004508522, 0.00424163688396193, 0.00152430462570915, 0.00019562019257218, 0.0034046010087031, 0.0052547941847441, 0.00371420241029555, 0.00133476204345558, 0.000171295424533231, 0.00171893840164765, 0.00265307667295562, 0.00187525208922536, 0.000673903851785402, 8.64848134932762e-05, 0.000366257730507922, 0.000565296487744311, 0.00039956380849458, 0.000143590075769372, 1.8427496577589e-05, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565252, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06};
-    // Quadrature points on the UFC reference element: (0.0434850684329929, 0.0384332743963333, 0.034578939918215), (0.0372285899889251, 0.0329036302803046, 0.173480320771696), (0.0274810994988124, 0.0242885357160768, 0.389886387065519), (0.0164705687743685, 0.0145571321830714, 0.634333472630887), (0.0067089045501621, 0.00592951049099777, 0.851054212947016), (0.0363203493206216, 0.191166323793956, 0.034578939918215), (0.0310947054204484, 0.163661986623795, 0.173480320771696), (0.0229532381913956, 0.120810681788372, 0.389886387065519), (0.0137568327003139, 0.0724068788863314, 0.634333472630887), (0.00560352704046152, 0.0294932643722359, 0.851054212947016), (0.025452983470971, 0.42283010559815, 0.034578939918215), (0.0217908978824722, 0.361994799675747, 0.173480320771696), (0.0160854287808059, 0.267214393854326, 0.389886387065519), (0.00964066816216436, 0.160152727938308, 0.634333472630887), (0.00392690279162666, 0.0652345028216781, 0.851054212947016), (0.0137918067694829, 0.671415856030076, 0.034578939918215), (0.0118074902013492, 0.574814908126993, 0.173480320771696), (0.00871595763232119, 0.42431222048264, 0.389886387065519), (0.00522383682733774, 0.254308005746508, 0.634333472630887), (0.00212780888992548, 0.103586473561889, 0.851054212947016), (0.00446245462992895, 0.870293213094632, 0.034578939918215), (0.00382041237943087, 0.745078491721125, 0.173480320771696), (0.00282012111543484, 0.54999601573695, 0.389886387065519), (0.00169021617151183, 0.329635544721039, 0.634333472630887), (0.000688470393412244, 0.134269401146344, 0.851054212947016), (0.213916656125506, 0.0384332743963333, 0.034578939918215), (0.183139081291086, 0.0329036302803046, 0.173480320771696), (0.135188126023001, 0.0242885357160768, 0.389886387065519), (0.0810238806942951, 0.0145571321830714, 0.634333472630887), (0.0330032003938849, 0.00592951049099777, 0.851054212947016), (0.178671161296432, 0.191166323793956, 0.034578939918215), (0.152964584084757, 0.163661986623795, 0.173480320771696), (0.112914159689587, 0.120810681788372, 0.389886387065519), (0.0676741639412116, 0.0724068788863314, 0.634333472630887), (0.027565502601231, 0.0294932643722359, 0.851054212947016), (0.125211188776624, 0.42283010559815, 0.034578939918215), (0.107196244066483, 0.361994799675747, 0.173480320771696), (0.0791292565731431, 0.267214393854326, 0.389886387065519), (0.0474254628170509, 0.160152727938308, 0.634333472630887), (0.0193176633816068, 0.0652345028216781, 0.851054212947016), (0.0678462123292524, 0.671415856030076, 0.034578939918215), (0.0580847383280397, 0.574814908126993, 0.173480320771696), (0.0428765224208113, 0.42431222048264, 0.389886387065519), (0.0256976876550462, 0.254308005746508, 0.634333472630887), (0.0104673576243388, 0.103586473561889, 0.851054212947016), (0.0219522104240708, 0.870293213094632, 0.034578939918215), (0.0187938037280005, 0.745078491721125, 0.173480320771696), (0.0138730580546826, 0.54999601573695, 0.389886387065519), (0.00831470213956798, 0.329635544721039, 0.634333472630887), (0.00338680125632329, 0.134269401146344, 0.851054212947016), (0.463493892842726, 0.0384332743963333, 0.034578939918215), (0.396808024474, 0.0329036302803046, 0.173480320771696), (0.292912538609202, 0.0242885357160768, 0.389886387065519), (0.175554697593021, 0.0145571321830714, 0.634333472630887), (0.0715081382809929, 0.00592951049099777, 0.851054212947016), (0.387127368143914, 0.191166323793956, 0.034578939918215), (0.331428846302255, 0.163661986623795, 0.173480320771696), (0.244651465573054, 0.120810681788372, 0.389886387065519), (0.146629824241391, 0.0724068788863314, 0.634333472630887), (0.0597262613403738, 0.0294932643722359, 0.851054212947016), (0.271295477241817, 0.42283010559815, 0.034578939918215), (0.232262439776279, 0.361994799675747, 0.173480320771696), (0.171449609540077, 0.267214393854326, 0.389886387065519), (0.102756899715403, 0.160152727938308, 0.634333472630887), (0.0418556421156527, 0.0652345028216781, 0.851054212947016), (0.147002602025855, 0.671415856030076, 0.034578939918215), (0.125852385550656, 0.574814908126993, 0.173480320771696), (0.0929006962259202, 0.42431222048264, 0.389886387065519), (0.0556792608113027, 0.254308005746508, 0.634333472630887), (0.0226796567455474, 0.103586473561889, 0.851054212947016), (0.0475639234935763, 0.870293213094632, 0.034578939918215), (0.0407205937535897, 0.745078491721125, 0.173480320771696), (0.0300587985987655, 0.54999601573695, 0.389886387065519), (0.0180154913240372, 0.329635544721039, 0.634333472630887), (0.00733819295331972, 0.134269401146344, 0.851054212947016), (0.713071129559946, 0.0384332743963333, 0.034578939918215), (0.610476967656914, 0.0329036302803046, 0.173480320771696), (0.450636951195403, 0.0242885357160768, 0.389886387065519), (0.270085514491747, 0.0145571321830714, 0.634333472630887), (0.110013076168101, 0.00592951049099777, 0.851054212947016), (0.595583574991397, 0.191166323793956, 0.034578939918215), (0.509893108519752, 0.163661986623795, 0.173480320771696), (0.376388771456521, 0.120810681788372, 0.389886387065519), (0.22558548454157, 0.0724068788863314, 0.634333472630887), (0.0918870200795167, 0.0294932643722359, 0.851054212947016), (0.417379765707011, 0.42283010559815, 0.034578939918215), (0.357328635486074, 0.361994799675747, 0.173480320771696), (0.263769962507011, 0.267214393854326, 0.389886387065519), (0.158088336613754, 0.160152727938308, 0.634333472630887), (0.0643936208496987, 0.0652345028216781, 0.851054212947016), (0.226158991722457, 0.671415856030076, 0.034578939918215), (0.193620032773272, 0.574814908126993, 0.173480320771696), (0.142924870031029, 0.42431222048264, 0.389886387065519), (0.0856608339675592, 0.254308005746508, 0.634333472630887), (0.0348919558667561, 0.103586473561889, 0.851054212947016), (0.0731756365630818, 0.870293213094632, 0.034578939918215), (0.062647383779179, 0.745078491721125, 0.173480320771696), (0.0462445391428484, 0.54999601573695, 0.389886387065519), (0.0277162805085065, 0.329635544721039, 0.634333472630887), (0.0112895846503162, 0.134269401146344, 0.851054212947016), (0.883502717252459, 0.0384332743963333, 0.034578939918215), (0.756387458959075, 0.0329036302803046, 0.173480320771696), (0.558343977719591, 0.0242885357160768, 0.389886387065519), (0.334638826411673, 0.0145571321830714, 0.634333472630887), (0.136307372011824, 0.00592951049099777, 0.851054212947016), (0.737934386967207, 0.191166323793956, 0.034578939918215), (0.631762987184061, 0.163661986623795, 0.173480320771696), (0.466349692954713, 0.120810681788372, 0.389886387065519), (0.279502815782468, 0.0724068788863314, 0.634333472630887), (0.113848995640286, 0.0294932643722359, 0.851054212947016), (0.517137971012664, 0.42283010559815, 0.034578939918215), (0.442733981670085, 0.361994799675747, 0.173480320771696), (0.326813790299348, 0.267214393854326, 0.389886387065519), (0.195873131268641, 0.160152727938308, 0.634333472630887), (0.0797843814396788, 0.0652345028216781, 0.851054212947016), (0.280213397282226, 0.671415856030076, 0.034578939918215), (0.239897280899962, 0.574814908126993, 0.173480320771696), (0.177085434819519, 0.42431222048264, 0.389886387065519), (0.106134684795268, 0.254308005746508, 0.634333472630887), (0.0432315046011695, 0.103586473561889, 0.851054212947016), (0.0906653923572237, 0.870293213094632, 0.034578939918215), (0.0776207751277486, 0.745078491721125, 0.173480320771696), (0.0572974760820962, 0.54999601573695, 0.389886387065519), (0.0343407664765626, 0.329635544721039, 0.634333472630887), (0.0139879155132272, 0.134269401146344, 0.851054212947016)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE1_C0[125][10] = \
-    {{0.677651385532498, -0.0397031660797488, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.00601467027473595, 0.00668509426891429, 0.12220234950981, 0.135823609448279, 0.153676704481833},
-    {0.387856517182057, -0.0344566541637981, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.0258337109326268, 0.00489982304341057, 0.524873356031632, 0.0995515731929938, 0.112636954329409},
-    {0.0651520171918798, -0.0259706778394852, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.0428580263847204, 0.00266990266677583, 0.870762864851529, 0.0542454305787948, 0.0613756256250992},
-    {-0.110672538127309, -0.015928009502866, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.0417913323474042, 0.000959056987115393, 0.849090435339365, 0.0194855265186504, 0.0220467672199497},
-    {-0.0991479726822843, -0.00661888574963566, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.0228385659266996, 0.000159122079653143, 0.464019852825595, 0.00323294396937779, 0.0036578925932431},
-    {0.351159931970128, -0.0336820137710776, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0050236767078656, 0.0277729106341423, 0.102067955322095, 0.564272815830671, 0.107208138841391},
-    {0.166485956767395, -0.0291609440100794, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.0215772778825633, 0.0203560850503691, 0.438393782673502, 0.413582342231706, 0.0785779359281236},
-    {-0.0313856207168029, -0.0218995359044537, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.0357966204395903, 0.0110919854206136, 0.727293587580909, 0.225360097430627, 0.0428169423314949},
-    {-0.123259167721812, -0.013378331808425, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.0349056778367692, 0.00398435727676459, 0.709191966981616, 0.080951706122999, 0.0153802939039443},
-    {-0.0879258080236823, -0.00554072800987512, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0190756211805894, 0.000661065217685219, 0.387566669517808, 0.01343111410773, 0.00255182370239899},
-    {0.0177253911135257, -0.0241572747358239, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0035205487447283, 0.0430491507552746, 0.071528331316298, 0.874646011568391, 0.0526508169135872},
-    {-0.0507072246191906, -0.0208412114214236, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0151211678182184, 0.0315527668548808, 0.307222532626625, 0.641069596017233, 0.0385902839346927},
-    {-0.113199283239695, -0.0155679467426812, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.0250859588469928, 0.0171930324062, 0.509680991772005, 0.349317395512301, 0.0210277597937817},
-    {-0.119140564162676, -0.00945478319693843, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.0244615940551512, 0.00617591722127442, 0.49699553421089, 0.125478465209964, 0.00755339144178017},
-    {-0.0670532863962545, -0.00389606166055687, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0133680286585892, 0.00102467820496327, 0.271603335806442, 0.0208187778246103, 0.00125322204081482},
-    {-0.123174301249333, -0.0134113789015495, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00190762423058253, 0.0370401509933353, 0.038757928915604, 0.752558872029367, 0.0154585961181473},
-    {-0.124795870133571, -0.0115286565516393, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.00819346875055506, 0.0271484855811957, 0.166469828971132, 0.551586133921709, 0.0113303391742265},
-    {-0.114366932369083, -0.00856402179742438, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0135929329243276, 0.0147931493464113, 0.276172801534836, 0.300558056253616, 0.00617387658875252},
-    {-0.083605542162086, -0.00516925988494044, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0132546182205693, 0.00531385410362168, 0.269299132691067, 0.107963600123275, 0.00221772110036569},
-    {-0.0394935786210076, -0.00211875374858136, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.00724352288046892, 0.00088164887728405, 0.147169416491454, 0.0179127964336388, 0.000367953519260986},
-    {-0.0742249656146451, -0.00442262762728059, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.000617227802144495, 0.0155345759126796, 0.0125404526199273, 0.315621902524215, 0.00161836079959531},
-    {-0.0655708056648836, -0.00379122127793308, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.00265106546025557, 0.0113860283736764, 0.0538627078708379, 0.23133428023363, 0.00118617348079641},
-    {-0.0507314745513395, -0.00280421494922342, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.00439810733113653, 0.00620422150953917, 0.0893580237504861, 0.126053534227744, 0.000646343288641082},
-    {-0.0319821899921671, -0.00168450251009896, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0042886427742881, 0.00222862131357039, 0.0871339906075373, 0.0452797490545588, 0.000232173275363283},
-    {-0.0135965919524168, -0.000687522410446964, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.00234370251521121, 0.000369762029721776, 0.0476178977115156, 0.00751259615698667, 3.85210627857485e-05},
-    {0.303869742063848, -0.12239598458967, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0295880447986775, 0.0328860701712706, 0.0986289749858682, 0.109622633545923, 0.610151166460404},
-    {0.134887288422247, -0.1160592350988, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.127084106272845, 0.0241037624827062, 0.423622960691414, 0.0803476337536982, 0.447208764024221},
-    {-0.0444896276300268, -0.0986364671877792, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.210832040117064, 0.0131340865091965, 0.702788851119186, 0.0437812467363741, 0.2436830597953},
-    {-0.124193144215204, -0.0678941422087684, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.205584638427372, 0.004717901365009, 0.685297129259398, 0.0157266821407568, 0.0875335060137464},
-    {-0.0858073223121642, -0.030824777921407, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.112350050943802, 0.000782771291888182, 0.374508367808493, 0.00260929475714278, 0.0145231343948943},
-    {0.113856014607669, -0.114824393538401, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0247130374063482, 0.136623636292144, 0.0823785946236127, 0.45542209017267, 0.425654435971174},
-    {0.0100888557121195, -0.106168256116312, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.106145380454931, 0.100137950857575, 0.353825680101135, 0.333800476424499, 0.311982349089632},
-    {-0.0930517568994226, -0.0874149447727761, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.17609477507965, 0.0545649464626408, 0.58699543294085, 0.1818871363886, 0.169998487382437},
-    {-0.12380786286986, -0.0585145790109275, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.171711949680883, 0.0196002999689002, 0.572385695137502, 0.0653357634308634, 0.0610652362544955},
-    {-0.0750005711613296, -0.026045788733914, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0938389484831186, 0.00325198662308666, 0.312803342215279, 0.0108401927023285, 0.0101316475640852},
-    {-0.0689680280637322, -0.0938555051869132, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0173186806951808, 0.211772240689959, 0.0577301993658455, 0.705922921633706, 0.209042466541935},
-    {-0.101961128009395, -0.084214174582561, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0743857552246981, 0.155217931587356, 0.247957945220146, 0.517404431284758, 0.153217150486034},
-    {-0.124620776265111, -0.0666063780815064, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.123405679825933, 0.0845779053253436, 0.411361270793064, 0.281932522593157, 0.0834876841580225},
-    {-0.108104492267147, -0.0429271137702279, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.120334234079468, 0.03038126897555, 0.401122894186573, 0.101273113455689, 0.0299896501195402},
-    {-0.0561005440374291, -0.0185713191445566, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0657615152208353, 0.00504071266550263, 0.219209849244195, 0.0168027433640709, 0.00497573716598929},
-    {-0.12386321264862, -0.0586399952744004, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00938420039924693, 0.182212090917773, 0.0312813527469397, 0.607386932104929, 0.0613761238902858},
-    {-0.118642598591026, -0.051337064674766, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0403062361483535, 0.13355189410245, 0.134357061573334, 0.445182725400454, 0.0449854757548079},
-    {-0.102069833084256, -0.0391997300710066, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0668678896663356, 0.0727721297397925, 0.222897844792828, 0.242579075860235, 0.0245124855775079},
-    {-0.0709852770155237, -0.0243769453534135, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0652036137952374, 0.0261405107994058, 0.217350137116399, 0.0871369434274908, 0.00880514142227651},
-    {-0.0324570586983408, -0.0102482264730672, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0356331552184666, 0.00433710665526561, 0.118779784153456, 0.0144573386556573, 0.00146090632108002},
-    {-0.0624662889902574, -0.0209884113390654, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00303633666130402, 0.0764194389779763, 0.0101213437607678, 0.254737039458918, 0.00642546788699245},
-    {-0.0547979943904275, -0.0180873896108673, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0130414203970155, 0.0560114357414459, 0.043472352934078, 0.18670887286586, 0.00470953053927457},
-    {-0.0419674243417796, -0.0134881345751054, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0216356659299618, 0.0305205066246512, 0.0721204651516608, 0.101737249112632, 0.00256621270496322},
-    {-0.0261798960980541, -0.00817643359622851, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0210971755283347, 0.0109632854758787, 0.0703254578534908, 0.0365450848922505, 0.000921810467379901},
-    {-0.0110346752071629, -0.00336386041082359, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0115294059104329, 0.00181897510595286, 0.0384321943162941, 0.00606338308075562, 0.000152942317908342},
-    {-0.0338407154377174, -0.0338407154377172, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0641085098922729, 0.0712543518585967, 0.0641085098922728, 0.0712543518585967, 0.859306354810017},
-    {-0.0818948079000829, -0.0818948079000828, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.27535353348213, 0.0522256981182022, 0.275353533482129, 0.0522256981182022, 0.629826433147834},
-    {-0.121317028060228, -0.121317028060227, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.456810445618125, 0.0284576666227853, 0.456810445618125, 0.0284576666227853, 0.343191021097949},
-    {-0.113915793899067, -0.113915793899067, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.445440883843385, 0.0102222917528829, 0.445440883843385, 0.0102222917528829, 0.123277807387908},
-    {-0.0612813106001657, -0.0612813106001656, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.243429209376147, 0.00169603302451547, 0.243429209376147, 0.00169603302451546, 0.0204536553616545},
-    {-0.0873921698118468, -0.0873921698118467, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0535458160149806, 0.296022863232407, 0.0535458160149805, 0.296022863232407, 0.599470396664135},
-    {-0.111738685979768, -0.111738685979767, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.229985530278033, 0.216969213641037, 0.229985530278033, 0.216969213641037, 0.439380320644974},
-    {-0.124942786358968, -0.124942786358967, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.38154510401025, 0.118226041425621, 0.38154510401025, 0.118226041425621, 0.239417358428173},
-    {-0.103629213527269, -0.103629213527268, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.372048822409193, 0.0424680316998818, 0.372048822409192, 0.0424680316998817, 0.0860012214282448},
-    {-0.0525918087529765, -0.0525918087529765, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.203321145349199, 0.00704608966270762, 0.203321145349198, 0.00704608966270757, 0.0142689051747946},
-    {-0.124093005298086, -0.124093005298086, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0375244400305132, 0.458847581161833, 0.037524440030513, 0.458847581161833, 0.294404943887462},
-    {-0.12437075791462, -0.12437075791462, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.161171850222422, 0.336311181436057, 0.161171850222422, 0.336311181436057, 0.215783363723318},
-    {-0.112659672317187, -0.112659672317187, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.267383475309499, 0.183255213959251, 0.267383475309499, 0.18325521395925, 0.11757987444578},
-    {-0.08163893883716, -0.0816389388371599, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.260728564133021, 0.0658271912156194, 0.26072856413302, 0.0658271912156194, 0.0422359217564853},
-    {-0.0383518525618255, -0.0383518525618255, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.142485682232515, 0.0109217280147868, 0.142485682232515, 0.0109217280147868, 0.00700757910765451},
-    {-0.103783072021111, -0.103783072021111, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0203327765730934, 0.394799511511351, 0.0203327765730932, 0.394799511511351, 0.0864390600094873},
-    {-0.094174739653074, -0.0941747396530738, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0873316488608436, 0.289367309751452, 0.0873316488608435, 0.289367309751452, 0.0633552917951636},
-    {-0.0756396175073989, -0.0756396175073988, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.144882867229582, 0.157675602800014, 0.144882867229582, 0.157675602800014, 0.0345221574370429},
-    {-0.0494789006423166, -0.0494789006423165, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.141276875455818, 0.0566387271134483, 0.141276875455818, 0.0566387271134482, 0.0124007203379724},
-    {-0.0216509230853557, -0.0216509230853557, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0772064696859616, 0.00939722265546143, 0.0772064696859615, 0.00939722265546143, 0.00205746732038352},
-    {-0.0430392698573708, -0.0430392698573707, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00657884021103599, 0.165578239218447, 0.00657884021103578, 0.165578239218447, 0.00904930727241116},
-    {-0.0374042602423, -0.0374042602422999, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0282568866655468, 0.121360154303653, 0.0282568866655467, 0.121360154303653, 0.00663266702257968},
-    {-0.0282517358523633, -0.0282517358523632, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0468780655408114, 0.0661288778686417, 0.0468780655408113, 0.0661288778686419, 0.0036141254928047},
-    {-0.0173663754687444, -0.0173663754687443, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0457113166909128, 0.0237541851840646, 0.0457113166909126, 0.0237541851840646, 0.00129823171058596},
-    {-0.00723049480167941, -0.00723049480167938, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0249808001133636, 0.00394117909335424, 0.0249808001133633, 0.00394117909335422, 0.000215396303280713},
-    {-0.12239598458967, 0.303869742063848, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0986289749858684, 0.109622633545923, 0.0295880447986773, 0.0328860701712705, 0.610151166460404},
-    {-0.1160592350988, 0.134887288422247, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.423622960691414, 0.0803476337536981, 0.127084106272845, 0.0241037624827062, 0.447208764024221},
-    {-0.0986364671877794, -0.0444896276300268, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.702788851119186, 0.0437812467363741, 0.210832040117064, 0.0131340865091965, 0.2436830597953},
-    {-0.0678941422087684, -0.124193144215204, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.685297129259398, 0.0157266821407568, 0.205584638427371, 0.00471790136500898, 0.0875335060137464},
-    {-0.030824777921407, -0.0858073223121641, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.374508367808493, 0.00260929475714279, 0.112350050943801, 0.000782771291888154, 0.0145231343948942},
-    {-0.114824393538401, 0.113856014607669, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0823785946236129, 0.45542209017267, 0.0247130374063481, 0.136623636292144, 0.425654435971174},
-    {-0.106168256116312, 0.0100888557121194, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.353825680101135, 0.333800476424499, 0.106145380454931, 0.100137950857575, 0.311982349089632},
-    {-0.0874149447727762, -0.0930517568994225, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.58699543294085, 0.1818871363886, 0.17609477507965, 0.0545649464626407, 0.169998487382437},
-    {-0.0585145790109276, -0.12380786286986, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.572385695137502, 0.0653357634308634, 0.171711949680883, 0.0196002999689001, 0.0610652362544955},
-    {-0.026045788733914, -0.0750005711613296, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.312803342215279, 0.0108401927023285, 0.0938389484831182, 0.00325198662308662, 0.0101316475640852},
-    {-0.0938555051869133, -0.0689680280637323, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0577301993658456, 0.705922921633706, 0.0173186806951807, 0.211772240689959, 0.209042466541935},
-    {-0.0842141745825612, -0.101961128009395, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.247957945220146, 0.517404431284758, 0.0743857552246979, 0.155217931587356, 0.153217150486034},
-    {-0.0666063780815065, -0.124620776265111, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.411361270793064, 0.281932522593158, 0.123405679825933, 0.0845779053253435, 0.0834876841580226},
-    {-0.042927113770228, -0.108104492267147, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.401122894186574, 0.101273113455689, 0.120334234079468, 0.0303812689755499, 0.0299896501195402},
-    {-0.0185713191445567, -0.0561005440374291, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.219209849244196, 0.016802743364071, 0.065761515220835, 0.00504071266550261, 0.00497573716598929},
-    {-0.0586399952744005, -0.12386321264862, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0312813527469399, 0.607386932104929, 0.00938420039924669, 0.182212090917773, 0.0613761238902859},
-    {-0.0513370646747661, -0.118642598591026, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.134357061573334, 0.445182725400454, 0.0403062361483534, 0.13355189410245, 0.0449854757548079},
-    {-0.0391997300710068, -0.102069833084256, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.222897844792828, 0.242579075860235, 0.0668678896663356, 0.0727721297397927, 0.024512485577508},
-    {-0.0243769453534136, -0.0709852770155237, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.217350137116399, 0.0871369434274908, 0.0652036137952371, 0.0261405107994057, 0.00880514142227651},
-    {-0.0102482264730672, -0.0324570586983408, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.118779784153457, 0.0144573386556573, 0.0356331552184663, 0.0043371066552656, 0.00146090632108002},
-    {-0.0209884113390655, -0.0624662889902573, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.010121343760768, 0.254737039458918, 0.00303633666130378, 0.0764194389779762, 0.00642546788699245},
-    {-0.0180873896108673, -0.0547979943904275, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0434723529340782, 0.186708872865861, 0.0130414203970153, 0.0560114357414458, 0.00470953053927457},
-    {-0.0134881345751056, -0.0419674243417795, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0721204651516608, 0.101737249112632, 0.0216356659299618, 0.0305205066246514, 0.00256621270496323},
-    {-0.00817643359622858, -0.0261798960980541, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0703254578534909, 0.0365450848922505, 0.0210971755283345, 0.0109632854758786, 0.000921810467379901},
-    {-0.00336386041082355, -0.0110346752071629, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0384321943162945, 0.00606338308075567, 0.0115294059104325, 0.00181897510595279, 0.000152942317908342},
-    {-0.0397031660797491, 0.677651385532497, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.12220234950981, 0.135823609448279, 0.00601467027473575, 0.00668509426891421, 0.153676704481834},
-    {-0.0344566541637982, 0.387856517182057, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.524873356031632, 0.0995515731929938, 0.0258337109326267, 0.00489982304341049, 0.112636954329409},
-    {-0.0259706778394854, 0.0651520171918798, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.870762864851529, 0.0542454305787948, 0.0428580263847204, 0.00266990266677576, 0.0613756256250995},
-    {-0.0159280095028661, -0.110672538127309, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.849090435339365, 0.0194855265186504, 0.0417913323474039, 0.000959056987115348, 0.0220467672199497},
-    {-0.00661888574963571, -0.0991479726822842, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.464019852825596, 0.0032329439693778, 0.0228385659266992, 0.000159122079653129, 0.00365789259324308},
-    {-0.0336820137710778, 0.351159931970128, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.102067955322096, 0.564272815830671, 0.00502367670786549, 0.0277729106341421, 0.107208138841391},
-    {-0.0291609440100797, 0.166485956767395, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.438393782673502, 0.413582342231706, 0.0215772778825632, 0.0203560850503691, 0.0785779359281241},
-    {-0.0218995359044539, -0.0313856207168029, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.727293587580909, 0.225360097430628, 0.0357966204395903, 0.0110919854206135, 0.0428169423314951},
-    {-0.0133783318084251, -0.123259167721811, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.709191966981616, 0.080951706122999, 0.034905677836769, 0.00398435727676454, 0.0153802939039443},
-    {-0.00554072800987505, -0.0879258080236823, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.387566669517808, 0.01343111410773, 0.0190756211805888, 0.000661065217685206, 0.00255182370239895},
-    {-0.0241572747358242, 0.0177253911135256, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0715283313162981, 0.874646011568391, 0.00352054874472815, 0.0430491507552746, 0.0526508169135876},
-    {-0.0208412114214238, -0.0507072246191906, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.307222532626626, 0.641069596017233, 0.0151211678182183, 0.0315527668548808, 0.0385902839346929},
-    {-0.0155679467426813, -0.113199283239695, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.509680991772005, 0.349317395512301, 0.0250859588469928, 0.0171930324062, 0.0210277597937819},
-    {-0.00945478319693848, -0.119140564162676, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.49699553421089, 0.125478465209964, 0.024461594055151, 0.00617591722127439, 0.00755339144178018},
-    {-0.00389606166055691, -0.0670532863962544, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.271603335806442, 0.0208187778246103, 0.013368028658589, 0.0010246782049633, 0.00125322204081482},
-    {-0.0134113789015497, -0.123174301249333, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0387579289156042, 0.752558872029367, 0.00190762423058235, 0.0370401509933354, 0.0154585961181475},
-    {-0.0115286565516395, -0.124795870133571, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.166469828971132, 0.551586133921708, 0.00819346875055494, 0.0271484855811958, 0.0113303391742266},
-    {-0.00856402179742457, -0.114366932369083, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.276172801534836, 0.300558056253616, 0.0135929329243277, 0.0147931493464114, 0.00617387658875262},
-    {-0.00516925988494049, -0.083605542162086, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.269299132691067, 0.107963600123275, 0.013254618220569, 0.0053138541036216, 0.00221772110036569},
-    {-0.00211875374858132, -0.0394935786210076, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.147169416491455, 0.0179127964336388, 0.00724352288046848, 0.000881648877284022, 0.000367953519260972},
-    {-0.00442262762728068, -0.074224965614645, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.0125404526199275, 0.315621902524215, 0.000617227802144259, 0.0155345759126795, 0.00161836079959531},
-    {-0.00379122127793318, -0.0655708056648835, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0538627078708381, 0.23133428023363, 0.00265106546025538, 0.0113860283736764, 0.00118617348079642},
-    {-0.00280421494922354, -0.0507314745513394, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0893580237504861, 0.126053534227744, 0.0043981073311365, 0.00620422150953936, 0.000646343288641096},
-    {-0.001684502510099, -0.031982189992167, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0871339906075375, 0.0452797490545588, 0.00428864277428789, 0.00222862131357036, 0.000232173275363283},
-    {-0.000687522410446992, -0.0135965919524168, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0476178977115159, 0.0075125961569867, 0.00234370251521104, 0.000369762029721762, 3.85210627857485e-05}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc0[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc4[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
-    static const double FE1_C0_D001[125][7] = \
-    {{-2.53401086900984, -0.86168424032714, 0.153733097585334, 0.173940273731973, 3.39569510933698, -0.153733097585335, -0.173940273731971},
-    {-2.0255498358363, -0.306078716913217, 0.131614521121219, 0.148914359955701, 2.33162855274952, -0.131614521121219, -0.1489143599557},
-    {-1.23337591087837, 0.559545548262077, 0.0971541428643073, 0.10992439799525, 0.673830362616288, -0.097154142864307, -0.109924397995249},
-    {-0.338555305646693, 1.53733389052355, 0.0582285287322854, 0.0658822750974736, -1.19877858487685, -0.0582285287322848, -0.065882275097473},
-    {0.454770511952704, 2.40421685178806, 0.0237180419639913, 0.0268356182006482, -2.85898736374077, -0.0237180419639906, -0.0268356182006476},
-    {-1.95173754786883, -0.86168424032714, 0.764665295175825, 0.145281397282487, 2.81342178819597, -0.764665295175825, -0.145281397282486},
-    {-1.52705194873624, -0.306078716913217, 0.654647946495179, 0.124378821681794, 1.83313066564946, -0.654647946495179, -0.124378821681793},
-    {-0.865398771818851, 0.559545548262077, 0.483242727153488, 0.0918129527655822, 0.305853223556774, -0.483242727153488, -0.0918129527655815},
-    {-0.118011263129872, 1.53733389052355, 0.289627515545325, 0.0550273308012554, -1.41932262739368, -0.289627515545325, -0.0550273308012548},
-    {0.544604017438855, 2.40421685178806, 0.117973057488944, 0.0224141081618458, -2.94882086922692, -0.117973057488943, -0.0224141081618453},
-    {-1.06855188405066, -0.86168424032714, 1.6913204223926, 0.101811933883884, 1.9302361243778, -1.6913204223926, -0.101811933883883},
-    {-0.77093592668034, -0.306078716913217, 1.44797919870299, 0.0871635915298887, 1.07701464359356, -1.44797919870299, -0.0871635915298881},
-    {-0.307255161197394, 0.559545548262077, 1.0688575754173, 0.0643417151232234, -0.252290387064684, -1.0688575754173, -0.0643417151232229},
-    {0.216507474925436, 1.53733389052355, 0.640610911753232, 0.0385626726486572, -1.75384136544898, -0.640610911753231, -0.0385626726486566},
-    {0.680862474241284, 2.40421685178806, 0.260938011286713, 0.0157076111665065, -3.08507932602935, -0.260938011286712, -0.0157076111665059},
-    {-0.120853589128906, -0.86168424032714, 2.6856634241203, 0.0551672270779314, 0.982537829456046, -2.6856634241203, -0.0551672270779307},
-    {0.0404108764001508, -0.306078716913217, 2.29925963250797, 0.0472299608053964, 0.265667840513066, -2.29925963250797, -0.0472299608053958},
-    {0.291658260721922, 0.559545548262078, 1.69724888193056, 0.0348638305292845, -0.851203808984, -1.69724888193056, -0.034863830529284},
-    {0.575461260818928, 1.53733389052355, 1.01723202298603, 0.0208953473093509, -2.11279515134248, -1.01723202298603, -0.0208953473093502},
-    {0.827073981595321, 2.40421685178806, 0.414345894247555, 0.00851123555970183, -3.23129083338339, -0.414345894247554, -0.0085112355597012},
-    {0.637338430571104, -0.861684240327141, 3.48117285237853, 0.0178498185197156, 0.224345809756035, -3.48117285237853, -0.0178498185197148},
-    {0.689516899489004, -0.306078716913217, 2.9803139668845, 0.0152816495177237, -0.383438182575788, -2.9803139668845, -0.0152816495177229},
-    {0.770810095671614, 0.559545548262077, 2.1999840629478, 0.0112804844617394, -1.33035564393369, -2.1999840629478, -0.0112804844617387},
-    {0.862636934093748, 1.53733389052355, 1.31854217888416, 0.00676086468604747, -2.3999708246173, -1.31854217888415, -0.00676086468604671},
-    {0.94404833794709, 2.40421685178807, 0.537077604585377, 0.00275388157364889, -3.34826518973516, -0.537077604585376, -0.00275388157364832},
-    {-1.85228451823978, -0.86168424032714, 0.153733097585334, 0.855666624502025, 2.71396875856692, -0.153733097585334, -0.855666624502024},
-    {-1.44190787062765, -0.306078716913217, 0.131614521121219, 0.732556325164345, 1.74798658754087, -0.131614521121219, -0.732556325164345},
-    {-0.802547804781613, 0.559545548262077, 0.0971541428643073, 0.540752504092003, 0.243002256519535, -0.0971541428643072, -0.540752504092002},
-    {-0.0803420579669869, 1.53733389052355, 0.0582285287322856, 0.32409552277718, -1.45699183255656, -0.058228528732285, -0.32409552277718},
-    {0.559947695327595, 2.40421685178806, 0.0237180419639915, 0.132012801575539, -2.96416454711566, -0.0237180419639908, -0.132012801575539},
-    {-1.38233429996559, -0.86168424032714, 0.764665295175825, 0.714684645185728, 2.24401854029273, -0.764665295175825, -0.714684645185728},
-    {-1.03957243407901, -0.306078716913217, 0.654647946495179, 0.611858336339029, 1.34565115099223, -0.654647946495179, -0.611858336339028},
-    {-0.505555085826084, 0.559545548262077, 0.483242727153489, 0.45165663875835, -0.0539904624359933, -0.483242727153488, -0.451656638758349},
-    {0.0976580618337187, 1.53733389052355, 0.289627515545326, 0.270696655764846, -1.63499195235727, -0.289627515545325, -0.270696655764845},
-    {0.632451919681933, 2.40421685178806, 0.117973057488944, 0.110262010404924, -3.03666877147, -0.117973057488943, -0.110262010404923},
-    {-0.669519062828044, -0.86168424032714, 1.6913204223926, 0.500844755106496, 1.53120330315518, -1.6913204223926, -0.500844755106495},
-    {-0.429314541944297, -0.306078716913217, 1.44797919870299, 0.428784976265932, 0.735393258857514, -1.44797919870299, -0.428784976265932},
-    {-0.0550798500280451, 0.559545548262077, 1.06885757541731, 0.316517026292572, -0.504465698234032, -1.0688575754173, -0.316517026292572},
-    {0.367646653544982, 1.53733389052355, 0.640610911753232, 0.189701851268203, -1.90498054406853, -0.640610911753231, -0.189701851268203},
-    {0.742425516601204, 2.40421685178806, 0.260938011286713, 0.0772706535264272, -3.14664236838927, -0.260938011286712, -0.0772706535264267},
-    {0.0953640331101715, -0.86168424032714, 2.6856634241203, 0.271384849317009, 0.766320207216968, -2.6856634241203, -0.271384849317009},
-    {0.225519868906913, -0.306078716913217, 2.29925963250797, 0.232338953312159, 0.0805588480063039, -2.29925963250797, -0.232338953312158},
-    {0.428300519875882, 0.559545548262077, 1.69724888193056, 0.171506089683245, -0.98784606813796, -1.69724888193056, -0.171506089683244},
-    {0.657356664129762, 1.53733389052355, 1.01723202298603, 0.102790750620185, -2.19469055465331, -1.01723202298603, -0.102790750620184},
-    {0.860432176532974, 2.40421685178806, 0.414345894247555, 0.0418694304973552, -3.26464902832104, -0.414345894247554, -0.0418694304973546},
-    {0.707297453747672, -0.861684240327141, 3.48117285237853, 0.0878088416962831, 0.154386786579467, -3.48117285237853, -0.0878088416962823},
-    {0.749410464883283, -0.306078716913217, 2.9803139668845, 0.0751752149120021, -0.443331747970066, -2.9803139668845, -0.0751752149120014},
-    {0.815021843428605, 0.559545548262077, 2.1999840629478, 0.0554922322187304, -1.37456739169068, -2.1999840629478, -0.0554922322187298},
-    {0.889134877965972, 1.53733389052355, 1.31854217888416, 0.0332588085582721, -2.42646876848952, -1.31854217888415, -0.0332588085582713},
-    {0.954841661398734, 2.40421685178807, 0.537077604585377, 0.0135472050252931, -3.3590585131868, -0.537077604585376, -0.0135472050252925},
-    {-0.853975571370904, -0.86168424032714, 0.153733097585333, 1.8539755713709, 1.71565981169804, -0.153733097585333, -1.8539755713709},
-    {-0.587232097896, -0.306078716913217, 0.131614521121218, 1.587232097896, 0.893310814809216, -0.131614521121218, -1.587232097896},
-    {-0.171650154436808, 0.559545548262077, 0.0971541428643073, 1.17165015443681, -0.387895393825269, -0.0971541428643073, -1.17165015443681},
-    {0.297781209627916, 1.53733389052355, 0.0582285287322859, 0.702218790372083, -1.83511510015146, -0.0582285287322854, -0.702218790372083},
-    {0.713967446876027, 2.40421685178806, 0.0237180419639917, 0.286032553123971, -3.11818429866409, -0.023718041963991, -0.286032553123971},
-    {-0.548509472575658, -0.86168424032714, 0.764665295175825, 1.54850947257566, 1.4101937129028, -0.764665295175825, -1.54850947257566},
-    {-0.325715385209019, -0.306078716913217, 0.654647946495179, 1.32571538520902, 0.631794102122236, -0.654647946495179, -1.32571538520902},
-    {0.0213941377077832, 0.559545548262077, 0.483242727153489, 0.978605862292217, -0.58093968596986, -0.483242727153489, -0.978605862292217},
-    {0.413480703034436, 1.53733389052355, 0.289627515545326, 0.586519296965564, -1.95081459355798, -0.289627515545326, -0.586519296965563},
-    {0.761094954638504, 2.40421685178806, 0.117973057488944, 0.238905045361495, -3.16531180642657, -0.117973057488944, -0.238905045361495},
-    {-0.0851819089672699, -0.86168424032714, 1.6913204223926, 1.08518190896727, 0.94686614929441, -1.6913204223926, -1.08518190896727},
-    {0.0709502408948852, -0.306078716913217, 1.44797919870299, 0.929049759105114, 0.235128476018332, -1.44797919870299, -0.929049759105114},
-    {0.314201561839691, 0.559545548262077, 1.06885757541731, 0.685798438160309, -0.873747110101769, -1.06885757541731, -0.685798438160308},
-    {0.588972401138389, 1.53733389052355, 0.640610911753232, 0.41102759886161, -2.12630629166194, -0.640610911753232, -0.41102759886161},
-    {0.832577431537388, 2.40421685178806, 0.260938011286713, 0.167422568462611, -3.23679428332545, -0.260938011286712, -0.16742256846261},
-    {0.411989591896581, -0.86168424032714, 2.6856634241203, 0.588010408103419, 0.449694648430559, -2.6856634241203, -0.588010408103418},
-    {0.496590457797377, -0.306078716913217, 2.29925963250797, 0.503409542202622, -0.19051174088416, -2.29925963250797, -0.503409542202622},
-    {0.628397215096318, 0.559545548262078, 1.69724888193056, 0.371602784903681, -1.1879427633584, -1.69724888193056, -0.37160278490368},
-    {0.777282956754788, 1.53733389052355, 1.01723202298603, 0.222717043245211, -2.31461684727834, -1.01723202298603, -0.22271704324521},
-    {0.909281373017809, 2.40421685178806, 0.414345894247555, 0.0907186269821898, -3.31349822480587, -0.414345894247555, -0.0907186269821892},
-    {0.809744306025694, -0.861684240327141, 3.48117285237853, 0.190255693974305, 0.0519399343014455, -3.48117285237853, -0.190255693974305},
-    {0.83711762498564, -0.306078716913217, 2.9803139668845, 0.162882375014359, -0.531038908072423, -2.9803139668845, -0.162882375014358},
-    {0.879764805604936, 0.559545548262077, 2.1999840629478, 0.120235194395062, -1.43931035386701, -2.1999840629478, -0.120235194395062},
-    {0.92793803470385, 1.53733389052355, 1.31854217888416, 0.0720619652961492, -2.4652719252274, -1.31854217888415, -0.0720619652961484},
-    {0.97064722818672, 2.40421685178807, 0.537077604585377, 0.0293527718132788, -3.37486407997479, -0.537077604585376, -0.0293527718132783},
-    {0.144333375497976, -0.86168424032714, 0.153733097585332, 2.85228451823978, 0.717350864829163, -0.153733097585332, -2.85228451823978},
-    {0.267443674835655, -0.306078716913217, 0.131614521121218, 2.44190787062765, 0.0386350420775617, -0.131614521121218, -2.44190787062765},
-    {0.459247495907997, 0.559545548262077, 0.0971541428643074, 1.80254780478161, -1.01879304417007, -0.0971541428643074, -1.80254780478161},
-    {0.675904477222819, 1.53733389052355, 0.0582285287322862, 1.08034205796699, -2.21323836774637, -0.0582285287322857, -1.08034205796699},
-    {0.86798719842446, 2.40421685178806, 0.0237180419639919, 0.440052304672404, -3.27220405021253, -0.0237180419639913, -0.440052304672404},
-    {0.285315354814272, -0.86168424032714, 0.764665295175825, 2.38233429996559, 0.576368885512868, -0.764665295175825, -2.38233429996559},
-    {0.388141663660971, -0.306078716913217, 0.654647946495179, 2.03957243407901, -0.0820629467477537, -0.654647946495179, -2.03957243407901},
-    {0.54834336124165, 0.559545548262077, 0.483242727153489, 1.50555508582608, -1.10788890950373, -0.483242727153489, -1.50555508582608},
-    {0.729303344235153, 1.53733389052355, 0.289627515545326, 0.902341938166281, -2.2666372347587, -0.289627515545326, -0.902341938166281},
-    {0.889737989595075, 2.40421685178806, 0.117973057488944, 0.367548080318067, -3.29395484138314, -0.117973057488944, -0.367548080318066},
-    {0.499155244893504, -0.86168424032714, 1.6913204223926, 1.66951906282804, 0.362528995433636, -1.6913204223926, -1.66951906282804},
-    {0.571215023734067, -0.306078716913217, 1.44797919870299, 1.4293145419443, -0.26513630682085, -1.44797919870299, -1.4293145419443},
-    {0.683482973707427, 0.559545548262077, 1.06885757541731, 1.05507985002804, -1.2430285219695, -1.06885757541731, -1.05507985002804},
-    {0.810298148731796, 1.53733389052355, 0.640610911753232, 0.632353346455017, -2.34763203925534, -0.640610911753232, -0.632353346455017},
-    {0.922729346473571, 2.40421685178806, 0.260938011286713, 0.257574483398795, -3.32694619826164, -0.260938011286712, -0.257574483398794},
-    {0.72861515068299, -0.86168424032714, 2.6856634241203, 0.904635966889828, 0.13306908964415, -2.6856634241203, -0.904635966889828},
-    {0.76766104668784, -0.306078716913217, 2.29925963250797, 0.774480131093086, -0.461582329774624, -2.29925963250797, -0.774480131093086},
-    {0.828493910316754, 0.559545548262078, 1.69724888193056, 0.571699480124117, -1.38803945857883, -1.69724888193056, -0.571699480124116},
-    {0.897209249379814, 1.53733389052355, 1.01723202298603, 0.342643335870237, -2.43454313990336, -1.01723202298603, -0.342643335870237},
-    {0.958130569502644, 2.40421685178806, 0.414345894247555, 0.139567823467025, -3.36234742129071, -0.414345894247555, -0.139567823467024},
-    {0.912191158303716, -0.861684240327141, 3.48117285237853, 0.292702546252328, -0.0505069179765767, -3.48117285237853, -0.292702546252327},
-    {0.924824785087997, -0.306078716913217, 2.9803139668845, 0.250589535116716, -0.61874606817478, -2.9803139668845, -0.250589535116716},
-    {0.944507767781268, 0.559545548262077, 2.1999840629478, 0.184978156571394, -1.50405331604335, -2.1999840629478, -0.184978156571393},
-    {0.966741191441727, 1.53733389052355, 1.31854217888416, 0.110865122034026, -2.50407508196527, -1.31854217888415, -0.110865122034026},
-    {0.986452794974706, 2.40421685178807, 0.537077604585377, 0.0451583386012648, -3.39066964676277, -0.537077604585376, -0.0451583386012643},
-    {0.826059726268027, -0.86168424032714, 0.153733097585331, 3.53401086900984, 0.0356245140591109, -0.153733097585331, -3.53401086900983},
-    {0.8510856400443, -0.306078716913217, 0.131614521121218, 3.0255498358363, -0.545006923131083, -0.131614521121218, -3.0255498358363},
-    {0.890075602004749, 0.559545548262077, 0.0971541428643075, 2.23337591087837, -1.44962115026683, -0.0971541428643075, -2.23337591087836},
-    {0.934117724902526, 1.53733389052355, 0.0582285287322864, 1.33855530564669, -2.47145161542607, -0.058228528732286, -1.33855530564669},
-    {0.973164381799351, 2.40421685178806, 0.023718041963992, 0.545229488047295, -3.37738123358742, -0.0237180419639914, -0.545229488047295},
-    {0.854718602717513, -0.86168424032714, 0.764665295175825, 2.95173754786883, 0.00696563760962579, -0.764665295175825, -2.95173754786883},
-    {0.875621178318205, -0.306078716913217, 0.654647946495179, 2.52705194873624, -0.569542461404989, -0.654647946495179, -2.52705194873624},
-    {0.908187047234417, 0.559545548262077, 0.483242727153489, 1.86539877181885, -1.46773259549649, -0.483242727153489, -1.86539877181885},
-    {0.944972669198744, 1.53733389052355, 0.289627515545326, 1.11801126312987, -2.48230655972229, -0.289627515545326, -1.11801126312987},
-    {0.977585891838153, 2.40421685178806, 0.117973057488945, 0.455395982561145, -3.38180274362622, -0.117973057488944, -0.455395982561144},
-    {0.898188066116116, -0.86168424032714, 1.6913204223926, 2.06855188405066, -0.0365038257889762, -1.6913204223926, -2.06855188405065},
-    {0.91283640847011, -0.306078716913217, 1.44797919870299, 1.77093592668034, -0.606757691556893, -1.44797919870299, -1.77093592668034},
-    {0.935658284876775, 0.559545548262077, 1.06885757541731, 1.30725516119739, -1.49520383313885, -1.06885757541731, -1.30725516119739},
-    {0.961437327351342, 1.53733389052355, 0.640610911753233, 0.783492525074564, -2.49877121787489, -0.640610911753232, -0.783492525074563},
-    {0.984292388833492, 2.40421685178806, 0.260938011286713, 0.319137525758715, -3.38850924062156, -0.260938011286713, -0.319137525758715},
-    {0.944832772922068, -0.86168424032714, 2.6856634241203, 1.12085358912891, -0.083148532594928, -2.6856634241203, -1.12085358912891},
-    {0.952770039194602, -0.306078716913217, 2.29925963250797, 0.959589123599848, -0.646691322281386, -2.29925963250797, -0.959589123599848},
-    {0.965136169470714, 0.559545548262077, 1.69724888193056, 0.708341739278077, -1.52468171773279, -1.69724888193056, -0.708341739278077},
-    {0.979104652690648, 1.53733389052355, 1.01723202298603, 0.424538739181071, -2.5164385432142, -1.01723202298603, -0.42453873918107},
-    {0.991488764440297, 2.40421685178806, 0.414345894247555, 0.172926018404678, -3.39570561622836, -0.414345894247555, -0.172926018404678},
-    {0.982150181480283, -0.861684240327141, 3.48117285237853, 0.362661569428895, -0.120465941153144, -3.48117285237853, -0.362661569428894},
-    {0.984718350482275, -0.306078716913217, 2.9803139668845, 0.310483100510995, -0.678639633569059, -2.9803139668845, -0.310483100510994},
-    {0.988719515538259, 0.559545548262077, 2.1999840629478, 0.229189904328385, -1.54826506380034, -2.1999840629478, -0.229189904328384},
-    {0.993239135313951, 1.53733389052355, 1.31854217888416, 0.137363065906251, -2.5305730258375, -1.31854217888415, -0.13736306590625},
-    {0.997246118426349, 2.40421685178807, 0.537077604585377, 0.0559516620529087, -3.40146297021442, -0.537077604585376, -0.0559516620529083}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[7] = {0, 3, 4, 5, 7, 8, 9};
-    static const double FE1_C0_D010[125][7] = \
-    {{-2.53401086900984, -0.846266902414667, 0.138315759672862, 0.173940273731974, -0.138315759672862, 3.3802777714245, -0.173940273731973},
-    {-2.0255498358363, -0.868385478878781, 0.693921283086784, 0.148914359955701, -0.693921283086783, 2.89393531471508, -0.1489143599557},
-    {-1.23337591087837, -0.902845857135692, 1.55954554826208, 0.109924397995249, -1.55954554826208, 2.13622176801406, -0.109924397995249},
-    {-0.338555305646693, -0.941771471267714, 2.53733389052355, 0.0658822750974729, -2.53733389052355, 1.28032677691441, -0.0658822750974728},
-    {0.454770511952705, -0.976281958036009, 3.40421685178806, 0.0268356182006483, -3.40421685178806, 0.521511446083304, -0.0268356182006486},
-    {-1.95173754786883, -0.235334704824175, 0.138315759672861, 0.145281397282487, -0.138315759672861, 2.187072252693, -0.145281397282487},
-    {-1.52705194873624, -0.345352053504821, 0.693921283086783, 0.124378821681794, -0.693921283086783, 1.87240400224106, -0.124378821681793},
-    {-0.865398771818851, -0.516757272846511, 1.55954554826208, 0.0918129527655814, -1.55954554826208, 1.38215604466536, -0.0918129527655814},
-    {-0.118011263129871, -0.710372484454674, 2.53733389052355, 0.0550273308012546, -2.53733389052355, 0.828383747584545, -0.0550273308012547},
-    {0.544604017438855, -0.882026942511056, 3.40421685178806, 0.0224141081618461, -3.40421685178806, 0.337422925072202, -0.0224141081618462},
-    {-1.06855188405066, 0.6913204223926, 0.138315759672859, 0.101811933883883, -0.13831575967286, 0.377231461658056, -0.101811933883884},
-    {-0.77093592668034, 0.447979198702987, 0.693921283086782, 0.087163591529888, -0.693921283086782, 0.322956727977352, -0.0871635915298885},
-    {-0.307255161197393, 0.068857575417305, 1.55954554826208, 0.0643417151232226, -1.55954554826208, 0.238397585780088, -0.0643417151232226},
-    {0.216507474925436, -0.359389088246769, 2.53733389052355, 0.0385626726486567, -2.53733389052355, 0.142881613321332, -0.0385626726486567},
-    {0.680862474241284, -0.739061988713288, 3.40421685178806, 0.0157076111665069, -3.40421685178806, 0.058199514472004, -0.015707611166507},
-    {-0.120853589128906, 1.6856634241203, 0.138315759672859, 0.0551672270779302, -0.138315759672859, -1.5648098349914, -0.0551672270779314},
-    {0.0404108764001513, 1.29925963250797, 0.693921283086782, 0.0472299608053953, -0.693921283086782, -1.33967050890812, -0.047229960805396},
-    {0.291658260721923, 0.69724888193056, 1.55954554826208, 0.0348638305292839, -1.55954554826208, -0.988907142652483, -0.034863830529284},
-    {0.575461260818929, 0.0172320229860304, 2.53733389052355, 0.0208953473093506, -2.53733389052355, -0.59269328380496, -0.0208953473093506},
-    {0.827073981595321, -0.585654105752446, 3.40421685178807, 0.00851123555970239, -3.40421685178807, -0.241419875842875, -0.00851123555970248},
-    {0.637338430571105, 2.48117285237853, 0.138315759672859, 0.0178498185197144, -0.138315759672859, -3.11851128294963, -0.0178498185197154},
-    {0.689516899489005, 1.9803139668845, 0.693921283086782, 0.0152816495177227, -0.693921283086782, -2.6698308663735, -0.0152816495177232},
-    {0.770810095671614, 1.1999840629478, 1.55954554826208, 0.0112804844617389, -1.55954554826208, -1.97079415861941, -0.011280484461739},
-    {0.862636934093749, 0.318542178884154, 2.53733389052355, 0.00676086468604743, -2.53733389052355, -1.1811791129779, -0.00676086468604731},
-    {0.94404833794709, -0.462922395414624, 3.40421685178807, 0.00275388157364971, -3.40421685178807, -0.481125942532466, -0.00275388157364974},
-    {-1.85228451823978, -0.846266902414667, 0.138315759672862, 0.855666624502025, -0.138315759672862, 2.69855142065445, -0.855666624502025},
-    {-1.44190787062765, -0.868385478878781, 0.693921283086783, 0.732556325164345, -0.693921283086783, 2.31029334950644, -0.732556325164345},
-    {-0.802547804781612, -0.902845857135692, 1.55954554826208, 0.540752504092002, -1.55954554826208, 1.7053936619173, -0.540752504092002},
-    {-0.0803420579669867, -0.941771471267714, 2.53733389052355, 0.32409552277718, -2.53733389052355, 1.0221135292347, -0.32409552277718},
-    {0.559947695327596, -0.976281958036009, 3.40421685178806, 0.13201280157554, -3.40421685178806, 0.416334262708413, -0.13201280157554},
-    {-1.38233429996559, -0.235334704824175, 0.138315759672861, 0.714684645185728, -0.138315759672861, 1.61766900478976, -0.714684645185729},
-    {-1.03957243407901, -0.345352053504821, 0.693921283086783, 0.611858336339028, -0.693921283086783, 1.38492448758383, -0.611858336339029},
-    {-0.505555085826084, -0.516757272846511, 1.55954554826208, 0.451656638758349, -1.55954554826208, 1.02231235867259, -0.451656638758349},
-    {0.097658061833719, -0.710372484454674, 2.53733389052355, 0.270696655764845, -2.53733389052355, 0.612714422620955, -0.270696655764845},
-    {0.632451919681933, -0.882026942511056, 3.40421685178806, 0.110262010404924, -3.40421685178806, 0.249575022829124, -0.110262010404924},
-    {-0.669519062828044, 0.6913204223926, 0.13831575967286, 0.500844755106495, -0.13831575967286, -0.0218013595645561, -0.500844755106496},
-    {-0.429314541944297, 0.447979198702988, 0.693921283086782, 0.428784976265931, -0.693921283086782, -0.0186646567586911, -0.428784976265932},
-    {-0.0550798500280447, 0.0688575754173051, 1.55954554826208, 0.316517026292572, -1.55954554826208, -0.0137777253892607, -0.316517026292571},
-    {0.367646653544982, -0.359389088246769, 2.53733389052355, 0.189701851268203, -2.53733389052355, -0.00825756529821425, -0.189701851268203},
-    {0.742425516601205, -0.739061988713288, 3.40421685178806, 0.0772706535264277, -3.40421685178806, -0.00336352788791668, -0.0772706535264278},
-    {0.0953640331101717, 1.6856634241203, 0.138315759672859, 0.271384849317008, -0.138315759672859, -1.78102745723047, -0.271384849317009},
-    {0.225519868906913, 1.29925963250797, 0.693921283086782, 0.232338953312158, -0.693921283086782, -1.52477950141488, -0.232338953312158},
-    {0.428300519875883, 0.69724888193056, 1.55954554826208, 0.171506089683245, -1.55954554826208, -1.12554940180644, -0.171506089683245},
-    {0.657356664129763, 0.0172320229860304, 2.53733389052355, 0.102790750620184, -2.53733389052355, -0.674588687115793, -0.102790750620184},
-    {0.860432176532975, -0.585654105752446, 3.40421685178807, 0.0418694304973558, -3.40421685178807, -0.274778070780529, -0.0418694304973559},
-    {0.707297453747672, 2.48117285237853, 0.138315759672859, 0.087808841696282, -0.138315759672859, -3.1884703061262, -0.0878088416962829},
-    {0.749410464883284, 1.9803139668845, 0.693921283086782, 0.0751752149120012, -0.693921283086783, -2.72972443176778, -0.0751752149120016},
-    {0.815021843428605, 1.1999840629478, 1.55954554826208, 0.05549223221873, -1.55954554826208, -2.0150059063764, -0.0554922322187299},
-    {0.889134877965973, 0.318542178884154, 2.53733389052355, 0.0332588085582721, -2.53733389052355, -1.20767705685013, -0.033258808558272},
-    {0.954841661398734, -0.462922395414624, 3.40421685178807, 0.0135472050252939, -3.40421685178807, -0.49191926598411, -0.013547205025294},
-    {-0.853975571370904, -0.846266902414667, 0.138315759672861, 1.8539755713709, -0.138315759672861, 1.70024247378557, -1.8539755713709},
-    {-0.587232097895999, -0.868385478878781, 0.693921283086783, 1.587232097896, -0.693921283086783, 1.45561757677478, -1.587232097896},
-    {-0.171650154436808, -0.902845857135692, 1.55954554826208, 1.17165015443681, -1.55954554826208, 1.0744960115725, -1.17165015443681},
-    {0.297781209627916, -0.941771471267714, 2.53733389052355, 0.702218790372083, -2.53733389052355, 0.643990261639798, -0.702218790372083},
-    {0.713967446876028, -0.976281958036009, 3.40421685178806, 0.286032553123972, -3.40421685178806, 0.262314511159981, -0.286032553123972},
-    {-0.548509472575657, -0.235334704824175, 0.13831575967286, 1.54850947257566, -0.13831575967286, 0.783844177399832, -1.54850947257566},
-    {-0.325715385209019, -0.345352053504821, 0.693921283086783, 1.32571538520902, -0.693921283086783, 0.67106743871384, -1.32571538520902},
-    {0.0213941377077833, -0.516757272846511, 1.55954554826208, 0.978605862292217, -1.55954554826208, 0.495363135138727, -0.978605862292217},
-    {0.413480703034436, -0.710372484454674, 2.53733389052355, 0.586519296965563, -2.53733389052355, 0.296891781420238, -0.586519296965563},
-    {0.761094954638504, -0.882026942511056, 3.40421685178806, 0.238905045361496, -3.40421685178806, 0.120931987872552, -0.238905045361496},
-    {-0.08518190896727, 0.6913204223926, 0.13831575967286, 1.08518190896727, -0.13831575967286, -0.60613851342533, -1.08518190896727},
-    {0.0709502408948853, 0.447979198702988, 0.693921283086783, 0.929049759105114, -0.693921283086783, -0.518929439597874, -0.929049759105114},
-    {0.314201561839691, 0.0688575754173052, 1.55954554826208, 0.685798438160308, -1.55954554826208, -0.383059137256997, -0.685798438160308},
-    {0.588972401138389, -0.359389088246769, 2.53733389052355, 0.41102759886161, -2.53733389052355, -0.229583312891621, -0.41102759886161},
-    {0.832577431537388, -0.739061988713288, 3.40421685178806, 0.167422568462611, -3.40421685178806, -0.0935154428241002, -0.167422568462612},
-    {0.411989591896581, 1.6856634241203, 0.138315759672859, 0.588010408103418, -0.138315759672859, -2.09765301601688, -0.588010408103419},
-    {0.496590457797377, 1.29925963250797, 0.693921283086782, 0.503409542202622, -0.693921283086782, -1.79585009030535, -0.503409542202622},
-    {0.628397215096319, 0.69724888193056, 1.55954554826208, 0.37160278490368, -1.55954554826208, -1.32564609702688, -0.37160278490368},
-    {0.777282956754789, 0.0172320229860305, 2.53733389052355, 0.222717043245211, -2.53733389052355, -0.79451497974082, -0.222717043245211},
-    {0.909281373017809, -0.585654105752446, 3.40421685178807, 0.0907186269821904, -3.40421685178807, -0.323627267265363, -0.0907186269821905},
-    {0.809744306025694, 2.48117285237853, 0.138315759672859, 0.190255693974304, -0.138315759672859, -3.29091715840422, -0.190255693974305},
-    {0.83711762498564, 1.9803139668845, 0.693921283086782, 0.162882375014358, -0.693921283086783, -2.81743159187014, -0.162882375014359},
-    {0.879764805604937, 1.1999840629478, 1.55954554826208, 0.120235194395062, -1.55954554826208, -2.07974886855273, -0.120235194395062},
-    {0.92793803470385, 0.318542178884154, 2.53733389052355, 0.0720619652961492, -2.53733389052355, -1.246480213588, -0.0720619652961491},
-    {0.97064722818672, -0.462922395414624, 3.40421685178807, 0.0293527718132797, -3.40421685178807, -0.507724832772096, -0.0293527718132797},
-    {0.144333375497976, -0.846266902414667, 0.13831575967286, 2.85228451823978, -0.13831575967286, 0.701933526916691, -2.85228451823978},
-    {0.267443674835655, -0.868385478878781, 0.693921283086782, 2.44190787062765, -0.693921283086783, 0.600941804043126, -2.44190787062765},
-    {0.459247495907997, -0.902845857135692, 1.55954554826208, 1.80254780478161, -1.55954554826208, 0.443598361227695, -1.80254780478161},
-    {0.675904477222819, -0.941771471267714, 2.53733389052355, 1.08034205796699, -2.53733389052355, 0.265866994044895, -1.08034205796699},
-    {0.86798719842446, -0.976281958036009, 3.40421685178806, 0.440052304672404, -3.40421685178806, 0.108294759611549, -0.440052304672405},
-    {0.285315354814272, -0.235334704824175, 0.13831575967286, 2.38233429996559, -0.13831575967286, -0.0499806499900974, -2.38233429996559},
-    {0.388141663660971, -0.345352053504821, 0.693921283086783, 2.03957243407901, -0.693921283086783, -0.0427896101561506, -2.03957243407901},
-    {0.54834336124165, -0.516757272846511, 1.55954554826208, 1.50555508582608, -1.55954554826208, -0.0315860883951393, -1.50555508582608},
-    {0.729303344235153, -0.710372484454674, 2.53733389052355, 0.902341938166281, -2.53733389052355, -0.0189308597804795, -0.902341938166281},
-    {0.889737989595075, -0.882026942511056, 3.40421685178807, 0.367548080318067, -3.40421685178807, -0.00771104708401874, -0.367548080318067},
-    {0.499155244893504, 0.691320422392601, 0.13831575967286, 1.66951906282804, -0.13831575967286, -1.1904756672861, -1.66951906282804},
-    {0.571215023734067, 0.447979198702988, 0.693921283086783, 1.4293145419443, -0.693921283086783, -1.01919422243706, -1.4293145419443},
-    {0.683482973707427, 0.0688575754173054, 1.55954554826208, 1.05507985002804, -1.55954554826208, -0.752340549124733, -1.05507985002804},
-    {0.810298148731796, -0.359389088246769, 2.53733389052355, 0.632353346455017, -2.53733389052355, -0.450909060485028, -0.632353346455017},
-    {0.922729346473572, -0.739061988713288, 3.40421685178806, 0.257574483398795, -3.40421685178806, -0.183667357760284, -0.257574483398796},
-    {0.72861515068299, 1.6856634241203, 0.138315759672859, 0.904635966889828, -0.13831575967286, -2.41427857480329, -0.904635966889828},
-    {0.767661046687841, 1.29925963250797, 0.693921283086783, 0.774480131093086, -0.693921283086783, -2.06692067919581, -0.774480131093086},
-    {0.828493910316754, 0.69724888193056, 1.55954554826208, 0.571699480124116, -1.55954554826208, -1.52574279224731, -0.571699480124116},
-    {0.897209249379815, 0.0172320229860305, 2.53733389052355, 0.342643335870237, -2.53733389052355, -0.914441272365846, -0.342643335870237},
-    {0.958130569502644, -0.585654105752446, 3.40421685178807, 0.139567823467025, -3.40421685178807, -0.372476463750198, -0.139567823467025},
-    {0.912191158303716, 2.48117285237853, 0.138315759672859, 0.292702546252327, -0.138315759672859, -3.39336401068225, -0.292702546252327},
-    {0.924824785087997, 1.9803139668845, 0.693921283086783, 0.250589535116716, -0.693921283086783, -2.9051387519725, -0.250589535116716},
-    {0.944507767781269, 1.1999840629478, 1.55954554826208, 0.184978156571394, -1.55954554826208, -2.14449183072907, -0.184978156571394},
-    {0.966741191441727, 0.318542178884154, 2.53733389052355, 0.110865122034026, -2.53733389052355, -1.28528337032588, -0.110865122034026},
-    {0.986452794974706, -0.462922395414624, 3.40421685178807, 0.0451583386012656, -3.40421685178807, -0.523530399560082, -0.0451583386012656},
-    {0.826059726268028, -0.846266902414667, 0.138315759672859, 3.53401086900983, -0.138315759672859, 0.0202071761466383, -3.53401086900983},
-    {0.8510856400443, -0.868385478878782, 0.693921283086782, 3.0255498358363, -0.693921283086782, 0.0172998388344806, -3.0255498358363},
-    {0.89007560200475, -0.902845857135692, 1.55954554826208, 2.23337591087836, -1.55954554826208, 0.012770255130942, -2.23337591087836},
-    {0.934117724902525, -0.941771471267714, 2.53733389052355, 1.33855530564669, -2.53733389052355, 0.00765374636518801, -1.33855530564669},
-    {0.973164381799351, -0.976281958036009, 3.40421685178806, 0.545229488047295, -3.40421685178806, 0.00311757623665807, -0.545229488047296},
-    {0.854718602717513, -0.235334704824175, 0.138315759672859, 2.95173754786883, -0.13831575967286, -0.61938389789334, -2.95173754786883},
-    {0.875621178318206, -0.345352053504821, 0.693921283086783, 2.52705194873624, -0.693921283086783, -0.530269124813386, -2.52705194873624},
-    {0.908187047234417, -0.516757272846511, 1.55954554826208, 1.86539877181885, -1.55954554826208, -0.391429774387907, -1.86539877181885},
-    {0.944972669198744, -0.710372484454674, 2.53733389052355, 1.11801126312987, -2.53733389052355, -0.23460018474407, -1.11801126312987},
-    {0.977585891838153, -0.882026942511056, 3.40421685178807, 0.455395982561145, -3.40421685178807, -0.0955589493270969, -0.455395982561146},
-    {0.898188066116116, 0.691320422392601, 0.13831575967286, 2.06855188405065, -0.13831575967286, -1.58950848850872, -2.06855188405066},
-    {0.91283640847011, 0.447979198702988, 0.693921283086783, 1.77093592668034, -0.693921283086783, -1.3608156071731, -1.77093592668034},
-    {0.935658284876775, 0.0688575754173054, 1.55954554826208, 1.30725516119739, -1.55954554826208, -1.00451586029408, -1.30725516119739},
-    {0.961437327351342, -0.359389088246768, 2.53733389052355, 0.783492525074564, -2.53733389052355, -0.602048239104574, -0.783492525074564},
-    {0.984292388833492, -0.739061988713288, 3.40421685178807, 0.319137525758716, -3.40421685178807, -0.245230400120204, -0.319137525758716},
-    {0.944832772922068, 1.6856634241203, 0.138315759672859, 1.12085358912891, -0.13831575967286, -2.63049619704237, -1.12085358912891},
-    {0.952770039194603, 1.29925963250797, 0.693921283086783, 0.959589123599848, -0.693921283086783, -2.25202967170258, -0.959589123599848},
-    {0.965136169470714, 0.69724888193056, 1.55954554826208, 0.708341739278077, -1.55954554826208, -1.66238505140128, -0.708341739278077},
-    {0.979104652690649, 0.0172320229860305, 2.53733389052355, 0.424538739181071, -2.53733389052355, -0.996336675676679, -0.424538739181071},
-    {0.991488764440297, -0.585654105752446, 3.40421685178807, 0.172926018404679, -3.40421685178807, -0.405834658687851, -0.172926018404679},
-    {0.982150181480284, 2.48117285237853, 0.138315759672859, 0.362661569428894, -0.13831575967286, -3.46332303385881, -0.362661569428895},
-    {0.984718350482276, 1.9803139668845, 0.693921283086783, 0.310483100510994, -0.693921283086783, -2.96503231736678, -0.310483100510994},
-    {0.98871951553826, 1.1999840629478, 1.55954554826208, 0.229189904328385, -1.55954554826208, -2.18870357848606, -0.229189904328385},
-    {0.993239135313952, 0.318542178884154, 2.53733389052355, 0.137363065906251, -2.53733389052355, -1.31178131419811, -0.137363065906251},
-    {0.99724611842635, -0.462922395414624, 3.40421685178807, 0.0559516620529096, -3.40421685178807, -0.534323723011726, -0.0559516620529098}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc2[7] = {0, 2, 4, 6, 7, 8, 9};
-    static const double FE1_C0_D100[125][7] = \
-    {{-2.53401086900984, -0.82605972626803, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 3.36007059527787},
-    {-2.0255498358363, -0.8510856400443, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.13161452112122, 2.8766354758806},
-    {-1.23337591087837, -0.89007560200475, 1.55954554826208, 0.0971541428643071, -1.55954554826208, -0.0971541428643071, 2.12345151288312},
-    {-0.338555305646693, -0.934117724902525, 2.53733389052355, 0.0582285287322848, -2.53733389052355, -0.0582285287322848, 1.27267303054922},
-    {0.454770511952704, -0.973164381799351, 3.40421685178806, 0.0237180419639906, -3.40421685178806, -0.0237180419639906, 0.518393869846646},
-    {-1.95173754786883, -0.854718602717514, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175826, 2.80645615058634},
-    {-1.52705194873624, -0.875621178318207, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 2.40267312705445},
-    {-0.865398771818852, -0.908187047234418, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.77358581905327},
-    {-0.118011263129872, -0.944972669198744, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 1.06298393232862},
-    {0.544604017438855, -0.977585891838153, 3.40421685178807, 0.117973057488943, -3.40421685178807, -0.117973057488943, 0.432981874399299},
-    {-1.06855188405066, -0.898188066116116, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.96673995016677},
-    {-0.77093592668034, -0.912836408470111, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.68377233515045},
-    {-0.307255161197394, -0.935658284876776, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.0688575754173, 1.24291344607417},
-    {0.216507474925436, -0.961437327351342, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753231, 0.744929852425906},
-    {0.680862474241284, -0.984292388833493, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.303429914592209},
-    {-0.120853589128906, -0.944832772922068, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 1.06568636205097},
-    {0.0404108764001512, -0.952770039194603, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.912359162794452},
-    {0.291658260721922, -0.965136169470715, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.673477908748793},
-    {0.575461260818929, -0.979104652690649, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.40364339187172},
-    {0.827073981595321, -0.991488764440298, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.164414782844977},
-    {0.637338430571105, -0.982150181480284, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.344811750909179},
-    {0.689516899489005, -0.984718350482277, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.295201450993271},
-    {0.770810095671615, -0.988719515538262, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.217909419866647},
-    {0.862636934093749, -0.993239135313953, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.130602201220204},
-    {0.94404833794709, -0.997246118426351, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0531977804792609},
-    {-1.85228451823978, -0.144333375497977, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 1.99661789373776},
-    {-1.44190787062765, -0.267443674835656, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 1.70935154546331},
-    {-0.802547804781613, -0.459247495907997, 1.55954554826208, 0.0971541428643072, -1.55954554826208, -0.0971541428643073, 1.26179530068961},
-    {-0.0803420579669868, -0.675904477222819, 2.53733389052355, 0.0582285287322851, -2.53733389052355, -0.0582285287322851, 0.756246535189806},
-    {0.559947695327596, -0.86798719842446, 3.40421685178806, 0.0237180419639908, -3.40421685178806, -0.0237180419639908, 0.308039503096864},
-    {-1.38233429996559, -0.285315354814272, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175825, 1.66764965477986},
-    {-1.03957243407901, -0.388141663660972, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 1.42771409773998},
-    {-0.505555085826084, -0.54834336124165, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.05389844706773},
-    {0.0976580618337188, -0.729303344235153, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 0.631645282401435},
-    {0.632451919681933, -0.889737989595075, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0.257286069913143},
-    {-0.669519062828044, -0.499155244893504, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.16867430772155},
-    {-0.429314541944297, -0.571215023734068, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.00052956567836},
-    {-0.0550798500280449, -0.683482973707428, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.06885757541731, 0.738562823735472},
-    {0.367646653544982, -0.810298148731796, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753232, 0.442651495186814},
-    {0.742425516601204, -0.922729346473572, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.180303829872368},
-    {0.0953640331101717, -0.72861515068299, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 0.633251117572818},
-    {0.225519868906913, -0.767661046687841, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.542141177780928},
-    {0.428300519875883, -0.828493910316755, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.400193390440872},
-    {0.657356664129763, -0.897209249379815, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.239852585250053},
-    {0.860432176532975, -0.958130569502645, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.09769839296967},
-    {0.707297453747673, -0.912191158303717, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.204893704556044},
-    {0.749410464883284, -0.924824785087998, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.175414320204714},
-    {0.815021843428606, -0.944507767781271, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.129485924352665},
-    {0.889134877965973, -0.966741191441729, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.0776063134757552},
-    {0.954841661398734, -0.986452794974707, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0316111335759726},
-    {-0.853975571370903, 0.853975571370903, 0.138315759672861, 0.153733097585334, -0.138315759672861, -0.153733097585334, 0},
-    {-0.587232097895999, 0.587232097895999, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 0},
-    {-0.171650154436808, 0.171650154436808, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643074, 0},
-    {0.297781209627916, -0.297781209627916, 2.53733389052355, 0.0582285287322856, -2.53733389052355, -0.0582285287322856, 0},
-    {0.713967446876028, -0.713967446876028, 3.40421685178807, 0.0237180419639911, -3.40421685178807, -0.0237180419639911, 0},
-    {-0.548509472575657, 0.548509472575658, 0.13831575967286, 0.764665295175825, -0.13831575967286, -0.764665295175825, 0},
-    {-0.325715385209019, 0.325715385209019, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 0},
-    {0.0213941377077832, -0.0213941377077827, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153489, 0},
-    {0.413480703034436, -0.413480703034436, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, 0},
-    {0.761094954638504, -0.761094954638504, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0},
-    {-0.0851819089672702, 0.0851819089672698, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 0},
-    {0.0709502408948851, -0.0709502408948855, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, 0},
-    {0.314201561839691, -0.314201561839691, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, 0},
-    {0.588972401138389, -0.58897240113839, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753232, 0},
-    {0.832577431537388, -0.832577431537389, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, 0},
-    {0.411989591896581, -0.411989591896581, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, 0},
-    {0.496590457797377, -0.496590457797378, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0},
-    {0.628397215096318, -0.62839721509632, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0},
-    {0.777282956754789, -0.777282956754789, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0},
-    {0.909281373017809, -0.90928137301781, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0},
-    {0.809744306025695, -0.809744306025695, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, 0},
-    {0.837117624985641, -0.837117624985642, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0},
-    {0.879764805604937, -0.879764805604939, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0},
-    {0.92793803470385, -0.927938034703852, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0},
-    {0.97064722818672, -0.970647228186721, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0},
-    {0.144333375497977, 1.85228451823978, 0.13831575967286, 0.153733097585332, -0.13831575967286, -0.153733097585333, -1.99661789373776},
-    {0.267443674835656, 1.44190787062765, 0.693921283086783, 0.131614521121218, -0.693921283086783, -0.131614521121218, -1.70935154546331},
-    {0.459247495907997, 0.802547804781612, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -1.26179530068961},
-    {0.675904477222819, 0.0803420579669871, 2.53733389052355, 0.058228528732286, -2.53733389052355, -0.058228528732286, -0.756246535189806},
-    {0.86798719842446, -0.559947695327595, 3.40421685178807, 0.0237180419639914, -3.40421685178807, -0.0237180419639914, -0.308039503096864},
-    {0.285315354814272, 1.38233429996559, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175825, -1.66764965477986},
-    {0.388141663660971, 1.03957243407901, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -1.42771409773998},
-    {0.54834336124165, 0.505555085826084, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.05389844706773},
-    {0.729303344235153, -0.0976580618337189, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -0.631645282401434},
-    {0.889737989595075, -0.632451919681933, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.257286069913142},
-    {0.499155244893504, 0.669519062828043, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.16867430772155},
-    {0.571215023734067, 0.429314541944296, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.00052956567836},
-    {0.683482973707427, 0.0550798500280444, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -0.738562823735472},
-    {0.810298148731796, -0.367646653544983, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753233, -0.442651495186813},
-    {0.922729346473572, -0.742425516601205, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.180303829872367},
-    {0.72861515068299, -0.0953640331101723, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -0.633251117572818},
-    {0.767661046687841, -0.225519868906914, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.542141177780927},
-    {0.828493910316754, -0.428300519875884, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.40019339044087},
-    {0.897209249379815, -0.657356664129763, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.239852585250051},
-    {0.958130569502644, -0.860432176532975, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.0976983929696685},
-    {0.912191158303717, -0.707297453747673, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.204893704556044},
-    {0.924824785087998, -0.749410464883284, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.175414320204714},
-    {0.944507767781269, -0.815021843428607, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.129485924352662},
-    {0.966741191441727, -0.889134877965975, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.0776063134757529},
-    {0.986452794974706, -0.954841661398735, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0316111335759707},
-    {0.826059726268029, 2.53401086900983, 0.138315759672859, 0.153733097585331, -0.138315759672859, -0.153733097585332, -3.36007059527786},
-    {0.851085640044301, 2.0255498358363, 0.693921283086782, 0.131614521121218, -0.693921283086782, -0.131614521121218, -2.8766354758806},
-    {0.89007560200475, 1.23337591087837, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -2.12345151288312},
-    {0.934117724902526, 0.338555305646693, 2.53733389052355, 0.0582285287322862, -2.53733389052355, -0.0582285287322862, -1.27267303054922},
-    {0.973164381799351, -0.454770511952705, 3.40421685178807, 0.0237180419639916, -3.40421685178807, -0.0237180419639916, -0.518393869846646},
-    {0.854718602717514, 1.95173754786883, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175824, -2.80645615058634},
-    {0.875621178318206, 1.52705194873624, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -2.40267312705445},
-    {0.908187047234417, 0.865398771818851, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.77358581905327},
-    {0.944972669198744, 0.118011263129871, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -1.06298393232862},
-    {0.977585891838153, -0.544604017438855, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.432981874399298},
-    {0.898188066116116, 1.06855188405065, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.96673995016677},
-    {0.91283640847011, 0.77093592668034, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.68377233515045},
-    {0.935658284876776, 0.307255161197392, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -1.24291344607417},
-    {0.961437327351342, -0.216507474925437, 2.53733389052355, 0.640610911753233, -2.53733389052355, -0.640610911753233, -0.744929852425905},
-    {0.984292388833492, -0.680862474241285, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.303429914592208},
-    {0.944832772922068, 0.120853589128905, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -1.06568636205097},
-    {0.952770039194603, -0.0404108764001523, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.912359162794451},
-    {0.965136169470714, -0.291658260721924, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.673477908748791},
-    {0.979104652690648, -0.57546126081893, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.403643391871719},
-    {0.991488764440297, -0.827073981595322, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.164414782844975},
-    {0.982150181480284, -0.637338430571106, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.344811750909179},
-    {0.984718350482276, -0.689516899489006, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.29520145099327},
-    {0.98871951553826, -0.770810095671616, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.217909419866644},
-    {0.993239135313952, -0.86263693409375, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.130602201220202},
-    {0.99724611842635, -0.944048337947091, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0531977804792586}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc3[7] = {0, 1, 5, 6, 7, 8, 9};
-    
-    // Number of operations to compute geometry constants: 88
-    const double G0 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
-    const double G1 = -3*Jinv_22*det;
-    const double G2 = 3*det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
-    const double G3 = 3*det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
-    const double G4 = 3*det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
-    const double G5 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
-    const double G6 = det*w[2][0];
-    const double G7 = -3*Jinv_02*det;
-    const double G8 = 3*det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
-    const double G9 = 3*det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
-    const double G10 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
-    const double G11 = -3*Jinv_12*det;
-    const double G12 = 3*det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
-    const double G13 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
-    const double G14 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
-    const double G15 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
-    const double G16 = -0.5*det*w[1][0]*w[2][0];
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 371213
-    
-    // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 371125
-    for (unsigned int ip = 0; ip < 125; ip++)
-    {
-      
-      // Function declarations
-      double F0 = 0;
-      double F1 = 0;
-      double F2 = 0;
-      double F3 = 0;
-      
-      // Total number of operations to compute function values = 20
-      for (unsigned int r = 0; r < 10; r++)
-      {
-        F0 += FE1_C0[ip][r]*w[0][nzc4[r]];
-      }// end loop over 'r'
-      
-      // Total number of operations to compute function values = 42
-      for (unsigned int r = 0; r < 7; r++)
-      {
-        F1 += FE1_C0_D100[ip][r]*w[0][nzc3[r]];
-        F2 += FE1_C0_D010[ip][r]*w[0][nzc2[r]];
-        F3 += FE1_C0_D001[ip][r]*w[0][nzc1[r]];
-      }// end loop over 'r'
-      
-      // Number of operations to compute ip constants: 54
-      // Number of operations: 4
-      const double Gip0 = F0*F0*F0*G0*W125[ip];
-      
-      // Number of operations: 1
-      const double Gip1 = W125[ip]*det;
-      
-      // Number of operations: 9
-      const double Gip2 = F0*F0*W125[ip]*(G1 + F1*G3 + F2*G4 + F3*G2);
-      
-      // Number of operations: 4
-      const double Gip3 = F0*F0*F0*G5*W125[ip];
-      
-      // Number of operations: 1
-      const double Gip4 = G6*W125[ip];
-      
-      // Number of operations: 9
-      const double Gip5 = F0*F0*W125[ip]*(G7 + F1*G8 + F2*G9 + F3*G3);
-      
-      // Number of operations: 4
-      const double Gip6 = F0*F0*F0*G10*W125[ip];
-      
-      // Number of operations: 9
-      const double Gip7 = F0*F0*W125[ip]*(G11 + F1*G9 + F2*G12 + F3*G4);
-      
-      // Number of operations: 4
-      const double Gip8 = F0*F0*F0*G13*W125[ip];
-      
-      // Number of operations: 4
-      const double Gip9 = F0*F0*F0*G14*W125[ip];
-      
-      // Number of operations: 4
-      const double Gip10 = F0*F0*F0*G15*W125[ip];
-      
-      // Number of operations: 1
-      const double Gip11 = G16*W125[ip];
-      
-      
-      // Number of operations for primary indices: 1323
-      for (unsigned int j = 0; j < 7; j++)
-      {
-        for (unsigned int k = 0; k < 7; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*20 + nzc1[k]] += FE1_C0_D001[ip][k]*FE1_C0_D010[ip][j]*Gip0;
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*20 + nzc3[k]] += FE1_C0_D100[ip][j]*FE1_C0_D100[ip][k]*Gip3;
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*20 + nzc3[k]] += FE1_C0_D010[ip][j]*FE1_C0_D100[ip][k]*Gip6;
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*20 + nzc2[k]] += FE1_C0_D010[ip][k]*FE1_C0_D100[ip][j]*Gip6;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*20 + nzc2[k]] += FE1_C0_D001[ip][j]*FE1_C0_D010[ip][k]*Gip0;
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*20 + nzc2[k]] += FE1_C0_D010[ip][j]*FE1_C0_D010[ip][k]*Gip8;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*20 + nzc1[k]] += FE1_C0_D001[ip][j]*FE1_C0_D001[ip][k]*Gip9;
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*20 + nzc1[k]] += FE1_C0_D001[ip][k]*FE1_C0_D100[ip][j]*Gip10;
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*20 + nzc3[k]] += FE1_C0_D001[ip][j]*FE1_C0_D100[ip][k]*Gip10;
-        }// end loop over 'k'
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 900
-      for (unsigned int j = 0; j < 10; j++)
-      {
-        for (unsigned int k = 0; k < 10; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc4[j]*20 + nzc4[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip1;
-          // Number of operations to compute entry: 3
-          A[nzc0[j]*20 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip4;
-          // Number of operations to compute entry: 3
-          A[nzc4[j]*20 + nzc0[k]] += FE1_C0[ip][j]*FE1_C0[ip][k]*Gip11;
-        }// end loop over 'k'
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 630
-      for (unsigned int j = 0; j < 7; j++)
-      {
-        for (unsigned int k = 0; k < 10; k++)
-        {
-          // Number of operations to compute entry: 3
-          A[nzc1[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D001[ip][j]*Gip2;
-          // Number of operations to compute entry: 3
-          A[nzc3[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D100[ip][j]*Gip5;
-          // Number of operations to compute entry: 3
-          A[nzc2[j]*20 + nzc4[k]] += FE1_C0[ip][k]*FE1_C0_D010[ip][j]*Gip7;
-        }// end loop over 'k'
-      }// end loop over 'j'
-    }// end loop over 'ip'
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -11045,29 +1696,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_cell_integral_0() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_cell_integral_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_cell_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_cell_integral_0();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 400; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c);
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -11080,257 +1717,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_exterior_facet_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave3d_0_exterior_facet_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_exterior_facet_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    
-    // Compute sub determinants
-    
-    
-    
-    // Compute determinant of Jacobian
-    
-    // Compute inverse of Jacobian
-    
-    // Vertices on faces
-    static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
-    
-    // Get vertices
-    const unsigned int v0 = face_vertices[facet][0];
-    const unsigned int v1 = face_vertices[facet][1];
-    const unsigned int v2 = face_vertices[facet][2];
-    
-    // Compute scale factor (area of face scaled by area of reference triangle)
-    const double a0 = (x[v0][1]*x[v1][2] + x[v0][2]*x[v2][1] + x[v1][1]*x[v2][2])
-                  - (x[v2][1]*x[v1][2] + x[v2][2]*x[v0][1] + x[v1][1]*x[v0][2]);
-    const double a1 = (x[v0][2]*x[v1][0] + x[v0][0]*x[v2][2] + x[v1][2]*x[v2][0])
-                  - (x[v2][2]*x[v1][0] + x[v2][0]*x[v0][2] + x[v1][2]*x[v0][0]);
-    const double a2 = (x[v0][0]*x[v1][1] + x[v0][1]*x[v2][0] + x[v1][0]*x[v2][1])
-                  - (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
-    const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
-    
-    const bool direction = a0*(x[facet][0] - x[v0][0]) + a1*(x[facet][1] - x[v0][1])  + a2*(x[facet][2] - x[v0][2]) < 0;
-    // Compute facet normals from the facet scale factor constants
-    const double n2 = direction ? a2 / det : -a2 / det;
-    
-    
-    // Array of quadrature weights
-    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
-    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE0_f0_C0[25][6] = \
-    {{0.759842524889053, -0.0409849230988147, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
-    {0.404143384962011, -0.0347905350890821, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
-    {0.0382038937201701, -0.0249744559383749, -0.0543309414249184, 0.0461882014671774, 0.938423301877432, 0.0564900002985142},
-    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218534},
-    {-0.0762735703276686, -0.00457955736373825, 0.723813068870285, 0.0166673234982245, 0.338636367163553, 0.00173636815934473},
-    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
-    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
-    {-0.0585120870225411, -0.0960538647466012, -0.0543309414249184, 0.227214213208259, 0.75739729013635, 0.224285389849452},
-    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372834},
-    {-0.0643063527627086, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032827},
-    {-0.0191125161665051, -0.0191125161665051, -0.036640207614552, 0.0764500646660208, 0.0764500646660208, 0.921965110615521},
-    {-0.0794020521078099, -0.07940205210781, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
-    {-0.123076437918076, -0.123076437918076, -0.0543309414249184, 0.492305751672305, 0.492305751672305, 0.315872313916461},
-    {-0.105896858921167, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.0927420088040289},
-    {-0.0444129613327221, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330888, 0.0097091631333821},
-    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877739, 0.65464206627708},
-    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320685},
-    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249184, 0.75739729013635, 0.227214213208259, 0.224285389849452},
-    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.65167626994723, 0.195498601422111, 0.0658515377372834},
-    {-0.0217044058396818, -0.0643063527627087, 0.723813068870285, 0.273311911925214, 0.0819917787365635, 0.00689399907032831},
-    {-0.0409849230988147, 0.759842524889053, -0.036640207614552, 0.145727572487076, 0.00717255684496533, 0.164882476492272},
-    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.029798051046164, 0.115025523822223},
-    {-0.024974455938375, 0.0382038937201699, -0.0543309414249184, 0.938423301877431, 0.0461882014671778, 0.0564900002985144},
-    {-0.0138776265525463, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743823, 0.0165858034218534},
-    {-0.00457955736373818, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982247, 0.00173636815934472}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[6] = {11, 12, 13, 14, 15, 16};
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {1, 2, 3, 4, 5, 6};
-    // Array of non-zero columns
-    static const unsigned int nzc5[6] = {10, 11, 13, 15, 17, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc4[6] = {0, 1, 3, 5, 7, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc2[6] = {0, 2, 3, 4, 7, 8};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {10, 12, 13, 14, 17, 18};
-    // Array of non-zero columns
-    static const unsigned int nzc6[6] = {0, 1, 2, 6, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc7[6] = {10, 11, 12, 16, 18, 19};
-    
-    // Number of operations to compute geometry constants: 2
-    // Should be added to total operation count.
-    const double G0 = 3*det*n2;
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    switch ( facet )
-    {
-    case 0:
-      {
-      // Total number of operations to compute element tensor (from this point): 3075
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 3075
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 108
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          for (unsigned int k = 0; k < 6; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc0[j]*20 + nzc1[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 1:
-      {
-      // Total number of operations to compute element tensor (from this point): 3075
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 3075
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 108
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          for (unsigned int k = 0; k < 6; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc2[j]*20 + nzc3[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 2:
-      {
-      // Total number of operations to compute element tensor (from this point): 3075
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 3075
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 108
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          for (unsigned int k = 0; k < 6; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc4[j]*20 + nzc5[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 3:
-      {
-      // Total number of operations to compute element tensor (from this point): 3075
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 3075
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc7[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 3
-        // Number of operations: 3
-        const double Gip0 = F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 108
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          for (unsigned int k = 0; k < 6; k++)
-          {
-            // Number of operations to compute entry: 3
-            A[nzc6[j]*20 + nzc7[k]] += FE0_f0_C0[ip][j]*FE0_f0_C0[ip][k]*Gip0;
-          }// end loop over 'k'
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    }
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -11347,30 +1743,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_0_exterior_facet_integral_0();
 
   /// Destructor
-  virtual ~solitarywave3d_0_exterior_facet_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_0_exterior_facet_integral_0();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 400; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c, facet);
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -11394,118 +1776,43 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_form_0() : ufc::form()
-  {
-    // Do nothing
-  }
+  solitarywave3d_form_0();
 
   /// Destructor
-  virtual ~solitarywave3d_form_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_form_0();
 
   /// Return a string identifying the form
-  virtual const char* signature() const
-  {
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1, Space(3)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2}))))))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('tetrahedron', 1, Space(3))), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(2, (), (), {}), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 1), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})))))))), Measure('exterior_facet', 0, None))])";
-  }
+  virtual const char* signature() const;
 
   /// Return the rank of the global tensor (r)
-  virtual unsigned int rank() const
-  {
-    return 2;
-  }
+  virtual unsigned int rank() const;
 
   /// Return the number of coefficients (n)
-  virtual unsigned int num_coefficients() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_coefficients() const;
 
   /// Return the number of cell integrals
-  virtual unsigned int num_cell_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_cell_integrals() const;
 
   /// Return the number of exterior facet integrals
-  virtual unsigned int num_exterior_facet_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_exterior_facet_integrals() const;
 
   /// Return the number of interior facet integrals
-  virtual unsigned int num_interior_facet_integrals() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_interior_facet_integrals() const;
 
   /// Create a new finite element for argument function i
-  virtual ufc::finite_element* create_finite_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_finite_element_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_finite_element_1();
-      break;
-    case 2:
-      return new solitarywave3d_0_finite_element_2();
-      break;
-    case 3:
-      return new solitarywave3d_0_finite_element_3();
-      break;
-    case 4:
-      return new solitarywave3d_0_finite_element_4();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_finite_element(unsigned int i) const;
 
   /// Create a new dof map for argument function i
-  virtual ufc::dof_map* create_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_0_dof_map_0();
-      break;
-    case 1:
-      return new solitarywave3d_0_dof_map_1();
-      break;
-    case 2:
-      return new solitarywave3d_0_dof_map_2();
-      break;
-    case 3:
-      return new solitarywave3d_0_dof_map_3();
-      break;
-    case 4:
-      return new solitarywave3d_0_dof_map_4();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_dof_map(unsigned int i) const;
 
   /// Create a new cell integral on sub domain i
-  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
-  {
-    return new solitarywave3d_0_cell_integral_0();
-  }
+  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const;
 
   /// Create a new exterior facet integral on sub domain i
-  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
-  {
-    return new solitarywave3d_0_exterior_facet_integral_0();
-  }
+  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const;
 
   /// Create a new interior facet integral on sub domain i
-  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
-  {
-    return 0;
-  }
+  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const;
 
 };
 
@@ -11516,640 +1823,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_0_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_0_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_0_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_0_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -12160,640 +1897,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_0_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_0_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_0_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_0_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -12804,968 +1971,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    vertex_values[6] = dof_values[3];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[10];
-    vertex_values[3] = dof_values[11];
-    vertex_values[5] = dof_values[12];
-    vertex_values[7] = dof_values[13];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_finite_element_0_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_finite_element_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -13776,640 +2045,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_1_0() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_1_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_1_0();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_1_0();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -14420,640 +2119,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_1_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_1_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_1_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    const double coeff0_1 = coefficients0[dof][1];
-    const double coeff0_2 = coefficients0[dof][2];
-    const double coeff0_3 = coefficients0[dof][3];
-    const double coeff0_4 = coefficients0[dof][4];
-    const double coeff0_5 = coefficients0[dof][5];
-    const double coeff0_6 = coefficients0[dof][6];
-    const double coeff0_7 = coefficients0[dof][7];
-    const double coeff0_8 = coefficients0[dof][8];
-    const double coeff0_9 = coefficients0[dof][9];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-    const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-    const double scalings_z_0 = 1;
-    const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-    const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    const double psitilde_a_1 = x;
-    const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    const double psitilde_bs_0_1 = 1.5*y + 0.5;
-    const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-    const double psitilde_bs_1_0 = 1;
-    const double psitilde_bs_1_1 = 2.5*y + 1.5;
-    const double psitilde_bs_2_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    const double psitilde_cs_00_1 = 2*z + 1;
-    const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-    const double psitilde_cs_01_0 = 1;
-    const double psitilde_cs_01_1 = 3*z + 2;
-    const double psitilde_cs_02_0 = 1;
-    const double psitilde_cs_10_0 = 1;
-    const double psitilde_cs_10_1 = 3*z + 2;
-    const double psitilde_cs_11_0 = 1;
-    const double psitilde_cs_20_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-    const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-    const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-    const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-    const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-    const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-    const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-    const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-    const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[10][10] = \
-    {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-    {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-    {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-    {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-    {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-    {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-    {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-    {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats1[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-    static const double dmats2[10][10] = \
-    {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-    {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-    {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-    {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-    {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-    {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-    {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    double coeff0_1 = 0;
-    double coeff0_2 = 0;
-    double coeff0_3 = 0;
-    double coeff0_4 = 0;
-    double coeff0_5 = 0;
-    double coeff0_6 = 0;
-    double coeff0_7 = 0;
-    double coeff0_8 = 0;
-    double coeff0_9 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    double new_coeff0_1 = 0;
-    double new_coeff0_2 = 0;
-    double new_coeff0_3 = 0;
-    double new_coeff0_4 = 0;
-    double new_coeff0_5 = 0;
-    double new_coeff0_6 = 0;
-    double new_coeff0_7 = 0;
-    double new_coeff0_8 = 0;
-    double new_coeff0_9 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-      new_coeff0_1 = coefficients0[dof][1];
-      new_coeff0_2 = coefficients0[dof][2];
-      new_coeff0_3 = coefficients0[dof][3];
-      new_coeff0_4 = coefficients0[dof][4];
-      new_coeff0_5 = coefficients0[dof][5];
-      new_coeff0_6 = coefficients0[dof][6];
-      new_coeff0_7 = coefficients0[dof][7];
-      new_coeff0_8 = coefficients0[dof][8];
-      new_coeff0_9 = coefficients0[dof][9];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-        coeff0_1 = new_coeff0_1;
-        coeff0_2 = new_coeff0_2;
-        coeff0_3 = new_coeff0_3;
-        coeff0_4 = new_coeff0_4;
-        coeff0_5 = new_coeff0_5;
-        coeff0_6 = new_coeff0_6;
-        coeff0_7 = new_coeff0_7;
-        coeff0_8 = new_coeff0_8;
-        coeff0_9 = new_coeff0_9;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-          new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-          new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-          new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-          new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-          new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-          new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-          new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-          new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-          new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-          new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-          new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-          new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-          new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-          new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-          new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-          new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-          new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-          new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-          new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-          new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-          new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-          new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-          new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-          new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-          new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-          new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-          new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[10][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[10][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[10][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[1];
-    vertex_values[2] = dof_values[2];
-    vertex_values[3] = dof_values[3];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_1_1();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -15064,968 +2193,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_1() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_1();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 2;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    values[0] = 0;
-    values[1] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[0] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Extract relevant coefficients
-      const double coeff0_0 =   coefficients0[dof][0];
-      const double coeff0_1 =   coefficients0[dof][1];
-      const double coeff0_2 =   coefficients0[dof][2];
-      const double coeff0_3 =   coefficients0[dof][3];
-      const double coeff0_4 =   coefficients0[dof][4];
-      const double coeff0_5 =   coefficients0[dof][5];
-      const double coeff0_6 =   coefficients0[dof][6];
-      const double coeff0_7 =   coefficients0[dof][7];
-      const double coeff0_8 =   coefficients0[dof][8];
-      const double coeff0_9 =   coefficients0[dof][9];
-    
-      // Compute value(s)
-      values[1] = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9;
-    }
-    
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 2*num_derivatives; j++)
-      values[j] = 0;
-    
-    if (0 <= i && i <= 9)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-    if (10 <= i && i <= 19)
-    {
-      // Map degree of freedom to element degree of freedom
-      const unsigned int dof = i - 10;
-    
-      // Generate scalings
-      const double scalings_y_0 = 1;
-      const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y);
-      const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y);
-      const double scalings_z_0 = 1;
-      const double scalings_z_1 = scalings_z_0*(0.5 - 0.5*z);
-      const double scalings_z_2 = scalings_z_1*(0.5 - 0.5*z);
-    
-      // Compute psitilde_a
-      const double psitilde_a_0 = 1;
-      const double psitilde_a_1 = x;
-      const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0;
-    
-      // Compute psitilde_bs
-      const double psitilde_bs_0_0 = 1;
-      const double psitilde_bs_0_1 = 1.5*y + 0.5;
-      const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0;
-      const double psitilde_bs_1_0 = 1;
-      const double psitilde_bs_1_1 = 2.5*y + 1.5;
-      const double psitilde_bs_2_0 = 1;
-    
-      // Compute psitilde_cs
-      const double psitilde_cs_00_0 = 1;
-      const double psitilde_cs_00_1 = 2*z + 1;
-      const double psitilde_cs_00_2 = 0.3125*psitilde_cs_00_1 + 1.875*z*psitilde_cs_00_1 - 0.5625*psitilde_cs_00_0;
-      const double psitilde_cs_01_0 = 1;
-      const double psitilde_cs_01_1 = 3*z + 2;
-      const double psitilde_cs_02_0 = 1;
-      const double psitilde_cs_10_0 = 1;
-      const double psitilde_cs_10_1 = 3*z + 2;
-      const double psitilde_cs_11_0 = 1;
-      const double psitilde_cs_20_0 = 1;
-    
-      // Compute basisvalues
-      const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-      const double basisvalue1 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_0;
-      const double basisvalue2 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_0;
-      const double basisvalue3 = 1.11803398874989*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_1;
-      const double basisvalue4 = 5.1234753829798*psitilde_a_2*scalings_y_2*psitilde_bs_2_0*scalings_z_2*psitilde_cs_20_0;
-      const double basisvalue5 = 3.96862696659689*psitilde_a_1*scalings_y_1*psitilde_bs_1_1*scalings_z_2*psitilde_cs_11_0;
-      const double basisvalue6 = 2.29128784747792*psitilde_a_0*scalings_y_0*psitilde_bs_0_2*scalings_z_2*psitilde_cs_02_0;
-      const double basisvalue7 = 3.24037034920393*psitilde_a_1*scalings_y_1*psitilde_bs_1_0*scalings_z_1*psitilde_cs_10_1;
-      const double basisvalue8 = 1.87082869338697*psitilde_a_0*scalings_y_0*psitilde_bs_0_1*scalings_z_1*psitilde_cs_01_1;
-      const double basisvalue9 = 1.3228756555323*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_2;
-    
-      // Table(s) of coefficients
-      static const double coefficients0[10][10] =   \
-      {{-0.0577350269189626, -0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, 0.0503952630678969, 0.0290957186981323, 0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0.0608580619450185, -0.0351364184463153, -0.0248451997499977, 0.0650600048632355, -0.050395263067897, 0.0290957186981323, -0.0411475599898912, 0.0237565548366599, 0.0167984210226323},
-      {-0.0577350269189625, 0, 0.0702728368926306, -0.0248451997499977, 0, 0, 0.0872871560943969, 0, -0.0475131096733199, 0.0167984210226323},
-      {-0.0577350269189626, 0, 0, 0.074535599249993, 0, 0, 0, 0, 0, 0.100790526135794},
-      {0.23094010767585, 0, 0.140545673785261, 0.0993807989999906, 0, 0, 0, 0, 0.1187827741833, -0.0671936840905293},
-      {0.230940107675851, 0.121716123890037, -0.0702728368926306, 0.0993807989999907, 0, 0, 0, 0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, 0.121716123890037, 0.0702728368926307, -0.0993807989999907, 0, 0.100790526135794, -0.087287156094397, -0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, -0.121716123890037, -0.0702728368926307, 0.0993807989999906, 0, 0, 0, -0.102868899974728, -0.0593913870916499, -0.0671936840905293},
-      {0.23094010767585, -0.121716123890037, 0.0702728368926306, -0.0993807989999906, 0, -0.100790526135794, -0.0872871560943969, 0.0205737799949456, -0.01187827741833, 0.0167984210226323},
-      {0.23094010767585, 0, -0.140545673785261, -0.0993807989999906, -0.130120009726471, 0, 0.0290957186981323, 0, 0.02375655483666, 0.0167984210226323}};
-    
-      // Interesting (new) part
-      // Tables of derivatives of the polynomial base (transpose)
-      static const double dmats0[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {6.32455532033676, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 11.2249721603218, 0, 0, 0, 0, 0, 0, 0, 0},
-      {4.58257569495584, 0, 8.36660026534076, -1.18321595661992, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.74165738677394, 0, 0, 8.69482604771366, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats1[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.47722557505166, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 7.24568837309472, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {-2.64575131106459, 0, 9.66091783079296, 0.683130051063974, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 0, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {3.24037034920393, 0, 0, 7.52994023880668, 0, 0, 0, 0, 0, 0},
-      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-    
-      static const double dmats2[10][10] =   \
-      {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {3.16227766016838, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {1.82574185835055, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {5.16397779494322, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-      {2.95803989154981, 5.61248608016091, -1.08012344973464, -0.763762615825974, 0, 0, 0, 0, 0, 0},
-      {2.29128784747792, 1.44913767461894, 4.18330013267038, -0.591607978309962, 0, 0, 0, 0, 0, 0},
-      {1.32287565553229, 0, 3.86436713231718, -0.341565025531986, 0, 0, 0, 0, 0, 0},
-      {1.87082869338697, 7.09929573971954, 0, 4.34741302385683, 0, 0, 0, 0, 0, 0},
-      {1.08012344973464, 0, 7.09929573971954, 2.50998007960223, 0, 0, 0, 0, 0, 0},
-      {-3.81881307912987, 0, 0, 8.87411967464942, 0, 0, 0, 0, 0, 0}};
-    
-      // Compute reference derivatives
-      // Declare pointer to array of derivatives on FIAT element
-      double *derivatives = new double [num_derivatives];
-    
-      // Declare coefficients
-      double coeff0_0 = 0;
-      double coeff0_1 = 0;
-      double coeff0_2 = 0;
-      double coeff0_3 = 0;
-      double coeff0_4 = 0;
-      double coeff0_5 = 0;
-      double coeff0_6 = 0;
-      double coeff0_7 = 0;
-      double coeff0_8 = 0;
-      double coeff0_9 = 0;
-    
-      // Declare new coefficients
-      double new_coeff0_0 = 0;
-      double new_coeff0_1 = 0;
-      double new_coeff0_2 = 0;
-      double new_coeff0_3 = 0;
-      double new_coeff0_4 = 0;
-      double new_coeff0_5 = 0;
-      double new_coeff0_6 = 0;
-      double new_coeff0_7 = 0;
-      double new_coeff0_8 = 0;
-      double new_coeff0_9 = 0;
-    
-      // Loop possible derivatives
-      for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-      {
-        // Get values from coefficients array
-        new_coeff0_0 = coefficients0[dof][0];
-        new_coeff0_1 = coefficients0[dof][1];
-        new_coeff0_2 = coefficients0[dof][2];
-        new_coeff0_3 = coefficients0[dof][3];
-        new_coeff0_4 = coefficients0[dof][4];
-        new_coeff0_5 = coefficients0[dof][5];
-        new_coeff0_6 = coefficients0[dof][6];
-        new_coeff0_7 = coefficients0[dof][7];
-        new_coeff0_8 = coefficients0[dof][8];
-        new_coeff0_9 = coefficients0[dof][9];
-    
-        // Loop derivative order
-        for (unsigned int j = 0; j < n; j++)
-        {
-          // Update old coefficients
-          coeff0_0 = new_coeff0_0;
-          coeff0_1 = new_coeff0_1;
-          coeff0_2 = new_coeff0_2;
-          coeff0_3 = new_coeff0_3;
-          coeff0_4 = new_coeff0_4;
-          coeff0_5 = new_coeff0_5;
-          coeff0_6 = new_coeff0_6;
-          coeff0_7 = new_coeff0_7;
-          coeff0_8 = new_coeff0_8;
-          coeff0_9 = new_coeff0_9;
-    
-          if(combinations[deriv_num][j] == 0)
-          {
-            new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0];
-            new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1];
-            new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2];
-            new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3];
-            new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4];
-            new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5];
-            new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6];
-            new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7];
-            new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8];
-            new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9];
-          }
-          if(combinations[deriv_num][j] == 1)
-          {
-            new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0];
-            new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1];
-            new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2];
-            new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3];
-            new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4];
-            new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5];
-            new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6];
-            new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7];
-            new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8];
-            new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9];
-          }
-          if(combinations[deriv_num][j] == 2)
-          {
-            new_coeff0_0 = coeff0_0*dmats2[0][0] + coeff0_1*dmats2[1][0] + coeff0_2*dmats2[2][0] + coeff0_3*dmats2[3][0] + coeff0_4*dmats2[4][0] + coeff0_5*dmats2[5][0] + coeff0_6*dmats2[6][0] + coeff0_7*dmats2[7][0] + coeff0_8*dmats2[8][0] + coeff0_9*dmats2[9][0];
-            new_coeff0_1 = coeff0_0*dmats2[0][1] + coeff0_1*dmats2[1][1] + coeff0_2*dmats2[2][1] + coeff0_3*dmats2[3][1] + coeff0_4*dmats2[4][1] + coeff0_5*dmats2[5][1] + coeff0_6*dmats2[6][1] + coeff0_7*dmats2[7][1] + coeff0_8*dmats2[8][1] + coeff0_9*dmats2[9][1];
-            new_coeff0_2 = coeff0_0*dmats2[0][2] + coeff0_1*dmats2[1][2] + coeff0_2*dmats2[2][2] + coeff0_3*dmats2[3][2] + coeff0_4*dmats2[4][2] + coeff0_5*dmats2[5][2] + coeff0_6*dmats2[6][2] + coeff0_7*dmats2[7][2] + coeff0_8*dmats2[8][2] + coeff0_9*dmats2[9][2];
-            new_coeff0_3 = coeff0_0*dmats2[0][3] + coeff0_1*dmats2[1][3] + coeff0_2*dmats2[2][3] + coeff0_3*dmats2[3][3] + coeff0_4*dmats2[4][3] + coeff0_5*dmats2[5][3] + coeff0_6*dmats2[6][3] + coeff0_7*dmats2[7][3] + coeff0_8*dmats2[8][3] + coeff0_9*dmats2[9][3];
-            new_coeff0_4 = coeff0_0*dmats2[0][4] + coeff0_1*dmats2[1][4] + coeff0_2*dmats2[2][4] + coeff0_3*dmats2[3][4] + coeff0_4*dmats2[4][4] + coeff0_5*dmats2[5][4] + coeff0_6*dmats2[6][4] + coeff0_7*dmats2[7][4] + coeff0_8*dmats2[8][4] + coeff0_9*dmats2[9][4];
-            new_coeff0_5 = coeff0_0*dmats2[0][5] + coeff0_1*dmats2[1][5] + coeff0_2*dmats2[2][5] + coeff0_3*dmats2[3][5] + coeff0_4*dmats2[4][5] + coeff0_5*dmats2[5][5] + coeff0_6*dmats2[6][5] + coeff0_7*dmats2[7][5] + coeff0_8*dmats2[8][5] + coeff0_9*dmats2[9][5];
-            new_coeff0_6 = coeff0_0*dmats2[0][6] + coeff0_1*dmats2[1][6] + coeff0_2*dmats2[2][6] + coeff0_3*dmats2[3][6] + coeff0_4*dmats2[4][6] + coeff0_5*dmats2[5][6] + coeff0_6*dmats2[6][6] + coeff0_7*dmats2[7][6] + coeff0_8*dmats2[8][6] + coeff0_9*dmats2[9][6];
-            new_coeff0_7 = coeff0_0*dmats2[0][7] + coeff0_1*dmats2[1][7] + coeff0_2*dmats2[2][7] + coeff0_3*dmats2[3][7] + coeff0_4*dmats2[4][7] + coeff0_5*dmats2[5][7] + coeff0_6*dmats2[6][7] + coeff0_7*dmats2[7][7] + coeff0_8*dmats2[8][7] + coeff0_9*dmats2[9][7];
-            new_coeff0_8 = coeff0_0*dmats2[0][8] + coeff0_1*dmats2[1][8] + coeff0_2*dmats2[2][8] + coeff0_3*dmats2[3][8] + coeff0_4*dmats2[4][8] + coeff0_5*dmats2[5][8] + coeff0_6*dmats2[6][8] + coeff0_7*dmats2[7][8] + coeff0_8*dmats2[8][8] + coeff0_9*dmats2[9][8];
-            new_coeff0_9 = coeff0_0*dmats2[0][9] + coeff0_1*dmats2[1][9] + coeff0_2*dmats2[2][9] + coeff0_3*dmats2[3][9] + coeff0_4*dmats2[4][9] + coeff0_5*dmats2[5][9] + coeff0_6*dmats2[6][9] + coeff0_7*dmats2[7][9] + coeff0_8*dmats2[8][9] + coeff0_9*dmats2[9][9];
-          }
-    
-        }
-        // Compute derivatives on reference element as dot product of coefficients and basisvalues
-        derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9;
-      }
-    
-      // Transform derivatives back to physical element
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        for (unsigned int col = 0; col < num_derivatives; col++)
-        {
-          values[num_derivatives + row] += transform[row][col]*derivatives[col];
-        }
-      }
-      // Delete pointer to array of derivatives on FIAT element
-      delete [] derivatives;
-    
-      // Delete pointer to array of combinations of derivatives and transform
-      for (unsigned int row = 0; row < num_derivatives; row++)
-      {
-        delete [] combinations[row];
-        delete [] transform[row];
-      }
-    
-      delete [] combinations;
-      delete [] transform;
-    }
-    
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[20][1][3] = {{{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}, {{0, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0.5, 0.5}}, {{0.5, 0, 0.5}}, {{0.5, 0.5, 0}}, {{0, 0, 0.5}}, {{0, 0.5, 0}}, {{0.5, 0, 0}}};
-    static const double W[20][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
-    static const double D[20][1][2] = {{{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{1, 0}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}, {{0, 1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[2];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 2; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[2] = dof_values[1];
-    vertex_values[4] = dof_values[2];
-    vertex_values[6] = dof_values[3];
-    // Evaluate at vertices and use affine mapping
-    vertex_values[1] = dof_values[10];
-    vertex_values[3] = dof_values[11];
-    vertex_values[5] = dof_values[12];
-    vertex_values[7] = dof_values[13];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_finite_element_1_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_finite_element_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -16036,465 +2267,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_2() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_2();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_2();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    static const double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_2();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -16505,465 +2341,70 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_finite_element_3() : ufc::finite_element()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_finite_element_3();
 
   /// Destructor
-  virtual ~solitarywave3d_1_finite_element_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_finite_element_3();
 
   /// Return a string identifying the finite element
-  virtual const char* signature() const
-  {
-    return "FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return the cell shape
-  virtual ufc::shape cell_shape() const
-  {
-    return ufc::tetrahedron;
-  }
+  virtual ufc::shape cell_shape() const;
 
   /// Return the dimension of the finite element function space
-  virtual unsigned int space_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int space_dimension() const;
 
   /// Return the rank of the value space
-  virtual unsigned int value_rank() const
-  {
-    return 0;
-  }
+  virtual unsigned int value_rank() const;
 
   /// Return the dimension of the value space for axis i
-  virtual unsigned int value_dimension(unsigned int i) const
-  {
-    return 1;
-  }
+  virtual unsigned int value_dimension(unsigned int i) const;
 
   /// Evaluate basis function i at given point in cell
   virtual void evaluate_basis(unsigned int i,
                               double* values,
                               const double* coordinates,
-                              const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Reset values
-    *values = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Extract relevant coefficients
-    const double coeff0_0 = coefficients0[dof][0];
-    
-    // Compute value(s)
-    *values = coeff0_0*basisvalue0;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate all basis functions at given point in cell
   virtual void evaluate_basis_all(double* values,
                                   const double* coordinates,
-                                  const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
-  }
+                                  const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of basis function i at given point in cell
   virtual void evaluate_basis_derivatives(unsigned int i,
                                           unsigned int n,
                                           double* values,
                                           const double* coordinates,
-                                          const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * element_coordinates = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
-    const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
-    const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
-    const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
-    const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
-    const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
-    const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
-    const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
-    const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
-    
-    // Compute sub determinants
-    const double d00 = J_11*J_22 - J_12*J_21;
-    const double d01 = J_12*J_20 - J_10*J_22;
-    const double d02 = J_10*J_21 - J_11*J_20;
-    
-    const double d10 = J_02*J_21 - J_01*J_22;
-    const double d11 = J_00*J_22 - J_02*J_20;
-    const double d12 = J_01*J_20 - J_00*J_21;
-    
-    const double d20 = J_01*J_12 - J_02*J_11;
-    const double d21 = J_02*J_10 - J_00*J_12;
-    const double d22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d00 + J_10*d10 + J_20*d20;
-    
-    // Compute inverse of Jacobian
-    
-    // Compute constants
-    const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
-                    + d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
-                    + d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
-    
-    const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
-                    + d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
-                    + d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
-    
-    const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
-                    + d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
-                    + d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
-    
-    // Get coordinates and map to the UFC reference element
-    double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
-    double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
-    double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
-    
-    // Map coordinates to the reference cube
-    if (std::abs(y + z - 1.0) < 1e-14)
-      x = 1.0;
-    else
-      x = -2.0 * x/(y + z - 1.0) - 1.0;
-    if (std::abs(z - 1.0) < 1e-14)
-      y = -1.0;
-    else
-      y = 2.0 * y/(1.0 - z) - 1.0;
-    z = 2.0 * z - 1.0;
-    
-    // Compute number of derivatives
-    unsigned int num_derivatives = 1;
-    
-    for (unsigned int j = 0; j < n; j++)
-      num_derivatives *= 3;
-    
-    
-    // Declare pointer to two dimensional array that holds combinations of derivatives and initialise
-    unsigned int **combinations = new unsigned int *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      combinations[j] = new unsigned int [n];
-      for (unsigned int k = 0; k < n; k++)
-        combinations[j][k] = 0;
-    }
-    
-    // Generate combinations of derivatives
-    for (unsigned int row = 1; row < num_derivatives; row++)
-    {
-      for (unsigned int num = 0; num < row; num++)
-      {
-        for (unsigned int col = n-1; col+1 > 0; col--)
-        {
-          if (combinations[row][col] + 1 > 2)
-            combinations[row][col] = 0;
-          else
-          {
-            combinations[row][col] += 1;
-            break;
-          }
-        }
-      }
-    }
-    
-    // Compute inverse of Jacobian
-    const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
-    
-    // Declare transformation matrix
-    // Declare pointer to two dimensional array and initialise
-    double **transform = new double *[num_derivatives];
-    
-    for (unsigned int j = 0; j < num_derivatives; j++)
-    {
-      transform[j] = new double [num_derivatives];
-      for (unsigned int k = 0; k < num_derivatives; k++)
-        transform[j][k] = 1;
-    }
-    
-    // Construct transformation matrix
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        for (unsigned int k = 0; k < n; k++)
-          transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
-      }
-    }
-    
-    // Reset values
-    for (unsigned int j = 0; j < 1*num_derivatives; j++)
-      values[j] = 0;
-    
-    // Map degree of freedom to element degree of freedom
-    const unsigned int dof = i;
-    
-    // Generate scalings
-    const double scalings_y_0 = 1;
-    const double scalings_z_0 = 1;
-    
-    // Compute psitilde_a
-    const double psitilde_a_0 = 1;
-    
-    // Compute psitilde_bs
-    const double psitilde_bs_0_0 = 1;
-    
-    // Compute psitilde_cs
-    const double psitilde_cs_00_0 = 1;
-    
-    // Compute basisvalues
-    const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
-    
-    // Table(s) of coefficients
-    static const double coefficients0[1][1] = \
-    {{1.15470053837925}};
-    
-    // Interesting (new) part
-    // Tables of derivatives of the polynomial base (transpose)
-    static const double dmats0[1][1] = \
-    {{0}};
-    
-    static const double dmats1[1][1] = \
-    {{0}};
-    
-    static const double dmats2[1][1] = \
-    {{0}};
-    
-    // Compute reference derivatives
-    // Declare pointer to array of derivatives on FIAT element
-    double *derivatives = new double [num_derivatives];
-    
-    // Declare coefficients
-    double coeff0_0 = 0;
-    
-    // Declare new coefficients
-    double new_coeff0_0 = 0;
-    
-    // Loop possible derivatives
-    for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
-    {
-      // Get values from coefficients array
-      new_coeff0_0 = coefficients0[dof][0];
-    
-      // Loop derivative order
-      for (unsigned int j = 0; j < n; j++)
-      {
-        // Update old coefficients
-        coeff0_0 = new_coeff0_0;
-    
-        if(combinations[deriv_num][j] == 0)
-        {
-          new_coeff0_0 = coeff0_0*dmats0[0][0];
-        }
-        if(combinations[deriv_num][j] == 1)
-        {
-          new_coeff0_0 = coeff0_0*dmats1[0][0];
-        }
-        if(combinations[deriv_num][j] == 2)
-        {
-          new_coeff0_0 = coeff0_0*dmats2[0][0];
-        }
-    
-      }
-      // Compute derivatives on reference element as dot product of coefficients and basisvalues
-      derivatives[deriv_num] = new_coeff0_0*basisvalue0;
-    }
-    
-    // Transform derivatives back to physical element
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      for (unsigned int col = 0; col < num_derivatives; col++)
-      {
-        values[row] += transform[row][col]*derivatives[col];
-      }
-    }
-    // Delete pointer to array of derivatives on FIAT element
-    delete [] derivatives;
-    
-    // Delete pointer to array of combinations of derivatives and transform
-    for (unsigned int row = 0; row < num_derivatives; row++)
-    {
-      delete [] combinations[row];
-      delete [] transform[row];
-    }
-    
-    delete [] combinations;
-    delete [] transform;
-  }
+                                          const ufc::cell& c) const;
 
   /// Evaluate order n derivatives of all basis functions at given point in cell
   virtual void evaluate_basis_derivatives_all(unsigned int n,
                                               double* values,
                                               const double* coordinates,
-                                              const ufc::cell& c) const
-  {
-    throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
-  }
+                                              const ufc::cell& c) const;
 
   /// Evaluate linear functional for dof i on the function f
   virtual double evaluate_dof(unsigned int i,
                               const ufc::function& f,
-                              const ufc::cell& c) const
-  {
-    // The reference points, direction and weights:
-    static const double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
-    static const double W[1][1] = {{1}};
-    static const double D[1][1][1] = {{{1}}};
-    
-    const double * const * x = c.coordinates;
-    double result = 0.0;
-    // Iterate over the points:
-    // Evaluate basis functions for affine mapping
-    const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
-    const double w1 = X[i][0][0];
-    const double w2 = X[i][0][1];
-    const double w3 = X[i][0][2];
-    
-    // Compute affine mapping y = F(X)
-    double y[3];
-    y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
-    y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
-    y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
-    
-    // Evaluate function at physical points
-    double values[1];
-    f.evaluate(values, y, c);
-    
-    // Map function values using appropriate mapping
-    // Affine map: Do nothing
-    
-    // Note that we do not map the weights (yet).
-    
-    // Take directional components
-    for(int k = 0; k < 1; k++)
-      result += values[k]*D[i][0][k];
-    // Multiply by weights
-    result *= W[i][0];
-    
-    return result;
-  }
+                              const ufc::cell& c) const;
 
   /// Evaluate linear functionals for all dofs on the function f
   virtual void evaluate_dofs(double* values,
                              const ufc::function& f,
-                             const ufc::cell& c) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                             const ufc::cell& c) const;
 
   /// Interpolate vertex values from dof values
   virtual void interpolate_vertex_values(double* vertex_values,
                                          const double* dof_values,
-                                         const ufc::cell& c) const
-  {
-    // Evaluate at vertices and use affine mapping
-    vertex_values[0] = dof_values[0];
-    vertex_values[1] = dof_values[0];
-    vertex_values[2] = dof_values[0];
-    vertex_values[3] = dof_values[0];
-  }
+                                         const ufc::cell& c) const;
 
   /// Return the number of sub elements (for a mixed element)
-  virtual unsigned int num_sub_elements() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_elements() const;
 
   /// Create a new finite element for sub element i (for a mixed element)
-  virtual ufc::finite_element* create_sub_element(unsigned int i) const
-  {
-    return new solitarywave3d_1_finite_element_3();
-  }
+  virtual ufc::finite_element* create_sub_element(unsigned int i) const;
 
 };
 
@@ -16979,214 +2420,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_0_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_0_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_0_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_0_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_0_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -17202,214 +2496,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_0_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_0_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_0_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_0_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_0_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -17425,289 +2572,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 20;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 12;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-    offset = offset + m.num_entities[1];
-    dofs[10] = offset + c.entity_indices[0][0];
-    dofs[11] = offset + c.entity_indices[0][1];
-    dofs[12] = offset + c.entity_indices[0][2];
-    dofs[13] = offset + c.entity_indices[0][3];
-    offset = offset + m.num_entities[0];
-    dofs[14] = offset + c.entity_indices[1][0];
-    dofs[15] = offset + c.entity_indices[1][1];
-    dofs[16] = offset + c.entity_indices[1][2];
-    dofs[17] = offset + c.entity_indices[1][3];
-    dofs[18] = offset + c.entity_indices[1][4];
-    dofs[19] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      dofs[6] = 11;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 15;
-      dofs[11] = 16;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      dofs[6] = 10;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 17;
-      dofs[11] = 18;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 13;
-      dofs[9] = 15;
-      dofs[10] = 17;
-      dofs[11] = 19;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 12;
-      dofs[9] = 16;
-      dofs[10] = 18;
-      dofs[11] = 19;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-    coordinates[10][0] = x[0][0];
-    coordinates[10][1] = x[0][1];
-    coordinates[10][2] = x[0][2];
-    coordinates[11][0] = x[1][0];
-    coordinates[11][1] = x[1][1];
-    coordinates[11][2] = x[1][2];
-    coordinates[12][0] = x[2][0];
-    coordinates[12][1] = x[2][1];
-    coordinates[12][2] = x[2][2];
-    coordinates[13][0] = x[3][0];
-    coordinates[13][1] = x[3][1];
-    coordinates[13][2] = x[3][2];
-    coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_dof_map_0_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_dof_map_0_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -17723,214 +2648,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_1_0() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_1_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_1_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_1_0();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_1_0();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -17946,214 +2724,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_1_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_1_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_1_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_1_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[0] + m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 10;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 10;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 6;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_1_1();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -18169,289 +2800,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_1() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_1();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_1();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) })";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return true;
-      break;
-    case 1:
-      return true;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return false;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = 2*m.num_entities[0] + 2*m.num_entities[1];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 20;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 20;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 12;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[0][0];
-    dofs[1] = c.entity_indices[0][1];
-    dofs[2] = c.entity_indices[0][2];
-    dofs[3] = c.entity_indices[0][3];
-    unsigned int offset = m.num_entities[0];
-    dofs[4] = offset + c.entity_indices[1][0];
-    dofs[5] = offset + c.entity_indices[1][1];
-    dofs[6] = offset + c.entity_indices[1][2];
-    dofs[7] = offset + c.entity_indices[1][3];
-    dofs[8] = offset + c.entity_indices[1][4];
-    dofs[9] = offset + c.entity_indices[1][5];
-    offset = offset + m.num_entities[1];
-    dofs[10] = offset + c.entity_indices[0][0];
-    dofs[11] = offset + c.entity_indices[0][1];
-    dofs[12] = offset + c.entity_indices[0][2];
-    dofs[13] = offset + c.entity_indices[0][3];
-    offset = offset + m.num_entities[0];
-    dofs[14] = offset + c.entity_indices[1][0];
-    dofs[15] = offset + c.entity_indices[1][1];
-    dofs[16] = offset + c.entity_indices[1][2];
-    dofs[17] = offset + c.entity_indices[1][3];
-    dofs[18] = offset + c.entity_indices[1][4];
-    dofs[19] = offset + c.entity_indices[1][5];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      dofs[0] = 1;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 5;
-      dofs[5] = 6;
-      dofs[6] = 11;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 15;
-      dofs[11] = 16;
-      break;
-    case 1:
-      dofs[0] = 0;
-      dofs[1] = 2;
-      dofs[2] = 3;
-      dofs[3] = 4;
-      dofs[4] = 7;
-      dofs[5] = 8;
-      dofs[6] = 10;
-      dofs[7] = 12;
-      dofs[8] = 13;
-      dofs[9] = 14;
-      dofs[10] = 17;
-      dofs[11] = 18;
-      break;
-    case 2:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 3;
-      dofs[3] = 5;
-      dofs[4] = 7;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 13;
-      dofs[9] = 15;
-      dofs[10] = 17;
-      dofs[11] = 19;
-      break;
-    case 3:
-      dofs[0] = 0;
-      dofs[1] = 1;
-      dofs[2] = 2;
-      dofs[3] = 6;
-      dofs[4] = 8;
-      dofs[5] = 9;
-      dofs[6] = 10;
-      dofs[7] = 11;
-      dofs[8] = 12;
-      dofs[9] = 16;
-      dofs[10] = 18;
-      dofs[11] = 19;
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = x[0][0];
-    coordinates[0][1] = x[0][1];
-    coordinates[0][2] = x[0][2];
-    coordinates[1][0] = x[1][0];
-    coordinates[1][1] = x[1][1];
-    coordinates[1][2] = x[1][2];
-    coordinates[2][0] = x[2][0];
-    coordinates[2][1] = x[2][1];
-    coordinates[2][2] = x[2][2];
-    coordinates[3][0] = x[3][0];
-    coordinates[3][1] = x[3][1];
-    coordinates[3][2] = x[3][2];
-    coordinates[4][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[4][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[4][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[5][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[5][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[5][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[6][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[6][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[6][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[7][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[7][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[7][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[8][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[8][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[8][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[9][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[9][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[9][2] = 0.5*x[0][2] + 0.5*x[1][2];
-    coordinates[10][0] = x[0][0];
-    coordinates[10][1] = x[0][1];
-    coordinates[10][2] = x[0][2];
-    coordinates[11][0] = x[1][0];
-    coordinates[11][1] = x[1][1];
-    coordinates[11][2] = x[1][2];
-    coordinates[12][0] = x[2][0];
-    coordinates[12][1] = x[2][1];
-    coordinates[12][2] = x[2][2];
-    coordinates[13][0] = x[3][0];
-    coordinates[13][1] = x[3][1];
-    coordinates[13][2] = x[3][2];
-    coordinates[14][0] = 0.5*x[2][0] + 0.5*x[3][0];
-    coordinates[14][1] = 0.5*x[2][1] + 0.5*x[3][1];
-    coordinates[14][2] = 0.5*x[2][2] + 0.5*x[3][2];
-    coordinates[15][0] = 0.5*x[1][0] + 0.5*x[3][0];
-    coordinates[15][1] = 0.5*x[1][1] + 0.5*x[3][1];
-    coordinates[15][2] = 0.5*x[1][2] + 0.5*x[3][2];
-    coordinates[16][0] = 0.5*x[1][0] + 0.5*x[2][0];
-    coordinates[16][1] = 0.5*x[1][1] + 0.5*x[2][1];
-    coordinates[16][2] = 0.5*x[1][2] + 0.5*x[2][2];
-    coordinates[17][0] = 0.5*x[0][0] + 0.5*x[3][0];
-    coordinates[17][1] = 0.5*x[0][1] + 0.5*x[3][1];
-    coordinates[17][2] = 0.5*x[0][2] + 0.5*x[3][2];
-    coordinates[18][0] = 0.5*x[0][0] + 0.5*x[2][0];
-    coordinates[18][1] = 0.5*x[0][1] + 0.5*x[2][1];
-    coordinates[18][2] = 0.5*x[0][2] + 0.5*x[2][2];
-    coordinates[19][0] = 0.5*x[0][0] + 0.5*x[1][0];
-    coordinates[19][1] = 0.5*x[0][1] + 0.5*x[1][1];
-    coordinates[19][2] = 0.5*x[0][2] + 0.5*x[1][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 2;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_dof_map_1_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_dof_map_1_1();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -18467,157 +2876,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_2() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_2();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_2()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_2();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[3];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[3][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_2();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -18633,157 +2952,67 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_dof_map_3() : ufc::dof_map()
-  {
-    __global_dimension = 0;
-  }
+  solitarywave3d_1_dof_map_3();
 
   /// Destructor
-  virtual ~solitarywave3d_1_dof_map_3()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_dof_map_3();
 
   /// Return a string identifying the dof map
-  virtual const char* signature() const
-  {
-    return "FFC dof map for FiniteElement('Discontinuous Lagrange', Cell('tetrahedron', 1, Space(3)), 0)";
-  }
+  virtual const char* signature() const;
 
   /// Return true iff mesh entities of topological dimension d are needed
-  virtual bool needs_mesh_entities(unsigned int d) const
-  {
-    switch ( d )
-    {
-    case 0:
-      return false;
-      break;
-    case 1:
-      return false;
-      break;
-    case 2:
-      return false;
-      break;
-    case 3:
-      return true;
-      break;
-    }
-    return false;
-  }
+  virtual bool needs_mesh_entities(unsigned int d) const;
 
   /// Initialize dof map for mesh (return true iff init_cell() is needed)
-  virtual bool init_mesh(const ufc::mesh& m)
-  {
-    __global_dimension = m.num_entities[3];
-    return false;
-  }
+  virtual bool init_mesh(const ufc::mesh& m);
 
   /// Initialize dof map for given cell
   virtual void init_cell(const ufc::mesh& m,
-                         const ufc::cell& c)
-  {
-    // Do nothing
-  }
+                         const ufc::cell& c);
 
   /// Finish initialization of dof map for cells
-  virtual void init_cell_finalize()
-  {
-    // Do nothing
-  }
+  virtual void init_cell_finalize();
 
   /// Return the dimension of the global finite element function space
-  virtual unsigned int global_dimension() const
-  {
-    return __global_dimension;
-  }
+  virtual unsigned int global_dimension() const;
 
   /// Return the dimension of the local finite element function space for a cell
-  virtual unsigned int local_dimension(const ufc::cell& c) const
-  {
-    return 1;
-  }
+  virtual unsigned int local_dimension(const ufc::cell& c) const;
 
   /// Return the maximum dimension of the local finite element function space
-  virtual unsigned int max_local_dimension() const
-  {
-    return 1;
-  }
+  virtual unsigned int max_local_dimension() const;
 
   // Return the geometric dimension of the coordinates this dof map provides
-  virtual unsigned int geometric_dimension() const
-  {
-    return 3;
-  }
+  virtual unsigned int geometric_dimension() const;
 
   /// Return the number of dofs on each cell facet
-  virtual unsigned int num_facet_dofs() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_facet_dofs() const;
 
   /// Return the number of dofs associated with each cell entity of dimension d
-  virtual unsigned int num_entity_dofs(unsigned int d) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+  virtual unsigned int num_entity_dofs(unsigned int d) const;
 
   /// Tabulate the local-to-global mapping of dofs on a cell
   virtual void tabulate_dofs(unsigned int* dofs,
                              const ufc::mesh& m,
-                             const ufc::cell& c) const
-  {
-    dofs[0] = c.entity_indices[3][0];
-  }
+                             const ufc::cell& c) const;
 
   /// Tabulate the local-to-local mapping from facet dofs to cell dofs
   virtual void tabulate_facet_dofs(unsigned int* dofs,
-                                   unsigned int facet) const
-  {
-    switch ( facet )
-    {
-    case 0:
-      
-      break;
-    case 1:
-      
-      break;
-    case 2:
-      
-      break;
-    case 3:
-      
-      break;
-    }
-  }
+                                   unsigned int facet) const;
 
   /// Tabulate the local-to-local mapping of dofs on entity (d, i)
   virtual void tabulate_entity_dofs(unsigned int* dofs,
-                                    unsigned int d, unsigned int i) const
-  {
-    throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
-  }
+                                    unsigned int d, unsigned int i) const;
 
   /// Tabulate the coordinates of all dofs on a cell
   virtual void tabulate_coordinates(double** coordinates,
-                                    const ufc::cell& c) const
-  {
-    const double * const * x = c.coordinates;
-    coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
-    coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
-    coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
-  }
+                                    const ufc::cell& c) const;
 
   /// Return the number of sub dof maps (for a mixed element)
-  virtual unsigned int num_sub_dof_maps() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_sub_dof_maps() const;
 
   /// Create a new dof_map for sub dof map i (for a mixed element)
-  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const
-  {
-    return new solitarywave3d_1_dof_map_3();
-  }
+  virtual ufc::dof_map* create_sub_dof_map(unsigned int i) const;
 
 };
 
@@ -18796,673 +3025,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_cell_integral_0_quadrature() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_cell_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave3d_1_cell_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_cell_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    const double J_00 = x[1][0] - x[0][0];
-    const double J_01 = x[2][0] - x[0][0];
-    const double J_02 = x[3][0] - x[0][0];
-    const double J_10 = x[1][1] - x[0][1];
-    const double J_11 = x[2][1] - x[0][1];
-    const double J_12 = x[3][1] - x[0][1];
-    const double J_20 = x[1][2] - x[0][2];
-    const double J_21 = x[2][2] - x[0][2];
-    const double J_22 = x[3][2] - x[0][2];
-    
-    // Compute sub determinants
-    const double d_00 = J_11*J_22 - J_12*J_21;
-    const double d_01 = J_12*J_20 - J_10*J_22;
-    const double d_02 = J_10*J_21 - J_11*J_20;
-    
-    const double d_10 = J_02*J_21 - J_01*J_22;
-    const double d_11 = J_00*J_22 - J_02*J_20;
-    const double d_12 = J_01*J_20 - J_00*J_21;
-    
-    const double d_20 = J_01*J_12 - J_02*J_11;
-    const double d_21 = J_02*J_10 - J_00*J_12;
-    const double d_22 = J_00*J_11 - J_01*J_10;
-    
-    // Compute determinant of Jacobian
-    double detJ = J_00*d_00 + J_10*d_10 + J_20*d_20;
-    
-    // Compute inverse of Jacobian
-    const double Jinv_00 = d_00 / detJ;
-    const double Jinv_01 = d_10 / detJ;
-    const double Jinv_02 = d_20 / detJ;
-    const double Jinv_10 = d_01 / detJ;
-    const double Jinv_11 = d_11 / detJ;
-    const double Jinv_12 = d_21 / detJ;
-    const double Jinv_20 = d_02 / detJ;
-    const double Jinv_21 = d_12 / detJ;
-    const double Jinv_22 = d_22 / detJ;
-    
-    // Set scale factor
-    const double det = std::abs(detJ);
-    
-    
-    // Array of quadrature weights
-    static const double W125[125] = {0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565251, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.00225090157446143, 0.00347412941301361, 0.00245558995953753, 0.00088245817276838, 0.000113249435042247, 0.00388807060532275, 0.00600100004508522, 0.00424163688396193, 0.00152430462570915, 0.00019562019257218, 0.0034046010087031, 0.0052547941847441, 0.00371420241029555, 0.00133476204345558, 0.000171295424533231, 0.00171893840164765, 0.00265307667295562, 0.00187525208922536, 0.000673903851785402, 8.64848134932762e-05, 0.000366257730507922, 0.000565296487744311, 0.00039956380849458, 0.000143590075769372, 1.8427496577589e-05, 0.00189377231486028, 0.00292292216383614, 0.00206598473020027, 0.000742446882427904, 9.52812185081393e-05, 0.00327118722298822, 0.00504887813656484, 0.00356865648488397, 0.00128245763045954, 0.000164582987156811, 0.00286442517370845, 0.00442106570107946, 0.00312490504969682, 0.00112298797668544, 0.000144117599953649, 0.00144621070637857, 0.0022321380949974, 0.00157772357985427, 0.000566981902660164, 7.27630862707133e-05, 0.000308147081155878, 0.000475606241660779, 0.000336168798819301, 0.000120807996789371, 1.55037800172006e-05, 0.000937439821766984, 0.00144688123847004, 0.00102268701578053, 0.000367520038007324, 4.71653365059364e-05, 0.00161927658526931, 0.00249925473264391, 0.00176652740822439, 0.000634831781565252, 8.1470536312884e-05, 0.00141792453255091, 0.00218848010941898, 0.00154686516950305, 0.000555892406098532, 7.13399262170554e-05, 0.000715891501943862, 0.00110493490770459, 0.000780991938624509, 0.000280662785913662, 3.60185932012982e-05, 0.000152536470498617, 0.000235430746830112, 0.000166407554052789, 5.9801395389292e-05, 7.67455552179798e-06};
-    // Quadrature points on the UFC reference element: (0.0434850684329929, 0.0384332743963333, 0.034578939918215), (0.0372285899889251, 0.0329036302803046, 0.173480320771696), (0.0274810994988124, 0.0242885357160768, 0.389886387065519), (0.0164705687743685, 0.0145571321830714, 0.634333472630887), (0.0067089045501621, 0.00592951049099777, 0.851054212947016), (0.0363203493206216, 0.191166323793956, 0.034578939918215), (0.0310947054204484, 0.163661986623795, 0.173480320771696), (0.0229532381913956, 0.120810681788372, 0.389886387065519), (0.0137568327003139, 0.0724068788863314, 0.634333472630887), (0.00560352704046152, 0.0294932643722359, 0.851054212947016), (0.025452983470971, 0.42283010559815, 0.034578939918215), (0.0217908978824722, 0.361994799675747, 0.173480320771696), (0.0160854287808059, 0.267214393854326, 0.389886387065519), (0.00964066816216436, 0.160152727938308, 0.634333472630887), (0.00392690279162666, 0.0652345028216781, 0.851054212947016), (0.0137918067694829, 0.671415856030076, 0.034578939918215), (0.0118074902013492, 0.574814908126993, 0.173480320771696), (0.00871595763232119, 0.42431222048264, 0.389886387065519), (0.00522383682733774, 0.254308005746508, 0.634333472630887), (0.00212780888992548, 0.103586473561889, 0.851054212947016), (0.00446245462992895, 0.870293213094632, 0.034578939918215), (0.00382041237943087, 0.745078491721125, 0.173480320771696), (0.00282012111543484, 0.54999601573695, 0.389886387065519), (0.00169021617151183, 0.329635544721039, 0.634333472630887), (0.000688470393412244, 0.134269401146344, 0.851054212947016), (0.213916656125506, 0.0384332743963333, 0.034578939918215), (0.183139081291086, 0.0329036302803046, 0.173480320771696), (0.135188126023001, 0.0242885357160768, 0.389886387065519), (0.0810238806942951, 0.0145571321830714, 0.634333472630887), (0.0330032003938849, 0.00592951049099777, 0.851054212947016), (0.178671161296432, 0.191166323793956, 0.034578939918215), (0.152964584084757, 0.163661986623795, 0.173480320771696), (0.112914159689587, 0.120810681788372, 0.389886387065519), (0.0676741639412116, 0.0724068788863314, 0.634333472630887), (0.027565502601231, 0.0294932643722359, 0.851054212947016), (0.125211188776624, 0.42283010559815, 0.034578939918215), (0.107196244066483, 0.361994799675747, 0.173480320771696), (0.0791292565731431, 0.267214393854326, 0.389886387065519), (0.0474254628170509, 0.160152727938308, 0.634333472630887), (0.0193176633816068, 0.0652345028216781, 0.851054212947016), (0.0678462123292524, 0.671415856030076, 0.034578939918215), (0.0580847383280397, 0.574814908126993, 0.173480320771696), (0.0428765224208113, 0.42431222048264, 0.389886387065519), (0.0256976876550462, 0.254308005746508, 0.634333472630887), (0.0104673576243388, 0.103586473561889, 0.851054212947016), (0.0219522104240708, 0.870293213094632, 0.034578939918215), (0.0187938037280005, 0.745078491721125, 0.173480320771696), (0.0138730580546826, 0.54999601573695, 0.389886387065519), (0.00831470213956798, 0.329635544721039, 0.634333472630887), (0.00338680125632329, 0.134269401146344, 0.851054212947016), (0.463493892842726, 0.0384332743963333, 0.034578939918215), (0.396808024474, 0.0329036302803046, 0.173480320771696), (0.292912538609202, 0.0242885357160768, 0.389886387065519), (0.175554697593021, 0.0145571321830714, 0.634333472630887), (0.0715081382809929, 0.00592951049099777, 0.851054212947016), (0.387127368143914, 0.191166323793956, 0.034578939918215), (0.331428846302255, 0.163661986623795, 0.173480320771696), (0.244651465573054, 0.120810681788372, 0.389886387065519), (0.146629824241391, 0.0724068788863314, 0.634333472630887), (0.0597262613403738, 0.0294932643722359, 0.851054212947016), (0.271295477241817, 0.42283010559815, 0.034578939918215), (0.232262439776279, 0.361994799675747, 0.173480320771696), (0.171449609540077, 0.267214393854326, 0.389886387065519), (0.102756899715403, 0.160152727938308, 0.634333472630887), (0.0418556421156527, 0.0652345028216781, 0.851054212947016), (0.147002602025855, 0.671415856030076, 0.034578939918215), (0.125852385550656, 0.574814908126993, 0.173480320771696), (0.0929006962259202, 0.42431222048264, 0.389886387065519), (0.0556792608113027, 0.254308005746508, 0.634333472630887), (0.0226796567455474, 0.103586473561889, 0.851054212947016), (0.0475639234935763, 0.870293213094632, 0.034578939918215), (0.0407205937535897, 0.745078491721125, 0.173480320771696), (0.0300587985987655, 0.54999601573695, 0.389886387065519), (0.0180154913240372, 0.329635544721039, 0.634333472630887), (0.00733819295331972, 0.134269401146344, 0.851054212947016), (0.713071129559946, 0.0384332743963333, 0.034578939918215), (0.610476967656914, 0.0329036302803046, 0.173480320771696), (0.450636951195403, 0.0242885357160768, 0.389886387065519), (0.270085514491747, 0.0145571321830714, 0.634333472630887), (0.110013076168101, 0.00592951049099777, 0.851054212947016), (0.595583574991397, 0.191166323793956, 0.034578939918215), (0.509893108519752, 0.163661986623795, 0.173480320771696), (0.376388771456521, 0.120810681788372, 0.389886387065519), (0.22558548454157, 0.0724068788863314, 0.634333472630887), (0.0918870200795167, 0.0294932643722359, 0.851054212947016), (0.417379765707011, 0.42283010559815, 0.034578939918215), (0.357328635486074, 0.361994799675747, 0.173480320771696), (0.263769962507011, 0.267214393854326, 0.389886387065519), (0.158088336613754, 0.160152727938308, 0.634333472630887), (0.0643936208496987, 0.0652345028216781, 0.851054212947016), (0.226158991722457, 0.671415856030076, 0.034578939918215), (0.193620032773272, 0.574814908126993, 0.173480320771696), (0.142924870031029, 0.42431222048264, 0.389886387065519), (0.0856608339675592, 0.254308005746508, 0.634333472630887), (0.0348919558667561, 0.103586473561889, 0.851054212947016), (0.0731756365630818, 0.870293213094632, 0.034578939918215), (0.062647383779179, 0.745078491721125, 0.173480320771696), (0.0462445391428484, 0.54999601573695, 0.389886387065519), (0.0277162805085065, 0.329635544721039, 0.634333472630887), (0.0112895846503162, 0.134269401146344, 0.851054212947016), (0.883502717252459, 0.0384332743963333, 0.034578939918215), (0.756387458959075, 0.0329036302803046, 0.173480320771696), (0.558343977719591, 0.0242885357160768, 0.389886387065519), (0.334638826411673, 0.0145571321830714, 0.634333472630887), (0.136307372011824, 0.00592951049099777, 0.851054212947016), (0.737934386967207, 0.191166323793956, 0.034578939918215), (0.631762987184061, 0.163661986623795, 0.173480320771696), (0.466349692954713, 0.120810681788372, 0.389886387065519), (0.279502815782468, 0.0724068788863314, 0.634333472630887), (0.113848995640286, 0.0294932643722359, 0.851054212947016), (0.517137971012664, 0.42283010559815, 0.034578939918215), (0.442733981670085, 0.361994799675747, 0.173480320771696), (0.326813790299348, 0.267214393854326, 0.389886387065519), (0.195873131268641, 0.160152727938308, 0.634333472630887), (0.0797843814396788, 0.0652345028216781, 0.851054212947016), (0.280213397282226, 0.671415856030076, 0.034578939918215), (0.239897280899962, 0.574814908126993, 0.173480320771696), (0.177085434819519, 0.42431222048264, 0.389886387065519), (0.106134684795268, 0.254308005746508, 0.634333472630887), (0.0432315046011695, 0.103586473561889, 0.851054212947016), (0.0906653923572237, 0.870293213094632, 0.034578939918215), (0.0776207751277486, 0.745078491721125, 0.173480320771696), (0.0572974760820962, 0.54999601573695, 0.389886387065519), (0.0343407664765626, 0.329635544721039, 0.634333472630887), (0.0139879155132272, 0.134269401146344, 0.851054212947016)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE1_C0[125][10] = \
-    {{0.677651385532498, -0.0397031660797488, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.00601467027473595, 0.00668509426891429, 0.12220234950981, 0.135823609448279, 0.153676704481833},
-    {0.387856517182057, -0.0344566541637981, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.0258337109326268, 0.00489982304341057, 0.524873356031632, 0.0995515731929938, 0.112636954329409},
-    {0.0651520171918798, -0.0259706778394852, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.0428580263847204, 0.00266990266677583, 0.870762864851529, 0.0542454305787948, 0.0613756256250992},
-    {-0.110672538127309, -0.015928009502866, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.0417913323474042, 0.000959056987115393, 0.849090435339365, 0.0194855265186504, 0.0220467672199497},
-    {-0.0991479726822843, -0.00661888574963566, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.0228385659266996, 0.000159122079653143, 0.464019852825595, 0.00323294396937779, 0.0036578925932431},
-    {0.351159931970128, -0.0336820137710776, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0050236767078656, 0.0277729106341423, 0.102067955322095, 0.564272815830671, 0.107208138841391},
-    {0.166485956767395, -0.0291609440100794, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.0215772778825633, 0.0203560850503691, 0.438393782673502, 0.413582342231706, 0.0785779359281236},
-    {-0.0313856207168029, -0.0218995359044537, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.0357966204395903, 0.0110919854206136, 0.727293587580909, 0.225360097430627, 0.0428169423314949},
-    {-0.123259167721812, -0.013378331808425, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.0349056778367692, 0.00398435727676459, 0.709191966981616, 0.080951706122999, 0.0153802939039443},
-    {-0.0879258080236823, -0.00554072800987512, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0190756211805894, 0.000661065217685219, 0.387566669517808, 0.01343111410773, 0.00255182370239899},
-    {0.0177253911135257, -0.0241572747358239, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0035205487447283, 0.0430491507552746, 0.071528331316298, 0.874646011568391, 0.0526508169135872},
-    {-0.0507072246191906, -0.0208412114214236, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0151211678182184, 0.0315527668548808, 0.307222532626625, 0.641069596017233, 0.0385902839346927},
-    {-0.113199283239695, -0.0155679467426812, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.0250859588469928, 0.0171930324062, 0.509680991772005, 0.349317395512301, 0.0210277597937817},
-    {-0.119140564162676, -0.00945478319693843, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.0244615940551512, 0.00617591722127442, 0.49699553421089, 0.125478465209964, 0.00755339144178017},
-    {-0.0670532863962545, -0.00389606166055687, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0133680286585892, 0.00102467820496327, 0.271603335806442, 0.0208187778246103, 0.00125322204081482},
-    {-0.123174301249333, -0.0134113789015495, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00190762423058253, 0.0370401509933353, 0.038757928915604, 0.752558872029367, 0.0154585961181473},
-    {-0.124795870133571, -0.0115286565516393, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.00819346875055506, 0.0271484855811957, 0.166469828971132, 0.551586133921709, 0.0113303391742265},
-    {-0.114366932369083, -0.00856402179742438, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0135929329243276, 0.0147931493464113, 0.276172801534836, 0.300558056253616, 0.00617387658875252},
-    {-0.083605542162086, -0.00516925988494044, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0132546182205693, 0.00531385410362168, 0.269299132691067, 0.107963600123275, 0.00221772110036569},
-    {-0.0394935786210076, -0.00211875374858136, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.00724352288046892, 0.00088164887728405, 0.147169416491454, 0.0179127964336388, 0.000367953519260986},
-    {-0.0742249656146451, -0.00442262762728059, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.000617227802144495, 0.0155345759126796, 0.0125404526199273, 0.315621902524215, 0.00161836079959531},
-    {-0.0655708056648836, -0.00379122127793308, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.00265106546025557, 0.0113860283736764, 0.0538627078708379, 0.23133428023363, 0.00118617348079641},
-    {-0.0507314745513395, -0.00280421494922342, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.00439810733113653, 0.00620422150953917, 0.0893580237504861, 0.126053534227744, 0.000646343288641082},
-    {-0.0319821899921671, -0.00168450251009896, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0042886427742881, 0.00222862131357039, 0.0871339906075373, 0.0452797490545588, 0.000232173275363283},
-    {-0.0135965919524168, -0.000687522410446964, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.00234370251521121, 0.000369762029721776, 0.0476178977115156, 0.00751259615698667, 3.85210627857485e-05},
-    {0.303869742063848, -0.12239598458967, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0295880447986775, 0.0328860701712706, 0.0986289749858682, 0.109622633545923, 0.610151166460404},
-    {0.134887288422247, -0.1160592350988, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.127084106272845, 0.0241037624827062, 0.423622960691414, 0.0803476337536982, 0.447208764024221},
-    {-0.0444896276300268, -0.0986364671877792, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.210832040117064, 0.0131340865091965, 0.702788851119186, 0.0437812467363741, 0.2436830597953},
-    {-0.124193144215204, -0.0678941422087684, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.205584638427372, 0.004717901365009, 0.685297129259398, 0.0157266821407568, 0.0875335060137464},
-    {-0.0858073223121642, -0.030824777921407, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.112350050943802, 0.000782771291888182, 0.374508367808493, 0.00260929475714278, 0.0145231343948943},
-    {0.113856014607669, -0.114824393538401, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0247130374063482, 0.136623636292144, 0.0823785946236127, 0.45542209017267, 0.425654435971174},
-    {0.0100888557121195, -0.106168256116312, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.106145380454931, 0.100137950857575, 0.353825680101135, 0.333800476424499, 0.311982349089632},
-    {-0.0930517568994226, -0.0874149447727761, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.17609477507965, 0.0545649464626408, 0.58699543294085, 0.1818871363886, 0.169998487382437},
-    {-0.12380786286986, -0.0585145790109275, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.171711949680883, 0.0196002999689002, 0.572385695137502, 0.0653357634308634, 0.0610652362544955},
-    {-0.0750005711613296, -0.026045788733914, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.0938389484831186, 0.00325198662308666, 0.312803342215279, 0.0108401927023285, 0.0101316475640852},
-    {-0.0689680280637322, -0.0938555051869132, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0173186806951808, 0.211772240689959, 0.0577301993658455, 0.705922921633706, 0.209042466541935},
-    {-0.101961128009395, -0.084214174582561, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.0743857552246981, 0.155217931587356, 0.247957945220146, 0.517404431284758, 0.153217150486034},
-    {-0.124620776265111, -0.0666063780815064, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.123405679825933, 0.0845779053253436, 0.411361270793064, 0.281932522593157, 0.0834876841580225},
-    {-0.108104492267147, -0.0429271137702279, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.120334234079468, 0.03038126897555, 0.401122894186573, 0.101273113455689, 0.0299896501195402},
-    {-0.0561005440374291, -0.0185713191445566, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.0657615152208353, 0.00504071266550263, 0.219209849244195, 0.0168027433640709, 0.00497573716598929},
-    {-0.12386321264862, -0.0586399952744004, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.00938420039924693, 0.182212090917773, 0.0312813527469397, 0.607386932104929, 0.0613761238902858},
-    {-0.118642598591026, -0.051337064674766, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0403062361483535, 0.13355189410245, 0.134357061573334, 0.445182725400454, 0.0449854757548079},
-    {-0.102069833084256, -0.0391997300710066, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.0668678896663356, 0.0727721297397925, 0.222897844792828, 0.242579075860235, 0.0245124855775079},
-    {-0.0709852770155237, -0.0243769453534135, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.0652036137952374, 0.0261405107994058, 0.217350137116399, 0.0871369434274908, 0.00880514142227651},
-    {-0.0324570586983408, -0.0102482264730672, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0356331552184666, 0.00433710665526561, 0.118779784153456, 0.0144573386556573, 0.00146090632108002},
-    {-0.0624662889902574, -0.0209884113390654, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00303633666130402, 0.0764194389779763, 0.0101213437607678, 0.254737039458918, 0.00642546788699245},
-    {-0.0547979943904275, -0.0180873896108673, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0130414203970155, 0.0560114357414459, 0.043472352934078, 0.18670887286586, 0.00470953053927457},
-    {-0.0419674243417796, -0.0134881345751054, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0216356659299618, 0.0305205066246512, 0.0721204651516608, 0.101737249112632, 0.00256621270496322},
-    {-0.0261798960980541, -0.00817643359622851, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0210971755283347, 0.0109632854758787, 0.0703254578534908, 0.0365450848922505, 0.000921810467379901},
-    {-0.0110346752071629, -0.00336386041082359, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0115294059104329, 0.00181897510595286, 0.0384321943162941, 0.00606338308075562, 0.000152942317908342},
-    {-0.0338407154377174, -0.0338407154377172, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0641085098922729, 0.0712543518585967, 0.0641085098922728, 0.0712543518585967, 0.859306354810017},
-    {-0.0818948079000829, -0.0818948079000828, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.27535353348213, 0.0522256981182022, 0.275353533482129, 0.0522256981182022, 0.629826433147834},
-    {-0.121317028060228, -0.121317028060227, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.456810445618125, 0.0284576666227853, 0.456810445618125, 0.0284576666227853, 0.343191021097949},
-    {-0.113915793899067, -0.113915793899067, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.445440883843385, 0.0102222917528829, 0.445440883843385, 0.0102222917528829, 0.123277807387908},
-    {-0.0612813106001657, -0.0612813106001656, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.243429209376147, 0.00169603302451547, 0.243429209376147, 0.00169603302451546, 0.0204536553616545},
-    {-0.0873921698118468, -0.0873921698118467, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0535458160149806, 0.296022863232407, 0.0535458160149805, 0.296022863232407, 0.599470396664135},
-    {-0.111738685979768, -0.111738685979767, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.229985530278033, 0.216969213641037, 0.229985530278033, 0.216969213641037, 0.439380320644974},
-    {-0.124942786358968, -0.124942786358967, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.38154510401025, 0.118226041425621, 0.38154510401025, 0.118226041425621, 0.239417358428173},
-    {-0.103629213527269, -0.103629213527268, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.372048822409193, 0.0424680316998818, 0.372048822409192, 0.0424680316998817, 0.0860012214282448},
-    {-0.0525918087529765, -0.0525918087529765, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.203321145349199, 0.00704608966270762, 0.203321145349198, 0.00704608966270757, 0.0142689051747946},
-    {-0.124093005298086, -0.124093005298086, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0375244400305132, 0.458847581161833, 0.037524440030513, 0.458847581161833, 0.294404943887462},
-    {-0.12437075791462, -0.12437075791462, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.161171850222422, 0.336311181436057, 0.161171850222422, 0.336311181436057, 0.215783363723318},
-    {-0.112659672317187, -0.112659672317187, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.267383475309499, 0.183255213959251, 0.267383475309499, 0.18325521395925, 0.11757987444578},
-    {-0.08163893883716, -0.0816389388371599, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.260728564133021, 0.0658271912156194, 0.26072856413302, 0.0658271912156194, 0.0422359217564853},
-    {-0.0383518525618255, -0.0383518525618255, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.142485682232515, 0.0109217280147868, 0.142485682232515, 0.0109217280147868, 0.00700757910765451},
-    {-0.103783072021111, -0.103783072021111, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0203327765730934, 0.394799511511351, 0.0203327765730932, 0.394799511511351, 0.0864390600094873},
-    {-0.094174739653074, -0.0941747396530738, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.0873316488608436, 0.289367309751452, 0.0873316488608435, 0.289367309751452, 0.0633552917951636},
-    {-0.0756396175073989, -0.0756396175073988, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.144882867229582, 0.157675602800014, 0.144882867229582, 0.157675602800014, 0.0345221574370429},
-    {-0.0494789006423166, -0.0494789006423165, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.141276875455818, 0.0566387271134483, 0.141276875455818, 0.0566387271134482, 0.0124007203379724},
-    {-0.0216509230853557, -0.0216509230853557, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.0772064696859616, 0.00939722265546143, 0.0772064696859615, 0.00939722265546143, 0.00205746732038352},
-    {-0.0430392698573708, -0.0430392698573707, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.00657884021103599, 0.165578239218447, 0.00657884021103578, 0.165578239218447, 0.00904930727241116},
-    {-0.0374042602423, -0.0374042602422999, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0282568866655468, 0.121360154303653, 0.0282568866655467, 0.121360154303653, 0.00663266702257968},
-    {-0.0282517358523633, -0.0282517358523632, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0468780655408114, 0.0661288778686417, 0.0468780655408113, 0.0661288778686419, 0.0036141254928047},
-    {-0.0173663754687444, -0.0173663754687443, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0457113166909128, 0.0237541851840646, 0.0457113166909126, 0.0237541851840646, 0.00129823171058596},
-    {-0.00723049480167941, -0.00723049480167938, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0249808001133636, 0.00394117909335424, 0.0249808001133633, 0.00394117909335422, 0.000215396303280713},
-    {-0.12239598458967, 0.303869742063848, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.0986289749858684, 0.109622633545923, 0.0295880447986773, 0.0328860701712705, 0.610151166460404},
-    {-0.1160592350988, 0.134887288422247, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.423622960691414, 0.0803476337536981, 0.127084106272845, 0.0241037624827062, 0.447208764024221},
-    {-0.0986364671877794, -0.0444896276300268, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.702788851119186, 0.0437812467363741, 0.210832040117064, 0.0131340865091965, 0.2436830597953},
-    {-0.0678941422087684, -0.124193144215204, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.685297129259398, 0.0157266821407568, 0.205584638427371, 0.00471790136500898, 0.0875335060137464},
-    {-0.030824777921407, -0.0858073223121641, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.374508367808493, 0.00260929475714279, 0.112350050943801, 0.000782771291888154, 0.0145231343948942},
-    {-0.114824393538401, 0.113856014607669, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.0823785946236129, 0.45542209017267, 0.0247130374063481, 0.136623636292144, 0.425654435971174},
-    {-0.106168256116312, 0.0100888557121194, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.353825680101135, 0.333800476424499, 0.106145380454931, 0.100137950857575, 0.311982349089632},
-    {-0.0874149447727762, -0.0930517568994225, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.58699543294085, 0.1818871363886, 0.17609477507965, 0.0545649464626407, 0.169998487382437},
-    {-0.0585145790109276, -0.12380786286986, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.572385695137502, 0.0653357634308634, 0.171711949680883, 0.0196002999689001, 0.0610652362544955},
-    {-0.026045788733914, -0.0750005711613296, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.312803342215279, 0.0108401927023285, 0.0938389484831182, 0.00325198662308662, 0.0101316475640852},
-    {-0.0938555051869133, -0.0689680280637323, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0577301993658456, 0.705922921633706, 0.0173186806951807, 0.211772240689959, 0.209042466541935},
-    {-0.0842141745825612, -0.101961128009395, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.247957945220146, 0.517404431284758, 0.0743857552246979, 0.155217931587356, 0.153217150486034},
-    {-0.0666063780815065, -0.124620776265111, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.411361270793064, 0.281932522593158, 0.123405679825933, 0.0845779053253435, 0.0834876841580226},
-    {-0.042927113770228, -0.108104492267147, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.401122894186574, 0.101273113455689, 0.120334234079468, 0.0303812689755499, 0.0299896501195402},
-    {-0.0185713191445567, -0.0561005440374291, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.219209849244196, 0.016802743364071, 0.065761515220835, 0.00504071266550261, 0.00497573716598929},
-    {-0.0586399952744005, -0.12386321264862, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0312813527469399, 0.607386932104929, 0.00938420039924669, 0.182212090917773, 0.0613761238902859},
-    {-0.0513370646747661, -0.118642598591026, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.134357061573334, 0.445182725400454, 0.0403062361483534, 0.13355189410245, 0.0449854757548079},
-    {-0.0391997300710068, -0.102069833084256, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.222897844792828, 0.242579075860235, 0.0668678896663356, 0.0727721297397927, 0.024512485577508},
-    {-0.0243769453534136, -0.0709852770155237, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.217350137116399, 0.0871369434274908, 0.0652036137952371, 0.0261405107994057, 0.00880514142227651},
-    {-0.0102482264730672, -0.0324570586983408, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.118779784153457, 0.0144573386556573, 0.0356331552184663, 0.0043371066552656, 0.00146090632108002},
-    {-0.0209884113390655, -0.0624662889902573, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.010121343760768, 0.254737039458918, 0.00303633666130378, 0.0764194389779762, 0.00642546788699245},
-    {-0.0180873896108673, -0.0547979943904275, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0434723529340782, 0.186708872865861, 0.0130414203970153, 0.0560114357414458, 0.00470953053927457},
-    {-0.0134881345751056, -0.0419674243417795, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0721204651516608, 0.101737249112632, 0.0216356659299618, 0.0305205066246514, 0.00256621270496323},
-    {-0.00817643359622858, -0.0261798960980541, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0703254578534909, 0.0365450848922505, 0.0210971755283345, 0.0109632854758786, 0.000921810467379901},
-    {-0.00336386041082355, -0.0110346752071629, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0384321943162945, 0.00606338308075567, 0.0115294059104325, 0.00181897510595279, 0.000152942317908342},
-    {-0.0397031660797491, 0.677651385532497, -0.0354790412346856, -0.03218753374648, 0.00531592754484438, 0.12220234950981, 0.135823609448279, 0.00601467027473575, 0.00668509426891421, 0.153676704481834},
-    {-0.0344566541637982, 0.387856517182057, -0.0307383325090586, -0.113289477381595, 0.0228325293423221, 0.524873356031632, 0.0995515731929938, 0.0258337109326267, 0.00489982304341049, 0.112636954329409},
-    {-0.0259706778394854, 0.0651520171918798, -0.0231086697816145, -0.0858635974275114, 0.0378790777498121, 0.870762864851529, 0.0542454305787948, 0.0428580263847204, 0.00266990266677576, 0.0613756256250995},
-    {-0.0159280095028661, -0.110672538127309, -0.0141333119882805, 0.170424436369033, 0.036936304836938, 0.849090435339365, 0.0194855265186504, 0.0417913323474039, 0.000959056987115348, 0.0220467672199497},
-    {-0.00661888574963571, -0.0991479726822842, -0.00585919230167206, 0.597532333802715, 0.0201853395363087, 0.464019852825596, 0.0032329439693778, 0.0228385659266992, 0.000159122079653129, 0.00365789259324308},
-    {-0.0336820137710778, 0.351159931970128, -0.118077197088165, -0.03218753374648, 0.026441315299429, 0.102067955322096, 0.564272815830671, 0.00502367670786549, 0.0277729106341421, 0.107208138841391},
-    {-0.0291609440100797, 0.166485956767395, -0.1100914948925, -0.113289477381595, 0.113568535750516, 0.438393782673502, 0.413582342231706, 0.0215772778825632, 0.0203560850503691, 0.0785779359281241},
-    {-0.0218995359044539, -0.0313856207168029, -0.0916202401200295, -0.0858635974275114, 0.188409760965562, 0.727293587580909, 0.225360097430628, 0.0357966204395903, 0.0110919854206135, 0.0428169423314951},
-    {-0.0133783318084251, -0.123259167721811, -0.0619213666662117, 0.170424436369033, 0.183720427705323, 0.709191966981616, 0.080951706122999, 0.034905677836769, 0.00398435727676454, 0.0153802939039443},
-    {-0.00554072800987505, -0.0879258080236823, -0.0277535590855747, 0.597532333802715, 0.100401467590206, 0.387566669517808, 0.01343111410773, 0.0190756211805888, 0.000661065217685206, 0.00255182370239895},
-    {-0.0241572747358242, 0.0177253911135256, -0.0652595091978644, -0.03218753374648, 0.0584840672683638, 0.0715283313162981, 0.874646011568391, 0.00352054874472815, 0.0430491507552746, 0.0526508169135876},
-    {-0.0208412114214238, -0.0507072246191906, -0.0999143296911785, -0.113289477381595, 0.251195895861737, 0.307222532626626, 0.641069596017233, 0.0151211678182183, 0.0315527668548808, 0.0385902839346929},
-    {-0.0155679467426813, -0.113199283239695, -0.124407329288456, -0.0858635974275114, 0.416733018367064, 0.509680991772005, 0.349317395512301, 0.0250859588469928, 0.0171930324062, 0.0210277597937819},
-    {-0.00945478319693848, -0.119140564162676, -0.108854935406145, 0.170424436369033, 0.406360944257666, 0.49699553421089, 0.125478465209964, 0.024461594055151, 0.00617591722127439, 0.00755339144178018},
-    {-0.00389606166055691, -0.0670532863962544, -0.056723422104895, 0.597532333802715, 0.222072393823573, 0.271603335806442, 0.0208187778246103, 0.013368028658589, 0.0010246782049633, 0.00125322204081482},
-    {-0.0134113789015497, -0.123174301249333, 0.230182647427123, -0.03218753374648, 0.0928673941832035, 0.0387579289156042, 0.752558872029367, 0.00190762423058235, 0.0370401509933354, 0.0154585961181475},
-    {-0.0115286565516395, -0.124795870133571, 0.0860094490830938, -0.113289477381595, 0.398876298584894, 0.166469828971132, 0.551586133921708, 0.00819346875055494, 0.0271484855811958, 0.0113303391742266},
-    {-0.00856402179742457, -0.114366932369083, -0.0642304995808229, -0.0858635974275114, 0.661734234526899, 0.276172801534836, 0.300558056253616, 0.0135929329243277, 0.0147931493464114, 0.00617387658875262},
-    {-0.00516925988494049, -0.083605542162086, -0.124962882172976, 0.170424436369033, 0.645264321612071, 0.269299132691067, 0.107963600123275, 0.013254618220569, 0.0053138541036216, 0.00221772110036569},
-    {-0.00211875374858132, -0.0394935786210076, -0.082126158551913, 0.597532333802715, 0.35263081891668, 0.147169416491455, 0.0179127964336388, 0.00724352288046848, 0.000881648877284022, 0.000367953519260972},
-    {-0.00442262762728068, -0.074224965614645, 0.644527340422526, -0.03218753374648, 0.120375266907318, 0.0125404526199275, 0.315621902524215, 0.000617227802144259, 0.0155345759126795, 0.00161836079959531},
-    {-0.00379122127793318, -0.0655708056648835, 0.365205425929728, -0.113289477381595, 0.517025822975488, 0.0538627078708381, 0.23133428023363, 0.00265106546025538, 0.0113860283736764, 0.00118617348079642},
-    {-0.00280421494922354, -0.0507314745513394, 0.0549952189160882, -0.0858635974275114, 0.857743837904439, 0.0893580237504861, 0.126053534227744, 0.0043981073311365, 0.00620422150953936, 0.000646343288641096},
-    {-0.001684502510099, -0.031982189992167, -0.112316360033967, 0.170424436369033, 0.836395439141882, 0.0871339906075375, 0.0452797490545588, 0.00428864277428789, 0.00222862131357036, 0.000232173275363283},
-    {-0.000687522410446992, -0.0135965919524168, -0.0982128569779484, 0.597532333802715, 0.457082158061876, 0.0476178977115159, 0.0075125961569867, 0.00234370251521104, 0.000369762029721762, 3.85210627857485e-05}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc0[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc4[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
-    static const double FE1_C0_D001[125][7] = \
-    {{-2.53401086900984, -0.86168424032714, 0.153733097585334, 0.173940273731973, 3.39569510933698, -0.153733097585335, -0.173940273731971},
-    {-2.0255498358363, -0.306078716913217, 0.131614521121219, 0.148914359955701, 2.33162855274952, -0.131614521121219, -0.1489143599557},
-    {-1.23337591087837, 0.559545548262077, 0.0971541428643073, 0.10992439799525, 0.673830362616288, -0.097154142864307, -0.109924397995249},
-    {-0.338555305646693, 1.53733389052355, 0.0582285287322854, 0.0658822750974736, -1.19877858487685, -0.0582285287322848, -0.065882275097473},
-    {0.454770511952704, 2.40421685178806, 0.0237180419639913, 0.0268356182006482, -2.85898736374077, -0.0237180419639906, -0.0268356182006476},
-    {-1.95173754786883, -0.86168424032714, 0.764665295175825, 0.145281397282487, 2.81342178819597, -0.764665295175825, -0.145281397282486},
-    {-1.52705194873624, -0.306078716913217, 0.654647946495179, 0.124378821681794, 1.83313066564946, -0.654647946495179, -0.124378821681793},
-    {-0.865398771818851, 0.559545548262077, 0.483242727153488, 0.0918129527655822, 0.305853223556774, -0.483242727153488, -0.0918129527655815},
-    {-0.118011263129872, 1.53733389052355, 0.289627515545325, 0.0550273308012554, -1.41932262739368, -0.289627515545325, -0.0550273308012548},
-    {0.544604017438855, 2.40421685178806, 0.117973057488944, 0.0224141081618458, -2.94882086922692, -0.117973057488943, -0.0224141081618453},
-    {-1.06855188405066, -0.86168424032714, 1.6913204223926, 0.101811933883884, 1.9302361243778, -1.6913204223926, -0.101811933883883},
-    {-0.77093592668034, -0.306078716913217, 1.44797919870299, 0.0871635915298887, 1.07701464359356, -1.44797919870299, -0.0871635915298881},
-    {-0.307255161197394, 0.559545548262077, 1.0688575754173, 0.0643417151232234, -0.252290387064684, -1.0688575754173, -0.0643417151232229},
-    {0.216507474925436, 1.53733389052355, 0.640610911753232, 0.0385626726486572, -1.75384136544898, -0.640610911753231, -0.0385626726486566},
-    {0.680862474241284, 2.40421685178806, 0.260938011286713, 0.0157076111665065, -3.08507932602935, -0.260938011286712, -0.0157076111665059},
-    {-0.120853589128906, -0.86168424032714, 2.6856634241203, 0.0551672270779314, 0.982537829456046, -2.6856634241203, -0.0551672270779307},
-    {0.0404108764001508, -0.306078716913217, 2.29925963250797, 0.0472299608053964, 0.265667840513066, -2.29925963250797, -0.0472299608053958},
-    {0.291658260721922, 0.559545548262078, 1.69724888193056, 0.0348638305292845, -0.851203808984, -1.69724888193056, -0.034863830529284},
-    {0.575461260818928, 1.53733389052355, 1.01723202298603, 0.0208953473093509, -2.11279515134248, -1.01723202298603, -0.0208953473093502},
-    {0.827073981595321, 2.40421685178806, 0.414345894247555, 0.00851123555970183, -3.23129083338339, -0.414345894247554, -0.0085112355597012},
-    {0.637338430571104, -0.861684240327141, 3.48117285237853, 0.0178498185197156, 0.224345809756035, -3.48117285237853, -0.0178498185197148},
-    {0.689516899489004, -0.306078716913217, 2.9803139668845, 0.0152816495177237, -0.383438182575788, -2.9803139668845, -0.0152816495177229},
-    {0.770810095671614, 0.559545548262077, 2.1999840629478, 0.0112804844617394, -1.33035564393369, -2.1999840629478, -0.0112804844617387},
-    {0.862636934093748, 1.53733389052355, 1.31854217888416, 0.00676086468604747, -2.3999708246173, -1.31854217888415, -0.00676086468604671},
-    {0.94404833794709, 2.40421685178807, 0.537077604585377, 0.00275388157364889, -3.34826518973516, -0.537077604585376, -0.00275388157364832},
-    {-1.85228451823978, -0.86168424032714, 0.153733097585334, 0.855666624502025, 2.71396875856692, -0.153733097585334, -0.855666624502024},
-    {-1.44190787062765, -0.306078716913217, 0.131614521121219, 0.732556325164345, 1.74798658754087, -0.131614521121219, -0.732556325164345},
-    {-0.802547804781613, 0.559545548262077, 0.0971541428643073, 0.540752504092003, 0.243002256519535, -0.0971541428643072, -0.540752504092002},
-    {-0.0803420579669869, 1.53733389052355, 0.0582285287322856, 0.32409552277718, -1.45699183255656, -0.058228528732285, -0.32409552277718},
-    {0.559947695327595, 2.40421685178806, 0.0237180419639915, 0.132012801575539, -2.96416454711566, -0.0237180419639908, -0.132012801575539},
-    {-1.38233429996559, -0.86168424032714, 0.764665295175825, 0.714684645185728, 2.24401854029273, -0.764665295175825, -0.714684645185728},
-    {-1.03957243407901, -0.306078716913217, 0.654647946495179, 0.611858336339029, 1.34565115099223, -0.654647946495179, -0.611858336339028},
-    {-0.505555085826084, 0.559545548262077, 0.483242727153489, 0.45165663875835, -0.0539904624359933, -0.483242727153488, -0.451656638758349},
-    {0.0976580618337187, 1.53733389052355, 0.289627515545326, 0.270696655764846, -1.63499195235727, -0.289627515545325, -0.270696655764845},
-    {0.632451919681933, 2.40421685178806, 0.117973057488944, 0.110262010404924, -3.03666877147, -0.117973057488943, -0.110262010404923},
-    {-0.669519062828044, -0.86168424032714, 1.6913204223926, 0.500844755106496, 1.53120330315518, -1.6913204223926, -0.500844755106495},
-    {-0.429314541944297, -0.306078716913217, 1.44797919870299, 0.428784976265932, 0.735393258857514, -1.44797919870299, -0.428784976265932},
-    {-0.0550798500280451, 0.559545548262077, 1.06885757541731, 0.316517026292572, -0.504465698234032, -1.0688575754173, -0.316517026292572},
-    {0.367646653544982, 1.53733389052355, 0.640610911753232, 0.189701851268203, -1.90498054406853, -0.640610911753231, -0.189701851268203},
-    {0.742425516601204, 2.40421685178806, 0.260938011286713, 0.0772706535264272, -3.14664236838927, -0.260938011286712, -0.0772706535264267},
-    {0.0953640331101715, -0.86168424032714, 2.6856634241203, 0.271384849317009, 0.766320207216968, -2.6856634241203, -0.271384849317009},
-    {0.225519868906913, -0.306078716913217, 2.29925963250797, 0.232338953312159, 0.0805588480063039, -2.29925963250797, -0.232338953312158},
-    {0.428300519875882, 0.559545548262077, 1.69724888193056, 0.171506089683245, -0.98784606813796, -1.69724888193056, -0.171506089683244},
-    {0.657356664129762, 1.53733389052355, 1.01723202298603, 0.102790750620185, -2.19469055465331, -1.01723202298603, -0.102790750620184},
-    {0.860432176532974, 2.40421685178806, 0.414345894247555, 0.0418694304973552, -3.26464902832104, -0.414345894247554, -0.0418694304973546},
-    {0.707297453747672, -0.861684240327141, 3.48117285237853, 0.0878088416962831, 0.154386786579467, -3.48117285237853, -0.0878088416962823},
-    {0.749410464883283, -0.306078716913217, 2.9803139668845, 0.0751752149120021, -0.443331747970066, -2.9803139668845, -0.0751752149120014},
-    {0.815021843428605, 0.559545548262077, 2.1999840629478, 0.0554922322187304, -1.37456739169068, -2.1999840629478, -0.0554922322187298},
-    {0.889134877965972, 1.53733389052355, 1.31854217888416, 0.0332588085582721, -2.42646876848952, -1.31854217888415, -0.0332588085582713},
-    {0.954841661398734, 2.40421685178807, 0.537077604585377, 0.0135472050252931, -3.3590585131868, -0.537077604585376, -0.0135472050252925},
-    {-0.853975571370904, -0.86168424032714, 0.153733097585333, 1.8539755713709, 1.71565981169804, -0.153733097585333, -1.8539755713709},
-    {-0.587232097896, -0.306078716913217, 0.131614521121218, 1.587232097896, 0.893310814809216, -0.131614521121218, -1.587232097896},
-    {-0.171650154436808, 0.559545548262077, 0.0971541428643073, 1.17165015443681, -0.387895393825269, -0.0971541428643073, -1.17165015443681},
-    {0.297781209627916, 1.53733389052355, 0.0582285287322859, 0.702218790372083, -1.83511510015146, -0.0582285287322854, -0.702218790372083},
-    {0.713967446876027, 2.40421685178806, 0.0237180419639917, 0.286032553123971, -3.11818429866409, -0.023718041963991, -0.286032553123971},
-    {-0.548509472575658, -0.86168424032714, 0.764665295175825, 1.54850947257566, 1.4101937129028, -0.764665295175825, -1.54850947257566},
-    {-0.325715385209019, -0.306078716913217, 0.654647946495179, 1.32571538520902, 0.631794102122236, -0.654647946495179, -1.32571538520902},
-    {0.0213941377077832, 0.559545548262077, 0.483242727153489, 0.978605862292217, -0.58093968596986, -0.483242727153489, -0.978605862292217},
-    {0.413480703034436, 1.53733389052355, 0.289627515545326, 0.586519296965564, -1.95081459355798, -0.289627515545326, -0.586519296965563},
-    {0.761094954638504, 2.40421685178806, 0.117973057488944, 0.238905045361495, -3.16531180642657, -0.117973057488944, -0.238905045361495},
-    {-0.0851819089672699, -0.86168424032714, 1.6913204223926, 1.08518190896727, 0.94686614929441, -1.6913204223926, -1.08518190896727},
-    {0.0709502408948852, -0.306078716913217, 1.44797919870299, 0.929049759105114, 0.235128476018332, -1.44797919870299, -0.929049759105114},
-    {0.314201561839691, 0.559545548262077, 1.06885757541731, 0.685798438160309, -0.873747110101769, -1.06885757541731, -0.685798438160308},
-    {0.588972401138389, 1.53733389052355, 0.640610911753232, 0.41102759886161, -2.12630629166194, -0.640610911753232, -0.41102759886161},
-    {0.832577431537388, 2.40421685178806, 0.260938011286713, 0.167422568462611, -3.23679428332545, -0.260938011286712, -0.16742256846261},
-    {0.411989591896581, -0.86168424032714, 2.6856634241203, 0.588010408103419, 0.449694648430559, -2.6856634241203, -0.588010408103418},
-    {0.496590457797377, -0.306078716913217, 2.29925963250797, 0.503409542202622, -0.19051174088416, -2.29925963250797, -0.503409542202622},
-    {0.628397215096318, 0.559545548262078, 1.69724888193056, 0.371602784903681, -1.1879427633584, -1.69724888193056, -0.37160278490368},
-    {0.777282956754788, 1.53733389052355, 1.01723202298603, 0.222717043245211, -2.31461684727834, -1.01723202298603, -0.22271704324521},
-    {0.909281373017809, 2.40421685178806, 0.414345894247555, 0.0907186269821898, -3.31349822480587, -0.414345894247555, -0.0907186269821892},
-    {0.809744306025694, -0.861684240327141, 3.48117285237853, 0.190255693974305, 0.0519399343014455, -3.48117285237853, -0.190255693974305},
-    {0.83711762498564, -0.306078716913217, 2.9803139668845, 0.162882375014359, -0.531038908072423, -2.9803139668845, -0.162882375014358},
-    {0.879764805604936, 0.559545548262077, 2.1999840629478, 0.120235194395062, -1.43931035386701, -2.1999840629478, -0.120235194395062},
-    {0.92793803470385, 1.53733389052355, 1.31854217888416, 0.0720619652961492, -2.4652719252274, -1.31854217888415, -0.0720619652961484},
-    {0.97064722818672, 2.40421685178807, 0.537077604585377, 0.0293527718132788, -3.37486407997479, -0.537077604585376, -0.0293527718132783},
-    {0.144333375497976, -0.86168424032714, 0.153733097585332, 2.85228451823978, 0.717350864829163, -0.153733097585332, -2.85228451823978},
-    {0.267443674835655, -0.306078716913217, 0.131614521121218, 2.44190787062765, 0.0386350420775617, -0.131614521121218, -2.44190787062765},
-    {0.459247495907997, 0.559545548262077, 0.0971541428643074, 1.80254780478161, -1.01879304417007, -0.0971541428643074, -1.80254780478161},
-    {0.675904477222819, 1.53733389052355, 0.0582285287322862, 1.08034205796699, -2.21323836774637, -0.0582285287322857, -1.08034205796699},
-    {0.86798719842446, 2.40421685178806, 0.0237180419639919, 0.440052304672404, -3.27220405021253, -0.0237180419639913, -0.440052304672404},
-    {0.285315354814272, -0.86168424032714, 0.764665295175825, 2.38233429996559, 0.576368885512868, -0.764665295175825, -2.38233429996559},
-    {0.388141663660971, -0.306078716913217, 0.654647946495179, 2.03957243407901, -0.0820629467477537, -0.654647946495179, -2.03957243407901},
-    {0.54834336124165, 0.559545548262077, 0.483242727153489, 1.50555508582608, -1.10788890950373, -0.483242727153489, -1.50555508582608},
-    {0.729303344235153, 1.53733389052355, 0.289627515545326, 0.902341938166281, -2.2666372347587, -0.289627515545326, -0.902341938166281},
-    {0.889737989595075, 2.40421685178806, 0.117973057488944, 0.367548080318067, -3.29395484138314, -0.117973057488944, -0.367548080318066},
-    {0.499155244893504, -0.86168424032714, 1.6913204223926, 1.66951906282804, 0.362528995433636, -1.6913204223926, -1.66951906282804},
-    {0.571215023734067, -0.306078716913217, 1.44797919870299, 1.4293145419443, -0.26513630682085, -1.44797919870299, -1.4293145419443},
-    {0.683482973707427, 0.559545548262077, 1.06885757541731, 1.05507985002804, -1.2430285219695, -1.06885757541731, -1.05507985002804},
-    {0.810298148731796, 1.53733389052355, 0.640610911753232, 0.632353346455017, -2.34763203925534, -0.640610911753232, -0.632353346455017},
-    {0.922729346473571, 2.40421685178806, 0.260938011286713, 0.257574483398795, -3.32694619826164, -0.260938011286712, -0.257574483398794},
-    {0.72861515068299, -0.86168424032714, 2.6856634241203, 0.904635966889828, 0.13306908964415, -2.6856634241203, -0.904635966889828},
-    {0.76766104668784, -0.306078716913217, 2.29925963250797, 0.774480131093086, -0.461582329774624, -2.29925963250797, -0.774480131093086},
-    {0.828493910316754, 0.559545548262078, 1.69724888193056, 0.571699480124117, -1.38803945857883, -1.69724888193056, -0.571699480124116},
-    {0.897209249379814, 1.53733389052355, 1.01723202298603, 0.342643335870237, -2.43454313990336, -1.01723202298603, -0.342643335870237},
-    {0.958130569502644, 2.40421685178806, 0.414345894247555, 0.139567823467025, -3.36234742129071, -0.414345894247555, -0.139567823467024},
-    {0.912191158303716, -0.861684240327141, 3.48117285237853, 0.292702546252328, -0.0505069179765767, -3.48117285237853, -0.292702546252327},
-    {0.924824785087997, -0.306078716913217, 2.9803139668845, 0.250589535116716, -0.61874606817478, -2.9803139668845, -0.250589535116716},
-    {0.944507767781268, 0.559545548262077, 2.1999840629478, 0.184978156571394, -1.50405331604335, -2.1999840629478, -0.184978156571393},
-    {0.966741191441727, 1.53733389052355, 1.31854217888416, 0.110865122034026, -2.50407508196527, -1.31854217888415, -0.110865122034026},
-    {0.986452794974706, 2.40421685178807, 0.537077604585377, 0.0451583386012648, -3.39066964676277, -0.537077604585376, -0.0451583386012643},
-    {0.826059726268027, -0.86168424032714, 0.153733097585331, 3.53401086900984, 0.0356245140591109, -0.153733097585331, -3.53401086900983},
-    {0.8510856400443, -0.306078716913217, 0.131614521121218, 3.0255498358363, -0.545006923131083, -0.131614521121218, -3.0255498358363},
-    {0.890075602004749, 0.559545548262077, 0.0971541428643075, 2.23337591087837, -1.44962115026683, -0.0971541428643075, -2.23337591087836},
-    {0.934117724902526, 1.53733389052355, 0.0582285287322864, 1.33855530564669, -2.47145161542607, -0.058228528732286, -1.33855530564669},
-    {0.973164381799351, 2.40421685178806, 0.023718041963992, 0.545229488047295, -3.37738123358742, -0.0237180419639914, -0.545229488047295},
-    {0.854718602717513, -0.86168424032714, 0.764665295175825, 2.95173754786883, 0.00696563760962579, -0.764665295175825, -2.95173754786883},
-    {0.875621178318205, -0.306078716913217, 0.654647946495179, 2.52705194873624, -0.569542461404989, -0.654647946495179, -2.52705194873624},
-    {0.908187047234417, 0.559545548262077, 0.483242727153489, 1.86539877181885, -1.46773259549649, -0.483242727153489, -1.86539877181885},
-    {0.944972669198744, 1.53733389052355, 0.289627515545326, 1.11801126312987, -2.48230655972229, -0.289627515545326, -1.11801126312987},
-    {0.977585891838153, 2.40421685178806, 0.117973057488945, 0.455395982561145, -3.38180274362622, -0.117973057488944, -0.455395982561144},
-    {0.898188066116116, -0.86168424032714, 1.6913204223926, 2.06855188405066, -0.0365038257889762, -1.6913204223926, -2.06855188405065},
-    {0.91283640847011, -0.306078716913217, 1.44797919870299, 1.77093592668034, -0.606757691556893, -1.44797919870299, -1.77093592668034},
-    {0.935658284876775, 0.559545548262077, 1.06885757541731, 1.30725516119739, -1.49520383313885, -1.06885757541731, -1.30725516119739},
-    {0.961437327351342, 1.53733389052355, 0.640610911753233, 0.783492525074564, -2.49877121787489, -0.640610911753232, -0.783492525074563},
-    {0.984292388833492, 2.40421685178806, 0.260938011286713, 0.319137525758715, -3.38850924062156, -0.260938011286713, -0.319137525758715},
-    {0.944832772922068, -0.86168424032714, 2.6856634241203, 1.12085358912891, -0.083148532594928, -2.6856634241203, -1.12085358912891},
-    {0.952770039194602, -0.306078716913217, 2.29925963250797, 0.959589123599848, -0.646691322281386, -2.29925963250797, -0.959589123599848},
-    {0.965136169470714, 0.559545548262077, 1.69724888193056, 0.708341739278077, -1.52468171773279, -1.69724888193056, -0.708341739278077},
-    {0.979104652690648, 1.53733389052355, 1.01723202298603, 0.424538739181071, -2.5164385432142, -1.01723202298603, -0.42453873918107},
-    {0.991488764440297, 2.40421685178806, 0.414345894247555, 0.172926018404678, -3.39570561622836, -0.414345894247555, -0.172926018404678},
-    {0.982150181480283, -0.861684240327141, 3.48117285237853, 0.362661569428895, -0.120465941153144, -3.48117285237853, -0.362661569428894},
-    {0.984718350482275, -0.306078716913217, 2.9803139668845, 0.310483100510995, -0.678639633569059, -2.9803139668845, -0.310483100510994},
-    {0.988719515538259, 0.559545548262077, 2.1999840629478, 0.229189904328385, -1.54826506380034, -2.1999840629478, -0.229189904328384},
-    {0.993239135313951, 1.53733389052355, 1.31854217888416, 0.137363065906251, -2.5305730258375, -1.31854217888415, -0.13736306590625},
-    {0.997246118426349, 2.40421685178807, 0.537077604585377, 0.0559516620529087, -3.40146297021442, -0.537077604585376, -0.0559516620529083}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[7] = {0, 3, 4, 5, 7, 8, 9};
-    static const double FE1_C0_D010[125][7] = \
-    {{-2.53401086900984, -0.846266902414667, 0.138315759672862, 0.173940273731974, -0.138315759672862, 3.3802777714245, -0.173940273731973},
-    {-2.0255498358363, -0.868385478878781, 0.693921283086784, 0.148914359955701, -0.693921283086783, 2.89393531471508, -0.1489143599557},
-    {-1.23337591087837, -0.902845857135692, 1.55954554826208, 0.109924397995249, -1.55954554826208, 2.13622176801406, -0.109924397995249},
-    {-0.338555305646693, -0.941771471267714, 2.53733389052355, 0.0658822750974729, -2.53733389052355, 1.28032677691441, -0.0658822750974728},
-    {0.454770511952705, -0.976281958036009, 3.40421685178806, 0.0268356182006483, -3.40421685178806, 0.521511446083304, -0.0268356182006486},
-    {-1.95173754786883, -0.235334704824175, 0.138315759672861, 0.145281397282487, -0.138315759672861, 2.187072252693, -0.145281397282487},
-    {-1.52705194873624, -0.345352053504821, 0.693921283086783, 0.124378821681794, -0.693921283086783, 1.87240400224106, -0.124378821681793},
-    {-0.865398771818851, -0.516757272846511, 1.55954554826208, 0.0918129527655814, -1.55954554826208, 1.38215604466536, -0.0918129527655814},
-    {-0.118011263129871, -0.710372484454674, 2.53733389052355, 0.0550273308012546, -2.53733389052355, 0.828383747584545, -0.0550273308012547},
-    {0.544604017438855, -0.882026942511056, 3.40421685178806, 0.0224141081618461, -3.40421685178806, 0.337422925072202, -0.0224141081618462},
-    {-1.06855188405066, 0.6913204223926, 0.138315759672859, 0.101811933883883, -0.13831575967286, 0.377231461658056, -0.101811933883884},
-    {-0.77093592668034, 0.447979198702987, 0.693921283086782, 0.087163591529888, -0.693921283086782, 0.322956727977352, -0.0871635915298885},
-    {-0.307255161197393, 0.068857575417305, 1.55954554826208, 0.0643417151232226, -1.55954554826208, 0.238397585780088, -0.0643417151232226},
-    {0.216507474925436, -0.359389088246769, 2.53733389052355, 0.0385626726486567, -2.53733389052355, 0.142881613321332, -0.0385626726486567},
-    {0.680862474241284, -0.739061988713288, 3.40421685178806, 0.0157076111665069, -3.40421685178806, 0.058199514472004, -0.015707611166507},
-    {-0.120853589128906, 1.6856634241203, 0.138315759672859, 0.0551672270779302, -0.138315759672859, -1.5648098349914, -0.0551672270779314},
-    {0.0404108764001513, 1.29925963250797, 0.693921283086782, 0.0472299608053953, -0.693921283086782, -1.33967050890812, -0.047229960805396},
-    {0.291658260721923, 0.69724888193056, 1.55954554826208, 0.0348638305292839, -1.55954554826208, -0.988907142652483, -0.034863830529284},
-    {0.575461260818929, 0.0172320229860304, 2.53733389052355, 0.0208953473093506, -2.53733389052355, -0.59269328380496, -0.0208953473093506},
-    {0.827073981595321, -0.585654105752446, 3.40421685178807, 0.00851123555970239, -3.40421685178807, -0.241419875842875, -0.00851123555970248},
-    {0.637338430571105, 2.48117285237853, 0.138315759672859, 0.0178498185197144, -0.138315759672859, -3.11851128294963, -0.0178498185197154},
-    {0.689516899489005, 1.9803139668845, 0.693921283086782, 0.0152816495177227, -0.693921283086782, -2.6698308663735, -0.0152816495177232},
-    {0.770810095671614, 1.1999840629478, 1.55954554826208, 0.0112804844617389, -1.55954554826208, -1.97079415861941, -0.011280484461739},
-    {0.862636934093749, 0.318542178884154, 2.53733389052355, 0.00676086468604743, -2.53733389052355, -1.1811791129779, -0.00676086468604731},
-    {0.94404833794709, -0.462922395414624, 3.40421685178807, 0.00275388157364971, -3.40421685178807, -0.481125942532466, -0.00275388157364974},
-    {-1.85228451823978, -0.846266902414667, 0.138315759672862, 0.855666624502025, -0.138315759672862, 2.69855142065445, -0.855666624502025},
-    {-1.44190787062765, -0.868385478878781, 0.693921283086783, 0.732556325164345, -0.693921283086783, 2.31029334950644, -0.732556325164345},
-    {-0.802547804781612, -0.902845857135692, 1.55954554826208, 0.540752504092002, -1.55954554826208, 1.7053936619173, -0.540752504092002},
-    {-0.0803420579669867, -0.941771471267714, 2.53733389052355, 0.32409552277718, -2.53733389052355, 1.0221135292347, -0.32409552277718},
-    {0.559947695327596, -0.976281958036009, 3.40421685178806, 0.13201280157554, -3.40421685178806, 0.416334262708413, -0.13201280157554},
-    {-1.38233429996559, -0.235334704824175, 0.138315759672861, 0.714684645185728, -0.138315759672861, 1.61766900478976, -0.714684645185729},
-    {-1.03957243407901, -0.345352053504821, 0.693921283086783, 0.611858336339028, -0.693921283086783, 1.38492448758383, -0.611858336339029},
-    {-0.505555085826084, -0.516757272846511, 1.55954554826208, 0.451656638758349, -1.55954554826208, 1.02231235867259, -0.451656638758349},
-    {0.097658061833719, -0.710372484454674, 2.53733389052355, 0.270696655764845, -2.53733389052355, 0.612714422620955, -0.270696655764845},
-    {0.632451919681933, -0.882026942511056, 3.40421685178806, 0.110262010404924, -3.40421685178806, 0.249575022829124, -0.110262010404924},
-    {-0.669519062828044, 0.6913204223926, 0.13831575967286, 0.500844755106495, -0.13831575967286, -0.0218013595645561, -0.500844755106496},
-    {-0.429314541944297, 0.447979198702988, 0.693921283086782, 0.428784976265931, -0.693921283086782, -0.0186646567586911, -0.428784976265932},
-    {-0.0550798500280447, 0.0688575754173051, 1.55954554826208, 0.316517026292572, -1.55954554826208, -0.0137777253892607, -0.316517026292571},
-    {0.367646653544982, -0.359389088246769, 2.53733389052355, 0.189701851268203, -2.53733389052355, -0.00825756529821425, -0.189701851268203},
-    {0.742425516601205, -0.739061988713288, 3.40421685178806, 0.0772706535264277, -3.40421685178806, -0.00336352788791668, -0.0772706535264278},
-    {0.0953640331101717, 1.6856634241203, 0.138315759672859, 0.271384849317008, -0.138315759672859, -1.78102745723047, -0.271384849317009},
-    {0.225519868906913, 1.29925963250797, 0.693921283086782, 0.232338953312158, -0.693921283086782, -1.52477950141488, -0.232338953312158},
-    {0.428300519875883, 0.69724888193056, 1.55954554826208, 0.171506089683245, -1.55954554826208, -1.12554940180644, -0.171506089683245},
-    {0.657356664129763, 0.0172320229860304, 2.53733389052355, 0.102790750620184, -2.53733389052355, -0.674588687115793, -0.102790750620184},
-    {0.860432176532975, -0.585654105752446, 3.40421685178807, 0.0418694304973558, -3.40421685178807, -0.274778070780529, -0.0418694304973559},
-    {0.707297453747672, 2.48117285237853, 0.138315759672859, 0.087808841696282, -0.138315759672859, -3.1884703061262, -0.0878088416962829},
-    {0.749410464883284, 1.9803139668845, 0.693921283086782, 0.0751752149120012, -0.693921283086783, -2.72972443176778, -0.0751752149120016},
-    {0.815021843428605, 1.1999840629478, 1.55954554826208, 0.05549223221873, -1.55954554826208, -2.0150059063764, -0.0554922322187299},
-    {0.889134877965973, 0.318542178884154, 2.53733389052355, 0.0332588085582721, -2.53733389052355, -1.20767705685013, -0.033258808558272},
-    {0.954841661398734, -0.462922395414624, 3.40421685178807, 0.0135472050252939, -3.40421685178807, -0.49191926598411, -0.013547205025294},
-    {-0.853975571370904, -0.846266902414667, 0.138315759672861, 1.8539755713709, -0.138315759672861, 1.70024247378557, -1.8539755713709},
-    {-0.587232097895999, -0.868385478878781, 0.693921283086783, 1.587232097896, -0.693921283086783, 1.45561757677478, -1.587232097896},
-    {-0.171650154436808, -0.902845857135692, 1.55954554826208, 1.17165015443681, -1.55954554826208, 1.0744960115725, -1.17165015443681},
-    {0.297781209627916, -0.941771471267714, 2.53733389052355, 0.702218790372083, -2.53733389052355, 0.643990261639798, -0.702218790372083},
-    {0.713967446876028, -0.976281958036009, 3.40421685178806, 0.286032553123972, -3.40421685178806, 0.262314511159981, -0.286032553123972},
-    {-0.548509472575657, -0.235334704824175, 0.13831575967286, 1.54850947257566, -0.13831575967286, 0.783844177399832, -1.54850947257566},
-    {-0.325715385209019, -0.345352053504821, 0.693921283086783, 1.32571538520902, -0.693921283086783, 0.67106743871384, -1.32571538520902},
-    {0.0213941377077833, -0.516757272846511, 1.55954554826208, 0.978605862292217, -1.55954554826208, 0.495363135138727, -0.978605862292217},
-    {0.413480703034436, -0.710372484454674, 2.53733389052355, 0.586519296965563, -2.53733389052355, 0.296891781420238, -0.586519296965563},
-    {0.761094954638504, -0.882026942511056, 3.40421685178806, 0.238905045361496, -3.40421685178806, 0.120931987872552, -0.238905045361496},
-    {-0.08518190896727, 0.6913204223926, 0.13831575967286, 1.08518190896727, -0.13831575967286, -0.60613851342533, -1.08518190896727},
-    {0.0709502408948853, 0.447979198702988, 0.693921283086783, 0.929049759105114, -0.693921283086783, -0.518929439597874, -0.929049759105114},
-    {0.314201561839691, 0.0688575754173052, 1.55954554826208, 0.685798438160308, -1.55954554826208, -0.383059137256997, -0.685798438160308},
-    {0.588972401138389, -0.359389088246769, 2.53733389052355, 0.41102759886161, -2.53733389052355, -0.229583312891621, -0.41102759886161},
-    {0.832577431537388, -0.739061988713288, 3.40421685178806, 0.167422568462611, -3.40421685178806, -0.0935154428241002, -0.167422568462612},
-    {0.411989591896581, 1.6856634241203, 0.138315759672859, 0.588010408103418, -0.138315759672859, -2.09765301601688, -0.588010408103419},
-    {0.496590457797377, 1.29925963250797, 0.693921283086782, 0.503409542202622, -0.693921283086782, -1.79585009030535, -0.503409542202622},
-    {0.628397215096319, 0.69724888193056, 1.55954554826208, 0.37160278490368, -1.55954554826208, -1.32564609702688, -0.37160278490368},
-    {0.777282956754789, 0.0172320229860305, 2.53733389052355, 0.222717043245211, -2.53733389052355, -0.79451497974082, -0.222717043245211},
-    {0.909281373017809, -0.585654105752446, 3.40421685178807, 0.0907186269821904, -3.40421685178807, -0.323627267265363, -0.0907186269821905},
-    {0.809744306025694, 2.48117285237853, 0.138315759672859, 0.190255693974304, -0.138315759672859, -3.29091715840422, -0.190255693974305},
-    {0.83711762498564, 1.9803139668845, 0.693921283086782, 0.162882375014358, -0.693921283086783, -2.81743159187014, -0.162882375014359},
-    {0.879764805604937, 1.1999840629478, 1.55954554826208, 0.120235194395062, -1.55954554826208, -2.07974886855273, -0.120235194395062},
-    {0.92793803470385, 0.318542178884154, 2.53733389052355, 0.0720619652961492, -2.53733389052355, -1.246480213588, -0.0720619652961491},
-    {0.97064722818672, -0.462922395414624, 3.40421685178807, 0.0293527718132797, -3.40421685178807, -0.507724832772096, -0.0293527718132797},
-    {0.144333375497976, -0.846266902414667, 0.13831575967286, 2.85228451823978, -0.13831575967286, 0.701933526916691, -2.85228451823978},
-    {0.267443674835655, -0.868385478878781, 0.693921283086782, 2.44190787062765, -0.693921283086783, 0.600941804043126, -2.44190787062765},
-    {0.459247495907997, -0.902845857135692, 1.55954554826208, 1.80254780478161, -1.55954554826208, 0.443598361227695, -1.80254780478161},
-    {0.675904477222819, -0.941771471267714, 2.53733389052355, 1.08034205796699, -2.53733389052355, 0.265866994044895, -1.08034205796699},
-    {0.86798719842446, -0.976281958036009, 3.40421685178806, 0.440052304672404, -3.40421685178806, 0.108294759611549, -0.440052304672405},
-    {0.285315354814272, -0.235334704824175, 0.13831575967286, 2.38233429996559, -0.13831575967286, -0.0499806499900974, -2.38233429996559},
-    {0.388141663660971, -0.345352053504821, 0.693921283086783, 2.03957243407901, -0.693921283086783, -0.0427896101561506, -2.03957243407901},
-    {0.54834336124165, -0.516757272846511, 1.55954554826208, 1.50555508582608, -1.55954554826208, -0.0315860883951393, -1.50555508582608},
-    {0.729303344235153, -0.710372484454674, 2.53733389052355, 0.902341938166281, -2.53733389052355, -0.0189308597804795, -0.902341938166281},
-    {0.889737989595075, -0.882026942511056, 3.40421685178807, 0.367548080318067, -3.40421685178807, -0.00771104708401874, -0.367548080318067},
-    {0.499155244893504, 0.691320422392601, 0.13831575967286, 1.66951906282804, -0.13831575967286, -1.1904756672861, -1.66951906282804},
-    {0.571215023734067, 0.447979198702988, 0.693921283086783, 1.4293145419443, -0.693921283086783, -1.01919422243706, -1.4293145419443},
-    {0.683482973707427, 0.0688575754173054, 1.55954554826208, 1.05507985002804, -1.55954554826208, -0.752340549124733, -1.05507985002804},
-    {0.810298148731796, -0.359389088246769, 2.53733389052355, 0.632353346455017, -2.53733389052355, -0.450909060485028, -0.632353346455017},
-    {0.922729346473572, -0.739061988713288, 3.40421685178806, 0.257574483398795, -3.40421685178806, -0.183667357760284, -0.257574483398796},
-    {0.72861515068299, 1.6856634241203, 0.138315759672859, 0.904635966889828, -0.13831575967286, -2.41427857480329, -0.904635966889828},
-    {0.767661046687841, 1.29925963250797, 0.693921283086783, 0.774480131093086, -0.693921283086783, -2.06692067919581, -0.774480131093086},
-    {0.828493910316754, 0.69724888193056, 1.55954554826208, 0.571699480124116, -1.55954554826208, -1.52574279224731, -0.571699480124116},
-    {0.897209249379815, 0.0172320229860305, 2.53733389052355, 0.342643335870237, -2.53733389052355, -0.914441272365846, -0.342643335870237},
-    {0.958130569502644, -0.585654105752446, 3.40421685178807, 0.139567823467025, -3.40421685178807, -0.372476463750198, -0.139567823467025},
-    {0.912191158303716, 2.48117285237853, 0.138315759672859, 0.292702546252327, -0.138315759672859, -3.39336401068225, -0.292702546252327},
-    {0.924824785087997, 1.9803139668845, 0.693921283086783, 0.250589535116716, -0.693921283086783, -2.9051387519725, -0.250589535116716},
-    {0.944507767781269, 1.1999840629478, 1.55954554826208, 0.184978156571394, -1.55954554826208, -2.14449183072907, -0.184978156571394},
-    {0.966741191441727, 0.318542178884154, 2.53733389052355, 0.110865122034026, -2.53733389052355, -1.28528337032588, -0.110865122034026},
-    {0.986452794974706, -0.462922395414624, 3.40421685178807, 0.0451583386012656, -3.40421685178807, -0.523530399560082, -0.0451583386012656},
-    {0.826059726268028, -0.846266902414667, 0.138315759672859, 3.53401086900983, -0.138315759672859, 0.0202071761466383, -3.53401086900983},
-    {0.8510856400443, -0.868385478878782, 0.693921283086782, 3.0255498358363, -0.693921283086782, 0.0172998388344806, -3.0255498358363},
-    {0.89007560200475, -0.902845857135692, 1.55954554826208, 2.23337591087836, -1.55954554826208, 0.012770255130942, -2.23337591087836},
-    {0.934117724902525, -0.941771471267714, 2.53733389052355, 1.33855530564669, -2.53733389052355, 0.00765374636518801, -1.33855530564669},
-    {0.973164381799351, -0.976281958036009, 3.40421685178806, 0.545229488047295, -3.40421685178806, 0.00311757623665807, -0.545229488047296},
-    {0.854718602717513, -0.235334704824175, 0.138315759672859, 2.95173754786883, -0.13831575967286, -0.61938389789334, -2.95173754786883},
-    {0.875621178318206, -0.345352053504821, 0.693921283086783, 2.52705194873624, -0.693921283086783, -0.530269124813386, -2.52705194873624},
-    {0.908187047234417, -0.516757272846511, 1.55954554826208, 1.86539877181885, -1.55954554826208, -0.391429774387907, -1.86539877181885},
-    {0.944972669198744, -0.710372484454674, 2.53733389052355, 1.11801126312987, -2.53733389052355, -0.23460018474407, -1.11801126312987},
-    {0.977585891838153, -0.882026942511056, 3.40421685178807, 0.455395982561145, -3.40421685178807, -0.0955589493270969, -0.455395982561146},
-    {0.898188066116116, 0.691320422392601, 0.13831575967286, 2.06855188405065, -0.13831575967286, -1.58950848850872, -2.06855188405066},
-    {0.91283640847011, 0.447979198702988, 0.693921283086783, 1.77093592668034, -0.693921283086783, -1.3608156071731, -1.77093592668034},
-    {0.935658284876775, 0.0688575754173054, 1.55954554826208, 1.30725516119739, -1.55954554826208, -1.00451586029408, -1.30725516119739},
-    {0.961437327351342, -0.359389088246768, 2.53733389052355, 0.783492525074564, -2.53733389052355, -0.602048239104574, -0.783492525074564},
-    {0.984292388833492, -0.739061988713288, 3.40421685178807, 0.319137525758716, -3.40421685178807, -0.245230400120204, -0.319137525758716},
-    {0.944832772922068, 1.6856634241203, 0.138315759672859, 1.12085358912891, -0.13831575967286, -2.63049619704237, -1.12085358912891},
-    {0.952770039194603, 1.29925963250797, 0.693921283086783, 0.959589123599848, -0.693921283086783, -2.25202967170258, -0.959589123599848},
-    {0.965136169470714, 0.69724888193056, 1.55954554826208, 0.708341739278077, -1.55954554826208, -1.66238505140128, -0.708341739278077},
-    {0.979104652690649, 0.0172320229860305, 2.53733389052355, 0.424538739181071, -2.53733389052355, -0.996336675676679, -0.424538739181071},
-    {0.991488764440297, -0.585654105752446, 3.40421685178807, 0.172926018404679, -3.40421685178807, -0.405834658687851, -0.172926018404679},
-    {0.982150181480284, 2.48117285237853, 0.138315759672859, 0.362661569428894, -0.13831575967286, -3.46332303385881, -0.362661569428895},
-    {0.984718350482276, 1.9803139668845, 0.693921283086783, 0.310483100510994, -0.693921283086783, -2.96503231736678, -0.310483100510994},
-    {0.98871951553826, 1.1999840629478, 1.55954554826208, 0.229189904328385, -1.55954554826208, -2.18870357848606, -0.229189904328385},
-    {0.993239135313952, 0.318542178884154, 2.53733389052355, 0.137363065906251, -2.53733389052355, -1.31178131419811, -0.137363065906251},
-    {0.99724611842635, -0.462922395414624, 3.40421685178807, 0.0559516620529096, -3.40421685178807, -0.534323723011726, -0.0559516620529098}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc2[7] = {0, 2, 4, 6, 7, 8, 9};
-    static const double FE1_C0_D100[125][7] = \
-    {{-2.53401086900984, -0.82605972626803, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 3.36007059527787},
-    {-2.0255498358363, -0.8510856400443, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.13161452112122, 2.8766354758806},
-    {-1.23337591087837, -0.89007560200475, 1.55954554826208, 0.0971541428643071, -1.55954554826208, -0.0971541428643071, 2.12345151288312},
-    {-0.338555305646693, -0.934117724902525, 2.53733389052355, 0.0582285287322848, -2.53733389052355, -0.0582285287322848, 1.27267303054922},
-    {0.454770511952704, -0.973164381799351, 3.40421685178806, 0.0237180419639906, -3.40421685178806, -0.0237180419639906, 0.518393869846646},
-    {-1.95173754786883, -0.854718602717514, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175826, 2.80645615058634},
-    {-1.52705194873624, -0.875621178318207, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 2.40267312705445},
-    {-0.865398771818852, -0.908187047234418, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.77358581905327},
-    {-0.118011263129872, -0.944972669198744, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 1.06298393232862},
-    {0.544604017438855, -0.977585891838153, 3.40421685178807, 0.117973057488943, -3.40421685178807, -0.117973057488943, 0.432981874399299},
-    {-1.06855188405066, -0.898188066116116, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.96673995016677},
-    {-0.77093592668034, -0.912836408470111, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.68377233515045},
-    {-0.307255161197394, -0.935658284876776, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.0688575754173, 1.24291344607417},
-    {0.216507474925436, -0.961437327351342, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753231, 0.744929852425906},
-    {0.680862474241284, -0.984292388833493, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.303429914592209},
-    {-0.120853589128906, -0.944832772922068, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 1.06568636205097},
-    {0.0404108764001512, -0.952770039194603, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.912359162794452},
-    {0.291658260721922, -0.965136169470715, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.673477908748793},
-    {0.575461260818929, -0.979104652690649, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.40364339187172},
-    {0.827073981595321, -0.991488764440298, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.164414782844977},
-    {0.637338430571105, -0.982150181480284, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.344811750909179},
-    {0.689516899489005, -0.984718350482277, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.295201450993271},
-    {0.770810095671615, -0.988719515538262, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.217909419866647},
-    {0.862636934093749, -0.993239135313953, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.130602201220204},
-    {0.94404833794709, -0.997246118426351, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0531977804792609},
-    {-1.85228451823978, -0.144333375497977, 0.138315759672862, 0.153733097585335, -0.138315759672862, -0.153733097585335, 1.99661789373776},
-    {-1.44190787062765, -0.267443674835656, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 1.70935154546331},
-    {-0.802547804781613, -0.459247495907997, 1.55954554826208, 0.0971541428643072, -1.55954554826208, -0.0971541428643073, 1.26179530068961},
-    {-0.0803420579669868, -0.675904477222819, 2.53733389052355, 0.0582285287322851, -2.53733389052355, -0.0582285287322851, 0.756246535189806},
-    {0.559947695327596, -0.86798719842446, 3.40421685178806, 0.0237180419639908, -3.40421685178806, -0.0237180419639908, 0.308039503096864},
-    {-1.38233429996559, -0.285315354814272, 0.138315759672861, 0.764665295175825, -0.138315759672861, -0.764665295175825, 1.66764965477986},
-    {-1.03957243407901, -0.388141663660972, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 1.42771409773998},
-    {-0.505555085826084, -0.54834336124165, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153488, 1.05389844706773},
-    {0.0976580618337188, -0.729303344235153, 2.53733389052355, 0.289627515545325, -2.53733389052355, -0.289627515545325, 0.631645282401435},
-    {0.632451919681933, -0.889737989595075, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0.257286069913143},
-    {-0.669519062828044, -0.499155244893504, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 1.16867430772155},
-    {-0.429314541944297, -0.571215023734068, 0.693921283086782, 1.44797919870299, -0.693921283086782, -1.44797919870299, 1.00052956567836},
-    {-0.0550798500280449, -0.683482973707428, 1.55954554826208, 1.0688575754173, -1.55954554826208, -1.06885757541731, 0.738562823735472},
-    {0.367646653544982, -0.810298148731796, 2.53733389052355, 0.640610911753231, -2.53733389052355, -0.640610911753232, 0.442651495186814},
-    {0.742425516601204, -0.922729346473572, 3.40421685178807, 0.260938011286712, -3.40421685178807, -0.260938011286712, 0.180303829872368},
-    {0.0953640331101717, -0.72861515068299, 0.138315759672859, 2.6856634241203, -0.138315759672859, -2.6856634241203, 0.633251117572818},
-    {0.225519868906913, -0.767661046687841, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0.542141177780928},
-    {0.428300519875883, -0.828493910316755, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0.400193390440872},
-    {0.657356664129763, -0.897209249379815, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0.239852585250053},
-    {0.860432176532975, -0.958130569502645, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0.09769839296967},
-    {0.707297453747673, -0.912191158303717, 0.138315759672859, 3.48117285237853, -0.138315759672859, -3.48117285237853, 0.204893704556044},
-    {0.749410464883284, -0.924824785087998, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0.175414320204714},
-    {0.815021843428606, -0.944507767781271, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0.129485924352665},
-    {0.889134877965973, -0.966741191441729, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0.0776063134757552},
-    {0.954841661398734, -0.986452794974707, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0.0316111335759726},
-    {-0.853975571370903, 0.853975571370903, 0.138315759672861, 0.153733097585334, -0.138315759672861, -0.153733097585334, 0},
-    {-0.587232097895999, 0.587232097895999, 0.693921283086783, 0.131614521121219, -0.693921283086783, -0.131614521121219, 0},
-    {-0.171650154436808, 0.171650154436808, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643074, 0},
-    {0.297781209627916, -0.297781209627916, 2.53733389052355, 0.0582285287322856, -2.53733389052355, -0.0582285287322856, 0},
-    {0.713967446876028, -0.713967446876028, 3.40421685178807, 0.0237180419639911, -3.40421685178807, -0.0237180419639911, 0},
-    {-0.548509472575657, 0.548509472575658, 0.13831575967286, 0.764665295175825, -0.13831575967286, -0.764665295175825, 0},
-    {-0.325715385209019, 0.325715385209019, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, 0},
-    {0.0213941377077832, -0.0213941377077827, 1.55954554826208, 0.483242727153488, -1.55954554826208, -0.483242727153489, 0},
-    {0.413480703034436, -0.413480703034436, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, 0},
-    {0.761094954638504, -0.761094954638504, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, 0},
-    {-0.0851819089672702, 0.0851819089672698, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, 0},
-    {0.0709502408948851, -0.0709502408948855, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, 0},
-    {0.314201561839691, -0.314201561839691, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, 0},
-    {0.588972401138389, -0.58897240113839, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753232, 0},
-    {0.832577431537388, -0.832577431537389, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, 0},
-    {0.411989591896581, -0.411989591896581, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, 0},
-    {0.496590457797377, -0.496590457797378, 0.693921283086782, 2.29925963250797, -0.693921283086782, -2.29925963250797, 0},
-    {0.628397215096318, -0.62839721509632, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, 0},
-    {0.777282956754789, -0.777282956754789, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, 0},
-    {0.909281373017809, -0.90928137301781, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, 0},
-    {0.809744306025695, -0.809744306025695, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, 0},
-    {0.837117624985641, -0.837117624985642, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, 0},
-    {0.879764805604937, -0.879764805604939, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, 0},
-    {0.92793803470385, -0.927938034703852, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, 0},
-    {0.97064722818672, -0.970647228186721, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, 0},
-    {0.144333375497977, 1.85228451823978, 0.13831575967286, 0.153733097585332, -0.13831575967286, -0.153733097585333, -1.99661789373776},
-    {0.267443674835656, 1.44190787062765, 0.693921283086783, 0.131614521121218, -0.693921283086783, -0.131614521121218, -1.70935154546331},
-    {0.459247495907997, 0.802547804781612, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -1.26179530068961},
-    {0.675904477222819, 0.0803420579669871, 2.53733389052355, 0.058228528732286, -2.53733389052355, -0.058228528732286, -0.756246535189806},
-    {0.86798719842446, -0.559947695327595, 3.40421685178807, 0.0237180419639914, -3.40421685178807, -0.0237180419639914, -0.308039503096864},
-    {0.285315354814272, 1.38233429996559, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175825, -1.66764965477986},
-    {0.388141663660971, 1.03957243407901, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -1.42771409773998},
-    {0.54834336124165, 0.505555085826084, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.05389844706773},
-    {0.729303344235153, -0.0976580618337189, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -0.631645282401434},
-    {0.889737989595075, -0.632451919681933, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.257286069913142},
-    {0.499155244893504, 0.669519062828043, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.16867430772155},
-    {0.571215023734067, 0.429314541944296, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.00052956567836},
-    {0.683482973707427, 0.0550798500280444, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -0.738562823735472},
-    {0.810298148731796, -0.367646653544983, 2.53733389052355, 0.640610911753232, -2.53733389052355, -0.640610911753233, -0.442651495186813},
-    {0.922729346473572, -0.742425516601205, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.180303829872367},
-    {0.72861515068299, -0.0953640331101723, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -0.633251117572818},
-    {0.767661046687841, -0.225519868906914, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.542141177780927},
-    {0.828493910316754, -0.428300519875884, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.40019339044087},
-    {0.897209249379815, -0.657356664129763, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.239852585250051},
-    {0.958130569502644, -0.860432176532975, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.0976983929696685},
-    {0.912191158303717, -0.707297453747673, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.204893704556044},
-    {0.924824785087998, -0.749410464883284, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.175414320204714},
-    {0.944507767781269, -0.815021843428607, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.129485924352662},
-    {0.966741191441727, -0.889134877965975, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.0776063134757529},
-    {0.986452794974706, -0.954841661398735, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0316111335759707},
-    {0.826059726268029, 2.53401086900983, 0.138315759672859, 0.153733097585331, -0.138315759672859, -0.153733097585332, -3.36007059527786},
-    {0.851085640044301, 2.0255498358363, 0.693921283086782, 0.131614521121218, -0.693921283086782, -0.131614521121218, -2.8766354758806},
-    {0.89007560200475, 1.23337591087837, 1.55954554826208, 0.0971541428643074, -1.55954554826208, -0.0971541428643075, -2.12345151288312},
-    {0.934117724902526, 0.338555305646693, 2.53733389052355, 0.0582285287322862, -2.53733389052355, -0.0582285287322862, -1.27267303054922},
-    {0.973164381799351, -0.454770511952705, 3.40421685178807, 0.0237180419639916, -3.40421685178807, -0.0237180419639916, -0.518393869846646},
-    {0.854718602717514, 1.95173754786883, 0.13831575967286, 0.764665295175824, -0.13831575967286, -0.764665295175824, -2.80645615058634},
-    {0.875621178318206, 1.52705194873624, 0.693921283086783, 0.654647946495179, -0.693921283086783, -0.654647946495179, -2.40267312705445},
-    {0.908187047234417, 0.865398771818851, 1.55954554826208, 0.483242727153489, -1.55954554826208, -0.483242727153489, -1.77358581905327},
-    {0.944972669198744, 0.118011263129871, 2.53733389052355, 0.289627515545326, -2.53733389052355, -0.289627515545326, -1.06298393232862},
-    {0.977585891838153, -0.544604017438855, 3.40421685178807, 0.117973057488944, -3.40421685178807, -0.117973057488944, -0.432981874399298},
-    {0.898188066116116, 1.06855188405065, 0.13831575967286, 1.6913204223926, -0.13831575967286, -1.6913204223926, -1.96673995016677},
-    {0.91283640847011, 0.77093592668034, 0.693921283086783, 1.44797919870299, -0.693921283086783, -1.44797919870299, -1.68377233515045},
-    {0.935658284876776, 0.307255161197392, 1.55954554826208, 1.06885757541731, -1.55954554826208, -1.06885757541731, -1.24291344607417},
-    {0.961437327351342, -0.216507474925437, 2.53733389052355, 0.640610911753233, -2.53733389052355, -0.640610911753233, -0.744929852425905},
-    {0.984292388833492, -0.680862474241285, 3.40421685178807, 0.260938011286713, -3.40421685178807, -0.260938011286713, -0.303429914592208},
-    {0.944832772922068, 0.120853589128905, 0.13831575967286, 2.6856634241203, -0.13831575967286, -2.6856634241203, -1.06568636205097},
-    {0.952770039194603, -0.0404108764001523, 0.693921283086783, 2.29925963250797, -0.693921283086783, -2.29925963250797, -0.912359162794451},
-    {0.965136169470714, -0.291658260721924, 1.55954554826208, 1.69724888193056, -1.55954554826208, -1.69724888193056, -0.673477908748791},
-    {0.979104652690648, -0.57546126081893, 2.53733389052355, 1.01723202298603, -2.53733389052355, -1.01723202298603, -0.403643391871719},
-    {0.991488764440297, -0.827073981595322, 3.40421685178807, 0.414345894247555, -3.40421685178807, -0.414345894247555, -0.164414782844975},
-    {0.982150181480284, -0.637338430571106, 0.13831575967286, 3.48117285237853, -0.13831575967286, -3.48117285237853, -0.344811750909179},
-    {0.984718350482276, -0.689516899489006, 0.693921283086783, 2.9803139668845, -0.693921283086783, -2.9803139668845, -0.29520145099327},
-    {0.98871951553826, -0.770810095671616, 1.55954554826208, 2.1999840629478, -1.55954554826208, -2.1999840629478, -0.217909419866644},
-    {0.993239135313952, -0.86263693409375, 2.53733389052355, 1.31854217888416, -2.53733389052355, -1.31854217888416, -0.130602201220202},
-    {0.99724611842635, -0.944048337947091, 3.40421685178807, 0.537077604585377, -3.40421685178807, -0.537077604585377, -0.0531977804792586}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc3[7] = {0, 1, 5, 6, 7, 8, 9};
-    
-    // Number of operations to compute geometry constants: 43
-    const double G0 = det*(Jinv_10*Jinv_20 + Jinv_11*Jinv_21 + Jinv_12*Jinv_22);
-    const double G1 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11 + Jinv_12*Jinv_12);
-    const double G2 = -Jinv_12*det;
-    const double G3 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11 + Jinv_02*Jinv_12);
-    const double G4 = -0.5*det*w[1][0]*w[2][0];
-    const double G5 = det*(Jinv_20*Jinv_20 + Jinv_21*Jinv_21 + Jinv_22*Jinv_22);
-    const double G6 = -Jinv_22*det;
-    const double G7 = det*(Jinv_00*Jinv_20 + Jinv_01*Jinv_21 + Jinv_02*Jinv_22);
-    const double G8 = -Jinv_02*det;
-    const double G9 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01 + Jinv_02*Jinv_02);
-    const double G10 = det*w[2][0];
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    // Total number of operations to compute element tensor: 25043
-    
-    // Loop quadrature points for integral
-    // Number of operations to compute element tensor for following IP loop = 25000
-    for (unsigned int ip = 0; ip < 125; ip++)
-    {
-      
-      // Function declarations
-      double F0 = 0;
-      double F1 = 0;
-      double F2 = 0;
-      double F3 = 0;
-      double F4 = 0;
-      
-      // Total number of operations to compute function values = 40
-      for (unsigned int r = 0; r < 10; r++)
-      {
-        F0 += FE1_C0[ip][r]*w[0][nzc4[r]];
-        F1 += FE1_C0[ip][r]*w[0][nzc0[r]];
-      }// end loop over 'r'
-      
-      // Total number of operations to compute function values = 42
-      for (unsigned int r = 0; r < 7; r++)
-      {
-        F2 += FE1_C0_D100[ip][r]*w[0][nzc3[r]];
-        F3 += FE1_C0_D010[ip][r]*w[0][nzc2[r]];
-        F4 += FE1_C0_D001[ip][r]*w[0][nzc1[r]];
-      }// end loop over 'r'
-      
-      // Number of operations to compute ip constants: 36
-      // Number of operations: 10
-      const double Gip0 = F0*F0*F0*W125[ip]*(G2 + F2*G3 + F3*G1 + F4*G0);
-      
-      // Number of operations: 4
-      const double Gip1 = W125[ip]*(F0*det + F1*G4);
-      
-      // Number of operations: 10
-      const double Gip2 = F0*F0*F0*W125[ip]*(G6 + F2*G7 + F3*G0 + F4*G5);
-      
-      // Number of operations: 10
-      const double Gip3 = F0*F0*F0*W125[ip]*(G8 + F2*G9 + F3*G3 + F4*G7);
-      
-      // Number of operations: 2
-      const double Gip4 = F1*G10*W125[ip];
-      
-      
-      // Number of operations for primary indices: 40
-      for (unsigned int j = 0; j < 10; j++)
-      {
-        // Number of operations to compute entry: 2
-        A[nzc4[j]] += FE1_C0[ip][j]*Gip1;
-        // Number of operations to compute entry: 2
-        A[nzc0[j]] += FE1_C0[ip][j]*Gip4;
-      }// end loop over 'j'
-      
-      // Number of operations for primary indices: 42
-      for (unsigned int j = 0; j < 7; j++)
-      {
-        // Number of operations to compute entry: 2
-        A[nzc2[j]] += FE1_C0_D010[ip][j]*Gip0;
-        // Number of operations to compute entry: 2
-        A[nzc1[j]] += FE1_C0_D001[ip][j]*Gip2;
-        // Number of operations to compute entry: 2
-        A[nzc3[j]] += FE1_C0_D100[ip][j]*Gip3;
-      }// end loop over 'j'
-    }// end loop over 'ip'
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -19479,29 +3050,15 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_cell_integral_0() : ufc::cell_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_cell_integral_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_cell_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_cell_integral_0();
 
   /// Tabulate the tensor for the contribution from a local cell
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
-                               const ufc::cell& c) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 20; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c);
-  }
+                               const ufc::cell& c) const;
 
 };
 
@@ -19514,245 +3071,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_exterior_facet_integral_0_quadrature();
 
   /// Destructor
-  virtual ~solitarywave3d_1_exterior_facet_integral_0_quadrature()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_exterior_facet_integral_0_quadrature();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Extract vertex coordinates
-    const double * const * x = c.coordinates;
-    
-    // Compute Jacobian of affine map from reference cell
-    
-    // Compute sub determinants
-    
-    
-    
-    // Compute determinant of Jacobian
-    
-    // Compute inverse of Jacobian
-    
-    // Vertices on faces
-    static unsigned int face_vertices[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
-    
-    // Get vertices
-    const unsigned int v0 = face_vertices[facet][0];
-    const unsigned int v1 = face_vertices[facet][1];
-    const unsigned int v2 = face_vertices[facet][2];
-    
-    // Compute scale factor (area of face scaled by area of reference triangle)
-    const double a0 = (x[v0][1]*x[v1][2] + x[v0][2]*x[v2][1] + x[v1][1]*x[v2][2])
-                  - (x[v2][1]*x[v1][2] + x[v2][2]*x[v0][1] + x[v1][1]*x[v0][2]);
-    const double a1 = (x[v0][2]*x[v1][0] + x[v0][0]*x[v2][2] + x[v1][2]*x[v2][0])
-                  - (x[v2][2]*x[v1][0] + x[v2][0]*x[v0][2] + x[v1][2]*x[v0][0]);
-    const double a2 = (x[v0][0]*x[v1][1] + x[v0][1]*x[v2][0] + x[v1][0]*x[v2][1])
-                  - (x[v2][0]*x[v1][1] + x[v2][1]*x[v0][0] + x[v1][0]*x[v0][1]);
-    const double det = std::sqrt(a0*a0 + a1*a1 + a2*a2);
-    
-    const bool direction = a0*(x[facet][0] - x[v0][0]) + a1*(x[facet][1] - x[v0][1])  + a2*(x[facet][2] - x[v0][2]) < 0;
-    // Compute facet normals from the facet scale factor constants
-    const double n2 = direction ? a2 / det : -a2 / det;
-    
-    
-    // Array of quadrature weights
-    static const double W25[25] = {0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0275289856644697, 0.0475518970579538, 0.0416389652151948, 0.021022967487322, 0.00447940679728133, 0.0231612219294983, 0.0400072873861603, 0.0350325045033716, 0.0176874521104834, 0.0037687016953276, 0.0114650803515925, 0.0198040831320473, 0.0173415064313656, 0.0087554991821638, 0.00186555216687783};
-    // Quadrature points on the UFC reference element: (0.0450425935698037, 0.0398098570514687), (0.0376212523451112, 0.198013417873608), (0.0263646449444709, 0.437974810247386), (0.0142857943955714, 0.695464273353636), (0.00462228846504642, 0.901464914201174), (0.221578609552379, 0.0398098570514687), (0.185070710267389, 0.198013417873608), (0.129695936782254, 0.437974810247386), (0.0702762920082817, 0.695464273353636), (0.022738483063764, 0.901464914201174), (0.480095071474266, 0.0398098570514687), (0.400993291063196, 0.198013417873608), (0.281012594876307, 0.437974810247386), (0.152267863323182, 0.695464273353636), (0.0492675428994132, 0.901464914201174), (0.738611533396152, 0.0398098570514687), (0.616915871859002, 0.198013417873608), (0.43232925297036, 0.437974810247386), (0.234259434638082, 0.695464273353636), (0.0757966027350624, 0.901464914201174), (0.915147549378728, 0.0398098570514687), (0.764365329781281, 0.198013417873608), (0.535660544808143, 0.437974810247386), (0.290249932250792, 0.695464273353636), (0.09391279733378, 0.901464914201174)
-    
-    // Value of basis functions at quadrature points.
-    static const double FE0_f0_C0[25][6] = \
-    {{0.759842524889053, -0.0409849230988147, -0.036640207614552, 0.00717255684496518, 0.145727572487076, 0.164882476492272},
-    {0.404143384962011, -0.0347905350890821, -0.119594790557632, 0.0297980510461638, 0.605418365816316, 0.115025523822223},
-    {0.0382038937201701, -0.0249744559383749, -0.0543309414249184, 0.0461882014671774, 0.938423301877432, 0.0564900002985142},
-    {-0.121759885907613, -0.0138776265525463, 0.271876837668966, 0.0397410384743819, 0.807433832894958, 0.0165858034218534},
-    {-0.0762735703276686, -0.00457955736373825, 0.723813068870285, 0.0166673234982245, 0.338636367163553, 0.00173636815934473},
-    {0.352482461135478, -0.123384449130048, -0.036640207614552, 0.0352840510877737, 0.117616078244268, 0.65464206627708},
-    {0.144254514044104, -0.116568374669637, -0.119594790557632, 0.146585935553368, 0.488630481309112, 0.456692234320685},
-    {-0.0585120870225411, -0.0960538647466012, -0.0543309414249184, 0.227214213208259, 0.75739729013635, 0.224285389849452},
-    {-0.124504469204174, -0.0603987775714152, 0.271876837668966, 0.19549860142211, 0.65167626994723, 0.0658515377372834},
-    {-0.0643063527627086, -0.0217044058396819, 0.723813068870285, 0.0819917787365634, 0.273311911925214, 0.00689399907032827},
-    {-0.0191125161665051, -0.0191125161665051, -0.036640207614552, 0.0764500646660208, 0.0764500646660208, 0.921965110615521},
-    {-0.0794020521078099, -0.07940205210781, -0.119594790557632, 0.31760820843124, 0.31760820843124, 0.643182477910772},
-    {-0.123076437918076, -0.123076437918076, -0.0543309414249184, 0.492305751672305, 0.492305751672305, 0.315872313916461},
-    {-0.105896858921167, -0.105896858921168, 0.271876837668966, 0.42358743568467, 0.42358743568467, 0.0927420088040289},
-    {-0.0444129613327221, -0.0444129613327222, 0.723813068870285, 0.177651845330889, 0.177651845330888, 0.0097091631333821},
-    {-0.123384449130048, 0.352482461135478, -0.036640207614552, 0.117616078244268, 0.0352840510877739, 0.65464206627708},
-    {-0.116568374669637, 0.144254514044103, -0.119594790557632, 0.488630481309112, 0.146585935553368, 0.456692234320685},
-    {-0.0960538647466012, -0.0585120870225412, -0.0543309414249184, 0.75739729013635, 0.227214213208259, 0.224285389849452},
-    {-0.0603987775714152, -0.124504469204174, 0.271876837668966, 0.65167626994723, 0.195498601422111, 0.0658515377372834},
-    {-0.0217044058396818, -0.0643063527627087, 0.723813068870285, 0.273311911925214, 0.0819917787365635, 0.00689399907032831},
-    {-0.0409849230988147, 0.759842524889053, -0.036640207614552, 0.145727572487076, 0.00717255684496533, 0.164882476492272},
-    {-0.0347905350890821, 0.404143384962011, -0.119594790557632, 0.605418365816316, 0.029798051046164, 0.115025523822223},
-    {-0.024974455938375, 0.0382038937201699, -0.0543309414249184, 0.938423301877431, 0.0461882014671778, 0.0564900002985144},
-    {-0.0138776265525463, -0.121759885907613, 0.271876837668966, 0.807433832894958, 0.0397410384743823, 0.0165858034218534},
-    {-0.00457955736373818, -0.0762735703276687, 0.723813068870285, 0.338636367163553, 0.0166673234982247, 0.00173636815934472}};
-    
-    // Array of non-zero columns
-    static const unsigned int nzc1[6] = {11, 12, 13, 14, 15, 16};
-    // Array of non-zero columns
-    static const unsigned int nzc0[6] = {1, 2, 3, 4, 5, 6};
-    // Array of non-zero columns
-    static const unsigned int nzc5[6] = {10, 11, 13, 15, 17, 19};
-    // Array of non-zero columns
-    static const unsigned int nzc4[6] = {0, 1, 3, 5, 7, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc2[6] = {0, 2, 3, 4, 7, 8};
-    // Array of non-zero columns
-    static const unsigned int nzc3[6] = {10, 12, 13, 14, 17, 18};
-    // Array of non-zero columns
-    static const unsigned int nzc6[6] = {0, 1, 2, 6, 8, 9};
-    // Array of non-zero columns
-    static const unsigned int nzc7[6] = {10, 11, 12, 16, 18, 19};
-    
-    // Number of operations to compute geometry constants: 1
-    // Should be added to total operation count.
-    const double G0 = det*n2;
-    
-    // Compute element tensor using UFL quadrature representation
-    // Optimisations: ('simplify expressions', True), ('ignore zero tables', True), ('non zero columns', True), ('remove zero terms', True), ('ignore ones', True)
-    switch ( facet )
-    {
-    case 0:
-      {
-      // Total number of operations to compute element tensor (from this point): 700
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 700
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc1[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 12
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc0[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 1:
-      {
-      // Total number of operations to compute element tensor (from this point): 700
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 700
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc3[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 12
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc2[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 2:
-      {
-      // Total number of operations to compute element tensor (from this point): 700
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 700
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc5[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 12
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc4[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    case 3:
-      {
-      // Total number of operations to compute element tensor (from this point): 700
-      
-      // Loop quadrature points for integral
-      // Number of operations to compute element tensor for following IP loop = 700
-      for (unsigned int ip = 0; ip < 25; ip++)
-      {
-        
-        // Function declarations
-        double F0 = 0;
-        
-        // Total number of operations to compute function values = 12
-        for (unsigned int r = 0; r < 6; r++)
-        {
-          F0 += FE0_f0_C0[ip][r]*w[0][nzc7[r]];
-        }// end loop over 'r'
-        
-        // Number of operations to compute ip constants: 4
-        // Number of operations: 4
-        const double Gip0 = F0*F0*F0*G0*W25[ip];
-        
-        
-        // Number of operations for primary indices: 12
-        for (unsigned int j = 0; j < 6; j++)
-        {
-          // Number of operations to compute entry: 2
-          A[nzc6[j]] += FE0_f0_C0[ip][j]*Gip0;
-        }// end loop over 'j'
-      }// end loop over 'ip'
-      }
-      break;
-    }
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -19769,30 +3097,16 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_1_exterior_facet_integral_0() : ufc::exterior_facet_integral()
-  {
-    // Do nothing
-  }
+  solitarywave3d_1_exterior_facet_integral_0();
 
   /// Destructor
-  virtual ~solitarywave3d_1_exterior_facet_integral_0()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_1_exterior_facet_integral_0();
 
   /// Tabulate the tensor for the contribution from a local exterior facet
   virtual void tabulate_tensor(double* A,
                                const double * const * w,
                                const ufc::cell& c,
-                               unsigned int facet) const
-  {
-    // Reset values of the element tensor block
-    for (unsigned int j = 0; j < 20; j++)
-      A[j] = 0;
-    
-    // Add all contributions to element tensor
-    integral_0_quadrature.tabulate_tensor(A, w, c, facet);
-  }
+                               unsigned int facet) const;
 
 };
 
@@ -19816,112 +3130,43 @@ public:
 public:
 
   /// Constructor
-  solitarywave3d_form_1() : ufc::form()
-  {
-    // Do nothing
-  }
+  solitarywave3d_form_1();
 
   /// Destructor
-  virtual ~solitarywave3d_form_1()
-  {
-    // Do nothing
-  }
+  virtual ~solitarywave3d_form_1();
 
   /// Return a string identifying the form
-  virtual const char* signature() const
-  {
-    return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Sum(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Product(IntValue(-1, (), (), {}), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Product(FloatValue(0.5, (), (), {}), Constant(Cell('tetrahedron', 1, Space(3)), 1))))))), Sum(Product(IntValue(-1, (), (), {}), Product(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Sum(Product(IndexSum(Product(Indexed(ComponentTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(0),), {Index(0): 3})), MultiIndex((Index(1),), {Index(1): 3})), Indexed(ComponentTensor(Indexed(SpatialDerivative(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((FixedIndex(0),), {})), MultiIndex((Index(2),), {Index(2): 3})), MultiIndex((Index(1),), {Index(1): 3}))), MultiIndex((Index(1),), {Index(1): 3})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {})))), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Constant(Cell('tetrahedron', 1, Space(3)), 2), Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2}))))))), Measure('cell', 0, None)), Integral(Product(Indexed(FacetNormal(Cell('tetrahedron', 1, Space(3))), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), Product(Indexed(BasisFunction(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 2})), Product(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), Power(Indexed(Function(MixedElement(*[FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2), FiniteElement('Lagrange', Cell('tetrahedron', 1, Space(3)), 2)], **{'value_shape': (2,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 2})), IntValue(2, (), (), {}))))), Measure('exterior_facet', 0, None))])";
-  }
+  virtual const char* signature() const;
 
   /// Return the rank of the global tensor (r)
-  virtual unsigned int rank() const
-  {
-    return 1;
-  }
+  virtual unsigned int rank() const;
 
   /// Return the number of coefficients (n)
-  virtual unsigned int num_coefficients() const
-  {
-    return 3;
-  }
+  virtual unsigned int num_coefficients() const;
 
   /// Return the number of cell integrals
-  virtual unsigned int num_cell_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_cell_integrals() const;
 
   /// Return the number of exterior facet integrals
-  virtual unsigned int num_exterior_facet_integrals() const
-  {
-    return 1;
-  }
+  virtual unsigned int num_exterior_facet_integrals() const;
 
   /// Return the number of interior facet integrals
-  virtual unsigned int num_interior_facet_integrals() const
-  {
-    return 0;
-  }
+  virtual unsigned int num_interior_facet_integrals() const;
 
   /// Create a new finite element for argument function i
-  virtual ufc::finite_element* create_finite_element(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_finite_element_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_finite_element_1();
-      break;
-    case 2:
-      return new solitarywave3d_1_finite_element_2();
-      break;
-    case 3:
-      return new solitarywave3d_1_finite_element_3();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::finite_element* create_finite_element(unsigned int i) const;
 
   /// Create a new dof map for argument function i
-  virtual ufc::dof_map* create_dof_map(unsigned int i) const
-  {
-    switch ( i )
-    {
-    case 0:
-      return new solitarywave3d_1_dof_map_0();
-      break;
-    case 1:
-      return new solitarywave3d_1_dof_map_1();
-      break;
-    case 2:
-      return new solitarywave3d_1_dof_map_2();
-      break;
-    case 3:
-      return new solitarywave3d_1_dof_map_3();
-      break;
-    }
-    return 0;
-  }
+  virtual ufc::dof_map* create_dof_map(unsigned int i) const;
 
   /// Create a new cell integral on sub domain i
-  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
-  {
-    return new solitarywave3d_1_cell_integral_0();
-  }
+  virtual ufc::cell_integral* create_cell_integral(unsigned int i) const;
 
   /// Create a new exterior facet integral on sub domain i
-  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const
-  {
-    return new solitarywave3d_1_exterior_facet_integral_0();
-  }
+  virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const;
 
   /// Create a new interior facet integral on sub domain i
-  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const
-  {
-    return 0;
-  }
+  virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const;
 
 };
 
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/main.cpp
--- a/MADDs-4/cpp/main.cpp	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/main.cpp	Sat Dec 05 22:52:18 2009 -0500
@@ -13,7 +13,6 @@
 
 
 #include <dolfin.h>
-#include <dolfin/fem/SparsityPatternBuilder.h>
 #include <math.h>
 #include "petscsnes.h"
 #include "SolitaryWave2D.h"
@@ -25,59 +24,6 @@
 #include "utils.h"
 
 using namespace dolfin;
-
-
-// Variable Time Step
-class TimeStep: public Function
-{
-public:
-
-  TimeStep(double& dt): dt(dt)
-  {
-    //do nothing
-  }
-
-
-  void eval(double* values, const double* x) const
-    {
-      values[0] = dt;
-    }
-
-private:
-  double& dt;
-};
-
-//user-defined constant Vector function 
-class Velocity : public Function, public Parametrized
-{
-  public:
-
-  Velocity(const std::vector<double>& v0 ) : v0(v0) {}
-
-  void eval(double *values, const double* x) const
-    {
-      for (dolfin::uint i= 0; i < v0.size(); i++) {
-	values[i] = v0[i];
-      }
-    }
-
-  unsigned int rank() const
-   {
-    return 1;
-  }
-
-  unsigned int dim( unsigned int i) const
-  {
-    return v0.size();
-  }  
-
-private:
-
-  const std::vector<double>& v0; // constant vector
-
-  
-};
-
 
 // Sub domain for  Dirichlet boundary condition on top boundary
 class TopBoundary: public SubDomain
@@ -95,118 +41,158 @@ private:
   dolfin::uint& dim;
 };
 
-// user-defined SemiLagrangianUpdater
+// user-defined velocity 
+class Velocity : public Expression
+{
+public:
+
+  Velocity(std::vector<double>& W) : Expression(W.size()), W(W) {}
+
+  void eval(double* values, const std::vector<double>& x) const
+    {
+      // Copy values
+      for (dolfin::uint i = 0; i < W.size(); i++)
+	values[i] = W[i];
+    }
+
+private:
+
+std::vector<double>& W; //constant velocity vector
+  
+};
+
+
+// user-defined SemiLagrangianUpdate
 //  takes a function u, and velocity  and returns g*, the value of the source term at the take off point
-class SemiLagrangianSource : public Function, public Parametrized
+class SemiLagrangianFunction : public Function
 {
   public:
 
   // Constructor
-  SemiLagrangianSource(Function& u, Function& Velocity, double& delta_t, double& h2, dolfin::uint& dim ) :  u(u), Velocity(Velocity), delta_t(delta_t), h2(h2), dim(dim) 
+  SemiLagrangianFunction(FunctionSpace& V, Function& u, Expression& Velocity, double& delta_t, double& h2, dolfin::uint& dim ) :  Function(V), u(u), Velocity(Velocity), delta_t(delta_t), h2(h2), dim(dim) 
   {
-    printf("Creating Semi-Lagrangian Source Function: dt=%g, h2=%g, dim=%d\n", delta_t, h2, dim );
-    //check that dimension is consistent with function (fix this to be more transparent later)
+    
+    //check that dimension is consistent with function
+    //FixME: this could be more transparent
+
     if ( dim != u.function_space().mesh().topology().dim() )
-      error("topological dimension (%d) does not match dim (%d) in SemiLagrangianSource",u.function_space().mesh().topology().dim(),dim);
-    // create new intersection_dectector on function_space of u
-    intersection_detector = new IntersectionDetector(u.function_space().mesh());  }
+      error("topological dimension (%d) does not match dim (%d) in SemiLagrangianFunction",u.function_space().mesh().topology().dim(),dim);
+
+    // Initialize intersection detector if not done before
+    if (!intersection_detector)
+      intersection_detector.reset(new IntersectionDetector(V.mesh()));
+    
+    // create new ufc_cell
+    ufc_cell_star = new UFCCell(V.mesh());
+
+    //create initialize x_star
+    x_star.reserve(dim);
+  }
   
   // Destructor 
-  ~SemiLagrangianSource()
+  ~SemiLagrangianFunction()
   {
-    delete intersection_detector;
+    delete ufc_cell_star;
   }
 
   void eval(double *values, const Data& data) const
-    {
-      double xStar[3], values0[2];
-      double hdt = 0.5*delta_t;
-      bool outside = false;
+  {
+    double values0[2];
+    bool outside = false;
+    
+    //Find take off point x_star
+    outside = findpoint(data); 
+    
+    if ( outside ) { // // if takeoff point out of bounds set p=0, phi=1. (should only be top inflow boundary)
+      values0[0]=0.;
+      values0[1]=1.;
+    } 
+    else {
+      const Cell cell_star(this->function_space().mesh(), cell_star_index);
+      ufc_cell_star->update(cell_star);
 
-      // initialize ufccell to current cell
-      UFCCell ufc_cell_star(data.cell());
-      dolfin::uint index=data.cell().index();
+      // evaluate solution u* at take off point
+      u.eval(values0, x_star, cell_star, *ufc_cell_star); 
+    }
+    
+    // return source term 
+    double pStar, fStar;
+    pStar = values0[0];
+    fStar = values0[1];
+    
+    // if bulk-viscosity exponent m=1 use this
+    //values[0] = fStar + hdt*h2*fStar*pStar;
 
-      //Find take off point xStar, and new cell, given data
-      findpoint(xStar, ufc_cell_star, index, outside, data); 
-
-      if ( outside ) { // // if takeoff point out of bounds set p=0, phi=1. (should only be top inflow boundary)
-	values0[0]=0.;
-	values0[1]=1.;
-      } 
-      else {
-	u.eval(values0, xStar, ufc_cell_star, index); // get solution u* at take off point
-      }
-
-      // return source term 
-      double pStar, fStar;
-      pStar = values0[0];
-      fStar = values0[1];
-
-      // if bulk-viscosity exponent m=1 use this
-      //values[0] = fStar + hdt*h2*fStar*pStar;
-
-      // if bulk-viscosity exponent m=0 use this
-      values[0] = fStar + hdt*h2*pStar;
-      
-    }
+    // if bulk-viscosity exponent m=0 use this
+    values[0] = fStar + .5*delta_t*h2*pStar;
+    
+  }
   
 private:
   
-  // Model parameters
+  // Functions and  parameters
   Function& u;
-  Function& Velocity; // velocity
+  Expression& Velocity; // velocity
   double&  delta_t; // timestep
   double& h2; // (h/del)^2 parameter
   dolfin::uint& dim;
+
   // Intersection detector, used for evaluation at arbitrary points
-  mutable IntersectionDetector* intersection_detector;
+  mutable boost::scoped_ptr<IntersectionDetector> intersection_detector;
 
-  // find takeoff point and cell data using a modified midpoint method
-  void findpoint(double* xStar, UFCCell& ufc_cell_star, dolfin::uint& index, bool& outside, const Data& data) const
+  // takeoff point and cell
+  mutable std::vector<double> x_star;
+  mutable dolfin::uint cell_star_index;
+  UFCCell* ufc_cell_star;
+
+
+// modified midpoint method
+  bool findpoint(const Data& data) const
   {
-    double const dt = delta_t, hdt = 0.5*delta_t;
-    double V[3];
-    unsigned int i,k, kMax = 1;
+    double V[dim];
+    unsigned int i, k, kMax = 1;
+    bool outside = false;
     
+    //evaluate Velocity at quadrature point
+    Velocity.eval(V, data); 
+
+    //set current cell and index
+    cell_star_index = data.cell().index();
+
+    //iterated mid-point rule (for constant velocity even one mid-evaluation is overkill)
+    for (k=0; k< kMax; ++k)  
+    {
+      for(i=0; i< dim; i++ )
+	x_star[i] = data.x[i] - 0.5*delta_t*V[i];
     
-    for (i=0; i<dim; i++)  
-      xStar[i] = data.x[i];
+      Velocity.eval(V, x_star);
+    }
+
+    for(i=0; i< dim; i++ )
+      x_star[i] = data.x[i] - delta_t*V[i];
+
+    outside = checkpoint();
     
-    //evaluate Velocity which is a constant function and doesn't require cell information
-    Velocity.eval(V, xStar);
-    
-    for (k=0; k< kMax; ++k)  //iterated mid-point rule half-time-step
-    {
-      for (i = 0; i<dim; i++)
-	xStar[i] = data.x[i] - hdt*V[i];
-      // don't really need to check mid-point for constant V
-      //checkpoint(xStar, ufc_cell_star, index, outside, data); 
-      // if (outside) 
-      // 	break;
-      Velocity.eval(V, xStar);
-    }
-    // take full time step
-    for (i = 0; i<dim; i++)
-      xStar[i] = data.x[i] - dt*V[i];
-
-    //check to see if outside domain
-    checkpoint(xStar, ufc_cell_star, index, outside, data);
+    return outside;
   }
 
-  //for point xStar: Find current cell or flag outside the domain
-  void checkpoint(double* xStar, UFCCell& ufc_cell_star, dolfin::uint& index, bool& outside, const Data& data) const
+  //for point x_star: Find current cell or flag outside the domain
+  bool checkpoint() const
   {
-    Point point(u.function_space().mesh().geometry().dim(), xStar);
-    std::vector<dolfin::uint> cells;
-    
-    // check if xStar is in the original cell
-    if ( data.cell().intersects(point) ) {
+    // set current point and cell
+    const double* _x = &x_star[0];
+    Point point(this->function_space().mesh().geometry().dim(), _x);
+    Cell cell_star(this->function_space().mesh(), cell_star_index);
+      
+    bool outside;
+
+    // check if x_star is in the current cell
+    if ( cell_star.intersects(point) ) {
       outside = false;
-      index = data.cell().index();
-      ufc_cell_star.update(data.cell());
+      cell_star_index = cell_star.index();
     } 
     else { // use the intersection_detector to find the current cell
+      std::vector<dolfin::uint> cells;
       intersection_detector->intersection(point, cells);
       //if no cells found then its outside the domain
       if (cells.size() < 1) {
@@ -214,155 +200,43 @@ private:
       }
       else {
 	outside = false;
-	index = cells[0];
-	const Cell cellstar(u.function_space().mesh(), index);
-	ufc_cell_star.update(cellstar);
+	cell_star_index = cells[0];
       }
     }
+    return outside;
   }
       
 };  
 
- 
-//User defined nonlinear problem 
-class SolitaryWave : public NonlinearProblem, public Parametrized
-{
-  public:
-
-  // Constructor 
-  SolitaryWave(FunctionSpace& V, Function& u, Vector& bStar, Function& dt, Function& hsquared, FacetNormal& n, DirichletBC& bc)   
-    :V(V), bc(bc), bStar(bStar), initialize_rows(true), reset_Jacobian(true)
-  {
-    printf("Creating SolitaryWave\n");
-    // Create forms
-    if (V.mesh().topology().dim() == 2 ) {
-      a = new SolitaryWave2DBilinearForm(V,V);
-      SolitaryWave2DBilinearForm* _a = dynamic_cast<SolitaryWave2DBilinearForm*>(a);
-      if (!_a) error("Problem in downcast of SolitaryWave2DBilinearForm");
-      _a->w0 = u;
-      _a->dt = dt;
-      _a->hsquared = hsquared;
-      _a->n = n;
-      L = new SolitaryWave2DLinearForm(V);
-      SolitaryWave2DLinearForm* _L = dynamic_cast<SolitaryWave2DLinearForm*>(L);
-      if (!_L) error("Problem in downcast of SolitaryWave2DLinearform");
-      _L->w4 =u;
-      _L->dt = dt;
-      _L->hsquared = hsquared;
-      _L-> n = n;
-    } else if ( V.mesh().topology().dim() == 3 ) {
-      a = new SolitaryWave3DBilinearForm(V,V);
-      SolitaryWave3DBilinearForm* _a = dynamic_cast<SolitaryWave3DBilinearForm*>(a);
-      if (!_a) error("Problem in downcast of SolitaryWave2DBilinearForm");
-      _a->w0 = u;
-      _a->dt = dt;
-      _a->hsquared = hsquared;
-      _a->n = n;
-      L = new SolitaryWave3DLinearForm(V);
-      SolitaryWave3DLinearForm* _L = dynamic_cast<SolitaryWave3DLinearForm*>(L);
-      if (!_L) error("Problem in downcast of SolitaryWave2DLinearform");
-      _L->w4 =u;
-      _L->dt = dt;
-      _L->hsquared = hsquared;
-      _L-> n = n;
-    } else {
-      error("can only handle 2 and 3-D meshes");
-    }
-
-  }
-
-  // Destructor 
-  ~SolitaryWave()
-  {
-    delete a; 
-    delete L;
-    delete [] values;
-    delete [] irows;
-  }
-  
-  
-// User defined assemble of  residual vector 
-  void F(GenericVector& b, const GenericVector& x)
-  {
-    // Assemble system and RHS (Neumann boundary conditions)
-    assemble(b, *L);
-    
-    //add in RHS vector
-    unsigned int size = bStar.size();
-        
-    if (initialize_rows) {  //allocate space for values and irows
-      printf("initialize_rows=%d\n",initialize_rows);
-      values = new double[size];
-      irows = new unsigned int[size]; 
-      for ( unsigned int i=0; i< size; ++i) //set rows to point to second vector
-      {
-	irows[i] = i+size;
-      }
-      initialize_rows = false;
-      printf("initialize_rows=%d\n",initialize_rows);
-    }
-     
-    bStar.get(values);
-    b.add(values, size, irows);
-    b.apply();
-    
-    dolfin_set("output destination", "silent");
-    bc.apply(b, x);
-    dolfin_set("output destination", "terminal");
-  }
-
-// User defined assemble of Jacobian 
-  void J(GenericMatrix& A,  const GenericVector& x)
-  {
-    // Assemble system and RHS (Neumann boundary conditions)
-    assemble(A, *a,reset_Jacobian);
-    reset_Jacobian = false;
-    dolfin_set("output destination", "terminal");
-    bc.apply(A);
-    dolfin_set("output destination", "terminal");
-  }
-
-  private:
-  
-  // Pointers to FunctionSpace, form, etc
-  FunctionSpace& V;
-  Form *a;
-  Form *L;
-  DirichletBC& bc;
-  
-  
-  // SemiLagrangian RHS vector
-  Vector& bStar;
-  
-  // Variables for vector update
-  double* values;
-  unsigned int* irows;
-  bool initialize_rows;
-  bool reset_Jacobian;
-
-  
-};
 
 
 
 int main(int argc, char* argv[])
 {
   dolfin_init(argc, argv);
-  
+  logging(false); //turn off xs dolfin info
+
   // Read Mesh from file
   std::string  filename;
   filename.reserve(PETSC_MAX_PATH_LEN);
+
+  //read mesh
   GetFilename("-mesh_file",filename);
   Mesh mesh(filename);  
-  mesh.init();
-  mesh.order();
+  mesh.init(); mesh.order();
+
+  //get dimension of problem from mesh
   dolfin::uint dim = mesh.topology().dim();
 
+  //get min and max element sizes
+  double dh = mesh.hmin(), dh_max = mesh.hmax();
+  printf("Mesh size: min=%g, max=%g\n",dh,dh_max);
+
   //set the FunctionSpaces
-  SolitaryWave2DFunctionSpace V2(mesh);
-  SolitaryWave3DFunctionSpace V3(mesh);
-  SemiLagrangianRHS2DFunctionSpace VStar2(mesh);
-  SemiLagrangianRHS3DFunctionSpace VStar3(mesh);
+  SolitaryWave2D::FunctionSpace V2(mesh);
+  SolitaryWave3D::FunctionSpace V3(mesh);
+  SemiLagrangianRHS2D::FunctionSpace VStar2(mesh);
+  SemiLagrangianRHS3D::FunctionSpace VStar3(mesh);
   FunctionSpace V(V2), VStar(VStar2);
 
   if (dim == 2 ) {
@@ -375,26 +249,12 @@ int main(int argc, char* argv[])
     error("can only handle 2 or 3-D meshes");
   }
   
-  MeshSize mesh_size(V);
-  double dh = mesh_size.min();
-  printf("Mesh size: min=%g, max=%g\n",dh,mesh_size.max());
-  
-    
-  
- // Solution functions
+  // Solution functions
   Function u(V), uWork(V);
 
   //   initial conditions and model parameters
   GetFilename("-uinit_vector_file",filename);
   Function u0(V,filename);
-
-//   Function p0,f0;
-//   File p0file("Pressureu0.pvd");
-//   File f0file("orosityu0.pvd");
-//   p0 = u0[0];
-//   f0 = u0[1];
-//   p0file << p0;
-//   f0file << f0;
 
 
   // set/read problem parameters
@@ -415,23 +275,17 @@ int main(int argc, char* argv[])
   PetscOptionsGetReal("-cfl",&cfl,PETSC_NULL);
   double delta_t0 = cfl*dh/c;
   double delta_t = delta_t0;
-  PetscReal tMax = 10.*delta_t0; //
-  PetscReal dtPlot = 2.*delta_t0;
-  PetscOptionsGetReal("-t_max",&tMax,PETSC_NULL);
-  PetscOptionsGetReal("-t_plot",&dtPlot,PETSC_NULL);
+  PetscReal t_max = 10.*delta_t0; //
+  PetscReal dt_plot = 2.*delta_t0;
+  PetscOptionsGetReal("-t_max",&t_max,PETSC_NULL);
+  PetscOptionsGetReal("-t_plot",&dt_plot,PETSC_NULL);
 
   printf("Delta t=%g, h/d squared=%g, c=%g\n\n",delta_t0,h2,c);
   
-  //Choose to use either Dolfin or PETScs non linear solvers
-  PetscErrorCode ierr;
-  PetscTruth use_SNES=PETSC_FALSE;
-  ierr = PetscOptionsGetTruth(PETSC_NULL,"-use_snes",&use_SNES,PETSC_NULL);
-
   // set functions
-  TimeStep dt(delta_t); 
+  Constant dt(delta_t); 
   Constant hsquared(h2);
   Velocity W(W0Vector);
-  FacetNormal n;
   
   
   //Dirichlet boundary conditions
@@ -443,10 +297,10 @@ int main(int argc, char* argv[])
   
   //set SemiLagrangian source function
   Vector bStar;
-  SemiLagrangianSource gStar(u0, W, delta_t, h2,dim);
-  SemiLagrangianRHS2DLinearForm LStar2(VStar2);
-  SemiLagrangianRHS3DLinearForm LStar3(VStar3);
-  Form LStar;
+  SemiLagrangianFunction gStar(VStar,u0, W, delta_t, h2,dim);
+  SemiLagrangianRHS2D::LinearForm LStar2(VStar2);
+  SemiLagrangianRHS3D::LinearForm LStar3(VStar3);
+  Form LStar(1,1);
   if (dim == 2 ) {
     LStar2.gStar = gStar;
     LStar = LStar2;
@@ -455,35 +309,15 @@ int main(int argc, char* argv[])
     LStar = LStar3;
   }
   
-  // Create user-defined nonlinear problems
-  SolitaryWave solitary_wave(V, u, bStar, dt, hsquared, n, bc);
-  //SolitaryWave solitary_wave_work(V, uWork, bStar, dt, hsquared, n, bc); //needed for PetscSNES (attach uWork, rather than u to A)
-  
-  // Create dolfin linear and nonlinear solver and set parameters
-
-  // Create linear solver for use in Newton solver
-  DefaultFactory factory;
-  KrylovSolver solver(gmres,amg_hypre);
-  solver.set("Krylov relative tolerance", 1e-4);
-  solver.set("Krylov absolute tolerance", 1e-14);
-  
-  NewtonSolver newton_solver(solver, factory);
-  
-  newton_solver.set("Newton convergence criterion", "residual");
-  newton_solver.set("Newton maximum iterations", 10);
-  newton_solver.set("Newton relative tolerance", 1e-8);
-  newton_solver.set("Newton absolute tolerance", 1e-15);
-  
- 
   //Create PETSc SNES nonlinear Solver
   SNES snes;
 
 
   //set forms for SNES
-  SolitaryWave2DBilinearForm aSNES2(V,V,uWork,dt,hsquared,n);
-  SolitaryWave2DLinearForm LSNES2(V,uWork,dt,hsquared,n);
-  SolitaryWave3DBilinearForm aSNES3(V,V,uWork,dt,hsquared,n);
-  SolitaryWave3DLinearForm LSNES3(V,uWork,dt,hsquared,n);
+  SolitaryWave2D::BilinearForm aSNES2(V,V,uWork,dt,hsquared);
+  SolitaryWave2D::LinearForm LSNES2(V,uWork,dt,hsquared);
+  SolitaryWave3D::BilinearForm aSNES3(V,V,uWork,dt,hsquared);
+  SolitaryWave3D::LinearForm LSNES3(V,uWork,dt,hsquared);
  
   //Create user context for SNES
   SNESCtx ctx = {  aSNES2,
@@ -497,19 +331,14 @@ int main(int argc, char* argv[])
     ctx.a = aSNES3;
     ctx.L = LSNES3;
   }
+
   //create PETSc vectors and matrices
   unsigned int xSize = uWork.vector().size();
   PETScVector x(xSize), r(xSize);
-  // allocate proper memory for Jacobian matrix
-  PETScMatrix J;  
-  UFC ufc(ctx.a); //create UFC from bilinear form
-  SparsityPattern pattern; //create empty sparsity pattern
-  SparsityPatternBuilder::build(pattern, ufc, ctx.a); // build sparsity pattern for jacobian
-  J.init(pattern);  // allocate memory for given sparsity pattern
-  
-  
-  
-   
+  // pre-allocate  memory for Sparse Jacobian matrix
+  PETScMatrix J; 
+  Assembler::assemble(J,ctx.a,true); //Assemble matrix once to set sparsity pattern
+ 
   //create SNES and attach call-back functions
   SNESCreate(PETSC_COMM_WORLD, &snes);
   SNESSetFunction(snes, *r.vec(), FormFunction, (void *) &ctx);
@@ -520,63 +349,59 @@ int main(int argc, char* argv[])
 
 
   // set up output files and functions
-  File pfile("Pressure.pvd");
-  File ffile("Porosity.pvd");
-  Function p;
-  Function f;
+  File pfile("Pressure.pvd","compressed");
+  File ffile("Porosity.pvd","compressed");
+  Function p = u[0], f = u[1];
 
     
   // initialize time and plotting parameters
-  double tPlot = 0.;
-  unsigned int nStep = 0, nPlot = 0;
+  double t_plot = 0.;
+  unsigned int n_step = 0, n_plot = 0;
   double t = 0.0; 
   bool reset_tensor = true;
+
   // start timing
   PetscLogDouble v1,v2,elapsedTime;
-  ierr = PetscGetTime(&v1);CHKERRQ(ierr);
+  PetscGetTime(&v1);
   char namestr[100];
   
   delta_t = 0.; //solve linear problem at first time step
 
   u = u0;
-  while( t < tMax)
+  while( t < t_max)
   {
     //solve for the current time 
     assemble(bStar,LStar,reset_tensor);
     reset_tensor = false;
 
     Initialize(u.vector());
-    //Choose non-linear solver
-    if (use_SNES) {
-      x = u.vector();
-      SNESSolve(snes, PETSC_NULL, *x.vec());
-      u.vector() = x;
-    } else {
-      newton_solver.solve(solitary_wave, u.vector());
-    }
+
+    //Solve using PETSc SNES
+    x = u.vector();
+    SNESSolve(snes, PETSC_NULL, *x.vec());
+    u.vector() = x;
+
     delta_t = delta_t0;
+    dt = delta_t;
 
-    if ( t >= tPlot) // Save function to file
+    if ( t >= t_plot) // Save function to file
     {
-      ierr = PetscGetTime(&v2);CHKERRQ(ierr);
-      elapsedTime = v2 -v1;
+      PetscGetTime(&v2);
+      elapsedTime = v2 - v1;
 
-      printf("\n**************Writing output files:n=%d t=%g (Wall clock=%g s, %g s/time_step)*********************\n\n",nStep,t,elapsedTime,elapsedTime/nStep);
-      sprintf(namestr,"u_vector_t%f_%4.4d.xml",t,nPlot);
+      printf("\n**************Writing output files:n=%d t=%g (Wall clock=%g s, %g s/time_step)*********************\n\n",n_step,t,elapsedTime,elapsedTime/n_step);
+      sprintf(namestr,"u_vector_t%f_%4.4d.xml",t,n_plot);
       filename.assign(namestr);
       File uFile(filename);
       uFile << u.vector();
-      tPlot += dtPlot;
-      nPlot += 1;
+      t_plot += dt_plot;
+      n_plot += 1;
     }
+
     // Update for next time step
     t += delta_t;
-    nStep += 1;
+    n_step += 1;
     u0 = u;
   }
- 
-
- 
-
   return 0;
 }
diff -r af01730383b0 -r 945ab07a21be MADDs-4/cpp/makeMADDs-4_Pn.py
--- a/MADDs-4/cpp/makeMADDs-4_Pn.py	Sat Dec 05 17:40:46 2009 -0500
+++ b/MADDs-4/cpp/makeMADDs-4_Pn.py	Sat Dec 05 22:52:18 2009 -0500
@@ -34,7 +34,7 @@ for form in forms[:]:
     target = 'forms/'+form+'_P%d.ufl' % (N)
     link =   form.replace(nm,'')+'.ufl'
     subprocess.call(['ln','-sf',target,link])
-    subprocess.call(['ffc','-l','dolfin','-f','split_implementation','-O',link])
+    subprocess.call(['ffc','-l','dolfin','-f','split','-O',link])
 
 print '\nRecompiling'
 subprocess.call(['rm','main.o'])



More information about the CIG-COMMITS mailing list