6889
6889
return new UFC_NSEContinuity3DLinearForm_finite_element_3();
6894
UFC_NSEContinuity3DLinearForm_finite_element_4::UFC_NSEContinuity3DLinearForm_finite_element_4() : ufc::finite_element()
6900
UFC_NSEContinuity3DLinearForm_finite_element_4::~UFC_NSEContinuity3DLinearForm_finite_element_4()
6905
/// Return a string identifying the finite element
6906
const char* UFC_NSEContinuity3DLinearForm_finite_element_4::signature() const
6908
return "Discontinuous Lagrange finite element of degree 0 on a tetrahedron";
6911
/// Return the cell shape
6912
ufc::shape UFC_NSEContinuity3DLinearForm_finite_element_4::cell_shape() const
6914
return ufc::tetrahedron;
6917
/// Return the dimension of the finite element function space
6918
unsigned int UFC_NSEContinuity3DLinearForm_finite_element_4::space_dimension() const
6923
/// Return the rank of the value space
6924
unsigned int UFC_NSEContinuity3DLinearForm_finite_element_4::value_rank() const
6929
/// Return the dimension of the value space for axis i
6930
unsigned int UFC_NSEContinuity3DLinearForm_finite_element_4::value_dimension(unsigned int i) const
6935
/// Evaluate basis function i at given point in cell
6936
void UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_basis(unsigned int i,
6938
const double* coordinates,
6939
const ufc::cell& c) const
6941
// Extract vertex coordinates
6942
const double * const * element_coordinates = c.coordinates;
6944
// Compute Jacobian of affine map from reference cell
6945
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
6946
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
6947
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
6948
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
6949
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
6950
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
6951
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
6952
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
6953
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
6955
// Compute sub determinants
6956
const double d00 = J_11*J_22 - J_12*J_21;
6957
const double d01 = J_12*J_20 - J_10*J_22;
6958
const double d02 = J_10*J_21 - J_11*J_20;
6960
const double d10 = J_02*J_21 - J_01*J_22;
6961
const double d11 = J_00*J_22 - J_02*J_20;
6962
const double d12 = J_01*J_20 - J_00*J_21;
6964
const double d20 = J_01*J_12 - J_02*J_11;
6965
const double d21 = J_02*J_10 - J_00*J_12;
6966
const double d22 = J_00*J_11 - J_01*J_10;
6968
// Compute determinant of Jacobian
6969
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
6971
// Compute inverse of Jacobian
6973
// Compute constants
6974
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
6975
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
6976
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
6978
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
6979
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
6980
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
6982
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
6983
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
6984
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
6986
// Get coordinates and map to the UFC reference element
6987
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
6988
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
6989
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
6991
// Map coordinates to the reference cube
6992
if (std::abs(y + z - 1.0) < 1e-14)
6995
x = -2.0 * x/(y + z - 1.0) - 1.0;
6996
if (std::abs(z - 1.0) < 1e-14)
6999
y = 2.0 * y/(1.0 - z) - 1.0;
7005
// Map degree of freedom to element degree of freedom
7006
const unsigned int dof = i;
7008
// Generate scalings
7009
const double scalings_y_0 = 1;
7010
const double scalings_z_0 = 1;
7012
// Compute psitilde_a
7013
const double psitilde_a_0 = 1;
7015
// Compute psitilde_bs
7016
const double psitilde_bs_0_0 = 1;
7018
// Compute psitilde_cs
7019
const double psitilde_cs_00_0 = 1;
7021
// Compute basisvalues
7022
const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
7024
// Table(s) of coefficients
7025
const static double coefficients0[1][1] = \
7026
{{1.15470053837925}};
7028
// Extract relevant coefficients
7029
const double coeff0_0 = coefficients0[dof][0];
7032
*values = coeff0_0*basisvalue0;
7035
/// Evaluate all basis functions at given point in cell
7036
void UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_basis_all(double* values,
7037
const double* coordinates,
7038
const ufc::cell& c) const
7040
throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented.");
7043
/// Evaluate order n derivatives of basis function i at given point in cell
7044
void UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_basis_derivatives(unsigned int i,
7047
const double* coordinates,
7048
const ufc::cell& c) const
7050
// Extract vertex coordinates
7051
const double * const * element_coordinates = c.coordinates;
7053
// Compute Jacobian of affine map from reference cell
7054
const double J_00 = element_coordinates[1][0] - element_coordinates[0][0];
7055
const double J_01 = element_coordinates[2][0] - element_coordinates[0][0];
7056
const double J_02 = element_coordinates[3][0] - element_coordinates[0][0];
7057
const double J_10 = element_coordinates[1][1] - element_coordinates[0][1];
7058
const double J_11 = element_coordinates[2][1] - element_coordinates[0][1];
7059
const double J_12 = element_coordinates[3][1] - element_coordinates[0][1];
7060
const double J_20 = element_coordinates[1][2] - element_coordinates[0][2];
7061
const double J_21 = element_coordinates[2][2] - element_coordinates[0][2];
7062
const double J_22 = element_coordinates[3][2] - element_coordinates[0][2];
7064
// Compute sub determinants
7065
const double d00 = J_11*J_22 - J_12*J_21;
7066
const double d01 = J_12*J_20 - J_10*J_22;
7067
const double d02 = J_10*J_21 - J_11*J_20;
7069
const double d10 = J_02*J_21 - J_01*J_22;
7070
const double d11 = J_00*J_22 - J_02*J_20;
7071
const double d12 = J_01*J_20 - J_00*J_21;
7073
const double d20 = J_01*J_12 - J_02*J_11;
7074
const double d21 = J_02*J_10 - J_00*J_12;
7075
const double d22 = J_00*J_11 - J_01*J_10;
7077
// Compute determinant of Jacobian
7078
double detJ = J_00*d00 + J_10*d10 + J_20*d20;
7080
// Compute inverse of Jacobian
7082
// Compute constants
7083
const double C0 = d00*(element_coordinates[0][0] - element_coordinates[2][0] - element_coordinates[3][0]) \
7084
+ d10*(element_coordinates[0][1] - element_coordinates[2][1] - element_coordinates[3][1]) \
7085
+ d20*(element_coordinates[0][2] - element_coordinates[2][2] - element_coordinates[3][2]);
7087
const double C1 = d01*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[3][0]) \
7088
+ d11*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[3][1]) \
7089
+ d21*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[3][2]);
7091
const double C2 = d02*(element_coordinates[0][0] - element_coordinates[1][0] - element_coordinates[2][0]) \
7092
+ d12*(element_coordinates[0][1] - element_coordinates[1][1] - element_coordinates[2][1]) \
7093
+ d22*(element_coordinates[0][2] - element_coordinates[1][2] - element_coordinates[2][2]);
7095
// Get coordinates and map to the UFC reference element
7096
double x = (C0 + d00*coordinates[0] + d10*coordinates[1] + d20*coordinates[2]) / detJ;
7097
double y = (C1 + d01*coordinates[0] + d11*coordinates[1] + d21*coordinates[2]) / detJ;
7098
double z = (C2 + d02*coordinates[0] + d12*coordinates[1] + d22*coordinates[2]) / detJ;
7100
// Map coordinates to the reference cube
7101
if (std::abs(y + z - 1.0) < 1e-14)
7104
x = -2.0 * x/(y + z - 1.0) - 1.0;
7105
if (std::abs(z - 1.0) < 1e-14)
7108
y = 2.0 * y/(1.0 - z) - 1.0;
7111
// Compute number of derivatives
7112
unsigned int num_derivatives = 1;
7114
for (unsigned int j = 0; j < n; j++)
7115
num_derivatives *= 3;
7118
// Declare pointer to two dimensional array that holds combinations of derivatives and initialise
7119
unsigned int **combinations = new unsigned int *[num_derivatives];
7121
for (unsigned int j = 0; j < num_derivatives; j++)
7123
combinations[j] = new unsigned int [n];
7124
for (unsigned int k = 0; k < n; k++)
7125
combinations[j][k] = 0;
7128
// Generate combinations of derivatives
7129
for (unsigned int row = 1; row < num_derivatives; row++)
7131
for (unsigned int num = 0; num < row; num++)
7133
for (unsigned int col = n-1; col+1 > 0; col--)
7135
if (combinations[row][col] + 1 > 2)
7136
combinations[row][col] = 0;
7139
combinations[row][col] += 1;
7146
// Compute inverse of Jacobian
7147
const double Jinv[3][3] ={{d00 / detJ, d10 / detJ, d20 / detJ}, {d01 / detJ, d11 / detJ, d21 / detJ}, {d02 / detJ, d12 / detJ, d22 / detJ}};
7149
// Declare transformation matrix
7150
// Declare pointer to two dimensional array and initialise
7151
double **transform = new double *[num_derivatives];
7153
for (unsigned int j = 0; j < num_derivatives; j++)
7155
transform[j] = new double [num_derivatives];
7156
for (unsigned int k = 0; k < num_derivatives; k++)
7157
transform[j][k] = 1;
7160
// Construct transformation matrix
7161
for (unsigned int row = 0; row < num_derivatives; row++)
7163
for (unsigned int col = 0; col < num_derivatives; col++)
7165
for (unsigned int k = 0; k < n; k++)
7166
transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]];
7171
for (unsigned int j = 0; j < 1*num_derivatives; j++)
7174
// Map degree of freedom to element degree of freedom
7175
const unsigned int dof = i;
7177
// Generate scalings
7178
const double scalings_y_0 = 1;
7179
const double scalings_z_0 = 1;
7181
// Compute psitilde_a
7182
const double psitilde_a_0 = 1;
7184
// Compute psitilde_bs
7185
const double psitilde_bs_0_0 = 1;
7187
// Compute psitilde_cs
7188
const double psitilde_cs_00_0 = 1;
7190
// Compute basisvalues
7191
const double basisvalue0 = 0.866025403784439*psitilde_a_0*scalings_y_0*psitilde_bs_0_0*scalings_z_0*psitilde_cs_00_0;
7193
// Table(s) of coefficients
7194
const static double coefficients0[1][1] = \
7195
{{1.15470053837925}};
7197
// Interesting (new) part
7198
// Tables of derivatives of the polynomial base (transpose)
7199
const static double dmats0[1][1] = \
7202
const static double dmats1[1][1] = \
7205
const static double dmats2[1][1] = \
7208
// Compute reference derivatives
7209
// Declare pointer to array of derivatives on FIAT element
7210
double *derivatives = new double [num_derivatives];
7212
// Declare coefficients
7213
double coeff0_0 = 0;
7215
// Declare new coefficients
7216
double new_coeff0_0 = 0;
7218
// Loop possible derivatives
7219
for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++)
7221
// Get values from coefficients array
7222
new_coeff0_0 = coefficients0[dof][0];
7224
// Loop derivative order
7225
for (unsigned int j = 0; j < n; j++)
7227
// Update old coefficients
7228
coeff0_0 = new_coeff0_0;
7230
if(combinations[deriv_num][j] == 0)
7232
new_coeff0_0 = coeff0_0*dmats0[0][0];
7234
if(combinations[deriv_num][j] == 1)
7236
new_coeff0_0 = coeff0_0*dmats1[0][0];
7238
if(combinations[deriv_num][j] == 2)
7240
new_coeff0_0 = coeff0_0*dmats2[0][0];
7244
// Compute derivatives on reference element as dot product of coefficients and basisvalues
7245
derivatives[deriv_num] = new_coeff0_0*basisvalue0;
7248
// Transform derivatives back to physical element
7249
for (unsigned int row = 0; row < num_derivatives; row++)
7251
for (unsigned int col = 0; col < num_derivatives; col++)
7253
values[row] += transform[row][col]*derivatives[col];
7256
// Delete pointer to array of derivatives on FIAT element
7257
delete [] derivatives;
7259
// Delete pointer to array of combinations of derivatives and transform
7260
for (unsigned int row = 0; row < num_derivatives; row++)
7262
delete [] combinations[row];
7263
delete [] transform[row];
7266
delete [] combinations;
7267
delete [] transform;
7270
/// Evaluate order n derivatives of all basis functions at given point in cell
7271
void UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_basis_derivatives_all(unsigned int n,
7273
const double* coordinates,
7274
const ufc::cell& c) const
7276
throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented.");
7279
/// Evaluate linear functional for dof i on the function f
7280
double UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_dof(unsigned int i,
7281
const ufc::function& f,
7282
const ufc::cell& c) const
7284
// The reference points, direction and weights:
7285
const static double X[1][1][3] = {{{0.25, 0.25, 0.25}}};
7286
const static double W[1][1] = {{1}};
7287
const static double D[1][1][1] = {{{1}}};
7289
const double * const * x = c.coordinates;
7290
double result = 0.0;
7291
// Iterate over the points:
7292
// Evaluate basis functions for affine mapping
7293
const double w0 = 1.0 - X[i][0][0] - X[i][0][1] - X[i][0][2];
7294
const double w1 = X[i][0][0];
7295
const double w2 = X[i][0][1];
7296
const double w3 = X[i][0][2];
7298
// Compute affine mapping y = F(X)
7300
y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0] + w3*x[3][0];
7301
y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1] + w3*x[3][1];
7302
y[2] = w0*x[0][2] + w1*x[1][2] + w2*x[2][2] + w3*x[3][2];
7304
// Evaluate function at physical points
7306
f.evaluate(values, y, c);
7308
// Map function values using appropriate mapping
7309
// Affine map: Do nothing
7311
// Note that we do not map the weights (yet).
7313
// Take directional components
7314
for(int k = 0; k < 1; k++)
7315
result += values[k]*D[i][0][k];
7316
// Multiply by weights
7322
/// Evaluate linear functionals for all dofs on the function f
7323
void UFC_NSEContinuity3DLinearForm_finite_element_4::evaluate_dofs(double* values,
7324
const ufc::function& f,
7325
const ufc::cell& c) const
7327
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
7330
/// Interpolate vertex values from dof values
7331
void UFC_NSEContinuity3DLinearForm_finite_element_4::interpolate_vertex_values(double* vertex_values,
7332
const double* dof_values,
7333
const ufc::cell& c) const
7335
// Evaluate at vertices and use affine mapping
7336
vertex_values[0] = dof_values[0];
7337
vertex_values[1] = dof_values[0];
7338
vertex_values[2] = dof_values[0];
7339
vertex_values[3] = dof_values[0];
7342
/// Return the number of sub elements (for a mixed element)
7343
unsigned int UFC_NSEContinuity3DLinearForm_finite_element_4::num_sub_elements() const
7348
/// Create a new finite element for sub element i (for a mixed element)
7349
ufc::finite_element* UFC_NSEContinuity3DLinearForm_finite_element_4::create_sub_element(unsigned int i) const
7351
return new UFC_NSEContinuity3DLinearForm_finite_element_4();
6892
7354
/// Constructor
6893
7355
UFC_NSEContinuity3DLinearForm_dof_map_0::UFC_NSEContinuity3DLinearForm_dof_map_0() : ufc::dof_map()
8118
8580
/// Constructor
8581
UFC_NSEContinuity3DLinearForm_dof_map_4::UFC_NSEContinuity3DLinearForm_dof_map_4() : ufc::dof_map()
8583
__global_dimension = 0;
8587
UFC_NSEContinuity3DLinearForm_dof_map_4::~UFC_NSEContinuity3DLinearForm_dof_map_4()
8592
/// Return a string identifying the dof map
8593
const char* UFC_NSEContinuity3DLinearForm_dof_map_4::signature() const
8595
return "FFC dof map for Discontinuous Lagrange finite element of degree 0 on a tetrahedron";
8598
/// Return true iff mesh entities of topological dimension d are needed
8599
bool UFC_NSEContinuity3DLinearForm_dof_map_4::needs_mesh_entities(unsigned int d) const
8619
/// Initialize dof map for mesh (return true iff init_cell() is needed)
8620
bool UFC_NSEContinuity3DLinearForm_dof_map_4::init_mesh(const ufc::mesh& m)
8622
__global_dimension = m.num_entities[3];
8626
/// Initialize dof map for given cell
8627
void UFC_NSEContinuity3DLinearForm_dof_map_4::init_cell(const ufc::mesh& m,
8633
/// Finish initialization of dof map for cells
8634
void UFC_NSEContinuity3DLinearForm_dof_map_4::init_cell_finalize()
8639
/// Return the dimension of the global finite element function space
8640
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::global_dimension() const
8642
return __global_dimension;
8645
/// Return the dimension of the local finite element function space
8646
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::local_dimension() const
8651
// Return the geometric dimension of the coordinates this dof map provides
8652
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::geometric_dimension() const
8657
/// Return the number of dofs on each cell facet
8658
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::num_facet_dofs() const
8663
/// Return the number of dofs associated with each cell entity of dimension d
8664
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::num_entity_dofs(unsigned int d) const
8666
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
8669
/// Tabulate the local-to-global mapping of dofs on a cell
8670
void UFC_NSEContinuity3DLinearForm_dof_map_4::tabulate_dofs(unsigned int* dofs,
8672
const ufc::cell& c) const
8674
dofs[0] = c.entity_indices[3][0];
8677
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
8678
void UFC_NSEContinuity3DLinearForm_dof_map_4::tabulate_facet_dofs(unsigned int* dofs,
8679
unsigned int facet) const
8698
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
8699
void UFC_NSEContinuity3DLinearForm_dof_map_4::tabulate_entity_dofs(unsigned int* dofs,
8700
unsigned int d, unsigned int i) const
8702
throw std::runtime_error("Not implemented (introduced in UFC v1.1).");
8705
/// Tabulate the coordinates of all dofs on a cell
8706
void UFC_NSEContinuity3DLinearForm_dof_map_4::tabulate_coordinates(double** coordinates,
8707
const ufc::cell& c) const
8709
const double * const * x = c.coordinates;
8710
coordinates[0][0] = 0.25*x[0][0] + 0.25*x[1][0] + 0.25*x[2][0] + 0.25*x[3][0];
8711
coordinates[0][1] = 0.25*x[0][1] + 0.25*x[1][1] + 0.25*x[2][1] + 0.25*x[3][1];
8712
coordinates[0][2] = 0.25*x[0][2] + 0.25*x[1][2] + 0.25*x[2][2] + 0.25*x[3][2];
8715
/// Return the number of sub dof maps (for a mixed element)
8716
unsigned int UFC_NSEContinuity3DLinearForm_dof_map_4::num_sub_dof_maps() const
8721
/// Create a new dof_map for sub dof map i (for a mixed element)
8722
ufc::dof_map* UFC_NSEContinuity3DLinearForm_dof_map_4::create_sub_dof_map(unsigned int i) const
8724
return new UFC_NSEContinuity3DLinearForm_dof_map_4();
8119
8729
UFC_NSEContinuity3DLinearForm_cell_integral_0::UFC_NSEContinuity3DLinearForm_cell_integral_0() : ufc::cell_integral()
8187
8797
}// end loop over 'j'
8189
// Array of quadrature weights (tensor/monomial term 0)
8799
// Array of quadrature weights (tensor/monomial terms (0, 2))
8190
8800
const static double W0 = -0.166666666666666;
8191
8801
// Array of quadrature weights (tensor/monomial term 1)
8192
8802
const static double W1 = 0.333333333333333;
8194
const static double P_t1_p0_s0[1][2] = \
8804
const static double P_t2_s2_s2_s0[1][2] = \
8196
8806
// Array of non-zero columns
8197
static const unsigned int nzc7[2] = {0, 1};
8198
// Array of non-zero columns
8199
static const unsigned int nzc0[2] = {0, 1};
8200
// Array of non-zero columns
8201
static const unsigned int nzc10[2] = {4, 5};
8202
// Array of non-zero columns
8203
static const unsigned int nzc3[2] = {8, 9};
8204
// Array of non-zero columns
8205
static const unsigned int nzc4[2] = {8, 10};
8206
// Array of non-zero columns
8207
static const unsigned int nzc5[2] = {8, 11};
8208
// Array of non-zero columns
8209
static const unsigned int nzc8[2] = {0, 2};
8210
// Array of non-zero columns
8211
static const unsigned int nzc6[2] = {0, 3};
8212
// Array of non-zero columns
8213
static const unsigned int nzc2[2] = {0, 3};
8214
// Array of non-zero columns
8215
static const unsigned int nzc1[2] = {0, 2};
8216
// Array of non-zero columns
8217
static const unsigned int nzc11[2] = {4, 7};
8218
// Array of non-zero columns
8219
static const unsigned int nzc9[2] = {4, 6};
8807
static const unsigned int nzc9[2] = {0, 3};
8808
// Array of non-zero columns
8809
static const unsigned int nzc0[2] = {8, 9};
8810
// Array of non-zero columns
8811
static const unsigned int nzc3[2] = {8, 10};
8812
// Array of non-zero columns
8813
static const unsigned int nzc4[2] = {8, 11};
8814
// Array of non-zero columns
8815
static const unsigned int nzc5[2] = {4, 6};
8816
// Array of non-zero columns
8817
static const unsigned int nzc6[2] = {4, 5};
8818
// Array of non-zero columns
8819
static const unsigned int nzc7[2] = {4, 7};
8820
// Array of non-zero columns
8821
static const unsigned int nzc8[2] = {0, 1};
8822
// Array of non-zero columns
8823
static const unsigned int nzc10[2] = {0, 2};
8824
// Array of non-zero columns
8825
static const unsigned int nzc12[2] = {0, 2};
8826
// Array of non-zero columns
8827
static const unsigned int nzc13[2] = {0, 3};
8828
// Array of non-zero columns
8829
static const unsigned int nzc14[2] = {0, 1};
8221
const static double P_t0_p0[1][4] = \
8831
const static double P_t2_s1_s1[1][4] = \
8222
8832
{{0.25, 0.25, 0.25, 0.25}};
8833
// Array of non-zero columns
8834
static const unsigned int nzc1[4] = {4, 5, 6, 7};
8835
// Array of non-zero columns
8836
static const unsigned int nzc2[4] = {8, 9, 10, 11};
8837
// Array of non-zero columns
8838
static const unsigned int nzc11[4] = {0, 1, 2, 3};
8224
// Number of operations to compute geometry constants = 90
8840
// Number of operations to compute geometry constants = 270
8225
8841
const double G0 = Jinv_00*W0*det;
8226
8842
const double G1 = Jinv_01*W0*det;
8227
8843
const double G2 = Jinv_02*W0*det;
8231
8847
const double G6 = Jinv_20*W0*det;
8232
8848
const double G7 = Jinv_21*W0*det;
8233
8849
const double G8 = Jinv_22*W0*det;
8234
const double G9 = Jinv_00*Jinv_10*W1*det*w[2][0];
8235
const double G10 = Jinv_01*Jinv_11*W1*det*w[2][0];
8236
const double G11 = Jinv_02*Jinv_12*W1*det*w[2][0];
8237
const double G12 = Jinv_10*Jinv_10*W1*det*w[2][0];
8238
const double G13 = Jinv_10*Jinv_20*W1*det*w[2][0];
8239
const double G14 = Jinv_11*Jinv_11*W1*det*w[2][0];
8240
const double G15 = Jinv_11*Jinv_21*W1*det*w[2][0];
8241
const double G16 = Jinv_12*Jinv_12*W1*det*w[2][0];
8242
const double G17 = Jinv_12*Jinv_22*W1*det*w[2][0];
8243
const double G18 = Jinv_00*Jinv_00*W1*det*w[2][0];
8244
const double G19 = Jinv_00*Jinv_20*W1*det*w[2][0];
8245
const double G20 = Jinv_01*Jinv_01*W1*det*w[2][0];
8246
const double G21 = Jinv_01*Jinv_21*W1*det*w[2][0];
8247
const double G22 = Jinv_02*Jinv_02*W1*det*w[2][0];
8248
const double G23 = Jinv_02*Jinv_22*W1*det*w[2][0];
8249
const double G24 = Jinv_20*Jinv_20*W1*det*w[2][0];
8250
const double G25 = Jinv_21*Jinv_21*W1*det*w[2][0];
8251
const double G26 = Jinv_22*Jinv_22*W1*det*w[2][0];
8850
const double G9 = Jinv_00*Jinv_10*W0*det*w[2][0];
8851
const double G10 = Jinv_00*Jinv_11*W0*det*w[2][0];
8852
const double G11 = Jinv_00*Jinv_12*W0*det*w[2][0];
8853
const double G12 = Jinv_01*Jinv_10*W0*det*w[2][0];
8854
const double G13 = Jinv_01*Jinv_11*W0*det*w[2][0];
8855
const double G14 = Jinv_01*Jinv_12*W0*det*w[2][0];
8856
const double G15 = Jinv_02*Jinv_10*W0*det*w[2][0];
8857
const double G16 = Jinv_02*Jinv_11*W0*det*w[2][0];
8858
const double G17 = Jinv_02*Jinv_12*W0*det*w[2][0];
8859
const double G18 = Jinv_10*Jinv_10*W0*det*w[2][0];
8860
const double G19 = Jinv_10*Jinv_11*W0*det*w[2][0];
8861
const double G20 = Jinv_10*Jinv_12*W0*det*w[2][0];
8862
const double G21 = Jinv_10*Jinv_20*W0*det*w[2][0];
8863
const double G22 = Jinv_10*Jinv_21*W0*det*w[2][0];
8864
const double G23 = Jinv_10*Jinv_22*W0*det*w[2][0];
8865
const double G24 = Jinv_11*Jinv_11*W0*det*w[2][0];
8866
const double G25 = Jinv_11*Jinv_12*W0*det*w[2][0];
8867
const double G26 = Jinv_11*Jinv_20*W0*det*w[2][0];
8868
const double G27 = Jinv_11*Jinv_21*W0*det*w[2][0];
8869
const double G28 = Jinv_11*Jinv_22*W0*det*w[2][0];
8870
const double G29 = Jinv_12*Jinv_12*W0*det*w[2][0];
8871
const double G30 = Jinv_12*Jinv_20*W0*det*w[2][0];
8872
const double G31 = Jinv_12*Jinv_21*W0*det*w[2][0];
8873
const double G32 = Jinv_12*Jinv_22*W0*det*w[2][0];
8874
const double G33 = Jinv_00*Jinv_20*W0*det*w[2][0];
8875
const double G34 = Jinv_00*Jinv_21*W0*det*w[2][0];
8876
const double G35 = Jinv_00*Jinv_22*W0*det*w[2][0];
8877
const double G36 = Jinv_01*Jinv_20*W0*det*w[2][0];
8878
const double G37 = Jinv_01*Jinv_21*W0*det*w[2][0];
8879
const double G38 = Jinv_01*Jinv_22*W0*det*w[2][0];
8880
const double G39 = Jinv_02*Jinv_20*W0*det*w[2][0];
8881
const double G40 = Jinv_02*Jinv_21*W0*det*w[2][0];
8882
const double G41 = Jinv_02*Jinv_22*W0*det*w[2][0];
8883
const double G42 = Jinv_20*Jinv_20*W0*det*w[2][0];
8884
const double G43 = Jinv_20*Jinv_21*W0*det*w[2][0];
8885
const double G44 = Jinv_20*Jinv_22*W0*det*w[2][0];
8886
const double G45 = Jinv_21*Jinv_21*W0*det*w[2][0];
8887
const double G46 = Jinv_21*Jinv_22*W0*det*w[2][0];
8888
const double G47 = Jinv_22*Jinv_22*W0*det*w[2][0];
8889
const double G48 = Jinv_00*Jinv_00*W0*det*w[2][0];
8890
const double G49 = Jinv_00*Jinv_01*W0*det*w[2][0];
8891
const double G50 = Jinv_00*Jinv_02*W0*det*w[2][0];
8892
const double G51 = Jinv_01*Jinv_01*W0*det*w[2][0];
8893
const double G52 = Jinv_01*Jinv_02*W0*det*w[2][0];
8894
const double G53 = Jinv_02*Jinv_02*W0*det*w[2][0];
8895
const double G54 = Jinv_00*Jinv_10*W1*det*w[3][0];
8896
const double G55 = Jinv_01*Jinv_11*W1*det*w[3][0];
8897
const double G56 = Jinv_02*Jinv_12*W1*det*w[3][0];
8898
const double G57 = Jinv_10*Jinv_10*W1*det*w[3][0];
8899
const double G58 = Jinv_10*Jinv_20*W1*det*w[3][0];
8900
const double G59 = Jinv_11*Jinv_11*W1*det*w[3][0];
8901
const double G60 = Jinv_11*Jinv_21*W1*det*w[3][0];
8902
const double G61 = Jinv_12*Jinv_12*W1*det*w[3][0];
8903
const double G62 = Jinv_12*Jinv_22*W1*det*w[3][0];
8904
const double G63 = Jinv_00*Jinv_20*W1*det*w[3][0];
8905
const double G64 = Jinv_01*Jinv_21*W1*det*w[3][0];
8906
const double G65 = Jinv_02*Jinv_22*W1*det*w[3][0];
8907
const double G66 = Jinv_20*Jinv_20*W1*det*w[3][0];
8908
const double G67 = Jinv_21*Jinv_21*W1*det*w[3][0];
8909
const double G68 = Jinv_22*Jinv_22*W1*det*w[3][0];
8910
const double G69 = Jinv_00*Jinv_00*W1*det*w[3][0];
8911
const double G70 = Jinv_01*Jinv_01*W1*det*w[3][0];
8912
const double G71 = Jinv_02*Jinv_02*W1*det*w[3][0];
8253
// Loop quadrature points (tensor/monomial terms (0, 1))
8254
// Number of operations to compute element tensor for following IP loop = 118
8914
// Loop quadrature points (tensor/monomial terms (0, 1, 2))
8915
// Number of operations to compute element tensor for following IP loop = 349
8255
8916
// Only 1 integration point, omitting IP loop.
8257
8918
// Declare function values.
8268
8929
double F10 = 0;
8269
8930
double F11 = 0;
8271
8944
// Compute function values.
8272
8945
// Number of operations to compute values = 48
8273
8946
for (unsigned int r = 0; r < 2; r++)
8275
F0 += P_t1_p0_s0[0][r]*w[1][nzc7[r]];
8276
F1 += P_t1_p0_s0[0][r]*w[1][nzc10[r]];
8277
F2 += P_t1_p0_s0[0][r]*w[1][nzc3[r]];
8278
F3 += P_t1_p0_s0[0][r]*w[1][nzc8[r]];
8279
F4 += P_t1_p0_s0[0][r]*w[1][nzc9[r]];
8280
F5 += P_t1_p0_s0[0][r]*w[1][nzc4[r]];
8281
F6 += P_t1_p0_s0[0][r]*w[1][nzc6[r]];
8282
F7 += P_t1_p0_s0[0][r]*w[1][nzc11[r]];
8283
F8 += P_t1_p0_s0[0][r]*w[1][nzc5[r]];
8284
F9 += P_t1_p0_s0[0][r]*w[0][nzc0[r]];
8285
F10 += P_t1_p0_s0[0][r]*w[0][nzc1[r]];
8286
F11 += P_t1_p0_s0[0][r]*w[0][nzc2[r]];
8948
F0 += P_t2_s2_s2_s0[0][r]*w[1][nzc14[r]];
8949
F1 += P_t2_s2_s2_s0[0][r]*w[1][nzc6[r]];
8950
F2 += P_t2_s2_s2_s0[0][r]*w[1][nzc0[r]];
8951
F3 += P_t2_s2_s2_s0[0][r]*w[1][nzc12[r]];
8952
F4 += P_t2_s2_s2_s0[0][r]*w[1][nzc5[r]];
8953
F5 += P_t2_s2_s2_s0[0][r]*w[1][nzc3[r]];
8954
F6 += P_t2_s2_s2_s0[0][r]*w[1][nzc13[r]];
8955
F7 += P_t2_s2_s2_s0[0][r]*w[1][nzc7[r]];
8956
F8 += P_t2_s2_s2_s0[0][r]*w[1][nzc4[r]];
8957
F23 += P_t2_s2_s2_s0[0][r]*w[0][nzc9[r]];
8958
F22 += P_t2_s2_s2_s0[0][r]*w[0][nzc10[r]];
8959
F21 += P_t2_s2_s2_s0[0][r]*w[0][nzc8[r]];
8960
}// end loop over 'r'
8961
// Number of operations to compute values = 36
8962
for (unsigned int s = 0; s < 2; s++)
8964
F18 += P_t2_s2_s2_s0[0][s]*w[1][nzc3[s]];
8965
F20 += P_t2_s2_s2_s0[0][s]*w[1][nzc4[s]];
8966
F19 += P_t2_s2_s2_s0[0][s]*w[1][nzc7[s]];
8967
F12 += P_t2_s2_s2_s0[0][s]*w[1][nzc14[s]];
8968
F13 += P_t2_s2_s2_s0[0][s]*w[1][nzc6[s]];
8969
F16 += P_t2_s2_s2_s0[0][s]*w[1][nzc13[s]];
8970
F17 += P_t2_s2_s2_s0[0][s]*w[1][nzc5[s]];
8971
F14 += P_t2_s2_s2_s0[0][s]*w[1][nzc0[s]];
8972
F15 += P_t2_s2_s2_s0[0][s]*w[1][nzc12[s]];
8973
}// end loop over 's'
8974
// Number of operations to compute values = 24
8975
for (unsigned int r = 0; r < 4; r++)
8977
F9 += P_t2_s1_s1[0][r]*w[1][nzc11[r]];
8978
F10 += P_t2_s1_s1[0][r]*w[1][nzc1[r]];
8979
F11 += P_t2_s1_s1[0][r]*w[1][nzc2[r]];
8287
8980
}// end loop over 'r'
8289
// Number of operations to compute declarations = 50
8290
const double Gip0 = (G12 + G14 + G16)*F10 + (G10 + G11 + G9)*F9 + (G13 + G15 + G17)*F11;
8291
const double Gip1 = (G19 + G21 + G23)*F11 + (G10 + G11 + G9)*F10 + (G18 + G20 + G22)*F9;
8292
const double Gip2 = (G24 + G25 + G26)*F11 + (G13 + G15 + G17)*F10 + (G19 + G21 + G23)*F9;
8982
// Number of operations to compute declarations = 221
8983
const double Gip0 = (G69 + G70 + G71)*F21 + (G54 + G55 + G56)*F22 + (G63 + G64 + G65)*F23 + (F12*G48 + F13*G49 + F14*G50 + F15*G9 + F16*G33 + F17*G12 + F18*G15 + F19*G36 + F20*G39)*F9 + (F12*G50 + F13*G52 + F14*G53 + F15*G11 + F16*G35 + F17*G14 + F18*G17 + F19*G38 + F20*G41)*F11 + (F12*G49 + F13*G51 + F14*G52 + F15*G10 + F16*G34 + F17*G13 + F18*G16 + F19*G37 + F20*G40)*F10;
8984
const double Gip1 = (G63 + G64 + G65)*F21 + (G58 + G60 + G62)*F22 + (G66 + G67 + G68)*F23 + (F12*G33 + F13*G34 + F14*G35 + F15*G21 + F16*G42 + F17*G22 + F18*G23 + F19*G43 + F20*G44)*F9 + (F12*G39 + F13*G40 + F14*G41 + F15*G30 + F16*G44 + F17*G31 + F18*G32 + F19*G46 + F20*G47)*F11 + (F12*G36 + F13*G37 + F14*G38 + F15*G26 + F16*G43 + F17*G27 + F18*G28 + F19*G45 + F20*G46)*F10;
8985
const double Gip2 = (G54 + G55 + G56)*F21 + (G57 + G59 + G61)*F22 + (G58 + G60 + G62)*F23 + (F12*G9 + F13*G10 + F14*G11 + F15*G18 + F16*G21 + F17*G19 + F18*G20 + F19*G26 + F20*G30)*F9 + (F12*G15 + F13*G16 + F14*G17 + F15*G20 + F16*G23 + F17*G25 + F18*G29 + F19*G28 + F20*G32)*F11 + (F12*G12 + F13*G13 + F14*G14 + F15*G19 + F16*G22 + F17*G24 + F18*G25 + F19*G27 + F20*G31)*F10;
8293
8986
const double Gip3 = F0*G0 + F1*G1 + F2*G2 + F3*G3 + F4*G4 + F5*G5 + F6*G6 + F7*G7 + F8*G8;
8295
8988
// Loop primary indices.
8328
9021
/// Return a string identifying the form
8329
9022
const char* UFC_NSEContinuity3DLinearForm::signature() const
8331
return "-w1_a0[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11](dXa1[0, 1, 2]/dxa2[0, 1, 2]) | vi0[0, 1, 2, 3]*((d/dXa1[0, 1, 2])va0[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][a2[0, 1, 2]])*dX(0) + 2.0w2_a0[0]w0_a1[0, 1, 2, 3](dXa2[0, 1, 2]/dxb0[0, 1, 2])(dXa3[0, 1, 2]/dxb0[0, 1, 2]) | va0[0]*((d/dXa2[0, 1, 2])vi0[0, 1, 2, 3])*((d/dXa3[0, 1, 2])va1[0, 1, 2, 3])*dX(0)";
9024
return "-w1_a0[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11](dXa1[0, 1, 2]/dxa2[0, 1, 2]) | vi0[0, 1, 2, 3]*((d/dXa1[0, 1, 2])va0[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][a2[0, 1, 2]])*dX(0) + 2.0w3_a0[0]w0_a1[0, 1, 2, 3](dXa2[0, 1, 2]/dxb0[0, 1, 2])(dXa3[0, 1, 2]/dxb0[0, 1, 2]) | va0[0]*((d/dXa2[0, 1, 2])vi0[0, 1, 2, 3])*((d/dXa3[0, 1, 2])va1[0, 1, 2, 3])*dX(0) + -w2_a0[0]w1_a1[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]w1_a2[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11](dXa3[0, 1, 2]/dxa5[0, 1, 2])(dXa4[0, 1, 2]/dxa6[0, 1, 2]) | va0[0]*va1[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][a5[0, 1, 2]]*((d/dXa3[0, 1, 2])va2[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][a6[0, 1, 2]])*((d/dXa4[0, 1, 2])vi0[0, 1, 2, 3])*dX(0)";
8334
9027
/// Return the rank of the global tensor (r)