[cig-commits] commit: updated MADDS-1 forms and headers
Mercurial
hg at geodynamics.org
Wed Dec 9 20:51:06 PST 2009
changeset: 92:de7f60d82394
user: Marc Spiegelman <mspieg at ldeo.columbia.edu>
date: Sat Dec 05 06:00:28 2009 -0500
files: MADDs-1/cpp/Div.h MADDs-1/cpp/Stokes_AQP2_P1.h MADDs-1/cpp/Stokes_AQP2_P1.ufl MADDs-1/cpp/Stokes_P2P1.h MADDs-1/cpp/Stokes_P2P1.ufl
description:
updated MADDS-1 forms and headers
diff -r 6ed545ae2f2b -r de7f60d82394 MADDs-1/cpp/Div.h
--- a/MADDs-1/cpp/Div.h Sat Dec 05 06:00:01 2009 -0500
+++ b/MADDs-1/cpp/Div.h Sat Dec 05 06:00:28 2009 -0500
@@ -1,5 +1,5 @@
// This code conforms with the UFC specification version 1.0
-// and was automatically generated by FFC version 0.6.2.
+// and was automatically generated by FFC version 0.7.1.
//
// Warning: This code was generated with the option '-l dolfin'
// and contains DOLFIN-specific wrappers that depend on DOLFIN.
@@ -14,67 +14,67 @@
/// This class defines the interface for a finite element.
-class UFC_DivFunctional_finite_element_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+class div_0_finite_element_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -128,7 +128,7 @@ public:
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},
@@ -171,69 +171,69 @@ public:
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];
-
+
+ // 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];
@@ -285,7 +285,7 @@ public:
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},
@@ -295,7 +295,7 @@ public:
// 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},
@@ -303,7 +303,7 @@ public:
{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},
@@ -414,9 +414,9 @@ public:
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;
@@ -443,7 +443,7 @@ public:
// 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;
@@ -477,74 +477,74 @@ public:
/// 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 UFC_DivFunctional_finite_element_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_DivFunctional_finite_element_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new div_0_finite_element_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class div_0_finite_element_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -598,7 +598,7 @@ public:
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},
@@ -641,69 +641,69 @@ public:
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];
-
+
+ // 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];
@@ -755,7 +755,7 @@ public:
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},
@@ -765,7 +765,7 @@ public:
// 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},
@@ -773,7 +773,7 @@ public:
{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},
@@ -884,9 +884,9 @@ public:
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;
@@ -913,7 +913,7 @@ public:
// 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;
@@ -947,33 +947,33 @@ public:
/// 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 UFC_DivFunctional_finite_element_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_DivFunctional_finite_element_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new div_0_finite_element_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class div_0_finite_element_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -1014,7 +1014,7 @@ public:
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;
@@ -1071,7 +1071,7 @@ public:
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},
@@ -1123,7 +1123,7 @@ public:
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},
@@ -1168,69 +1168,69 @@ public:
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];
-
+
+ // 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];
@@ -1284,7 +1284,7 @@ public:
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},
@@ -1294,7 +1294,7 @@ public:
// 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},
@@ -1302,7 +1302,7 @@ public:
{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},
@@ -1430,7 +1430,7 @@ public:
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},
@@ -1440,7 +1440,7 @@ public:
// 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},
@@ -1448,7 +1448,7 @@ public:
{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},
@@ -1561,9 +1561,9 @@ public:
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}}};
+ 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;
@@ -1590,7 +1590,7 @@ public:
// 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;
@@ -1628,83 +1628,83 @@ public:
/// 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 UFC_DivFunctional_finite_element_0_0();
- break;
- case 1:
- return new UFC_DivFunctional_finite_element_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_DivFunctional_finite_element_1_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_1_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 1;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new div_0_finite_element_0_0();
+ break;
+ case 1:
+ return new div_0_finite_element_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class div_0_finite_element_1_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_1_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 1;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -1744,7 +1744,7 @@ public:
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
@@ -1777,69 +1777,69 @@ public:
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];
-
+
+ // 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];
@@ -1877,15 +1877,15 @@ public:
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
@@ -1961,9 +1961,9 @@ public:
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}}};
+ 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;
@@ -1990,7 +1990,7 @@ public:
// 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;
@@ -2024,74 +2024,74 @@ public:
/// 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 UFC_DivFunctional_finite_element_1_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_DivFunctional_finite_element_1_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_1_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 1;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new div_0_finite_element_1_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class div_0_finite_element_1_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_1_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 1;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -2131,7 +2131,7 @@ public:
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
@@ -2164,69 +2164,69 @@ public:
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];
-
+
+ // 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];
@@ -2264,15 +2264,15 @@ public:
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
@@ -2348,9 +2348,9 @@ public:
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}}};
+ 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;
@@ -2377,7 +2377,7 @@ public:
// 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;
@@ -2411,74 +2411,74 @@ public:
/// 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 UFC_DivFunctional_finite_element_1_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_DivFunctional_finite_element_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_finite_element_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_finite_element_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0), FiniteElement('Discontinuous Lagrange', 'triangle', 0)])";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 2;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 1;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 2;
- }
-
- /// 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];
-
+ return new div_0_finite_element_1_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class div_0_finite_element_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ div_0_finite_element_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_finite_element_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0, 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 1;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 2;
+ }
+
+ /// 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;
@@ -2521,7 +2521,7 @@ public:
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
@@ -2549,7 +2549,7 @@ public:
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
@@ -2584,69 +2584,69 @@ public:
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];
-
+
+ // 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];
@@ -2686,15 +2686,15 @@ public:
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
@@ -2773,15 +2773,15 @@ public:
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
@@ -2859,9 +2859,9 @@ public:
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}}};
+ static const double X[2][1][2] = {{{0.333333333333333, 0.333333333333333}}, {{0.333333333333333, 0.333333333333333}}};
+ static const double W[2][1] = {{1}, {1}};
+ static const double D[2][1][2] = {{{1, 0}}, {{0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -2888,7 +2888,7 @@ public:
// 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;
@@ -2926,53 +2926,53 @@ public:
/// 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 UFC_DivFunctional_finite_element_1_0();
- break;
- case 1:
- return new UFC_DivFunctional_finite_element_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new div_0_finite_element_1_0();
+ break;
+ case 1:
+ return new div_0_finite_element_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -3013,8 +3013,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -3055,7 +3061,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -3110,44 +3116,44 @@ public:
/// 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 UFC_DivFunctional_dof_map_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new div_0_dof_map_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -3188,8 +3194,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -3230,7 +3242,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -3285,44 +3297,44 @@ public:
/// 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 UFC_DivFunctional_dof_map_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new div_0_dof_map_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -3363,8 +3375,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -3413,7 +3431,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -3489,53 +3507,53 @@ public:
/// 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 UFC_DivFunctional_dof_map_0_0();
- break;
- case 1:
- return new UFC_DivFunctional_dof_map_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_1_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_1_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new div_0_dof_map_0_0();
+ break;
+ case 1:
+ return new div_0_dof_map_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_1_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_1_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_1_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -3576,8 +3594,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 1;
}
@@ -3612,7 +3636,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
@@ -3651,44 +3675,44 @@ public:
/// 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 UFC_DivFunctional_dof_map_1_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_1_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_1_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new div_0_dof_map_1_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_1_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_1_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_1_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -3729,8 +3753,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 1;
}
@@ -3765,7 +3795,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
@@ -3804,44 +3834,44 @@ public:
/// 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 UFC_DivFunctional_dof_map_1_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_DivFunctional_dof_map_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_dof_map_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_dof_map_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new div_0_dof_map_1_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class div_0_dof_map_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ div_0_dof_map_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~div_0_dof_map_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0, 2)";
+ }
+
+ /// 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;
@@ -3882,8 +3912,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 2;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 2;
}
@@ -3920,7 +3956,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
@@ -3961,13 +3997,13 @@ public:
/// 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 UFC_DivFunctional_dof_map_1_0();
- break;
- case 1:
- return new UFC_DivFunctional_dof_map_1_1();
+ switch ( i )
+ {
+ case 0:
+ return new div_0_dof_map_1_0();
+ break;
+ case 1:
+ return new div_0_dof_map_1_1();
break;
}
return 0;
@@ -3979,18 +4015,18 @@ public:
/// exterior facet tensor corresponding to the local contribution to
/// a form from the integral over an exterior facet.
-class UFC_DivFunctional_exterior_facet_integral_0_quadrature: public ufc::exterior_facet_integral
-{
-public:
-
- /// Constructor
- UFC_DivFunctional_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_exterior_facet_integral_0_quadrature()
+class div_0_exterior_facet_integral_0_quadrature: public ufc::exterior_facet_integral
+{
+public:
+
+ /// Constructor
+ div_0_exterior_facet_integral_0_quadrature() : ufc::exterior_facet_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_exterior_facet_integral_0_quadrature()
{
// Do nothing
}
@@ -4005,9 +4041,9 @@ public:
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
@@ -4023,30 +4059,35 @@ public:
const double det = std::sqrt(dx0*dx0 + dx1*dx1);
+ // Compute facet normals from the facet scale factor constants
+
+
// Array of quadrature weights
- const static double W2[2] = {0.5, 0.5};
-
-
- const static double FE1_f0_C0[2][3] = \
+ static const double W2[2] = {0.5, 0.5};
+ // Quadrature points on the UFC reference element: (0.211324865405187), (0.788675134594813)
+
+ // Value of basis functions at quadrature points.
+ static const double FE1_f0_C0[2][3] = \
{{0.45534180126148, -0.122008467928146, 0.666666666666667},
{-0.122008467928146, 0.45534180126148, 0.666666666666667}};
+
// Array of non-zero columns
static const unsigned int nzc2[3] = {1, 2, 3};
// Array of non-zero columns
static const unsigned int nzc3[3] = {7, 8, 9};
// Array of non-zero columns
- static const unsigned int nzc4[3] = {0, 1, 5};
- // Array of non-zero columns
- static const unsigned int nzc5[3] = {6, 7, 11};
- // Array of non-zero columns
- static const unsigned int nzc6[3] = {6, 8, 10};
- // Array of non-zero columns
- static const unsigned int nzc7[3] = {0, 2, 4};
+ static const unsigned int nzc6[3] = {0, 1, 5};
+ // Array of non-zero columns
+ static const unsigned int nzc7[3] = {6, 7, 11};
+ // Array of non-zero columns
+ static const unsigned int nzc5[3] = {6, 8, 10};
+ // Array of non-zero columns
+ static const unsigned int nzc4[3] = {0, 2, 4};
// Number of operations to compute geometry constants: 2
// Should be added to total operation count.
- const double G0 = det*w[1][0];
- const double G1 = det*w[1][1];
+ const double G0 = det*w[1][1];
+ const double G1 = det*w[1][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)
@@ -4074,11 +4115,11 @@ public:
// Number of operations to compute ip constants: 4
// Number of operations: 4
- const double Gip0 = W2[ip]*(F0*G0 + F1*G1);
-
-
- // Number of operations for primary indices = 1
- // Number of operations to compute entry = 1
+ const double Gip0 = W2[ip]*(F0*G1 + F1*G0);
+
+
+ // Number of operations for primary indices: 1
+ // Number of operations to compute entry: 1
A[0] += Gip0;
}// end loop over 'ip'
}
@@ -4099,17 +4140,17 @@ public:
// Total number of operations to compute function values = 12
for (unsigned int r = 0; r < 3; r++)
{
- F0 += FE1_f0_C0[ip][r]*w[0][nzc7[r]];
- F1 += FE1_f0_C0[ip][r]*w[0][nzc6[r]];
+ F0 += FE1_f0_C0[ip][r]*w[0][nzc4[r]];
+ F1 += FE1_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 = W2[ip]*(F0*G0 + F1*G1);
-
-
- // Number of operations for primary indices = 1
- // Number of operations to compute entry = 1
+ const double Gip0 = W2[ip]*(F0*G1 + F1*G0);
+
+
+ // Number of operations for primary indices: 1
+ // Number of operations to compute entry: 1
A[0] += Gip0;
}// end loop over 'ip'
}
@@ -4130,17 +4171,17 @@ public:
// Total number of operations to compute function values = 12
for (unsigned int r = 0; r < 3; r++)
{
- F0 += FE1_f0_C0[ip][r]*w[0][nzc4[r]];
- F1 += FE1_f0_C0[ip][r]*w[0][nzc5[r]];
+ F0 += FE1_f0_C0[ip][r]*w[0][nzc6[r]];
+ F1 += FE1_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 = W2[ip]*(F0*G0 + F1*G1);
-
-
- // Number of operations for primary indices = 1
- // Number of operations to compute entry = 1
+ const double Gip0 = W2[ip]*(F0*G1 + F1*G0);
+
+
+ // Number of operations for primary indices: 1
+ // Number of operations to compute entry: 1
A[0] += Gip0;
}// end loop over 'ip'
}
@@ -4154,22 +4195,22 @@ public:
/// exterior facet tensor corresponding to the local contribution to
/// a form from the integral over an exterior facet.
-class UFC_DivFunctional_exterior_facet_integral_0: public ufc::exterior_facet_integral
-{
-private:
-
- UFC_DivFunctional_exterior_facet_integral_0_quadrature integral_0_quadrature;
-
-public:
-
- /// Constructor
- UFC_DivFunctional_exterior_facet_integral_0() : ufc::exterior_facet_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional_exterior_facet_integral_0()
+class div_0_exterior_facet_integral_0: public ufc::exterior_facet_integral
+{
+private:
+
+ div_0_exterior_facet_integral_0_quadrature integral_0_quadrature;
+
+public:
+
+ /// Constructor
+ div_0_exterior_facet_integral_0() : ufc::exterior_facet_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_0_exterior_facet_integral_0()
{
// Do nothing
}
@@ -4204,18 +4245,18 @@ public:
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
-class UFC_DivFunctional: public ufc::form
-{
-public:
-
- /// Constructor
- UFC_DivFunctional() : ufc::form()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_DivFunctional()
+class div_form_0: public ufc::form
+{
+public:
+
+ /// Constructor
+ div_form_0() : ufc::form()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~div_form_0()
{
// Do nothing
}
@@ -4223,7 +4264,7 @@ public:
/// Return a string identifying the form
virtual const char* signature() const
{
- return "Form([Integral(IndexSum(Product(Indexed(Function(VectorElement('Lagrange', Cell('triangle', 1), 2, 2), 0), MultiIndex((Index(0),))), Indexed(VectorConstant(Cell('triangle', 1), 2, 1), MultiIndex((Index(0),)))), MultiIndex((Index(0),))), Measure('exterior_facet', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 3}))])";
+ return "Form([Integral(IndexSum(Product(Indexed(Function(VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), 0), MultiIndex((Index(0),), {Index(0): 2})), Indexed(VectorConstant(Cell('triangle', 1, Space(2)), 2, 1), MultiIndex((Index(0),), {Index(0): 2}))), MultiIndex((Index(0),), {Index(0): 2})), Measure('exterior_facet', 0, None))])";
}
/// Return the rank of the global tensor (r)
@@ -4243,44 +4284,44 @@ public:
{
return 0;
}
-
+
/// Return the number of exterior facet integrals
virtual unsigned int num_exterior_facet_integrals() const
{
return 1;
}
-
+
/// Return the number of interior facet integrals
virtual unsigned int num_interior_facet_integrals() const
{
return 0;
}
-
+
/// 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 UFC_DivFunctional_finite_element_0();
- break;
- case 1:
- return new UFC_DivFunctional_finite_element_1();
- break;
- }
- return 0;
- }
-
+ switch ( i )
+ {
+ case 0:
+ return new div_0_finite_element_0();
+ break;
+ case 1:
+ return new div_0_finite_element_1();
+ break;
+ }
+ return 0;
+ }
+
/// 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 UFC_DivFunctional_dof_map_0();
- break;
- case 1:
- return new UFC_DivFunctional_dof_map_1();
+ switch ( i )
+ {
+ case 0:
+ return new div_0_dof_map_0();
+ break;
+ case 1:
+ return new div_0_dof_map_1();
break;
}
return 0;
@@ -4295,7 +4336,7 @@ public:
/// 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 UFC_DivFunctional_exterior_facet_integral_0();
+ return new div_0_exterior_facet_integral_0();
}
/// Create a new interior facet integral on sub domain i
@@ -4308,145 +4349,218 @@ public:
// DOLFIN wrappers
-#include <dolfin/fem/Form.h>
+// Standard library includes
+#include <string>
+
+// DOLFIN includes
+#include <dolfin/common/NoDeleter.h>
#include <dolfin/fem/FiniteElement.h>
#include <dolfin/fem/DofMap.h>
-#include <dolfin/function/Coefficient.h>
-#include <dolfin/function/Function.h>
+#include <dolfin/fem/Form.h>
#include <dolfin/function/FunctionSpace.h>
-
-class DivFunctionalCoefficientSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- DivFunctionalCoefficientSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_DivFunctional_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_DivFunctional_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class DivFunctionalCoefficientSpace1 : public dolfin::FunctionSpace
-{
-public:
-
- DivFunctionalCoefficientSpace1(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_DivFunctional_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_DivFunctional_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class DivFunctionalCoefficient0 : public dolfin::Coefficient
-{
-public:
-
- // Constructor
- DivFunctionalCoefficient0(dolfin::Form& form) : dolfin::Coefficient(form) {}
-
- // Destructor
- ~DivFunctionalCoefficient0() {}
-
- // Attach function to coefficient
- const DivFunctionalCoefficient0& operator= (dolfin::Function& v)
- {
- attach(v);
- return *this;
- }
-
- /// Create function space for coefficient
- const dolfin::FunctionSpace* create_function_space() const
- {
- return new DivFunctionalCoefficientSpace0(form.mesh());
- }
-
- /// Return coefficient number
- dolfin::uint number() const
- {
- return 0;
- }
-
- /// Return coefficient name
- virtual std::string name() const
- {
- return "u";
- }
-
-};
-class DivFunctionalCoefficient1 : public dolfin::Coefficient
-{
-public:
-
- // Constructor
- DivFunctionalCoefficient1(dolfin::Form& form) : dolfin::Coefficient(form) {}
-
- // Destructor
- ~DivFunctionalCoefficient1() {}
-
- // Attach function to coefficient
- const DivFunctionalCoefficient1& operator= (dolfin::Function& v)
- {
- attach(v);
- return *this;
- }
-
- /// Create function space for coefficient
- const dolfin::FunctionSpace* create_function_space() const
- {
- return new DivFunctionalCoefficientSpace1(form.mesh());
- }
-
- /// Return coefficient number
- dolfin::uint number() const
- {
- return 1;
- }
-
- /// Return coefficient name
- virtual std::string name() const
- {
- return "n";
- }
-
-};
-class DivFunctional : public dolfin::Form
-{
-public:
-
- // Create form
- DivFunctional() : dolfin::Form(), u(*this), n(*this)
- {
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_DivFunctional());
- }
-
- // Create form with given coefficient(s)
- DivFunctional(dolfin::Function& w0, dolfin::Function& w1) : dolfin::Form(), u(*this), n(*this)
- {
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->u = w0;
- this->n = w1;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_DivFunctional());
+#include <dolfin/function/GenericFunction.h>
+#include <dolfin/function/CoefficientAssigner.h>
+
+namespace Div
+{
+
+class CoefficientSpace_n: public dolfin::FunctionSpace
+{
+public:
+
+ CoefficientSpace_n(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_n(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_n(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_n(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~CoefficientSpace_n()
+ {
+ }
+
+};
+
+class CoefficientSpace_u: public dolfin::FunctionSpace
+{
+public:
+
+ CoefficientSpace_u(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_u(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_u(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_u(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new div_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new div_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~CoefficientSpace_u()
+ {
+ }
+
+};
+
+typedef CoefficientSpace_u Form_0_FunctionSpace_0;
+
+typedef CoefficientSpace_n Form_0_FunctionSpace_1;
+
+class Form_0: public dolfin::Form
+{
+public:
+
+ // Constructor
+ Form_0(const dolfin::Mesh& mesh):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = reference_to_no_delete_pointer(mesh);
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::Mesh& mesh, const dolfin::GenericFunction& u, const dolfin::GenericFunction& n):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = reference_to_no_delete_pointer(mesh);
+ this->u = u;
+ this->n = n;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::Mesh& mesh, boost::shared_ptr<const dolfin::GenericFunction> u, boost::shared_ptr<const dolfin::GenericFunction> n):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = reference_to_no_delete_pointer(mesh);
+ this->u = *u;
+ this->n = *n;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = mesh;
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::Mesh> mesh, const dolfin::GenericFunction& u, const dolfin::GenericFunction& n):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = mesh;
+ this->u = u;
+ this->n = n;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::Mesh> mesh, boost::shared_ptr<const dolfin::GenericFunction> u, boost::shared_ptr<const dolfin::GenericFunction> n):
+ dolfin::Form(0, 2), u(*this, 0), n(*this, 1)
+ {
+ _mesh = mesh;
+ this->u = *u;
+ this->n = *n;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new div_form_0());
}
// Destructor
- ~DivFunctional() {}
+ ~Form_0()
+ {}
+
+ /// Return the number of the coefficient with this name
+ virtual dolfin::uint coefficient_number(const std::string& name) const
+ {
+ if (name == "u")
+ return 0;
+ else if (name == "n")
+ return 1;
+
+ dolfin::error("Invalid coefficient.");
+ return 0;
+ }
+
+ /// Return the name of the coefficient with this number
+ virtual std::string coefficient_name(dolfin::uint i) const
+ {
+ switch (i)
+ {
+ case 0:
+ return "u";
+ case 1:
+ return "n";
+ }
+
+ dolfin::error("Invalid coefficient.");
+ return "unnamed";
+ }
+
+ // Typedefs
+ typedef Form_0_FunctionSpace_0 CoefficientSpace_u;
+ typedef Form_0_FunctionSpace_1 CoefficientSpace_n;
// Coefficients
- DivFunctionalCoefficient0 u;
- DivFunctionalCoefficient1 n;
-
-};
+ dolfin::CoefficientAssigner u;
+ dolfin::CoefficientAssigner n;
+};
+
+// Class typedefs
+typedef Form_0 Functional;
+
+} // namespace Div
#endif
diff -r 6ed545ae2f2b -r de7f60d82394 MADDs-1/cpp/Stokes_AQP2_P1.h
--- a/MADDs-1/cpp/Stokes_AQP2_P1.h Sat Dec 05 06:00:01 2009 -0500
+++ b/MADDs-1/cpp/Stokes_AQP2_P1.h Sat Dec 05 06:00:28 2009 -0500
@@ -1,5 +1,5 @@
// This code conforms with the UFC specification version 1.0
-// and was automatically generated by FFC version 0.6.2.
+// and was automatically generated by FFC version 0.7.1.
//
// Warning: This code was generated with the option '-l dolfin'
// and contains DOLFIN-specific wrappers that depend on DOLFIN.
@@ -14,67 +14,67 @@
/// This class defines the interface for a finite element.
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+class stokes_aqp2_p1_0_finite_element_0_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_0_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -128,7 +128,7 @@ public:
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},
@@ -171,69 +171,69 @@ public:
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];
-
+
+ // 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];
@@ -285,7 +285,7 @@ public:
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},
@@ -295,7 +295,7 @@ public:
// 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},
@@ -303,7 +303,7 @@ public:
{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},
@@ -414,9 +414,9 @@ public:
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;
@@ -443,7 +443,7 @@ public:
// 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;
@@ -477,74 +477,74 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_aqp2_p1_0_finite_element_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_0_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_0_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -598,7 +598,7 @@ public:
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},
@@ -641,69 +641,69 @@ public:
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];
-
+
+ // 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];
@@ -755,7 +755,7 @@ public:
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},
@@ -765,7 +765,7 @@ public:
// 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},
@@ -773,7 +773,7 @@ public:
{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},
@@ -884,9 +884,9 @@ public:
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;
@@ -913,7 +913,7 @@ public:
// 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;
@@ -947,33 +947,33 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_aqp2_p1_0_finite_element_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -1014,7 +1014,7 @@ public:
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;
@@ -1071,7 +1071,7 @@ public:
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},
@@ -1123,7 +1123,7 @@ public:
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},
@@ -1168,69 +1168,69 @@ public:
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];
-
+
+ // 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];
@@ -1284,17 +1284,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -1302,7 +1302,7 @@ public:
{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},
@@ -1430,17 +1430,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -1448,7 +1448,7 @@ public:
{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},
@@ -1561,9 +1561,9 @@ public:
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}}};
+ 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;
@@ -1590,7 +1590,7 @@ public:
// 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;
@@ -1628,83 +1628,83 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 3;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_finite_element_0_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_finite_element_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 3;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -1750,7 +1750,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -1787,69 +1787,69 @@ public:
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];
-
+
+ // 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];
@@ -1893,19 +1893,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -1995,9 +1995,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[3][1] = {{1}, {1}, {1}};
- const static double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
+ static const double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[3][1] = {{1}, {1}, {1}};
+ static const double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -2024,7 +2024,7 @@ public:
// 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;
@@ -2058,33 +2058,33 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
+ return new stokes_aqp2_p1_0_finite_element_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
}
/// Return the cell shape
@@ -2125,7 +2125,7 @@ public:
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;
@@ -2183,7 +2183,7 @@ public:
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},
@@ -2235,7 +2235,7 @@ public:
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},
@@ -2279,7 +2279,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -2318,69 +2318,69 @@ public:
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];
-
+
+ // 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];
@@ -2434,17 +2434,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -2452,7 +2452,7 @@ public:
{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},
@@ -2580,17 +2580,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -2598,7 +2598,7 @@ public:
{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},
@@ -2718,19 +2718,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -2822,9 +2822,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
- const static double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
+ static const double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+ static const double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -2851,7 +2851,7 @@ public:
// Take directional components
for(int k = 0; k < 3; k++)
result += values[k]*D[i][0][k];
- // Multiply by weights
+ // Multiply by weights
result *= W[i][0];
return result;
@@ -2893,83 +2893,83 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_finite_element_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_finite_element_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_1_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_1_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_1_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -3023,7 +3023,7 @@ public:
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},
@@ -3066,69 +3066,69 @@ public:
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];
-
+
+ // 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];
@@ -3180,7 +3180,7 @@ public:
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},
@@ -3190,7 +3190,7 @@ public:
// 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},
@@ -3198,7 +3198,7 @@ public:
{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},
@@ -3309,9 +3309,9 @@ public:
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;
@@ -3338,7 +3338,7 @@ public:
// 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;
@@ -3372,74 +3372,74 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_aqp2_p1_0_finite_element_1_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_1_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_1_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_1_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -3493,7 +3493,7 @@ public:
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},
@@ -3536,69 +3536,69 @@ public:
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];
-
+
+ // 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];
@@ -3650,7 +3650,7 @@ public:
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},
@@ -3660,7 +3660,7 @@ public:
// 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},
@@ -3668,7 +3668,7 @@ public:
{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},
@@ -3779,9 +3779,9 @@ public:
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;
@@ -3808,7 +3808,7 @@ public:
// 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;
@@ -3842,33 +3842,33 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_aqp2_p1_0_finite_element_1_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_1_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_1_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -3909,7 +3909,7 @@ public:
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;
@@ -3966,7 +3966,7 @@ public:
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},
@@ -4018,7 +4018,7 @@ public:
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},
@@ -4063,69 +4063,69 @@ public:
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];
-
+
+ // 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];
@@ -4179,17 +4179,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -4197,7 +4197,7 @@ public:
{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},
@@ -4325,17 +4325,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -4343,7 +4343,7 @@ public:
{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},
@@ -4456,9 +4456,9 @@ public:
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}}};
+ 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;
@@ -4485,7 +4485,7 @@ public:
// 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;
@@ -4523,83 +4523,83 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 3;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_finite_element_1_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_finite_element_1_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_1_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_1_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 3;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -4645,7 +4645,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -4682,69 +4682,69 @@ public:
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];
-
+
+ // 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];
@@ -4788,19 +4788,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -4890,9 +4890,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[3][1] = {{1}, {1}, {1}};
- const static double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
+ static const double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[3][1] = {{1}, {1}, {1}};
+ static const double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -4919,7 +4919,7 @@ public:
// 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;
@@ -4953,33 +4953,33 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
+ return new stokes_aqp2_p1_0_finite_element_1_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
}
/// Return the cell shape
@@ -5020,7 +5020,7 @@ public:
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;
@@ -5078,7 +5078,7 @@ public:
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},
@@ -5130,7 +5130,7 @@ public:
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},
@@ -5174,7 +5174,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -5213,69 +5213,69 @@ public:
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];
-
+
+ // 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];
@@ -5329,17 +5329,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -5347,7 +5347,7 @@ public:
{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},
@@ -5475,17 +5475,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -5493,7 +5493,7 @@ public:
{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},
@@ -5613,19 +5613,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -5717,9 +5717,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
- const static double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
+ static const double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+ static const double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -5746,7 +5746,7 @@ public:
// Take directional components
for(int k = 0; k < 3; k++)
result += values[k]*D[i][0][k];
- // Multiply by weights
+ // Multiply by weights
result *= W[i][0];
return result;
@@ -5788,83 +5788,83 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_AQP2_P1BilinearForm_finite_element_2: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_finite_element_2() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_finite_element_2()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 1;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_finite_element_1_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_finite_element_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_aqp2_p1_0_finite_element_2: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_finite_element_2() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_finite_element_2()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 1;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -5904,7 +5904,7 @@ public:
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
@@ -5937,69 +5937,69 @@ public:
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];
-
+
+ // 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];
@@ -6037,15 +6037,15 @@ public:
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
@@ -6121,9 +6121,9 @@ public:
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}}};
+ 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;
@@ -6150,7 +6150,7 @@ public:
// 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;
@@ -6184,44 +6184,44 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_2();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_aqp2_p1_0_finite_element_2();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_0_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_0_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -6262,8 +6262,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -6304,7 +6310,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6359,44 +6365,44 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_aqp2_p1_0_dof_map_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_0_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_0_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -6437,8 +6443,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -6479,7 +6491,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6534,44 +6546,44 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_aqp2_p1_0_dof_map_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -6612,8 +6624,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -6662,7 +6680,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6738,53 +6756,53 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_dof_map_0_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_dof_map_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// 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;
@@ -6825,128 +6843,134 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_dimension() const
- {
- return 3;
- }
-
- // Return the geometric dimension of the coordinates this dof map provides
- virtual unsigned int geometric_dimension() const
- {
- return 2;
- }
-
- /// Return the number of dofs on each cell facet
- virtual unsigned int num_facet_dofs() const
- {
- return 2;
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// 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;
- break;
- case 1:
- dofs[0] = 0;
- dofs[1] = 2;
- break;
- case 2:
- dofs[0] = 0;
- dofs[1] = 1;
- break;
- }
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// Return the number of sub dof maps (for a mixed element)
- virtual unsigned int num_sub_dof_maps() const
- {
- return 1;
- }
-
- /// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ /// Return the dimension of the local finite element function space for a cell
+ virtual unsigned int local_dimension(const ufc::cell& c) const
+ {
+ return 3;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
+ {
+ return 3;
+ }
+
+ // Return the geometric dimension of the coordinates this dof map provides
+ virtual unsigned int geometric_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the number of dofs on each cell facet
+ virtual unsigned int num_facet_dofs() const
+ {
+ return 2;
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// 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;
+ break;
+ case 1:
+ dofs[0] = 0;
+ dofs[1] = 2;
+ break;
+ case 2:
+ dofs[0] = 0;
+ dofs[1] = 1;
+ break;
+ }
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// Return the number of sub dof maps (for a mixed element)
+ virtual unsigned int num_sub_dof_maps() const
+ {
+ return 1;
+ }
+
+ /// 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 stokes_aqp2_p1_0_dof_map_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
+ }
+
+ /// 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;
@@ -6987,8 +7011,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 15;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 15;
}
@@ -7041,7 +7071,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7129,53 +7159,53 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_dof_map_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_dof_map_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_1_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_1_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_1_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -7216,8 +7246,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -7258,7 +7294,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7313,44 +7349,44 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_aqp2_p1_0_dof_map_1_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_1_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_1_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_1_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -7391,8 +7427,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -7433,7 +7475,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7488,44 +7530,44 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_aqp2_p1_0_dof_map_1_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_1_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_1_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -7566,8 +7608,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -7616,7 +7664,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7692,53 +7740,53 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_dof_map_1_0_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_dof_map_1_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_1_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_1_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// 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;
@@ -7779,128 +7827,134 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_dimension() const
- {
- return 3;
- }
-
- // Return the geometric dimension of the coordinates this dof map provides
- virtual unsigned int geometric_dimension() const
- {
- return 2;
- }
-
- /// Return the number of dofs on each cell facet
- virtual unsigned int num_facet_dofs() const
- {
- return 2;
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// 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;
- break;
- case 1:
- dofs[0] = 0;
- dofs[1] = 2;
- break;
- case 2:
- dofs[0] = 0;
- dofs[1] = 1;
- break;
- }
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// Return the number of sub dof maps (for a mixed element)
- virtual unsigned int num_sub_dof_maps() const
- {
- return 1;
- }
-
- /// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ /// Return the dimension of the local finite element function space for a cell
+ virtual unsigned int local_dimension(const ufc::cell& c) const
+ {
+ return 3;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
+ {
+ return 3;
+ }
+
+ // Return the geometric dimension of the coordinates this dof map provides
+ virtual unsigned int geometric_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the number of dofs on each cell facet
+ virtual unsigned int num_facet_dofs() const
+ {
+ return 2;
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// 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;
+ break;
+ case 1:
+ dofs[0] = 0;
+ dofs[1] = 2;
+ break;
+ case 2:
+ dofs[0] = 0;
+ dofs[1] = 1;
+ break;
+ }
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// Return the number of sub dof maps (for a mixed element)
+ virtual unsigned int num_sub_dof_maps() const
+ {
+ return 1;
+ }
+
+ /// 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 stokes_aqp2_p1_0_dof_map_1_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
+ }
+
+ /// 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;
@@ -7941,8 +7995,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 15;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 15;
}
@@ -7995,7 +8055,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -8083,53 +8143,53 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_AQP2_P1BilinearForm_dof_map_2: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_dof_map_2() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_dof_map_2()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_dof_map_1_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_dof_map_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_aqp2_p1_0_dof_map_2: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_dof_map_2() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_dof_map_2()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -8170,8 +8230,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 1;
}
@@ -8206,7 +8272,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
@@ -8245,7 +8311,7 @@ public:
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_2();
+ return new stokes_aqp2_p1_0_dof_map_2();
}
};
@@ -8254,18 +8320,18 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0_quadrature: public ufc::cell_integral
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0_quadrature()
+class stokes_aqp2_p1_0_cell_integral_0_quadrature: public ufc::cell_integral
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_cell_integral_0_quadrature() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_cell_integral_0_quadrature()
{
// Do nothing
}
@@ -8283,10 +8349,10 @@ public:
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;
@@ -8298,25 +8364,26 @@ public:
// 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] = \
+ 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)
+
+ // Value of basis functions at quadrature points.
+ static const double FE1_C0_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.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};
+ static const unsigned int nzc4[5] = {6, 8, 9, 10, 11};
// Array of non-zero columns
- static const unsigned int nzc4[5] = {0, 2, 3, 4, 5};
-
- const static double FE0_C1_D10[9][5] = \
+ static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
+ static const double FE1_C0_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},
@@ -8326,12 +8393,12 @@ public:
{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 nzc2[5] = {6, 7, 9, 10, 11};
+ static const unsigned int nzc5[5] = {6, 7, 9, 10, 11};
// Array of non-zero columns
- static const unsigned int nzc3[5] = {0, 1, 3, 4, 5};
-
- const static double FE0_C2[9][3] = \
+ static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
+ static const double FE1_C2[9][3] = \
{{0.80869438567767, 0.102717654809626, 0.088587959512704},
{0.523979067720101, 0.0665540678391645, 0.409466864440735},
{0.188409405952072, 0.0239311322870807, 0.787659461760847},
@@ -8341,21 +8408,22 @@ public:
{0.102717654809626, 0.80869438567767, 0.088587959512704},
{0.0665540678391645, 0.523979067720101, 0.409466864440735},
{0.0239311322870807, 0.188409405952072, 0.787659461760847}};
+
// Array of non-zero columns
static const unsigned int nzc6[3] = {12, 13, 14};
- // Number of operations to compute geometry constants: 23
- const double G0 = det*w[0][0]*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
- const double G1 = det*w[0][0]*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
- const double G2 = det*w[0][0]*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
- const double G3 = - Jinv_11*det;
- const double G4 = - Jinv_01*det;
- const double G5 = - Jinv_10*det;
- const double G6 = - Jinv_00*det;
+ // Number of operations to compute geometry constants: 19
+ const double G0 = -Jinv_00*det;
+ const double G1 = det*w[0][0]*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
+ const double G2 = det*w[0][0]*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
+ const double G3 = det*w[0][0]*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
+ const double G4 = -Jinv_01*det;
+ const double G5 = -Jinv_10*det;
+ const double G6 = -Jinv_11*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: 7358
+ // Total number of operations to compute element tensor: 7354
// Loop quadrature points for integral
// Number of operations to compute element tensor for following IP loop = 7335
@@ -8364,77 +8432,77 @@ public:
// Number of operations to compute ip constants: 8
// Number of operations: 1
- const double Gip0 = W9[ip]*G0;
+ const double Gip0 = G0*W9[ip];
// Number of operations: 1
- const double Gip1 = W9[ip]*G1;
+ const double Gip1 = G1*W9[ip];
// Number of operations: 1
- const double Gip2 = W9[ip]*G2;
+ const double Gip2 = G2*W9[ip];
// Number of operations: 1
- const double Gip3 = W9[ip]*G3;
+ const double Gip3 = G3*W9[ip];
// Number of operations: 1
- const double Gip4 = W9[ip]*G4;
+ const double Gip4 = G4*W9[ip];
// Number of operations: 1
- const double Gip5 = W9[ip]*G5;
+ const double Gip5 = G5*W9[ip];
// Number of operations: 1
- const double Gip6 = W9[ip]*G6;
+ const double Gip6 = G6*W9[ip];
// Number of operations: 1
const double Gip7 = W9[ip]*det;
- // Number of operations for primary indices = 27
+ // 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]*15 + nzc6[k]] += FE0_C2[ip][j]*FE0_C2[ip][k]*Gip7;
+ // Number of operations to compute entry: 3
+ A[nzc6[j]*15 + nzc6[k]] += FE1_C2[ip][j]*FE1_C2[ip][k]*Gip7;
}// 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 < 3; k++)
{
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc6[k]] += FE0_C1_D01[ip][j]*FE0_C2[ip][k]*Gip3;
- // Number of operations to compute entry = 3
- A[nzc2[j]*15 + nzc6[k]] += FE0_C1_D10[ip][j]*FE0_C2[ip][k]*Gip4;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc6[k]] += FE0_C1_D01[ip][j]*FE0_C2[ip][k]*Gip5;
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc6[k]] += FE0_C1_D10[ip][j]*FE0_C2[ip][k]*Gip6;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc6[k]] += FE1_C0_D10[ip][j]*FE1_C2[ip][k]*Gip0;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc6[k]] += FE1_C0_D10[ip][j]*FE1_C2[ip][k]*Gip4;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc6[k]] += FE1_C0_D01[ip][j]*FE1_C2[ip][k]*Gip5;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc6[k]] += FE1_C0_D01[ip][j]*FE1_C2[ip][k]*Gip6;
}// end loop over 'k'
}// end loop over 'j'
- // Number of operations for primary indices = 600
+ // Number of operations for primary indices: 600
for (unsigned int j = 0; j < 5; j++)
{
for (unsigned int k = 0; k < 5; k++)
{
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc3[k]] += FE0_C1_D10[ip][j]*FE0_C1_D10[ip][k]*Gip0;
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc4[k]] += FE0_C1_D01[ip][k]*FE0_C1_D10[ip][j]*Gip1;
- // Number of operations to compute entry = 3
- A[nzc2[j]*15 + nzc2[k]] += FE0_C1_D10[ip][j]*FE0_C1_D10[ip][k]*Gip0;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc4[k]] += FE0_C1_D01[ip][j]*FE0_C1_D01[ip][k]*Gip2;
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc2[k]] += FE0_C1_D01[ip][j]*FE0_C1_D10[ip][k]*Gip1;
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc0[k]] += FE0_C1_D01[ip][j]*FE0_C1_D01[ip][k]*Gip2;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc3[k]] += FE0_C1_D01[ip][j]*FE0_C1_D10[ip][k]*Gip1;
- // Number of operations to compute entry = 3
- A[nzc2[j]*15 + nzc0[k]] += FE0_C1_D01[ip][k]*FE0_C1_D10[ip][j]*Gip1;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc2[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip1;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc1[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc4[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc5[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc4[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc1[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc2[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc5[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip1;
}// end loop over 'k'
}// end loop over 'j'
}// end loop over 'ip'
@@ -8446,22 +8514,22 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0: public ufc::cell_integral
-{
-private:
-
- UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0_quadrature integral_0_quadrature;
-
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0()
+class stokes_aqp2_p1_0_cell_integral_0: public ufc::cell_integral
+{
+private:
+
+ stokes_aqp2_p1_0_cell_integral_0_quadrature integral_0_quadrature;
+
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_0_cell_integral_0() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_0_cell_integral_0()
{
// Do nothing
}
@@ -8472,231 +8540,8 @@ public:
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;
+ for (unsigned int j = 0; j < 225; j++)
+ A[j] = 0;
// Add all contributions to element tensor
integral_0_quadrature.tabulate_tensor(A, w, c);
@@ -8719,18 +8564,18 @@ public:
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
-class UFC_Stokes_AQP2_P1BilinearForm: public ufc::form
-{
-public:
-
- /// Constructor
- UFC_Stokes_AQP2_P1BilinearForm() : ufc::form()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_AQP2_P1BilinearForm()
+class stokes_aqp2_p1_form_0: public ufc::form
+{
+public:
+
+ /// Constructor
+ stokes_aqp2_p1_form_0() : ufc::form()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_aqp2_p1_form_0()
{
// Do nothing
}
@@ -8738,7 +8583,7 @@ public:
/// Return a string identifying the form
virtual const char* signature() const
{
- return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(2),))), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),)))), Sum(Product(Constant(Cell('triangle', 1), 0), IndexSum(IndexSum(Product(Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(0),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(1),))), MultiIndex((Index(0), Index(1)))), MultiIndex((Index(2), Index(3)))), Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(4),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(4),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(5),))), MultiIndex((Index(4), Index(5)))), MultiIndex((Index(2), Index(3))))), MultiIndex((Index(2),))), MultiIndex((Index(3),)))), Product(IntValue(-1, (), (), {}), Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(6),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(6),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(6),))), MultiIndex((Index(6),))), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+ return "Form([Integral(Sum(Product(Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3}))), Sum(Product(Constant(Cell('triangle', 1, Space(2)), 0), IndexSum(IndexSum(Product(Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(1),), {Index(1): 2})), MultiIndex((Index(1), Index(0)), {Index(0): 2, Index(1): 2})), MultiIndex((Index(2), Index(3)), {Index(2): 2, Index(3): 2})), Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(4),), {Index(4): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(4),), {Index(4): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(5),), {Index(5): 2})), MultiIndex((Index(5), Index(4)), {Index(4): 2, Index(5): 2})), MultiIndex((Index(2), Index(3)), {Index(2): 2, Index(3): 2}))), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(3),), {Index(3): 2}))), Product(IntValue(-1, (), (), {}), Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(6),), {Index(6): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(6),), {Index(6): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(6),), {Index(6): 2})), MultiIndex((Index(6),), {Index(6): 2})), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})))))), Measure('cell', 0, None))])";
}
/// Return the rank of the global tensor (r)
@@ -8758,50 +8603,50 @@ public:
{
return 1;
}
-
+
/// Return the number of exterior facet integrals
virtual unsigned int num_exterior_facet_integrals() const
{
return 0;
}
-
+
/// Return the number of interior facet integrals
virtual unsigned int num_interior_facet_integrals() const
{
return 0;
}
-
+
/// 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 UFC_Stokes_AQP2_P1BilinearForm_finite_element_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1();
- break;
- case 2:
- return new UFC_Stokes_AQP2_P1BilinearForm_finite_element_2();
- break;
- }
- return 0;
- }
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_finite_element_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_finite_element_1();
+ break;
+ case 2:
+ return new stokes_aqp2_p1_0_finite_element_2();
+ break;
+ }
+ return 0;
+ }
+
/// 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 UFC_Stokes_AQP2_P1BilinearForm_dof_map_0();
- break;
- case 1:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1();
- break;
- case 2:
- return new UFC_Stokes_AQP2_P1BilinearForm_dof_map_2();
+ switch ( i )
+ {
+ case 0:
+ return new stokes_aqp2_p1_0_dof_map_0();
+ break;
+ case 1:
+ return new stokes_aqp2_p1_0_dof_map_1();
+ break;
+ case 2:
+ return new stokes_aqp2_p1_0_dof_map_2();
break;
}
return 0;
@@ -8810,7 +8655,7 @@ public:
/// Create a new cell integral on sub domain i
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
{
- return new UFC_Stokes_AQP2_P1BilinearForm_cell_integral_0();
+ return new stokes_aqp2_p1_0_cell_integral_0();
}
/// Create a new exterior facet integral on sub domain i
@@ -8829,209 +8674,264 @@ public:
// DOLFIN wrappers
-#include <dolfin/fem/Form.h>
+// Standard library includes
+#include <string>
+
+// DOLFIN includes
+#include <dolfin/common/NoDeleter.h>
#include <dolfin/fem/FiniteElement.h>
#include <dolfin/fem/DofMap.h>
-#include <dolfin/function/Coefficient.h>
-#include <dolfin/function/Function.h>
+#include <dolfin/fem/Form.h>
#include <dolfin/function/FunctionSpace.h>
-
-class Stokes_AQP2_P1BilinearFormFunctionSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1BilinearFormFunctionSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1BilinearFormFunctionSpace1 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1BilinearFormFunctionSpace1(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1BilinearFormCoefficientSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1BilinearFormCoefficientSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_2()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_2()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1TestSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1TestSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1TrialSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1TrialSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1CoefficientSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1CoefficientSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_2()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_2()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1FunctionSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_AQP2_P1FunctionSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_AQP2_P1BilinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_AQP2_P1BilinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_AQP2_P1BilinearFormCoefficient0 : public dolfin::Coefficient
+#include <dolfin/function/GenericFunction.h>
+#include <dolfin/function/CoefficientAssigner.h>
+
+namespace Stokes_AQP2_P1
+{
+
+class CoefficientSpace_alpha: public dolfin::FunctionSpace
+{
+public:
+
+ CoefficientSpace_alpha(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_2()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_2()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_2()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_2()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~CoefficientSpace_alpha()
+ {
+ }
+
+};
+
+class Form_0_FunctionSpace_0: public dolfin::FunctionSpace
+{
+public:
+
+ Form_0_FunctionSpace_0(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~Form_0_FunctionSpace_0()
+ {
+ }
+
+};
+
+class Form_0_FunctionSpace_1: public dolfin::FunctionSpace
+{
+public:
+
+ Form_0_FunctionSpace_1(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_aqp2_p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_aqp2_p1_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~Form_0_FunctionSpace_1()
+ {
+ }
+
+};
+
+typedef CoefficientSpace_alpha Form_0_FunctionSpace_2;
+
+class Form_0: public dolfin::Form
{
public:
// Constructor
- Stokes_AQP2_P1BilinearFormCoefficient0(dolfin::Form& form) : dolfin::Coefficient(form) {}
-
- // Destructor
- ~Stokes_AQP2_P1BilinearFormCoefficient0() {}
-
- // Attach function to coefficient
- const Stokes_AQP2_P1BilinearFormCoefficient0& operator= (dolfin::Function& v)
- {
- attach(v);
- return *this;
- }
-
- /// Create function space for coefficient
- const dolfin::FunctionSpace* create_function_space() const
- {
- return new Stokes_AQP2_P1BilinearFormCoefficientSpace0(form.mesh());
- }
-
- /// Return coefficient number
- dolfin::uint number() const
- {
- return 0;
- }
-
- /// Return coefficient name
- virtual std::string name() const
- {
- return "alpha";
- }
-
-};
-class Stokes_AQP2_P1BilinearForm : public dolfin::Form
-{
-public:
-
- // Create form on given function space(s)
- Stokes_AQP2_P1BilinearForm(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1) : dolfin::Form(), alpha(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
- boost::shared_ptr<const dolfin::FunctionSpace> _V1(&V1, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_AQP2_P1BilinearForm());
- }
-
- // Create form on given function space(s) (shared data)
- Stokes_AQP2_P1BilinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1) : dolfin::Form(), alpha(*this)
- {
- _function_spaces.push_back(V0);
- _function_spaces.push_back(V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_AQP2_P1BilinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s)
- Stokes_AQP2_P1BilinearForm(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, dolfin::Function& w0) : dolfin::Form(), alpha(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
- boost::shared_ptr<const dolfin::FunctionSpace> _V1(&V1, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->alpha = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_AQP2_P1BilinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s) (shared data)
- Stokes_AQP2_P1BilinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, dolfin::Function& w0) : dolfin::Form(), alpha(*this)
- {
- _function_spaces.push_back(V0);
- _function_spaces.push_back(V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->alpha = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_AQP2_P1BilinearForm());
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, const dolfin::GenericFunction& alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ this->alpha = alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, boost::shared_ptr<const dolfin::GenericFunction> alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ this->alpha = *alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, const dolfin::GenericFunction& alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ this->alpha = alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, boost::shared_ptr<const dolfin::GenericFunction> alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ this->alpha = *alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_aqp2_p1_form_0());
}
// Destructor
- ~Stokes_AQP2_P1BilinearForm() {}
+ ~Form_0()
+ {}
+
+ /// Return the number of the coefficient with this name
+ virtual dolfin::uint coefficient_number(const std::string& name) const
+ {
+ if (name == "alpha")
+ return 0;
+
+ dolfin::error("Invalid coefficient.");
+ return 0;
+ }
+
+ /// Return the name of the coefficient with this number
+ virtual std::string coefficient_name(dolfin::uint i) const
+ {
+ switch (i)
+ {
+ case 0:
+ return "alpha";
+ }
+
+ dolfin::error("Invalid coefficient.");
+ return "unnamed";
+ }
+
+ // Typedefs
+ typedef Form_0_FunctionSpace_0 TestSpace;
+ typedef Form_0_FunctionSpace_1 TrialSpace;
+ typedef Form_0_FunctionSpace_2 CoefficientSpace_alpha;
// Coefficients
- Stokes_AQP2_P1BilinearFormCoefficient0 alpha;
-
-};
+ dolfin::CoefficientAssigner alpha;
+};
+
+// Class typedefs
+typedef Form_0 BilinearForm;
+typedef Form_0::TestSpace FunctionSpace;
+
+} // namespace Stokes_AQP2_P1
#endif
diff -r 6ed545ae2f2b -r de7f60d82394 MADDs-1/cpp/Stokes_AQP2_P1.ufl
--- a/MADDs-1/cpp/Stokes_AQP2_P1.ufl Sat Dec 05 06:00:01 2009 -0500
+++ b/MADDs-1/cpp/Stokes_AQP2_P1.ufl Sat Dec 05 06:00:28 2009 -0500
@@ -4,10 +4,10 @@
# First added: 2005
# Last changed: 2007-04-23
#
-# The bilinear form a(v, u) for the block preconditioning matrix [ A Q ]
+# The bilinear form a(v, u) for the block preconditioning matrix [ A 0 ; G^T Q]
# equations using a mixed formulation (Taylor-Hood elements).
#
-# Compile this form with FFC: ffc -l dolfin Stokes.ufl
+# Compile this form with FFC: ffc -l dolfin -O Stokes_AQP2_P1.ufl
P2 = VectorElement("Lagrange", triangle, 2)
P1 = FiniteElement("Lagrange", triangle, 1)
@@ -20,5 +20,8 @@ TH = P2 + P1
alpha = Constant(triangle)
+# block diagonal precondtioner [ A 0 ; 0 Q]
#a = (alpha*inner(grad(v), grad(u)) + q*p)*dx
+
+#lower triangular preconditioner [ A 0 ; G^T Q]
a = (alpha*inner(grad(v), grad(u)) - div(v)*p + q*p)*dx
diff -r 6ed545ae2f2b -r de7f60d82394 MADDs-1/cpp/Stokes_P2P1.h
--- a/MADDs-1/cpp/Stokes_P2P1.h Sat Dec 05 06:00:01 2009 -0500
+++ b/MADDs-1/cpp/Stokes_P2P1.h Sat Dec 05 06:00:28 2009 -0500
@@ -1,5 +1,5 @@
// This code conforms with the UFC specification version 1.0
-// and was automatically generated by FFC version 0.6.2.
+// and was automatically generated by FFC version 0.7.1.
//
// Warning: This code was generated with the option '-l dolfin'
// and contains DOLFIN-specific wrappers that depend on DOLFIN.
@@ -14,67 +14,67 @@
/// This class defines the interface for a finite element.
-class UFC_Stokes_P2P1BilinearForm_finite_element_0_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_0_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+class stokes_p2p1_0_finite_element_0_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_0_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -128,7 +128,7 @@ public:
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},
@@ -171,69 +171,69 @@ public:
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];
-
+
+ // 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];
@@ -285,7 +285,7 @@ public:
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},
@@ -295,7 +295,7 @@ public:
// 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},
@@ -303,7 +303,7 @@ public:
{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},
@@ -414,9 +414,9 @@ public:
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;
@@ -443,7 +443,7 @@ public:
// 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;
@@ -477,74 +477,74 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_0_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_0_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_p2p1_0_finite_element_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_0_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_0_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -598,7 +598,7 @@ public:
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},
@@ -641,69 +641,69 @@ public:
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];
-
+
+ // 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];
@@ -755,7 +755,7 @@ public:
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},
@@ -765,7 +765,7 @@ public:
// 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},
@@ -773,7 +773,7 @@ public:
{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},
@@ -884,9 +884,9 @@ public:
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;
@@ -913,7 +913,7 @@ public:
// 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;
@@ -947,33 +947,33 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_p2p1_0_finite_element_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -1014,7 +1014,7 @@ public:
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;
@@ -1071,7 +1071,7 @@ public:
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},
@@ -1123,7 +1123,7 @@ public:
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},
@@ -1168,69 +1168,69 @@ public:
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];
-
+
+ // 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];
@@ -1284,17 +1284,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -1302,7 +1302,7 @@ public:
{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},
@@ -1430,17 +1430,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -1448,7 +1448,7 @@ public:
{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},
@@ -1561,9 +1561,9 @@ public:
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}}};
+ 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;
@@ -1590,7 +1590,7 @@ public:
// 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;
@@ -1628,83 +1628,83 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 3;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_finite_element_0_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_finite_element_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 3;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -1750,7 +1750,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -1787,69 +1787,69 @@ public:
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];
-
+
+ // 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];
@@ -1893,19 +1893,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -1995,9 +1995,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[3][1] = {{1}, {1}, {1}};
- const static double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
+ static const double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[3][1] = {{1}, {1}, {1}};
+ static const double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -2024,7 +2024,7 @@ public:
// 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;
@@ -2058,33 +2058,33 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
+ return new stokes_p2p1_0_finite_element_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
}
/// Return the cell shape
@@ -2125,7 +2125,7 @@ public:
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;
@@ -2183,7 +2183,7 @@ public:
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},
@@ -2235,7 +2235,7 @@ public:
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},
@@ -2279,7 +2279,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -2318,69 +2318,69 @@ public:
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];
-
+
+ // 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];
@@ -2434,17 +2434,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -2452,7 +2452,7 @@ public:
{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},
@@ -2580,17 +2580,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -2598,7 +2598,7 @@ public:
{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},
@@ -2718,19 +2718,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -2822,9 +2822,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
- const static double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
+ static const double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+ static const double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -2851,7 +2851,7 @@ public:
// Take directional components
for(int k = 0; k < 3; k++)
result += values[k]*D[i][0][k];
- // Multiply by weights
+ // Multiply by weights
result *= W[i][0];
return result;
@@ -2893,83 +2893,83 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_1_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_1_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_1_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_finite_element_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_finite_element_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_1_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_1_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_1_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -3023,7 +3023,7 @@ public:
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},
@@ -3066,69 +3066,69 @@ public:
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];
-
+
+ // 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];
@@ -3180,7 +3180,7 @@ public:
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},
@@ -3190,7 +3190,7 @@ public:
// 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},
@@ -3198,7 +3198,7 @@ public:
{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},
@@ -3309,9 +3309,9 @@ public:
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;
@@ -3338,7 +3338,7 @@ public:
// 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;
@@ -3372,74 +3372,74 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_1_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_1_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_1_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_1_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_p2p1_0_finite_element_1_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_1_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_1_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_1_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -3493,7 +3493,7 @@ public:
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},
@@ -3536,69 +3536,69 @@ public:
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];
-
+
+ // 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];
@@ -3650,7 +3650,7 @@ public:
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},
@@ -3660,7 +3660,7 @@ public:
// 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},
@@ -3668,7 +3668,7 @@ public:
{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},
@@ -3779,9 +3779,9 @@ public:
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;
@@ -3808,7 +3808,7 @@ public:
// 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;
@@ -3842,33 +3842,33 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_1_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_1_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_1_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_p2p1_0_finite_element_1_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_1_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_1_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -3909,7 +3909,7 @@ public:
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;
@@ -3966,7 +3966,7 @@ public:
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},
@@ -4018,7 +4018,7 @@ public:
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},
@@ -4063,69 +4063,69 @@ public:
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];
-
+
+ // 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];
@@ -4179,17 +4179,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -4197,7 +4197,7 @@ public:
{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},
@@ -4325,17 +4325,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -4343,7 +4343,7 @@ public:
{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},
@@ -4456,9 +4456,9 @@ public:
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}}};
+ 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;
@@ -4485,7 +4485,7 @@ public:
// 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;
@@ -4523,83 +4523,83 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_1_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_1_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_1_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_1_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 3;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_finite_element_1_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_finite_element_1_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_1_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_1_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 3;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -4645,7 +4645,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -4682,69 +4682,69 @@ public:
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];
-
+
+ // 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];
@@ -4788,19 +4788,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -4890,9 +4890,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[3][1] = {{1}, {1}, {1}};
- const static double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
+ static const double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[3][1] = {{1}, {1}, {1}};
+ static const double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -4919,7 +4919,7 @@ public:
// 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;
@@ -4953,33 +4953,33 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_1_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
+ return new stokes_p2p1_0_finite_element_1_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
}
/// Return the cell shape
@@ -5020,7 +5020,7 @@ public:
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;
@@ -5078,7 +5078,7 @@ public:
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},
@@ -5130,7 +5130,7 @@ public:
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},
@@ -5174,7 +5174,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -5213,69 +5213,69 @@ public:
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];
-
+
+ // 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];
@@ -5329,17 +5329,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -5347,7 +5347,7 @@ public:
{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},
@@ -5475,17 +5475,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -5493,7 +5493,7 @@ public:
{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},
@@ -5613,19 +5613,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -5717,9 +5717,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
- const static double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
+ static const double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+ static const double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -5746,7 +5746,7 @@ public:
// Take directional components
for(int k = 0; k < 3; k++)
result += values[k]*D[i][0][k];
- // Multiply by weights
+ // Multiply by weights
result *= W[i][0];
return result;
@@ -5788,83 +5788,83 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_1_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1BilinearForm_finite_element_2: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_finite_element_2() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_finite_element_2()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 1;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_finite_element_1_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_finite_element_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_0_finite_element_2: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_finite_element_2() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_finite_element_2()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Discontinuous Lagrange', Cell('triangle', 1, Space(2)), 0)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 1;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -5904,7 +5904,7 @@ public:
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
@@ -5937,69 +5937,69 @@ public:
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];
-
+
+ // 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];
@@ -6037,15 +6037,15 @@ public:
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
@@ -6121,9 +6121,9 @@ public:
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}}};
+ 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;
@@ -6150,7 +6150,7 @@ public:
// 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;
@@ -6184,44 +6184,44 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_2();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_0_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_0_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_0_finite_element_2();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_0_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_0_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -6262,8 +6262,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -6304,7 +6310,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6359,44 +6365,44 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_0_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_0_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_0_dof_map_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_0_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_0_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -6437,8 +6443,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -6479,7 +6491,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6534,44 +6546,44 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_0_dof_map_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -6612,8 +6624,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -6662,7 +6680,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -6738,53 +6756,53 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_dof_map_0_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_dof_map_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// 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;
@@ -6825,128 +6843,134 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_dimension() const
- {
- return 3;
- }
-
- // Return the geometric dimension of the coordinates this dof map provides
- virtual unsigned int geometric_dimension() const
- {
- return 2;
- }
-
- /// Return the number of dofs on each cell facet
- virtual unsigned int num_facet_dofs() const
- {
- return 2;
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// 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;
- break;
- case 1:
- dofs[0] = 0;
- dofs[1] = 2;
- break;
- case 2:
- dofs[0] = 0;
- dofs[1] = 1;
- break;
- }
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// Return the number of sub dof maps (for a mixed element)
- virtual unsigned int num_sub_dof_maps() const
- {
- return 1;
- }
-
- /// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ /// Return the dimension of the local finite element function space for a cell
+ virtual unsigned int local_dimension(const ufc::cell& c) const
+ {
+ return 3;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
+ {
+ return 3;
+ }
+
+ // Return the geometric dimension of the coordinates this dof map provides
+ virtual unsigned int geometric_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the number of dofs on each cell facet
+ virtual unsigned int num_facet_dofs() const
+ {
+ return 2;
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// 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;
+ break;
+ case 1:
+ dofs[0] = 0;
+ dofs[1] = 2;
+ break;
+ case 2:
+ dofs[0] = 0;
+ dofs[1] = 1;
+ break;
+ }
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// Return the number of sub dof maps (for a mixed element)
+ virtual unsigned int num_sub_dof_maps() const
+ {
+ return 1;
+ }
+
+ /// 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 stokes_p2p1_0_dof_map_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
+ }
+
+ /// 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;
@@ -6987,8 +7011,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 15;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 15;
}
@@ -7041,7 +7071,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7129,53 +7159,53 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_1_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_1_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_1_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_dof_map_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_dof_map_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_1_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_1_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_1_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -7216,8 +7246,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -7258,7 +7294,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7313,44 +7349,44 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_1_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_1_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_1_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_1_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_0_dof_map_1_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_1_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_1_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_1_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -7391,8 +7427,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -7433,7 +7475,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7488,44 +7530,44 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_1_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_1_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_1_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_0_dof_map_1_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_1_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_1_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -7566,8 +7608,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -7616,7 +7664,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -7692,53 +7740,53 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_1_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_1_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_1_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_1_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_dof_map_1_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_dof_map_1_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_1_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_1_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// 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;
@@ -7779,128 +7827,134 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_dimension() const
- {
- return 3;
- }
-
- // Return the geometric dimension of the coordinates this dof map provides
- virtual unsigned int geometric_dimension() const
- {
- return 2;
- }
-
- /// Return the number of dofs on each cell facet
- virtual unsigned int num_facet_dofs() const
- {
- return 2;
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// 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;
- break;
- case 1:
- dofs[0] = 0;
- dofs[1] = 2;
- break;
- case 2:
- dofs[0] = 0;
- dofs[1] = 1;
- break;
- }
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// Return the number of sub dof maps (for a mixed element)
- virtual unsigned int num_sub_dof_maps() const
- {
- return 1;
- }
-
- /// 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 UFC_Stokes_P2P1BilinearForm_dof_map_1_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ /// Return the dimension of the local finite element function space for a cell
+ virtual unsigned int local_dimension(const ufc::cell& c) const
+ {
+ return 3;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
+ {
+ return 3;
+ }
+
+ // Return the geometric dimension of the coordinates this dof map provides
+ virtual unsigned int geometric_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the number of dofs on each cell facet
+ virtual unsigned int num_facet_dofs() const
+ {
+ return 2;
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// 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;
+ break;
+ case 1:
+ dofs[0] = 0;
+ dofs[1] = 2;
+ break;
+ case 2:
+ dofs[0] = 0;
+ dofs[1] = 1;
+ break;
+ }
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// Return the number of sub dof maps (for a mixed element)
+ virtual unsigned int num_sub_dof_maps() const
+ {
+ return 1;
+ }
+
+ /// 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 stokes_p2p1_0_dof_map_1_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
+ }
+
+ /// 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;
@@ -7941,8 +7995,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 15;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 15;
}
@@ -7995,7 +8055,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -8083,53 +8143,53 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_1_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1BilinearForm_dof_map_2: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_dof_map_2() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_dof_map_2()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Discontinuous Lagrange', 'triangle', 0)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_dof_map_1_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_dof_map_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_0_dof_map_2: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_dof_map_2() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_dof_map_2()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -8170,8 +8230,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 1;
}
@@ -8206,7 +8272,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
@@ -8245,7 +8311,7 @@ public:
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_2();
+ return new stokes_p2p1_0_dof_map_2();
}
};
@@ -8254,18 +8320,18 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_P2P1BilinearForm_cell_integral_0_quadrature: public ufc::cell_integral
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_cell_integral_0_quadrature()
+class stokes_p2p1_0_cell_integral_0_quadrature: public ufc::cell_integral
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_0_cell_integral_0_quadrature() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_cell_integral_0_quadrature()
{
// Do nothing
}
@@ -8283,10 +8349,10 @@ public:
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;
@@ -8298,162 +8364,149 @@ public:
// 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}};
+ static const double W4[4] = {0.159020690871988, 0.0909793091280113, 0.159020690871988, 0.0909793091280113};
+ // Quadrature points on the UFC reference element: (0.178558728263616, 0.155051025721682), (0.0750311102226081, 0.644948974278318), (0.666390246014701, 0.155051025721682), (0.280019915499074, 0.644948974278318)
+
+ // Value of basis functions at quadrature points.
+ static const double FE1_C0_D01[4][5] = \
+ {{-1.66556098405881, -0.379795897113271, 0.714234913054466, 2.04535688117208, -0.714234913054465},
+ {-0.120079661996297, 1.57979589711327, 0.300124440890433, -1.45971623511698, -0.300124440890432},
+ {0.285765086945535, -0.379795897113271, 2.6655609840588, 0.0940308101677372, -2.66556098405881},
+ {0.699875559109568, 1.57979589711327, 1.1200796619963, -2.27967145622284, -1.1200796619963}};
+
// Array of non-zero columns
- static const unsigned int nzc0[5] = {6, 8, 9, 10, 11};
+ static const unsigned int nzc4[5] = {6, 8, 9, 10, 11};
// Array of non-zero columns
- static const unsigned int nzc4[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}};
+ static const unsigned int nzc1[5] = {0, 2, 3, 4, 5};
+ static const double FE1_C0_D10[4][5] = \
+ {{-1.66556098405881, -0.285765086945534, 0.620204102886728, -0.620204102886728, 1.95132607100434},
+ {-0.120079661996296, -0.699875559109567, 2.57979589711327, -2.57979589711327, 0.819955221105864},
+ {0.285765086945534, 1.66556098405881, 0.620204102886729, -0.620204102886729, -1.95132607100434},
+ {0.699875559109568, 0.120079661996297, 2.57979589711327, -2.57979589711327, -0.819955221105864}};
+
// Array of non-zero columns
- static const unsigned int nzc2[5] = {6, 7, 9, 10, 11};
+ static const unsigned int nzc5[5] = {6, 7, 9, 10, 11};
// Array of non-zero columns
- static const unsigned int nzc3[5] = {0, 1, 3, 4, 5};
-
- const static double FE0_C2[9][3] = \
- {{0.80869438567767, 0.102717654809626, 0.088587959512704},
- {0.523979067720101, 0.0665540678391645, 0.409466864440735},
- {0.188409405952072, 0.0239311322870807, 0.787659461760847},
- {0.455706020243648, 0.455706020243648, 0.088587959512704},
- {0.295266567779633, 0.295266567779633, 0.409466864440735},
- {0.106170269119577, 0.106170269119577, 0.787659461760847},
- {0.102717654809626, 0.80869438567767, 0.088587959512704},
- {0.0665540678391645, 0.523979067720101, 0.409466864440735},
- {0.0239311322870807, 0.188409405952072, 0.787659461760847}};
+ static const unsigned int nzc2[5] = {0, 1, 3, 4, 5};
+ static const double FE1_C2[4][3] = \
+ {{0.666390246014701, 0.178558728263616, 0.155051025721682},
+ {0.280019915499074, 0.0750311102226082, 0.644948974278318},
+ {0.178558728263616, 0.666390246014701, 0.155051025721682},
+ {0.0750311102226081, 0.280019915499074, 0.644948974278318}};
+
// Array of non-zero columns
static const unsigned int nzc6[3] = {12, 13, 14};
- // Number of operations to compute geometry constants: 27
+ // Number of operations to compute geometry constants: 23
const double G0 = Jinv_01*det;
- const double G1 = - Jinv_00*det;
+ const double G1 = -Jinv_00*det;
const double G2 = det*w[0][0]*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01);
- const double G3 = Jinv_00*det;
+ const double G3 = det*w[0][0]*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
const double G4 = det*w[0][0]*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11);
- const double G5 = det*w[0][0]*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11);
- const double G6 = - Jinv_11*det;
- const double G7 = - Jinv_01*det;
- const double G8 = - Jinv_10*det;
- const double G9 = Jinv_11*det;
- const double G10 = Jinv_10*det;
+ const double G5 = Jinv_00*det;
+ const double G6 = Jinv_10*det;
+ const double G7 = -Jinv_01*det;
+ const double G8 = -Jinv_10*det;
+ const double G9 = -Jinv_11*det;
+ const double G10 = Jinv_11*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: 8766
+ // Total number of operations to compute element tensor: 3907
// Loop quadrature points for integral
- // Number of operations to compute element tensor for following IP loop = 8739
- for (unsigned int ip = 0; ip < 9; ip++)
+ // Number of operations to compute element tensor for following IP loop = 3884
+ for (unsigned int ip = 0; ip < 4; ip++)
{
// Number of operations to compute ip constants: 11
// Number of operations: 1
- const double Gip0 = W9[ip]*G0;
+ const double Gip0 = G0*W4[ip];
// Number of operations: 1
- const double Gip1 = W9[ip]*G1;
+ const double Gip1 = G1*W4[ip];
// Number of operations: 1
- const double Gip2 = W9[ip]*G2;
+ const double Gip2 = G2*W4[ip];
// Number of operations: 1
- const double Gip3 = W9[ip]*G3;
+ const double Gip3 = G3*W4[ip];
// Number of operations: 1
- const double Gip4 = W9[ip]*G4;
+ const double Gip4 = G4*W4[ip];
// Number of operations: 1
- const double Gip5 = W9[ip]*G5;
+ const double Gip5 = G5*W4[ip];
// Number of operations: 1
- const double Gip6 = W9[ip]*G6;
+ const double Gip6 = G6*W4[ip];
// Number of operations: 1
- const double Gip7 = W9[ip]*G7;
+ const double Gip7 = G7*W4[ip];
// Number of operations: 1
- const double Gip8 = W9[ip]*G8;
+ const double Gip8 = G8*W4[ip];
// Number of operations: 1
- const double Gip9 = W9[ip]*G9;
+ const double Gip9 = G9*W4[ip];
// Number of operations: 1
- const double Gip10 = W9[ip]*G10;
-
-
- // Number of operations for primary indices = 180
+ const double Gip10 = G10*W4[ip];
+
+
+ // Number of operations for primary indices: 180
for (unsigned int j = 0; j < 5; j++)
{
for (unsigned int k = 0; k < 3; k++)
{
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc6[k]] += FE0_C1_D10[ip][j]*FE0_C2[ip][k]*Gip1;
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc6[k]] += FE0_C1_D01[ip][j]*FE0_C2[ip][k]*Gip6;
- // Number of operations to compute entry = 3
- A[nzc2[j]*15 + nzc6[k]] += FE0_C1_D10[ip][j]*FE0_C2[ip][k]*Gip7;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc6[k]] += FE0_C1_D01[ip][j]*FE0_C2[ip][k]*Gip8;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc6[k]] += FE1_C0_D10[ip][j]*FE1_C2[ip][k]*Gip1;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc6[k]] += FE1_C0_D10[ip][j]*FE1_C2[ip][k]*Gip7;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc6[k]] += FE1_C0_D01[ip][j]*FE1_C2[ip][k]*Gip8;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc6[k]] += FE1_C0_D01[ip][j]*FE1_C2[ip][k]*Gip9;
}// end loop over 'k'
}// end loop over 'j'
- // Number of operations for primary indices = 600
+ // Number of operations for primary indices: 600
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]*15 + nzc2[k]] += FE0_C1_D10[ip][j]*FE0_C1_D10[ip][k]*Gip2;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc4[k]] += FE0_C1_D01[ip][j]*FE0_C1_D01[ip][k]*Gip4;
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc2[k]] += FE0_C1_D01[ip][j]*FE0_C1_D10[ip][k]*Gip5;
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc4[k]] += FE0_C1_D01[ip][k]*FE0_C1_D10[ip][j]*Gip5;
- // Number of operations to compute entry = 3
- A[nzc0[j]*15 + nzc0[k]] += FE0_C1_D01[ip][j]*FE0_C1_D01[ip][k]*Gip4;
- // Number of operations to compute entry = 3
- A[nzc3[j]*15 + nzc3[k]] += FE0_C1_D10[ip][j]*FE0_C1_D10[ip][k]*Gip2;
- // Number of operations to compute entry = 3
- A[nzc4[j]*15 + nzc3[k]] += FE0_C1_D01[ip][j]*FE0_C1_D10[ip][k]*Gip5;
- // Number of operations to compute entry = 3
- A[nzc2[j]*15 + nzc0[k]] += FE0_C1_D01[ip][k]*FE0_C1_D10[ip][j]*Gip5;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc2[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc2[j]*15 + nzc1[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc4[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip4;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc4[k]] += FE1_C0_D01[ip][k]*FE1_C0_D10[ip][j]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc5[j]*15 + nzc5[k]] += FE1_C0_D10[ip][j]*FE1_C0_D10[ip][k]*Gip2;
+ // Number of operations to compute entry: 3
+ A[nzc4[j]*15 + nzc5[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc2[k]] += FE1_C0_D01[ip][j]*FE1_C0_D10[ip][k]*Gip3;
+ // Number of operations to compute entry: 3
+ A[nzc1[j]*15 + nzc1[k]] += FE1_C0_D01[ip][j]*FE1_C0_D01[ip][k]*Gip4;
}// 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 < 3; j++)
{
for (unsigned int k = 0; k < 5; k++)
{
- // Number of operations to compute entry = 3
- A[nzc6[j]*15 + nzc2[k]] += FE0_C1_D10[ip][k]*FE0_C2[ip][j]*Gip0;
- // Number of operations to compute entry = 3
- A[nzc6[j]*15 + nzc3[k]] += FE0_C1_D10[ip][k]*FE0_C2[ip][j]*Gip3;
- // Number of operations to compute entry = 3
- A[nzc6[j]*15 + nzc0[k]] += FE0_C1_D01[ip][k]*FE0_C2[ip][j]*Gip9;
- // Number of operations to compute entry = 3
- A[nzc6[j]*15 + nzc4[k]] += FE0_C1_D01[ip][k]*FE0_C2[ip][j]*Gip10;
+ // Number of operations to compute entry: 3
+ A[nzc6[j]*15 + nzc5[k]] += FE1_C0_D10[ip][k]*FE1_C2[ip][j]*Gip0;
+ // Number of operations to compute entry: 3
+ A[nzc6[j]*15 + nzc2[k]] += FE1_C0_D10[ip][k]*FE1_C2[ip][j]*Gip5;
+ // Number of operations to compute entry: 3
+ A[nzc6[j]*15 + nzc1[k]] += FE1_C0_D01[ip][k]*FE1_C2[ip][j]*Gip6;
+ // Number of operations to compute entry: 3
+ A[nzc6[j]*15 + nzc4[k]] += FE1_C0_D01[ip][k]*FE1_C2[ip][j]*Gip10;
}// end loop over 'k'
}// end loop over 'j'
}// end loop over 'ip'
@@ -8465,22 +8518,22 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_P2P1BilinearForm_cell_integral_0: public ufc::cell_integral
-{
-private:
-
- UFC_Stokes_P2P1BilinearForm_cell_integral_0_quadrature integral_0_quadrature;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm_cell_integral_0() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm_cell_integral_0()
+class stokes_p2p1_0_cell_integral_0: public ufc::cell_integral
+{
+private:
+
+ stokes_p2p1_0_cell_integral_0_quadrature integral_0_quadrature;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_0_cell_integral_0() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_0_cell_integral_0()
{
// Do nothing
}
@@ -8491,231 +8544,8 @@ public:
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;
+ for (unsigned int j = 0; j < 225; j++)
+ A[j] = 0;
// Add all contributions to element tensor
integral_0_quadrature.tabulate_tensor(A, w, c);
@@ -8738,18 +8568,18 @@ public:
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
-class UFC_Stokes_P2P1BilinearForm: public ufc::form
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1BilinearForm() : ufc::form()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1BilinearForm()
+class stokes_p2p1_form_0: public ufc::form
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_form_0() : ufc::form()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_form_0()
{
// Do nothing
}
@@ -8757,7 +8587,7 @@ public:
/// Return a string identifying the form
virtual const char* signature() const
{
- return "Form([Integral(Sum(Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(0),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(0),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(0),))), MultiIndex((Index(0),))), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(2),)))), Sum(Product(Constant(Cell('triangle', 1), 0), IndexSum(IndexSum(Product(Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(1),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(1),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(2),))), MultiIndex((Index(1), Index(2)))), MultiIndex((Index(3), Index(4)))), Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(5),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(5),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(6),))), MultiIndex((Index(5), Index(6)))), MultiIndex((Index(3), Index(4))))), MultiIndex((Index(3),))), MultiIndex((Index(4),)))), Product(IntValue(-1, (), (), {}), Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(7),))), MultiIndex((FixedIndex(0),))), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(7),))), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(7),))), MultiIndex((Index(7),))), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),))))))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+ return "Form([Integral(Sum(Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(0),), {Index(0): 2})), MultiIndex((Index(0),), {Index(0): 2})), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3}))), Sum(Product(Constant(Cell('triangle', 1, Space(2)), 0), IndexSum(IndexSum(Product(Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(1),), {Index(1): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(1),), {Index(1): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(2),), {Index(2): 2})), MultiIndex((Index(2), Index(1)), {Index(2): 2, Index(1): 2})), MultiIndex((Index(3), Index(4)), {Index(4): 2, Index(3): 2})), Indexed(ComponentTensor(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(5),), {Index(5): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((Index(5),), {Index(5): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(6),), {Index(6): 2})), MultiIndex((Index(6), Index(5)), {Index(5): 2, Index(6): 2})), MultiIndex((Index(3), Index(4)), {Index(4): 2, Index(3): 2}))), MultiIndex((Index(3),), {Index(3): 2})), MultiIndex((Index(4),), {Index(4): 2}))), Product(IntValue(-1, (), (), {}), Product(IndexSum(Indexed(ListTensor(Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(7),), {Index(7): 2})), MultiIndex((FixedIndex(0),), {})), Indexed(SpatialDerivative(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((Index(7),), {Index(7): 2})), MultiIndex((FixedIndex(1),), {}))), MultiIndex((Index(7),), {Index(7): 2})), MultiIndex((Index(7),), {Index(7): 2})), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 1), MultiIndex((FixedIndex(2),), {FixedIndex(2): 3})))))), Measure('cell', 0, None))])";
}
/// Return the rank of the global tensor (r)
@@ -8777,50 +8607,50 @@ public:
{
return 1;
}
-
+
/// Return the number of exterior facet integrals
virtual unsigned int num_exterior_facet_integrals() const
{
return 0;
}
-
+
/// Return the number of interior facet integrals
virtual unsigned int num_interior_facet_integrals() const
{
return 0;
}
-
+
/// 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 UFC_Stokes_P2P1BilinearForm_finite_element_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_1();
- break;
- case 2:
- return new UFC_Stokes_P2P1BilinearForm_finite_element_2();
- break;
- }
- return 0;
- }
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_finite_element_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_finite_element_1();
+ break;
+ case 2:
+ return new stokes_p2p1_0_finite_element_2();
+ break;
+ }
+ return 0;
+ }
+
/// 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 UFC_Stokes_P2P1BilinearForm_dof_map_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_1();
- break;
- case 2:
- return new UFC_Stokes_P2P1BilinearForm_dof_map_2();
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_0_dof_map_0();
+ break;
+ case 1:
+ return new stokes_p2p1_0_dof_map_1();
+ break;
+ case 2:
+ return new stokes_p2p1_0_dof_map_2();
break;
}
return 0;
@@ -8829,7 +8659,7 @@ public:
/// Create a new cell integral on sub domain i
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
{
- return new UFC_Stokes_P2P1BilinearForm_cell_integral_0();
+ return new stokes_p2p1_0_cell_integral_0();
}
/// Create a new exterior facet integral on sub domain i
@@ -8848,67 +8678,67 @@ public:
/// This class defines the interface for a finite element.
-class UFC_Stokes_P2P1LinearForm_finite_element_0_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_0_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+class stokes_p2p1_1_finite_element_0_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_0_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -8962,7 +8792,7 @@ public:
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},
@@ -9005,69 +8835,69 @@ public:
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];
-
+
+ // 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];
@@ -9119,7 +8949,7 @@ public:
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},
@@ -9129,7 +8959,7 @@ public:
// 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},
@@ -9137,7 +8967,7 @@ public:
{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},
@@ -9248,9 +9078,9 @@ public:
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;
@@ -9277,7 +9107,7 @@ public:
// 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;
@@ -9311,74 +9141,74 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_0_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_0_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_p2p1_1_finite_element_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_0_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_0_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -9432,7 +9262,7 @@ public:
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},
@@ -9475,69 +9305,69 @@ public:
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];
-
+
+ // 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];
@@ -9589,7 +9419,7 @@ public:
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},
@@ -9599,7 +9429,7 @@ public:
// 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},
@@ -9607,7 +9437,7 @@ public:
{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},
@@ -9718,9 +9548,9 @@ public:
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;
@@ -9747,7 +9577,7 @@ public:
// 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;
@@ -9781,33 +9611,33 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_0_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_0_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_p2p1_1_finite_element_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_0_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_0_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -9848,7 +9678,7 @@ public:
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;
@@ -9905,7 +9735,7 @@ public:
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},
@@ -9957,7 +9787,7 @@ public:
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},
@@ -10002,69 +9832,69 @@ public:
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];
-
+
+ // 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];
@@ -10118,17 +9948,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -10136,7 +9966,7 @@ public:
{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},
@@ -10264,17 +10094,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -10282,7 +10112,7 @@ public:
{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},
@@ -10395,9 +10225,9 @@ public:
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}}};
+ 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;
@@ -10424,7 +10254,7 @@ public:
// 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;
@@ -10462,83 +10292,83 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_finite_element_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_0_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_0_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 3;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_finite_element_0_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_finite_element_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_0_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_0_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 3;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -10584,7 +10414,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -10621,69 +10451,69 @@ public:
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];
-
+
+ // 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];
@@ -10727,19 +10557,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -10829,9 +10659,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[3][1] = {{1}, {1}, {1}};
- const static double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
+ static const double X[3][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[3][1] = {{1}, {1}, {1}};
+ static const double D[3][1][1] = {{{1}}, {{1}}, {{1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -10858,7 +10688,7 @@ public:
// 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;
@@ -10892,33 +10722,33 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
+ return new stokes_p2p1_1_finite_element_0_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
}
/// Return the cell shape
@@ -10959,7 +10789,7 @@ public:
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;
@@ -11017,7 +10847,7 @@ public:
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},
@@ -11069,7 +10899,7 @@ public:
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},
@@ -11113,7 +10943,7 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
@@ -11152,69 +10982,69 @@ public:
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];
-
+
+ // 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];
@@ -11268,17 +11098,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -11286,7 +11116,7 @@ public:
{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},
@@ -11414,17 +11244,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -11432,7 +11262,7 @@ public:
{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},
@@ -11552,19 +11382,19 @@ public:
const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1;
// Table(s) of coefficients
- const static double coefficients0[3][3] = \
+ static const double coefficients0[3][3] = \
{{0.471404520791032, -0.288675134594813, -0.166666666666667},
{0.471404520791032, 0.288675134594813, -0.166666666666667},
{0.471404520791032, 0, 0.333333333333333}};
// Interesting (new) part
// Tables of derivatives of the polynomial base (transpose)
- const static double dmats0[3][3] = \
+ static const double dmats0[3][3] = \
{{0, 0, 0},
{4.89897948556636, 0, 0},
{0, 0, 0}};
- const static double dmats1[3][3] = \
+ static const double dmats1[3][3] = \
{{0, 0, 0},
{2.44948974278318, 0, 0},
{4.24264068711928, 0, 0}};
@@ -11656,9 +11486,9 @@ public:
const ufc::cell& c) const
{
// The reference points, direction and weights:
- const static double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
- const static double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
- const static double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
+ static const double X[15][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}}, {{0, 0}}, {{1, 0}}, {{0, 1}}};
+ static const double W[15][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}};
+ static const double D[15][1][3] = {{{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{1, 0, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 1, 0}}, {{0, 0, 1}}, {{0, 0, 1}}, {{0, 0, 1}}};
const double * const * x = c.coordinates;
double result = 0.0;
@@ -11685,7 +11515,7 @@ public:
// Take directional components
for(int k = 0; k < 3; k++)
result += values[k]*D[i][0][k];
- // Multiply by weights
+ // Multiply by weights
result *= W[i][0];
return result;
@@ -11727,83 +11557,83 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_finite_element_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_1_0: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_1_0() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_finite_element_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_finite_element_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_1_0: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_1_0() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_1_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -11857,7 +11687,7 @@ public:
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},
@@ -11900,69 +11730,69 @@ public:
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];
-
+
+ // 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];
@@ -12014,7 +11844,7 @@ public:
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},
@@ -12024,7 +11854,7 @@ public:
// 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},
@@ -12032,7 +11862,7 @@ public:
{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},
@@ -12143,9 +11973,9 @@ public:
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;
@@ -12172,7 +12002,7 @@ public:
// 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;
@@ -12206,74 +12036,74 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_1_0();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_1_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_1_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return the cell shape
- virtual ufc::shape cell_shape() const
- {
- return ufc::triangle;
- }
-
- /// Return the dimension of the finite element function space
- virtual unsigned int space_dimension() const
- {
- return 6;
- }
-
- /// Return the rank of the value space
- virtual unsigned int value_rank() const
- {
- return 0;
- }
-
- /// Return the dimension of the value space for axis i
- virtual unsigned int value_dimension(unsigned int i) const
- {
- return 1;
- }
-
- /// 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];
-
+ return new stokes_p2p1_1_finite_element_1_0();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_1_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_1_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_1_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 2)";
+ }
+
+ /// Return the cell shape
+ virtual ufc::shape cell_shape() const
+ {
+ return ufc::triangle;
+ }
+
+ /// Return the dimension of the finite element function space
+ virtual unsigned int space_dimension() const
+ {
+ return 6;
+ }
+
+ /// Return the rank of the value space
+ virtual unsigned int value_rank() const
+ {
+ return 0;
+ }
+
+ /// Return the dimension of the value space for axis i
+ virtual unsigned int value_dimension(unsigned int i) const
+ {
+ return 1;
+ }
+
+ /// 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;
@@ -12327,7 +12157,7 @@ public:
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},
@@ -12370,69 +12200,69 @@ public:
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];
-
+
+ // 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];
@@ -12484,7 +12314,7 @@ public:
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},
@@ -12494,7 +12324,7 @@ public:
// 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},
@@ -12502,7 +12332,7 @@ public:
{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},
@@ -12613,9 +12443,9 @@ public:
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;
@@ -12642,7 +12472,7 @@ public:
// 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;
@@ -12676,33 +12506,33 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_1_1();
- }
-
-};
-
-/// This class defines the interface for a finite element.
-
-class UFC_Stokes_P2P1LinearForm_finite_element_1: public ufc::finite_element
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_finite_element_1() : ufc::finite_element()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_finite_element_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the finite element
- virtual const char* signature() const
- {
- return "MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)])";
+ return new stokes_p2p1_1_finite_element_1_1();
+ }
+
+};
+
+/// This class defines the interface for a finite element.
+
+class stokes_p2p1_1_finite_element_1: public ufc::finite_element
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_finite_element_1() : ufc::finite_element()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_finite_element_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the finite element
+ virtual const char* signature() const
+ {
+ return "VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
}
/// Return the cell shape
@@ -12743,7 +12573,7 @@ public:
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;
@@ -12800,7 +12630,7 @@ public:
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},
@@ -12852,7 +12682,7 @@ public:
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},
@@ -12897,69 +12727,69 @@ public:
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];
-
+
+ // 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];
@@ -13013,17 +12843,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -13031,7 +12861,7 @@ public:
{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},
@@ -13159,17 +12989,17 @@ public:
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] = \
- {{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)
- const static double dmats0[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},
+ {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},
@@ -13177,7 +13007,7 @@ public:
{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},
@@ -13290,9 +13120,9 @@ public:
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}}};
+ 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;
@@ -13319,7 +13149,7 @@ public:
// 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;
@@ -13357,53 +13187,53 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_1_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_finite_element_1_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_0_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_0_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_0_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_finite_element_1_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_finite_element_1_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_0_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_0_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_0_0_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -13444,8 +13274,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -13486,7 +13322,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -13541,44 +13377,44 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_0_0_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_0_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_0_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_0_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_1_dof_map_0_0_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_0_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_0_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_0_0_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -13619,8 +13455,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -13661,7 +13503,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -13716,44 +13558,44 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_0_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_0_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_0_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_0_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_1_dof_map_0_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_0_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_0_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_0_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -13794,8 +13636,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -13844,7 +13692,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -13920,53 +13768,53 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_0_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_dof_map_0_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_0_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_0_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_0_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 1)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_dof_map_0_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_dof_map_0_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_0_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_0_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_0_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)";
+ }
+
+ /// 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;
@@ -14007,128 +13855,134 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_dimension() const
- {
- return 3;
- }
-
- // Return the geometric dimension of the coordinates this dof map provides
- virtual unsigned int geometric_dimension() const
- {
- return 2;
- }
-
- /// Return the number of dofs on each cell facet
- virtual unsigned int num_facet_dofs() const
- {
- return 2;
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// 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;
- break;
- case 1:
- dofs[0] = 0;
- dofs[1] = 2;
- break;
- case 2:
- dofs[0] = 0;
- dofs[1] = 1;
- break;
- }
- }
-
- /// 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).");
- }
-
- /// 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];
- }
-
- /// Return the number of sub dof maps (for a mixed element)
- virtual unsigned int num_sub_dof_maps() const
- {
- return 1;
- }
-
- /// 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 UFC_Stokes_P2P1LinearForm_dof_map_0_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for MixedElement([MixedElement([FiniteElement('Lagrange', 'triangle', 2), FiniteElement('Lagrange', 'triangle', 2)]), FiniteElement('Lagrange', 'triangle', 1)])";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ /// Return the dimension of the local finite element function space for a cell
+ virtual unsigned int local_dimension(const ufc::cell& c) const
+ {
+ return 3;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
+ {
+ return 3;
+ }
+
+ // Return the geometric dimension of the coordinates this dof map provides
+ virtual unsigned int geometric_dimension() const
+ {
+ return 2;
+ }
+
+ /// Return the number of dofs on each cell facet
+ virtual unsigned int num_facet_dofs() const
+ {
+ return 2;
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// 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;
+ break;
+ case 1:
+ dofs[0] = 0;
+ dofs[1] = 2;
+ break;
+ case 2:
+ dofs[0] = 0;
+ dofs[1] = 1;
+ break;
+ }
+ }
+
+ /// 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).");
+ }
+
+ /// 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];
+ }
+
+ /// Return the number of sub dof maps (for a mixed element)
+ virtual unsigned int num_sub_dof_maps() const
+ {
+ return 1;
+ }
+
+ /// 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 stokes_p2p1_1_dof_map_0_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_0()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) })";
+ }
+
+ /// 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;
@@ -14169,8 +14023,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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 15;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 15;
}
@@ -14223,7 +14083,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -14311,53 +14171,53 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_0_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_dof_map_0_1();
- break;
- }
- return 0;
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_1_0: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_1_0() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_1_0()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_dof_map_0_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_dof_map_0_1();
+ break;
+ }
+ return 0;
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_1_0: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_1_0() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_1_0()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -14398,8 +14258,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -14440,7 +14306,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -14495,44 +14361,44 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_1_0();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_1_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_1_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_1_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* signature() const
- {
- return "FFC dof map for FiniteElement('Lagrange', 'triangle', 2)";
- }
-
- /// Return true iff mesh entities of topological dimension d are needed
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_1_dof_map_1_0();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_1_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_1_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_1_1()
+ {
+ // Do nothing
+ }
+
+ /// 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)";
+ }
+
+ /// 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;
@@ -14573,8 +14439,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 6;
}
@@ -14615,7 +14487,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -14670,44 +14542,44 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_1_1();
- }
-
-};
-
-/// This class defines the interface for a local-to-global mapping of
-/// degrees of freedom (dofs).
-
-class UFC_Stokes_P2P1LinearForm_dof_map_1: public ufc::dof_map
-{
-private:
-
- unsigned int __global_dimension;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_dof_map_1() : ufc::dof_map()
- {
- __global_dimension = 0;
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_dof_map_1()
- {
- // Do nothing
- }
-
- /// Return a string identifying the dof map
- virtual const char* 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
- virtual bool needs_mesh_entities(unsigned int d) const
- {
- switch (d)
+ return new stokes_p2p1_1_dof_map_1_1();
+ }
+
+};
+
+/// This class defines the interface for a local-to-global mapping of
+/// degrees of freedom (dofs).
+
+class stokes_p2p1_1_dof_map_1: public ufc::dof_map
+{
+private:
+
+ unsigned int __global_dimension;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_dof_map_1() : ufc::dof_map()
+ {
+ __global_dimension = 0;
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_dof_map_1()
+ {
+ // Do nothing
+ }
+
+ /// Return a string identifying the dof map
+ virtual const char* signature() const
+ {
+ return "FFC dof map for VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2)";
+ }
+
+ /// 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;
@@ -14748,8 +14620,14 @@ public:
return __global_dimension;
}
- /// Return the dimension of the local finite element function space
- virtual unsigned int local_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;
+ }
+
+ /// Return the maximum dimension of the local finite element function space
+ virtual unsigned int max_local_dimension() const
{
return 12;
}
@@ -14798,7 +14676,7 @@ public:
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const
{
- switch (facet)
+ switch ( facet )
{
case 0:
dofs[0] = 1;
@@ -14874,13 +14752,13 @@ public:
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_1_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_dof_map_1_1();
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_dof_map_1_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_dof_map_1_1();
break;
}
return 0;
@@ -14892,18 +14770,18 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_P2P1LinearForm_cell_integral_0_quadrature: public ufc::cell_integral
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_cell_integral_0_quadrature() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_cell_integral_0_quadrature()
+class stokes_p2p1_1_cell_integral_0_quadrature: public ufc::cell_integral
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_1_cell_integral_0_quadrature() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_cell_integral_0_quadrature()
{
// Do nothing
}
@@ -14921,10 +14799,10 @@ public:
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
@@ -14932,10 +14810,11 @@ public:
// 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 FE1_C0[9][6] = \
+ 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)
+
+ // Value of basis functions at quadrature points.
+ static const double FE0_C0[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},
@@ -14945,14 +14824,15 @@ public:
{-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 nzc0[6] = {0, 1, 2, 3, 4, 5};
+ static const unsigned int nzc2[6] = {0, 1, 2, 3, 4, 5};
+ // Array of non-zero columns
+ static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
// Array of non-zero columns
static const unsigned int nzc1[6] = {6, 7, 8, 9, 10, 11};
// Array of non-zero columns
- static const unsigned int nzc3[6] = {6, 7, 8, 9, 10, 11};
- // Array of non-zero columns
- static const unsigned int nzc4[6] = {0, 1, 2, 3, 4, 5};
+ static const unsigned int nzc0[6] = {0, 1, 2, 3, 4, 5};
// 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)
@@ -14970,25 +14850,25 @@ public:
// Total number of operations to compute function values = 24
for (unsigned int r = 0; r < 6; r++)
{
- F0 += FE1_C0[ip][r]*w[0][nzc0[r]];
- F1 += FE1_C0[ip][r]*w[0][nzc1[r]];
+ F0 += FE0_C0[ip][r]*w[0][nzc0[r]];
+ F1 += FE0_C0[ip][r]*w[0][nzc1[r]];
}// end loop over 'r'
// Number of operations to compute ip constants: 4
// Number of operations: 2
- const double Gip0 = F0*W9[ip]*det;
+ const double Gip0 = F1*W9[ip]*det;
// Number of operations: 2
- const double Gip1 = F1*W9[ip]*det;
-
-
- // Number of operations for primary indices = 24
+ const double Gip1 = F0*W9[ip]*det;
+
+
+ // Number of operations for primary indices: 24
for (unsigned int j = 0; j < 6; j++)
{
- // Number of operations to compute entry = 2
- A[nzc4[j]] += FE1_C0[ip][j]*Gip0;
- // Number of operations to compute entry = 2
- A[nzc3[j]] += FE1_C0[ip][j]*Gip1;
+ // Number of operations to compute entry: 2
+ A[nzc3[j]] += FE0_C0[ip][j]*Gip0;
+ // Number of operations to compute entry: 2
+ A[nzc2[j]] += FE0_C0[ip][j]*Gip1;
}// end loop over 'j'
}// end loop over 'ip'
}
@@ -14999,22 +14879,22 @@ public:
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
-class UFC_Stokes_P2P1LinearForm_cell_integral_0: public ufc::cell_integral
-{
-private:
-
- UFC_Stokes_P2P1LinearForm_cell_integral_0_quadrature integral_0_quadrature;
-
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm_cell_integral_0() : ufc::cell_integral()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm_cell_integral_0()
+class stokes_p2p1_1_cell_integral_0: public ufc::cell_integral
+{
+private:
+
+ stokes_p2p1_1_cell_integral_0_quadrature integral_0_quadrature;
+
+public:
+
+ /// Constructor
+ stokes_p2p1_1_cell_integral_0() : ufc::cell_integral()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_1_cell_integral_0()
{
// Do nothing
}
@@ -15025,21 +14905,8 @@ public:
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;
+ for (unsigned int j = 0; j < 15; j++)
+ A[j] = 0;
// Add all contributions to element tensor
integral_0_quadrature.tabulate_tensor(A, w, c);
@@ -15062,18 +14929,18 @@ public:
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
-class UFC_Stokes_P2P1LinearForm: public ufc::form
-{
-public:
-
- /// Constructor
- UFC_Stokes_P2P1LinearForm() : ufc::form()
- {
- // Do nothing
- }
-
- /// Destructor
- virtual ~UFC_Stokes_P2P1LinearForm()
+class stokes_p2p1_form_1: public ufc::form
+{
+public:
+
+ /// Constructor
+ stokes_p2p1_form_1() : ufc::form()
+ {
+ // Do nothing
+ }
+
+ /// Destructor
+ virtual ~stokes_p2p1_form_1()
{
// Do nothing
}
@@ -15081,7 +14948,7 @@ public:
/// Return a string identifying the form
virtual const char* signature() const
{
- return "Form([Integral(IndexSum(Product(Indexed(Function(VectorElement('Lagrange', Cell('triangle', 1), 2, 2), 0), MultiIndex((Index(0),))), Indexed(ListTensor(Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(0),))), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(1),)))), MultiIndex((Index(0),)))), MultiIndex((Index(0),))), Measure('cell', 0, {'ffc_representation': 'quadrature', 'quadrature_order': 4}))])";
+ return "Form([Integral(IndexSum(Product(Indexed(Function(VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), 0), MultiIndex((Index(0),), {Index(0): 2})), Indexed(ListTensor(Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(0),), {FixedIndex(0): 3})), Indexed(BasisFunction(MixedElement(*[VectorElement('Lagrange', Cell('triangle', 1, Space(2)), 2, 2), FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)], **{'value_shape': (3,) }), 0), MultiIndex((FixedIndex(1),), {FixedIndex(1): 3}))), MultiIndex((Index(0),), {Index(0): 2}))), MultiIndex((Index(0),), {Index(0): 2})), Measure('cell', 0, None))])";
}
/// Return the rank of the global tensor (r)
@@ -15101,44 +14968,44 @@ public:
{
return 1;
}
-
+
/// Return the number of exterior facet integrals
virtual unsigned int num_exterior_facet_integrals() const
{
return 0;
}
-
+
/// Return the number of interior facet integrals
virtual unsigned int num_interior_facet_integrals() const
{
return 0;
}
-
+
/// 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 UFC_Stokes_P2P1LinearForm_finite_element_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_finite_element_1();
- break;
- }
- return 0;
- }
-
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_finite_element_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_finite_element_1();
+ break;
+ }
+ return 0;
+ }
+
/// 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 UFC_Stokes_P2P1LinearForm_dof_map_0();
- break;
- case 1:
- return new UFC_Stokes_P2P1LinearForm_dof_map_1();
+ switch ( i )
+ {
+ case 0:
+ return new stokes_p2p1_1_dof_map_0();
+ break;
+ case 1:
+ return new stokes_p2p1_1_dof_map_1();
break;
}
return 0;
@@ -15147,7 +15014,7 @@ public:
/// Create a new cell integral on sub domain i
virtual ufc::cell_integral* create_cell_integral(unsigned int i) const
{
- return new UFC_Stokes_P2P1LinearForm_cell_integral_0();
+ return new stokes_p2p1_1_cell_integral_0();
}
/// Create a new exterior facet integral on sub domain i
@@ -15166,317 +15033,454 @@ public:
// DOLFIN wrappers
-#include <dolfin/fem/Form.h>
+// Standard library includes
+#include <string>
+
+// DOLFIN includes
+#include <dolfin/common/NoDeleter.h>
#include <dolfin/fem/FiniteElement.h>
#include <dolfin/fem/DofMap.h>
-#include <dolfin/function/Coefficient.h>
-#include <dolfin/function/Function.h>
+#include <dolfin/fem/Form.h>
#include <dolfin/function/FunctionSpace.h>
-
-class Stokes_P2P1BilinearFormFunctionSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1BilinearFormFunctionSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1BilinearFormFunctionSpace1 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1BilinearFormFunctionSpace1(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1BilinearFormCoefficientSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1BilinearFormCoefficientSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1BilinearForm_finite_element_2()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1BilinearForm_dof_map_2()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1LinearFormFunctionSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1LinearFormFunctionSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1LinearFormCoefficientSpace0 : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1LinearFormCoefficientSpace0(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_1()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_1()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1TestSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1TestSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1TrialSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1TrialSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1FunctionSpace : public dolfin::FunctionSpace
-{
-public:
-
- Stokes_P2P1FunctionSpace(const dolfin::Mesh& mesh)
- : dolfin::FunctionSpace(boost::shared_ptr<const dolfin::Mesh>(&mesh, dolfin::NoDeleter<const dolfin::Mesh>()),
- boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new UFC_Stokes_P2P1LinearForm_finite_element_0()))),
- boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new UFC_Stokes_P2P1LinearForm_dof_map_0()), mesh)))
- {
- // Do nothing
- }
-
-};
-
-class Stokes_P2P1BilinearFormCoefficient0 : public dolfin::Coefficient
+#include <dolfin/function/GenericFunction.h>
+#include <dolfin/function/CoefficientAssigner.h>
+
+namespace Stokes_P2P1
+{
+
+class CoefficientSpace_alpha: public dolfin::FunctionSpace
+{
+public:
+
+ CoefficientSpace_alpha(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_2()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_2()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_2()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_alpha(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_2()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_2()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~CoefficientSpace_alpha()
+ {
+ }
+
+};
+
+class CoefficientSpace_f: public dolfin::FunctionSpace
+{
+public:
+
+ CoefficientSpace_f(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_f(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_f(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ CoefficientSpace_f(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~CoefficientSpace_f()
+ {
+ }
+
+};
+
+class Form_0_FunctionSpace_0: public dolfin::FunctionSpace
+{
+public:
+
+ Form_0_FunctionSpace_0(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~Form_0_FunctionSpace_0()
+ {
+ }
+
+};
+
+class Form_0_FunctionSpace_1: public dolfin::FunctionSpace
+{
+public:
+
+ Form_0_FunctionSpace_1(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_1()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_0_FunctionSpace_1(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_0_finite_element_1()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_0_dof_map_1()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~Form_0_FunctionSpace_1()
+ {
+ }
+
+};
+
+typedef CoefficientSpace_alpha Form_0_FunctionSpace_2;
+
+class Form_0: public dolfin::Form
{
public:
// Constructor
- Stokes_P2P1BilinearFormCoefficient0(dolfin::Form& form) : dolfin::Coefficient(form) {}
-
- // Destructor
- ~Stokes_P2P1BilinearFormCoefficient0() {}
-
- // Attach function to coefficient
- const Stokes_P2P1BilinearFormCoefficient0& operator= (dolfin::Function& v)
- {
- attach(v);
- return *this;
- }
-
- /// Create function space for coefficient
- const dolfin::FunctionSpace* create_function_space() const
- {
- return new Stokes_P2P1BilinearFormCoefficientSpace0(form.mesh());
- }
-
- /// Return coefficient number
- dolfin::uint number() const
- {
- return 0;
- }
-
- /// Return coefficient name
- virtual std::string name() const
- {
- return "alpha";
- }
-
-};
-class Stokes_P2P1BilinearForm : public dolfin::Form
-{
-public:
-
- // Create form on given function space(s)
- Stokes_P2P1BilinearForm(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1) : dolfin::Form(), alpha(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
- boost::shared_ptr<const dolfin::FunctionSpace> _V1(&V1, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1BilinearForm());
- }
-
- // Create form on given function space(s) (shared data)
- Stokes_P2P1BilinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1) : dolfin::Form(), alpha(*this)
- {
- _function_spaces.push_back(V0);
- _function_spaces.push_back(V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1BilinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s)
- Stokes_P2P1BilinearForm(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, dolfin::Function& w0) : dolfin::Form(), alpha(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
- boost::shared_ptr<const dolfin::FunctionSpace> _V1(&V1, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->alpha = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1BilinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s) (shared data)
- Stokes_P2P1BilinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, dolfin::Function& w0) : dolfin::Form(), alpha(*this)
- {
- _function_spaces.push_back(V0);
- _function_spaces.push_back(V1);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->alpha = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1BilinearForm());
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, const dolfin::GenericFunction& alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ this->alpha = alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
+ }
+
+ // Constructor
+ Form_0(const dolfin::FunctionSpace& V0, const dolfin::FunctionSpace& V1, boost::shared_ptr<const dolfin::GenericFunction> alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+ _function_spaces[1] = reference_to_no_delete_pointer(V1);
+
+ this->alpha = *alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, const dolfin::GenericFunction& alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ this->alpha = alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
+ }
+
+ // Constructor
+ Form_0(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::FunctionSpace> V1, boost::shared_ptr<const dolfin::GenericFunction> alpha):
+ dolfin::Form(2, 1), alpha(*this, 0)
+ {
+ _function_spaces[0] = V0;
+ _function_spaces[1] = V1;
+
+ this->alpha = *alpha;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_0());
}
// Destructor
- ~Stokes_P2P1BilinearForm() {}
+ ~Form_0()
+ {}
+
+ /// Return the number of the coefficient with this name
+ virtual dolfin::uint coefficient_number(const std::string& name) const
+ {
+ if (name == "alpha")
+ return 0;
+
+ dolfin::error("Invalid coefficient.");
+ return 0;
+ }
+
+ /// Return the name of the coefficient with this number
+ virtual std::string coefficient_name(dolfin::uint i) const
+ {
+ switch (i)
+ {
+ case 0:
+ return "alpha";
+ }
+
+ dolfin::error("Invalid coefficient.");
+ return "unnamed";
+ }
+
+ // Typedefs
+ typedef Form_0_FunctionSpace_0 TestSpace;
+ typedef Form_0_FunctionSpace_1 TrialSpace;
+ typedef Form_0_FunctionSpace_2 CoefficientSpace_alpha;
// Coefficients
- Stokes_P2P1BilinearFormCoefficient0 alpha;
-
-};
-
-class Stokes_P2P1LinearFormCoefficient0 : public dolfin::Coefficient
+ dolfin::CoefficientAssigner alpha;
+};
+
+class Form_1_FunctionSpace_0: public dolfin::FunctionSpace
+{
+public:
+
+ Form_1_FunctionSpace_0(const dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_1_FunctionSpace_0(dolfin::Mesh& mesh):
+ dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_0()), mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_1_FunctionSpace_0(boost::shared_ptr<dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+ Form_1_FunctionSpace_0(boost::shared_ptr<const dolfin::Mesh> mesh):
+ dolfin::FunctionSpace(mesh,
+ boost::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(boost::shared_ptr<ufc::finite_element>(new stokes_p2p1_1_finite_element_0()))),
+ boost::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(boost::shared_ptr<ufc::dof_map>(new stokes_p2p1_1_dof_map_0()), *mesh)))
+ {
+ // Do nothing
+ }
+
+
+ ~Form_1_FunctionSpace_0()
+ {
+ }
+
+};
+
+typedef CoefficientSpace_f Form_1_FunctionSpace_1;
+
+class Form_1: public dolfin::Form
{
public:
// Constructor
- Stokes_P2P1LinearFormCoefficient0(dolfin::Form& form) : dolfin::Coefficient(form) {}
-
- // Destructor
- ~Stokes_P2P1LinearFormCoefficient0() {}
-
- // Attach function to coefficient
- const Stokes_P2P1LinearFormCoefficient0& operator= (dolfin::Function& v)
- {
- attach(v);
- return *this;
- }
-
- /// Create function space for coefficient
- const dolfin::FunctionSpace* create_function_space() const
- {
- return new Stokes_P2P1LinearFormCoefficientSpace0(form.mesh());
- }
-
- /// Return coefficient number
- dolfin::uint number() const
- {
- return 0;
- }
-
- /// Return coefficient name
- virtual std::string name() const
- {
- return "f";
- }
-
-};
-class Stokes_P2P1LinearForm : public dolfin::Form
-{
-public:
-
- // Create form on given function space(s)
- Stokes_P2P1LinearForm(const dolfin::FunctionSpace& V0) : dolfin::Form(), f(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1LinearForm());
- }
-
- // Create form on given function space(s) (shared data)
- Stokes_P2P1LinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0) : dolfin::Form(), f(*this)
- {
- _function_spaces.push_back(V0);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1LinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s)
- Stokes_P2P1LinearForm(const dolfin::FunctionSpace& V0, dolfin::Function& w0) : dolfin::Form(), f(*this)
- {
- boost::shared_ptr<const dolfin::FunctionSpace> _V0(&V0, dolfin::NoDeleter<const dolfin::FunctionSpace>());
- _function_spaces.push_back(_V0);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->f = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1LinearForm());
- }
-
- // Create form on given function space(s) with given coefficient(s) (shared data)
- Stokes_P2P1LinearForm(boost::shared_ptr<const dolfin::FunctionSpace> V0, dolfin::Function& w0) : dolfin::Form(), f(*this)
- {
- _function_spaces.push_back(V0);
-
- _coefficients.push_back(boost::shared_ptr<const dolfin::Function>(static_cast<const dolfin::Function*>(0)));
-
- this->f = w0;
-
- _ufc_form = boost::shared_ptr<const ufc::form>(new UFC_Stokes_P2P1LinearForm());
+ Form_1(const dolfin::FunctionSpace& V0):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
+ }
+
+ // Constructor
+ Form_1(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& f):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+
+ this->f = f;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
+ }
+
+ // Constructor
+ Form_1(const dolfin::FunctionSpace& V0, boost::shared_ptr<const dolfin::GenericFunction> f):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = reference_to_no_delete_pointer(V0);
+
+ this->f = *f;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
+ }
+
+ // Constructor
+ Form_1(boost::shared_ptr<const dolfin::FunctionSpace> V0):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = V0;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
+ }
+
+ // Constructor
+ Form_1(boost::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& f):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = V0;
+
+ this->f = f;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
+ }
+
+ // Constructor
+ Form_1(boost::shared_ptr<const dolfin::FunctionSpace> V0, boost::shared_ptr<const dolfin::GenericFunction> f):
+ dolfin::Form(1, 1), f(*this, 0)
+ {
+ _function_spaces[0] = V0;
+
+ this->f = *f;
+
+ _ufc_form = boost::shared_ptr<const ufc::form>(new stokes_p2p1_form_1());
}
// Destructor
- ~Stokes_P2P1LinearForm() {}
+ ~Form_1()
+ {}
+
+ /// Return the number of the coefficient with this name
+ virtual dolfin::uint coefficient_number(const std::string& name) const
+ {
+ if (name == "f")
+ return 0;
+
+ dolfin::error("Invalid coefficient.");
+ return 0;
+ }
+
+ /// Return the name of the coefficient with this number
+ virtual std::string coefficient_name(dolfin::uint i) const
+ {
+ switch (i)
+ {
+ case 0:
+ return "f";
+ }
+
+ dolfin::error("Invalid coefficient.");
+ return "unnamed";
+ }
+
+ // Typedefs
+ typedef Form_1_FunctionSpace_0 TestSpace;
+ typedef Form_1_FunctionSpace_1 CoefficientSpace_f;
// Coefficients
- Stokes_P2P1LinearFormCoefficient0 f;
-
-};
+ dolfin::CoefficientAssigner f;
+};
+
+// Class typedefs
+typedef Form_0 BilinearForm;
+typedef Form_1 LinearForm;
+typedef Form_0::TestSpace FunctionSpace;
+
+} // namespace Stokes_P2P1
#endif
diff -r 6ed545ae2f2b -r de7f60d82394 MADDs-1/cpp/Stokes_P2P1.ufl
--- a/MADDs-1/cpp/Stokes_P2P1.ufl Sat Dec 05 06:00:01 2009 -0500
+++ b/MADDs-1/cpp/Stokes_P2P1.ufl Sat Dec 05 06:00:28 2009 -0500
@@ -7,7 +7,7 @@
# The bilinear form a(v, u) and Linear form L(v) for the Stokes
# equations using a mixed formulation (Taylor-Hood elements).
#
-# Compile this form with FFC: ffc -l dolfin Stokes.ufl
+# Compile this form with FFC: ffc -l dolfin -O Stokes_P2P1.ufl
P2 = VectorElement("Lagrange", triangle, 2)
P1 = FiniteElement("Lagrange", triangle, 1)
More information about the CIG-COMMITS
mailing list