// This code conforms with the UFC specification version 1.0 // and was automatically generated by FFC version 0.4.3. // // Warning: This code was generated with the option '-l dolfin' // and contains DOLFIN-specific wrappers that depend on DOLFIN. #ifndef __POISSON2D_5_H #define __POISSON2D_5_H #include #include #include #include /// This class defines the interface for a finite element. class UFC_Poisson2D_5BilinearForm_finite_element_0: public ufc::finite_element { public: /// Constructor UFC_Poisson2D_5BilinearForm_finite_element_0() : ufc::finite_element() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm_finite_element_0() { // Do nothing } /// Return a string identifying the finite element virtual const char* signature() const { return "Lagrange finite element of degree 5 on a triangle"; } /// 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 21; } /// 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; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Reset values *values = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Extract relevant coefficients const double coeff0_0 = coefficients0[dof][0]; const double coeff0_1 = coefficients0[dof][1]; const double coeff0_2 = coefficients0[dof][2]; const double coeff0_3 = coefficients0[dof][3]; const double coeff0_4 = coefficients0[dof][4]; const double coeff0_5 = coefficients0[dof][5]; const double coeff0_6 = coefficients0[dof][6]; const double coeff0_7 = coefficients0[dof][7]; const double coeff0_8 = coefficients0[dof][8]; const double coeff0_9 = coefficients0[dof][9]; const double coeff0_10 = coefficients0[dof][10]; const double coeff0_11 = coefficients0[dof][11]; const double coeff0_12 = coefficients0[dof][12]; const double coeff0_13 = coefficients0[dof][13]; const double coeff0_14 = coefficients0[dof][14]; const double coeff0_15 = coefficients0[dof][15]; const double coeff0_16 = coefficients0[dof][16]; const double coeff0_17 = coefficients0[dof][17]; const double coeff0_18 = coefficients0[dof][18]; const double coeff0_19 = coefficients0[dof][19]; const double coeff0_20 = coefficients0[dof][20]; // Compute value(s) *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9 + coeff0_10*basisvalue10 + coeff0_11*basisvalue11 + coeff0_12*basisvalue12 + coeff0_13*basisvalue13 + coeff0_14*basisvalue14 + coeff0_15*basisvalue15 + coeff0_16*basisvalue16 + coeff0_17*basisvalue17 + coeff0_18*basisvalue18 + coeff0_19*basisvalue19 + coeff0_20*basisvalue20; } /// Evaluate all basis functions at given point in cell virtual void evaluate_basis_all(double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented."); } /// Evaluate order n derivatives of basis function i at given point in cell virtual void evaluate_basis_derivatives(unsigned int i, unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { // Extract vertex coordinates const double * const * element_coordinates = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = element_coordinates[1][0] - element_coordinates[0][0]; const double J_01 = element_coordinates[2][0] - element_coordinates[0][0]; const double J_10 = element_coordinates[1][1] - element_coordinates[0][1]; const double J_11 = element_coordinates[2][1] - element_coordinates[0][1]; // Compute determinant of Jacobian const double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Compute number of derivatives unsigned int num_derivatives = 1; for (unsigned int j = 0; j < n; j++) num_derivatives *= 2; // Declare pointer to two dimensional array that holds combinations of derivatives and initialise unsigned int **combinations = new unsigned int *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { combinations[j] = new unsigned int [n]; for (unsigned int k = 0; k < n; k++) combinations[j][k] = 0; } // Generate combinations of derivatives for (unsigned int row = 1; row < num_derivatives; row++) { for (unsigned int num = 0; num < row; num++) { for (unsigned int col = n-1; col+1 > 0; col--) { if (combinations[row][col] + 1 > 1) combinations[row][col] = 0; else { combinations[row][col] += 1; break; } } } } // Compute inverse of Jacobian const double Jinv[2][2] = {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}}; // Declare transformation matrix // Declare pointer to two dimensional array and initialise double **transform = new double *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { transform[j] = new double [num_derivatives]; for (unsigned int k = 0; k < num_derivatives; k++) transform[j][k] = 1; } // Construct transformation matrix for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { for (unsigned int k = 0; k < n; k++) transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]]; } } // Reset values for (unsigned int j = 0; j < 1*num_derivatives; j++) values[j] = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Interesting (new) part // Tables of derivatives of the polynomial base (transpose) const static double dmats0[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.89897948556636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 9.48683298050514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4, 0, 7.07106781186548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.29150262212917, 0, -2.99332590941916, 13.6626010212795, 0, 0.611010092660777, 0, -1.27277816408026e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 4.38178046004133, 0, 0, 12.5219806739988, 0, 0, 0, -1.21552073961695e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.46410161513776, 0, 7.83836717690617, 0, 0, 8.4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 10.9544511501033, 0, 0, -3.83325938999965, 0, 17.7482393492989, 0, 0.553283335172478, 0, 0, 0, 0, 0, 0, 1.30575944758963e-14, 0, 0, 0, 0, 0}, {4.73286382647968, 0, 3.3466401061363, 4.36435780471985, 0, -5.07468037933238, 0, 17.0084012854152, 0, 1.52127765851134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 2.44948974278318, 0, 0, 9.14285714285713, 0, 0, -1.45463708554178e-14, 14.8461497791618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.09838667696594, 0, 7.66811580507233, 0, 0, 10.733126291999, 0, 0, 0, 9.2951600308978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.41602560309065, 0, -4.37680963545757, 15.7321327225523, 0, 2.01017818278147, 0, -4.03686713879668, 0, -0.515811962199122, 21.799082549502, 0, 0.451335466924226, 0, 0.0576695305542381, 0, 0, 0, 0, 0, 0}, {0, 6.85714285714286, 0, 0, 9.97292252418866, 0, 4.32049379893858, 0, -7.27309832077592, -1.59872115546023e-14, 0, 21.2540192277445, 0, 1.49078803979367, 0, 0, 0, 0, 0, 0, 0}, {4.32049379893858, 0, 5.93552661441898, 1.79284291400158, 0, -0.320713490294932, 0, 9.20087412456475, 0, -5.96639619853425, 0, 0, 19.8022632451351, 0, 2.53024038425528, 0, 1.17859985414066e-14, 0, 0, 0, -1.33686464676153e-14}, {0, 1.53330375599988, 1.24344978758018e-14, 0, 6.33793245113119, 0, 0, 0, 13.5526185435788, 1.4210854715202e-14, 0, 0, 0, 16.6675169851115, 0, 0, 0, 0, 0, 1.68753899743024e-14, 0}, {2.82842712474619, 0, 7.31428571428572, 0, 0, 11.337638238025, 0, 0, 0, 12.9299525702683, 0, 0, 0, 0, 9.93858693195777, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const static double dmats1[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.24264068711928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.58198889747161, 4.74341649025257, -0.912870929175276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 6.12372435695794, 3.53553390593274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.64575131106459, 5.18459255872629, -1.49666295470958, 6.83130051063974, -1.05830052442584, 0.30550504633039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.23606797749979, 2.19089023002066, 2.52982212813469, 8.08290376865476, 6.26099033699941, -1.80739222823012, 0, -1.56672320349306e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.73205080756888, -5.09116882454314, 3.91918358845308, 0, 9.69948452238571, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.00000000000001, 0, -2.8284271247462, 0, 0, 12.1243556529821, 0, 0, 0, -2.08002018386999e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.14001690032506e-14}, {2.68328157299975, 5.47722557505167, -1.89736659610103, 7.42307488958091, -1.91662969499983, 0.663940002206986, 8.87411967464944, -1.07142857142858, 0.276641667586237, -0.0958314847499917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.36643191323985, 2.89827534923789, 1.67332005306815, 2.18217890235992, 5.74704893215391, -2.53734018966619, 10.0623058987491, 8.50420064270761, -2.19577516413421, 0.760638829255665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1.2247448713916, 3.53553390593273, -7.37711113563318, 4.57142857142857, 1.64957219768464, 0, 11.4997781699989, 7.42307488958091, -2.57142857142858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.54919333848296, 6.64078308635361, 3.83405790253618, 0, -6.19677335393188, 5.3665631459995, 0, 0, 13.4164078649988, 4.64758001544891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-3.57770876399967, 0, 8.85437744847148, 0, 0, -3.09838667696592, 0, 0, -1.115968317663e-14, 16.0996894379985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.70801280154532, 5.68564249775213, -2.18840481772878, 7.86606636127615, -2.61129805863299, 1.00508909139074, 9.55297122675765, -2.01843356939834, 0.670059394260489, -0.257905981099558, 10.899541274751, -1.06805465250648, 0.225667733462112, -0.0749149177264378, 0.0288347652771189, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 3.42857142857144, 0.989743318610788, 3.04933917230523, 4.98646126209433, -2.72741187029097, 2.1602468994693, 8.34624849531682, -3.63654916038796, 1.5163507931515, 12.0498962651137, 10.6270096138723, -2.24536559755125, 0.745394019896833, -0.286902292026513, 0, 0, 0, 0, 0, 0}, {2.16024689946929, 1.81422947044429, 2.96776330720949, 0.896421457000793, 5.41604758366942, -0.160356745147465, -9.52579344415681, 4.60043706228237, 5.34522483824849, -2.98319809926713, 0, 13.3887736279041, 9.90113162256756, -3.28687867566959, 1.26512019212764, 0, 0, 0, 0, 0, 0}, {1.82574185835055, 0.76665187799994, 3.83609779052925, 8.6368042559214, 3.16896622556559, 3.65920700676626, 0, -8.74817765279707, 6.7763092717894, 0.521640530957295, 0, 0, 15.0623703313921, 8.33375849255573, -3.20766513935893, 0, 0, 0, 0, 1.07750480127221e-14, 0}, {1.4142135623731, -6.73025456655334, 3.65714285714287, 0, 9.4550278170087, 5.6688191190125, 0, 1.90406705745985e-14, -6.99854212223762, 6.46497628513416, 0, 0, 0, 17.2141375215909, 4.96929346597888, 0, 0, 0, 0, 1.47903916597301e-14, 0}, {5.71547606649408, 1.19544627798492e-14, -4.61880215351701, 0, 0, 12.7279220613579, 0, 0, 2.41311920846e-14, -3.2659863237109, 0, 0, 0, 0, 20.0831604418561, 0, 0, 0, 0, 0, 0}}; // Compute reference derivatives // Declare pointer to array of derivatives on FIAT element double *derivatives = new double [num_derivatives]; // Declare coefficients double coeff0_0 = 0; double coeff0_1 = 0; double coeff0_2 = 0; double coeff0_3 = 0; double coeff0_4 = 0; double coeff0_5 = 0; double coeff0_6 = 0; double coeff0_7 = 0; double coeff0_8 = 0; double coeff0_9 = 0; double coeff0_10 = 0; double coeff0_11 = 0; double coeff0_12 = 0; double coeff0_13 = 0; double coeff0_14 = 0; double coeff0_15 = 0; double coeff0_16 = 0; double coeff0_17 = 0; double coeff0_18 = 0; double coeff0_19 = 0; double coeff0_20 = 0; // Declare new coefficients double new_coeff0_0 = 0; double new_coeff0_1 = 0; double new_coeff0_2 = 0; double new_coeff0_3 = 0; double new_coeff0_4 = 0; double new_coeff0_5 = 0; double new_coeff0_6 = 0; double new_coeff0_7 = 0; double new_coeff0_8 = 0; double new_coeff0_9 = 0; double new_coeff0_10 = 0; double new_coeff0_11 = 0; double new_coeff0_12 = 0; double new_coeff0_13 = 0; double new_coeff0_14 = 0; double new_coeff0_15 = 0; double new_coeff0_16 = 0; double new_coeff0_17 = 0; double new_coeff0_18 = 0; double new_coeff0_19 = 0; double new_coeff0_20 = 0; // Loop possible derivatives for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++) { // Get values from coefficients array new_coeff0_0 = coefficients0[dof][0]; new_coeff0_1 = coefficients0[dof][1]; new_coeff0_2 = coefficients0[dof][2]; new_coeff0_3 = coefficients0[dof][3]; new_coeff0_4 = coefficients0[dof][4]; new_coeff0_5 = coefficients0[dof][5]; new_coeff0_6 = coefficients0[dof][6]; new_coeff0_7 = coefficients0[dof][7]; new_coeff0_8 = coefficients0[dof][8]; new_coeff0_9 = coefficients0[dof][9]; new_coeff0_10 = coefficients0[dof][10]; new_coeff0_11 = coefficients0[dof][11]; new_coeff0_12 = coefficients0[dof][12]; new_coeff0_13 = coefficients0[dof][13]; new_coeff0_14 = coefficients0[dof][14]; new_coeff0_15 = coefficients0[dof][15]; new_coeff0_16 = coefficients0[dof][16]; new_coeff0_17 = coefficients0[dof][17]; new_coeff0_18 = coefficients0[dof][18]; new_coeff0_19 = coefficients0[dof][19]; new_coeff0_20 = coefficients0[dof][20]; // Loop derivative order for (unsigned int j = 0; j < n; j++) { // Update old coefficients coeff0_0 = new_coeff0_0; coeff0_1 = new_coeff0_1; coeff0_2 = new_coeff0_2; coeff0_3 = new_coeff0_3; coeff0_4 = new_coeff0_4; coeff0_5 = new_coeff0_5; coeff0_6 = new_coeff0_6; coeff0_7 = new_coeff0_7; coeff0_8 = new_coeff0_8; coeff0_9 = new_coeff0_9; coeff0_10 = new_coeff0_10; coeff0_11 = new_coeff0_11; coeff0_12 = new_coeff0_12; coeff0_13 = new_coeff0_13; coeff0_14 = new_coeff0_14; coeff0_15 = new_coeff0_15; coeff0_16 = new_coeff0_16; coeff0_17 = new_coeff0_17; coeff0_18 = new_coeff0_18; coeff0_19 = new_coeff0_19; coeff0_20 = new_coeff0_20; if(combinations[deriv_num][j] == 0) { new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0] + coeff0_10*dmats0[10][0] + coeff0_11*dmats0[11][0] + coeff0_12*dmats0[12][0] + coeff0_13*dmats0[13][0] + coeff0_14*dmats0[14][0] + coeff0_15*dmats0[15][0] + coeff0_16*dmats0[16][0] + coeff0_17*dmats0[17][0] + coeff0_18*dmats0[18][0] + coeff0_19*dmats0[19][0] + coeff0_20*dmats0[20][0]; new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1] + coeff0_10*dmats0[10][1] + coeff0_11*dmats0[11][1] + coeff0_12*dmats0[12][1] + coeff0_13*dmats0[13][1] + coeff0_14*dmats0[14][1] + coeff0_15*dmats0[15][1] + coeff0_16*dmats0[16][1] + coeff0_17*dmats0[17][1] + coeff0_18*dmats0[18][1] + coeff0_19*dmats0[19][1] + coeff0_20*dmats0[20][1]; new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2] + coeff0_10*dmats0[10][2] + coeff0_11*dmats0[11][2] + coeff0_12*dmats0[12][2] + coeff0_13*dmats0[13][2] + coeff0_14*dmats0[14][2] + coeff0_15*dmats0[15][2] + coeff0_16*dmats0[16][2] + coeff0_17*dmats0[17][2] + coeff0_18*dmats0[18][2] + coeff0_19*dmats0[19][2] + coeff0_20*dmats0[20][2]; new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3] + coeff0_10*dmats0[10][3] + coeff0_11*dmats0[11][3] + coeff0_12*dmats0[12][3] + coeff0_13*dmats0[13][3] + coeff0_14*dmats0[14][3] + coeff0_15*dmats0[15][3] + coeff0_16*dmats0[16][3] + coeff0_17*dmats0[17][3] + coeff0_18*dmats0[18][3] + coeff0_19*dmats0[19][3] + coeff0_20*dmats0[20][3]; new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4] + coeff0_10*dmats0[10][4] + coeff0_11*dmats0[11][4] + coeff0_12*dmats0[12][4] + coeff0_13*dmats0[13][4] + coeff0_14*dmats0[14][4] + coeff0_15*dmats0[15][4] + coeff0_16*dmats0[16][4] + coeff0_17*dmats0[17][4] + coeff0_18*dmats0[18][4] + coeff0_19*dmats0[19][4] + coeff0_20*dmats0[20][4]; new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5] + coeff0_10*dmats0[10][5] + coeff0_11*dmats0[11][5] + coeff0_12*dmats0[12][5] + coeff0_13*dmats0[13][5] + coeff0_14*dmats0[14][5] + coeff0_15*dmats0[15][5] + coeff0_16*dmats0[16][5] + coeff0_17*dmats0[17][5] + coeff0_18*dmats0[18][5] + coeff0_19*dmats0[19][5] + coeff0_20*dmats0[20][5]; new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6] + coeff0_10*dmats0[10][6] + coeff0_11*dmats0[11][6] + coeff0_12*dmats0[12][6] + coeff0_13*dmats0[13][6] + coeff0_14*dmats0[14][6] + coeff0_15*dmats0[15][6] + coeff0_16*dmats0[16][6] + coeff0_17*dmats0[17][6] + coeff0_18*dmats0[18][6] + coeff0_19*dmats0[19][6] + coeff0_20*dmats0[20][6]; new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7] + coeff0_10*dmats0[10][7] + coeff0_11*dmats0[11][7] + coeff0_12*dmats0[12][7] + coeff0_13*dmats0[13][7] + coeff0_14*dmats0[14][7] + coeff0_15*dmats0[15][7] + coeff0_16*dmats0[16][7] + coeff0_17*dmats0[17][7] + coeff0_18*dmats0[18][7] + coeff0_19*dmats0[19][7] + coeff0_20*dmats0[20][7]; new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8] + coeff0_10*dmats0[10][8] + coeff0_11*dmats0[11][8] + coeff0_12*dmats0[12][8] + coeff0_13*dmats0[13][8] + coeff0_14*dmats0[14][8] + coeff0_15*dmats0[15][8] + coeff0_16*dmats0[16][8] + coeff0_17*dmats0[17][8] + coeff0_18*dmats0[18][8] + coeff0_19*dmats0[19][8] + coeff0_20*dmats0[20][8]; new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9] + coeff0_10*dmats0[10][9] + coeff0_11*dmats0[11][9] + coeff0_12*dmats0[12][9] + coeff0_13*dmats0[13][9] + coeff0_14*dmats0[14][9] + coeff0_15*dmats0[15][9] + coeff0_16*dmats0[16][9] + coeff0_17*dmats0[17][9] + coeff0_18*dmats0[18][9] + coeff0_19*dmats0[19][9] + coeff0_20*dmats0[20][9]; new_coeff0_10 = coeff0_0*dmats0[0][10] + coeff0_1*dmats0[1][10] + coeff0_2*dmats0[2][10] + coeff0_3*dmats0[3][10] + coeff0_4*dmats0[4][10] + coeff0_5*dmats0[5][10] + coeff0_6*dmats0[6][10] + coeff0_7*dmats0[7][10] + coeff0_8*dmats0[8][10] + coeff0_9*dmats0[9][10] + coeff0_10*dmats0[10][10] + coeff0_11*dmats0[11][10] + coeff0_12*dmats0[12][10] + coeff0_13*dmats0[13][10] + coeff0_14*dmats0[14][10] + coeff0_15*dmats0[15][10] + coeff0_16*dmats0[16][10] + coeff0_17*dmats0[17][10] + coeff0_18*dmats0[18][10] + coeff0_19*dmats0[19][10] + coeff0_20*dmats0[20][10]; new_coeff0_11 = coeff0_0*dmats0[0][11] + coeff0_1*dmats0[1][11] + coeff0_2*dmats0[2][11] + coeff0_3*dmats0[3][11] + coeff0_4*dmats0[4][11] + coeff0_5*dmats0[5][11] + coeff0_6*dmats0[6][11] + coeff0_7*dmats0[7][11] + coeff0_8*dmats0[8][11] + coeff0_9*dmats0[9][11] + coeff0_10*dmats0[10][11] + coeff0_11*dmats0[11][11] + coeff0_12*dmats0[12][11] + coeff0_13*dmats0[13][11] + coeff0_14*dmats0[14][11] + coeff0_15*dmats0[15][11] + coeff0_16*dmats0[16][11] + coeff0_17*dmats0[17][11] + coeff0_18*dmats0[18][11] + coeff0_19*dmats0[19][11] + coeff0_20*dmats0[20][11]; new_coeff0_12 = coeff0_0*dmats0[0][12] + coeff0_1*dmats0[1][12] + coeff0_2*dmats0[2][12] + coeff0_3*dmats0[3][12] + coeff0_4*dmats0[4][12] + coeff0_5*dmats0[5][12] + coeff0_6*dmats0[6][12] + coeff0_7*dmats0[7][12] + coeff0_8*dmats0[8][12] + coeff0_9*dmats0[9][12] + coeff0_10*dmats0[10][12] + coeff0_11*dmats0[11][12] + coeff0_12*dmats0[12][12] + coeff0_13*dmats0[13][12] + coeff0_14*dmats0[14][12] + coeff0_15*dmats0[15][12] + coeff0_16*dmats0[16][12] + coeff0_17*dmats0[17][12] + coeff0_18*dmats0[18][12] + coeff0_19*dmats0[19][12] + coeff0_20*dmats0[20][12]; new_coeff0_13 = coeff0_0*dmats0[0][13] + coeff0_1*dmats0[1][13] + coeff0_2*dmats0[2][13] + coeff0_3*dmats0[3][13] + coeff0_4*dmats0[4][13] + coeff0_5*dmats0[5][13] + coeff0_6*dmats0[6][13] + coeff0_7*dmats0[7][13] + coeff0_8*dmats0[8][13] + coeff0_9*dmats0[9][13] + coeff0_10*dmats0[10][13] + coeff0_11*dmats0[11][13] + coeff0_12*dmats0[12][13] + coeff0_13*dmats0[13][13] + coeff0_14*dmats0[14][13] + coeff0_15*dmats0[15][13] + coeff0_16*dmats0[16][13] + coeff0_17*dmats0[17][13] + coeff0_18*dmats0[18][13] + coeff0_19*dmats0[19][13] + coeff0_20*dmats0[20][13]; new_coeff0_14 = coeff0_0*dmats0[0][14] + coeff0_1*dmats0[1][14] + coeff0_2*dmats0[2][14] + coeff0_3*dmats0[3][14] + coeff0_4*dmats0[4][14] + coeff0_5*dmats0[5][14] + coeff0_6*dmats0[6][14] + coeff0_7*dmats0[7][14] + coeff0_8*dmats0[8][14] + coeff0_9*dmats0[9][14] + coeff0_10*dmats0[10][14] + coeff0_11*dmats0[11][14] + coeff0_12*dmats0[12][14] + coeff0_13*dmats0[13][14] + coeff0_14*dmats0[14][14] + coeff0_15*dmats0[15][14] + coeff0_16*dmats0[16][14] + coeff0_17*dmats0[17][14] + coeff0_18*dmats0[18][14] + coeff0_19*dmats0[19][14] + coeff0_20*dmats0[20][14]; new_coeff0_15 = coeff0_0*dmats0[0][15] + coeff0_1*dmats0[1][15] + coeff0_2*dmats0[2][15] + coeff0_3*dmats0[3][15] + coeff0_4*dmats0[4][15] + coeff0_5*dmats0[5][15] + coeff0_6*dmats0[6][15] + coeff0_7*dmats0[7][15] + coeff0_8*dmats0[8][15] + coeff0_9*dmats0[9][15] + coeff0_10*dmats0[10][15] + coeff0_11*dmats0[11][15] + coeff0_12*dmats0[12][15] + coeff0_13*dmats0[13][15] + coeff0_14*dmats0[14][15] + coeff0_15*dmats0[15][15] + coeff0_16*dmats0[16][15] + coeff0_17*dmats0[17][15] + coeff0_18*dmats0[18][15] + coeff0_19*dmats0[19][15] + coeff0_20*dmats0[20][15]; new_coeff0_16 = coeff0_0*dmats0[0][16] + coeff0_1*dmats0[1][16] + coeff0_2*dmats0[2][16] + coeff0_3*dmats0[3][16] + coeff0_4*dmats0[4][16] + coeff0_5*dmats0[5][16] + coeff0_6*dmats0[6][16] + coeff0_7*dmats0[7][16] + coeff0_8*dmats0[8][16] + coeff0_9*dmats0[9][16] + coeff0_10*dmats0[10][16] + coeff0_11*dmats0[11][16] + coeff0_12*dmats0[12][16] + coeff0_13*dmats0[13][16] + coeff0_14*dmats0[14][16] + coeff0_15*dmats0[15][16] + coeff0_16*dmats0[16][16] + coeff0_17*dmats0[17][16] + coeff0_18*dmats0[18][16] + coeff0_19*dmats0[19][16] + coeff0_20*dmats0[20][16]; new_coeff0_17 = coeff0_0*dmats0[0][17] + coeff0_1*dmats0[1][17] + coeff0_2*dmats0[2][17] + coeff0_3*dmats0[3][17] + coeff0_4*dmats0[4][17] + coeff0_5*dmats0[5][17] + coeff0_6*dmats0[6][17] + coeff0_7*dmats0[7][17] + coeff0_8*dmats0[8][17] + coeff0_9*dmats0[9][17] + coeff0_10*dmats0[10][17] + coeff0_11*dmats0[11][17] + coeff0_12*dmats0[12][17] + coeff0_13*dmats0[13][17] + coeff0_14*dmats0[14][17] + coeff0_15*dmats0[15][17] + coeff0_16*dmats0[16][17] + coeff0_17*dmats0[17][17] + coeff0_18*dmats0[18][17] + coeff0_19*dmats0[19][17] + coeff0_20*dmats0[20][17]; new_coeff0_18 = coeff0_0*dmats0[0][18] + coeff0_1*dmats0[1][18] + coeff0_2*dmats0[2][18] + coeff0_3*dmats0[3][18] + coeff0_4*dmats0[4][18] + coeff0_5*dmats0[5][18] + coeff0_6*dmats0[6][18] + coeff0_7*dmats0[7][18] + coeff0_8*dmats0[8][18] + coeff0_9*dmats0[9][18] + coeff0_10*dmats0[10][18] + coeff0_11*dmats0[11][18] + coeff0_12*dmats0[12][18] + coeff0_13*dmats0[13][18] + coeff0_14*dmats0[14][18] + coeff0_15*dmats0[15][18] + coeff0_16*dmats0[16][18] + coeff0_17*dmats0[17][18] + coeff0_18*dmats0[18][18] + coeff0_19*dmats0[19][18] + coeff0_20*dmats0[20][18]; new_coeff0_19 = coeff0_0*dmats0[0][19] + coeff0_1*dmats0[1][19] + coeff0_2*dmats0[2][19] + coeff0_3*dmats0[3][19] + coeff0_4*dmats0[4][19] + coeff0_5*dmats0[5][19] + coeff0_6*dmats0[6][19] + coeff0_7*dmats0[7][19] + coeff0_8*dmats0[8][19] + coeff0_9*dmats0[9][19] + coeff0_10*dmats0[10][19] + coeff0_11*dmats0[11][19] + coeff0_12*dmats0[12][19] + coeff0_13*dmats0[13][19] + coeff0_14*dmats0[14][19] + coeff0_15*dmats0[15][19] + coeff0_16*dmats0[16][19] + coeff0_17*dmats0[17][19] + coeff0_18*dmats0[18][19] + coeff0_19*dmats0[19][19] + coeff0_20*dmats0[20][19]; new_coeff0_20 = coeff0_0*dmats0[0][20] + coeff0_1*dmats0[1][20] + coeff0_2*dmats0[2][20] + coeff0_3*dmats0[3][20] + coeff0_4*dmats0[4][20] + coeff0_5*dmats0[5][20] + coeff0_6*dmats0[6][20] + coeff0_7*dmats0[7][20] + coeff0_8*dmats0[8][20] + coeff0_9*dmats0[9][20] + coeff0_10*dmats0[10][20] + coeff0_11*dmats0[11][20] + coeff0_12*dmats0[12][20] + coeff0_13*dmats0[13][20] + coeff0_14*dmats0[14][20] + coeff0_15*dmats0[15][20] + coeff0_16*dmats0[16][20] + coeff0_17*dmats0[17][20] + coeff0_18*dmats0[18][20] + coeff0_19*dmats0[19][20] + coeff0_20*dmats0[20][20]; } if(combinations[deriv_num][j] == 1) { new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0] + coeff0_10*dmats1[10][0] + coeff0_11*dmats1[11][0] + coeff0_12*dmats1[12][0] + coeff0_13*dmats1[13][0] + coeff0_14*dmats1[14][0] + coeff0_15*dmats1[15][0] + coeff0_16*dmats1[16][0] + coeff0_17*dmats1[17][0] + coeff0_18*dmats1[18][0] + coeff0_19*dmats1[19][0] + coeff0_20*dmats1[20][0]; new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1] + coeff0_10*dmats1[10][1] + coeff0_11*dmats1[11][1] + coeff0_12*dmats1[12][1] + coeff0_13*dmats1[13][1] + coeff0_14*dmats1[14][1] + coeff0_15*dmats1[15][1] + coeff0_16*dmats1[16][1] + coeff0_17*dmats1[17][1] + coeff0_18*dmats1[18][1] + coeff0_19*dmats1[19][1] + coeff0_20*dmats1[20][1]; new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2] + coeff0_10*dmats1[10][2] + coeff0_11*dmats1[11][2] + coeff0_12*dmats1[12][2] + coeff0_13*dmats1[13][2] + coeff0_14*dmats1[14][2] + coeff0_15*dmats1[15][2] + coeff0_16*dmats1[16][2] + coeff0_17*dmats1[17][2] + coeff0_18*dmats1[18][2] + coeff0_19*dmats1[19][2] + coeff0_20*dmats1[20][2]; new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3] + coeff0_10*dmats1[10][3] + coeff0_11*dmats1[11][3] + coeff0_12*dmats1[12][3] + coeff0_13*dmats1[13][3] + coeff0_14*dmats1[14][3] + coeff0_15*dmats1[15][3] + coeff0_16*dmats1[16][3] + coeff0_17*dmats1[17][3] + coeff0_18*dmats1[18][3] + coeff0_19*dmats1[19][3] + coeff0_20*dmats1[20][3]; new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4] + coeff0_10*dmats1[10][4] + coeff0_11*dmats1[11][4] + coeff0_12*dmats1[12][4] + coeff0_13*dmats1[13][4] + coeff0_14*dmats1[14][4] + coeff0_15*dmats1[15][4] + coeff0_16*dmats1[16][4] + coeff0_17*dmats1[17][4] + coeff0_18*dmats1[18][4] + coeff0_19*dmats1[19][4] + coeff0_20*dmats1[20][4]; new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5] + coeff0_10*dmats1[10][5] + coeff0_11*dmats1[11][5] + coeff0_12*dmats1[12][5] + coeff0_13*dmats1[13][5] + coeff0_14*dmats1[14][5] + coeff0_15*dmats1[15][5] + coeff0_16*dmats1[16][5] + coeff0_17*dmats1[17][5] + coeff0_18*dmats1[18][5] + coeff0_19*dmats1[19][5] + coeff0_20*dmats1[20][5]; new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6] + coeff0_10*dmats1[10][6] + coeff0_11*dmats1[11][6] + coeff0_12*dmats1[12][6] + coeff0_13*dmats1[13][6] + coeff0_14*dmats1[14][6] + coeff0_15*dmats1[15][6] + coeff0_16*dmats1[16][6] + coeff0_17*dmats1[17][6] + coeff0_18*dmats1[18][6] + coeff0_19*dmats1[19][6] + coeff0_20*dmats1[20][6]; new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7] + coeff0_10*dmats1[10][7] + coeff0_11*dmats1[11][7] + coeff0_12*dmats1[12][7] + coeff0_13*dmats1[13][7] + coeff0_14*dmats1[14][7] + coeff0_15*dmats1[15][7] + coeff0_16*dmats1[16][7] + coeff0_17*dmats1[17][7] + coeff0_18*dmats1[18][7] + coeff0_19*dmats1[19][7] + coeff0_20*dmats1[20][7]; new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8] + coeff0_10*dmats1[10][8] + coeff0_11*dmats1[11][8] + coeff0_12*dmats1[12][8] + coeff0_13*dmats1[13][8] + coeff0_14*dmats1[14][8] + coeff0_15*dmats1[15][8] + coeff0_16*dmats1[16][8] + coeff0_17*dmats1[17][8] + coeff0_18*dmats1[18][8] + coeff0_19*dmats1[19][8] + coeff0_20*dmats1[20][8]; new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9] + coeff0_10*dmats1[10][9] + coeff0_11*dmats1[11][9] + coeff0_12*dmats1[12][9] + coeff0_13*dmats1[13][9] + coeff0_14*dmats1[14][9] + coeff0_15*dmats1[15][9] + coeff0_16*dmats1[16][9] + coeff0_17*dmats1[17][9] + coeff0_18*dmats1[18][9] + coeff0_19*dmats1[19][9] + coeff0_20*dmats1[20][9]; new_coeff0_10 = coeff0_0*dmats1[0][10] + coeff0_1*dmats1[1][10] + coeff0_2*dmats1[2][10] + coeff0_3*dmats1[3][10] + coeff0_4*dmats1[4][10] + coeff0_5*dmats1[5][10] + coeff0_6*dmats1[6][10] + coeff0_7*dmats1[7][10] + coeff0_8*dmats1[8][10] + coeff0_9*dmats1[9][10] + coeff0_10*dmats1[10][10] + coeff0_11*dmats1[11][10] + coeff0_12*dmats1[12][10] + coeff0_13*dmats1[13][10] + coeff0_14*dmats1[14][10] + coeff0_15*dmats1[15][10] + coeff0_16*dmats1[16][10] + coeff0_17*dmats1[17][10] + coeff0_18*dmats1[18][10] + coeff0_19*dmats1[19][10] + coeff0_20*dmats1[20][10]; new_coeff0_11 = coeff0_0*dmats1[0][11] + coeff0_1*dmats1[1][11] + coeff0_2*dmats1[2][11] + coeff0_3*dmats1[3][11] + coeff0_4*dmats1[4][11] + coeff0_5*dmats1[5][11] + coeff0_6*dmats1[6][11] + coeff0_7*dmats1[7][11] + coeff0_8*dmats1[8][11] + coeff0_9*dmats1[9][11] + coeff0_10*dmats1[10][11] + coeff0_11*dmats1[11][11] + coeff0_12*dmats1[12][11] + coeff0_13*dmats1[13][11] + coeff0_14*dmats1[14][11] + coeff0_15*dmats1[15][11] + coeff0_16*dmats1[16][11] + coeff0_17*dmats1[17][11] + coeff0_18*dmats1[18][11] + coeff0_19*dmats1[19][11] + coeff0_20*dmats1[20][11]; new_coeff0_12 = coeff0_0*dmats1[0][12] + coeff0_1*dmats1[1][12] + coeff0_2*dmats1[2][12] + coeff0_3*dmats1[3][12] + coeff0_4*dmats1[4][12] + coeff0_5*dmats1[5][12] + coeff0_6*dmats1[6][12] + coeff0_7*dmats1[7][12] + coeff0_8*dmats1[8][12] + coeff0_9*dmats1[9][12] + coeff0_10*dmats1[10][12] + coeff0_11*dmats1[11][12] + coeff0_12*dmats1[12][12] + coeff0_13*dmats1[13][12] + coeff0_14*dmats1[14][12] + coeff0_15*dmats1[15][12] + coeff0_16*dmats1[16][12] + coeff0_17*dmats1[17][12] + coeff0_18*dmats1[18][12] + coeff0_19*dmats1[19][12] + coeff0_20*dmats1[20][12]; new_coeff0_13 = coeff0_0*dmats1[0][13] + coeff0_1*dmats1[1][13] + coeff0_2*dmats1[2][13] + coeff0_3*dmats1[3][13] + coeff0_4*dmats1[4][13] + coeff0_5*dmats1[5][13] + coeff0_6*dmats1[6][13] + coeff0_7*dmats1[7][13] + coeff0_8*dmats1[8][13] + coeff0_9*dmats1[9][13] + coeff0_10*dmats1[10][13] + coeff0_11*dmats1[11][13] + coeff0_12*dmats1[12][13] + coeff0_13*dmats1[13][13] + coeff0_14*dmats1[14][13] + coeff0_15*dmats1[15][13] + coeff0_16*dmats1[16][13] + coeff0_17*dmats1[17][13] + coeff0_18*dmats1[18][13] + coeff0_19*dmats1[19][13] + coeff0_20*dmats1[20][13]; new_coeff0_14 = coeff0_0*dmats1[0][14] + coeff0_1*dmats1[1][14] + coeff0_2*dmats1[2][14] + coeff0_3*dmats1[3][14] + coeff0_4*dmats1[4][14] + coeff0_5*dmats1[5][14] + coeff0_6*dmats1[6][14] + coeff0_7*dmats1[7][14] + coeff0_8*dmats1[8][14] + coeff0_9*dmats1[9][14] + coeff0_10*dmats1[10][14] + coeff0_11*dmats1[11][14] + coeff0_12*dmats1[12][14] + coeff0_13*dmats1[13][14] + coeff0_14*dmats1[14][14] + coeff0_15*dmats1[15][14] + coeff0_16*dmats1[16][14] + coeff0_17*dmats1[17][14] + coeff0_18*dmats1[18][14] + coeff0_19*dmats1[19][14] + coeff0_20*dmats1[20][14]; new_coeff0_15 = coeff0_0*dmats1[0][15] + coeff0_1*dmats1[1][15] + coeff0_2*dmats1[2][15] + coeff0_3*dmats1[3][15] + coeff0_4*dmats1[4][15] + coeff0_5*dmats1[5][15] + coeff0_6*dmats1[6][15] + coeff0_7*dmats1[7][15] + coeff0_8*dmats1[8][15] + coeff0_9*dmats1[9][15] + coeff0_10*dmats1[10][15] + coeff0_11*dmats1[11][15] + coeff0_12*dmats1[12][15] + coeff0_13*dmats1[13][15] + coeff0_14*dmats1[14][15] + coeff0_15*dmats1[15][15] + coeff0_16*dmats1[16][15] + coeff0_17*dmats1[17][15] + coeff0_18*dmats1[18][15] + coeff0_19*dmats1[19][15] + coeff0_20*dmats1[20][15]; new_coeff0_16 = coeff0_0*dmats1[0][16] + coeff0_1*dmats1[1][16] + coeff0_2*dmats1[2][16] + coeff0_3*dmats1[3][16] + coeff0_4*dmats1[4][16] + coeff0_5*dmats1[5][16] + coeff0_6*dmats1[6][16] + coeff0_7*dmats1[7][16] + coeff0_8*dmats1[8][16] + coeff0_9*dmats1[9][16] + coeff0_10*dmats1[10][16] + coeff0_11*dmats1[11][16] + coeff0_12*dmats1[12][16] + coeff0_13*dmats1[13][16] + coeff0_14*dmats1[14][16] + coeff0_15*dmats1[15][16] + coeff0_16*dmats1[16][16] + coeff0_17*dmats1[17][16] + coeff0_18*dmats1[18][16] + coeff0_19*dmats1[19][16] + coeff0_20*dmats1[20][16]; new_coeff0_17 = coeff0_0*dmats1[0][17] + coeff0_1*dmats1[1][17] + coeff0_2*dmats1[2][17] + coeff0_3*dmats1[3][17] + coeff0_4*dmats1[4][17] + coeff0_5*dmats1[5][17] + coeff0_6*dmats1[6][17] + coeff0_7*dmats1[7][17] + coeff0_8*dmats1[8][17] + coeff0_9*dmats1[9][17] + coeff0_10*dmats1[10][17] + coeff0_11*dmats1[11][17] + coeff0_12*dmats1[12][17] + coeff0_13*dmats1[13][17] + coeff0_14*dmats1[14][17] + coeff0_15*dmats1[15][17] + coeff0_16*dmats1[16][17] + coeff0_17*dmats1[17][17] + coeff0_18*dmats1[18][17] + coeff0_19*dmats1[19][17] + coeff0_20*dmats1[20][17]; new_coeff0_18 = coeff0_0*dmats1[0][18] + coeff0_1*dmats1[1][18] + coeff0_2*dmats1[2][18] + coeff0_3*dmats1[3][18] + coeff0_4*dmats1[4][18] + coeff0_5*dmats1[5][18] + coeff0_6*dmats1[6][18] + coeff0_7*dmats1[7][18] + coeff0_8*dmats1[8][18] + coeff0_9*dmats1[9][18] + coeff0_10*dmats1[10][18] + coeff0_11*dmats1[11][18] + coeff0_12*dmats1[12][18] + coeff0_13*dmats1[13][18] + coeff0_14*dmats1[14][18] + coeff0_15*dmats1[15][18] + coeff0_16*dmats1[16][18] + coeff0_17*dmats1[17][18] + coeff0_18*dmats1[18][18] + coeff0_19*dmats1[19][18] + coeff0_20*dmats1[20][18]; new_coeff0_19 = coeff0_0*dmats1[0][19] + coeff0_1*dmats1[1][19] + coeff0_2*dmats1[2][19] + coeff0_3*dmats1[3][19] + coeff0_4*dmats1[4][19] + coeff0_5*dmats1[5][19] + coeff0_6*dmats1[6][19] + coeff0_7*dmats1[7][19] + coeff0_8*dmats1[8][19] + coeff0_9*dmats1[9][19] + coeff0_10*dmats1[10][19] + coeff0_11*dmats1[11][19] + coeff0_12*dmats1[12][19] + coeff0_13*dmats1[13][19] + coeff0_14*dmats1[14][19] + coeff0_15*dmats1[15][19] + coeff0_16*dmats1[16][19] + coeff0_17*dmats1[17][19] + coeff0_18*dmats1[18][19] + coeff0_19*dmats1[19][19] + coeff0_20*dmats1[20][19]; new_coeff0_20 = coeff0_0*dmats1[0][20] + coeff0_1*dmats1[1][20] + coeff0_2*dmats1[2][20] + coeff0_3*dmats1[3][20] + coeff0_4*dmats1[4][20] + coeff0_5*dmats1[5][20] + coeff0_6*dmats1[6][20] + coeff0_7*dmats1[7][20] + coeff0_8*dmats1[8][20] + coeff0_9*dmats1[9][20] + coeff0_10*dmats1[10][20] + coeff0_11*dmats1[11][20] + coeff0_12*dmats1[12][20] + coeff0_13*dmats1[13][20] + coeff0_14*dmats1[14][20] + coeff0_15*dmats1[15][20] + coeff0_16*dmats1[16][20] + coeff0_17*dmats1[17][20] + coeff0_18*dmats1[18][20] + coeff0_19*dmats1[19][20] + coeff0_20*dmats1[20][20]; } } // Compute derivatives on reference element as dot product of coefficients and basisvalues derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9 + new_coeff0_10*basisvalue10 + new_coeff0_11*basisvalue11 + new_coeff0_12*basisvalue12 + new_coeff0_13*basisvalue13 + new_coeff0_14*basisvalue14 + new_coeff0_15*basisvalue15 + new_coeff0_16*basisvalue16 + new_coeff0_17*basisvalue17 + new_coeff0_18*basisvalue18 + new_coeff0_19*basisvalue19 + new_coeff0_20*basisvalue20; } // Transform derivatives back to physical element for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { values[row] += transform[row][col]*derivatives[col]; } } // Delete pointer to array of derivatives on FIAT element delete [] derivatives; // Delete pointer to array of combinations of derivatives and transform for (unsigned int row = 0; row < num_derivatives; row++) { delete [] combinations[row]; delete [] transform[row]; } delete [] combinations; delete [] transform; } /// Evaluate order n derivatives of all basis functions at given point in cell virtual void evaluate_basis_derivatives_all(unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented."); } /// Evaluate linear functional for dof i on the function f virtual double evaluate_dof(unsigned int i, const ufc::function& f, const ufc::cell& c) const { // The reference points, direction and weights: const static double X[21][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.8, 0.2}}, {{0.6, 0.4}}, {{0.4, 0.6}}, {{0.2, 0.8}}, {{0, 0.2}}, {{0, 0.4}}, {{0, 0.6}}, {{0, 0.8}}, {{0.2, 0}}, {{0.4, 0}}, {{0.6, 0}}, {{0.8, 0}}, {{0.2, 0.2}}, {{0.4, 0.2}}, {{0.6, 0.2}}, {{0.2, 0.4}}, {{0.4, 0.4}}, {{0.2, 0.6}}}; const static double W[21][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}; const static double D[21][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}}; const double * const * x = c.coordinates; double result = 0.0; // Iterate over the points: // Evaluate basis functions for affine mapping const double w0 = 1.0 - X[i][0][0] - X[i][0][1]; const double w1 = X[i][0][0]; const double w2 = X[i][0][1]; // Compute affine mapping y = F(X) double y[2]; y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0]; y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1]; // Evaluate function at physical points double values[1]; f.evaluate(values, y, c); // Map function values using appropriate mapping // Affine map: Do nothing // Note that we do not map the weights (yet). // Take directional components for(int k = 0; k < 1; k++) result += values[k]*D[i][0][k]; // Multiply by weights result *= W[i][0]; return result; } /// Evaluate linear functionals for all dofs on the function f virtual void evaluate_dofs(double* values, const ufc::function& f, const ufc::cell& c) const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Interpolate vertex values from dof values virtual void interpolate_vertex_values(double* vertex_values, const double* dof_values, const ufc::cell& c) const { // Evaluate at vertices and use affine mapping vertex_values[0] = dof_values[0]; vertex_values[1] = dof_values[1]; vertex_values[2] = dof_values[2]; } /// Return the number of sub elements (for a mixed element) virtual unsigned int num_sub_elements() const { return 1; } /// 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_Poisson2D_5BilinearForm_finite_element_0(); } }; /// This class defines the interface for a finite element. class UFC_Poisson2D_5BilinearForm_finite_element_1: public ufc::finite_element { public: /// Constructor UFC_Poisson2D_5BilinearForm_finite_element_1() : ufc::finite_element() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm_finite_element_1() { // Do nothing } /// Return a string identifying the finite element virtual const char* signature() const { return "Lagrange finite element of degree 5 on a triangle"; } /// 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 21; } /// 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; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Reset values *values = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Extract relevant coefficients const double coeff0_0 = coefficients0[dof][0]; const double coeff0_1 = coefficients0[dof][1]; const double coeff0_2 = coefficients0[dof][2]; const double coeff0_3 = coefficients0[dof][3]; const double coeff0_4 = coefficients0[dof][4]; const double coeff0_5 = coefficients0[dof][5]; const double coeff0_6 = coefficients0[dof][6]; const double coeff0_7 = coefficients0[dof][7]; const double coeff0_8 = coefficients0[dof][8]; const double coeff0_9 = coefficients0[dof][9]; const double coeff0_10 = coefficients0[dof][10]; const double coeff0_11 = coefficients0[dof][11]; const double coeff0_12 = coefficients0[dof][12]; const double coeff0_13 = coefficients0[dof][13]; const double coeff0_14 = coefficients0[dof][14]; const double coeff0_15 = coefficients0[dof][15]; const double coeff0_16 = coefficients0[dof][16]; const double coeff0_17 = coefficients0[dof][17]; const double coeff0_18 = coefficients0[dof][18]; const double coeff0_19 = coefficients0[dof][19]; const double coeff0_20 = coefficients0[dof][20]; // Compute value(s) *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9 + coeff0_10*basisvalue10 + coeff0_11*basisvalue11 + coeff0_12*basisvalue12 + coeff0_13*basisvalue13 + coeff0_14*basisvalue14 + coeff0_15*basisvalue15 + coeff0_16*basisvalue16 + coeff0_17*basisvalue17 + coeff0_18*basisvalue18 + coeff0_19*basisvalue19 + coeff0_20*basisvalue20; } /// Evaluate all basis functions at given point in cell virtual void evaluate_basis_all(double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented."); } /// Evaluate order n derivatives of basis function i at given point in cell virtual void evaluate_basis_derivatives(unsigned int i, unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { // Extract vertex coordinates const double * const * element_coordinates = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = element_coordinates[1][0] - element_coordinates[0][0]; const double J_01 = element_coordinates[2][0] - element_coordinates[0][0]; const double J_10 = element_coordinates[1][1] - element_coordinates[0][1]; const double J_11 = element_coordinates[2][1] - element_coordinates[0][1]; // Compute determinant of Jacobian const double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Compute number of derivatives unsigned int num_derivatives = 1; for (unsigned int j = 0; j < n; j++) num_derivatives *= 2; // Declare pointer to two dimensional array that holds combinations of derivatives and initialise unsigned int **combinations = new unsigned int *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { combinations[j] = new unsigned int [n]; for (unsigned int k = 0; k < n; k++) combinations[j][k] = 0; } // Generate combinations of derivatives for (unsigned int row = 1; row < num_derivatives; row++) { for (unsigned int num = 0; num < row; num++) { for (unsigned int col = n-1; col+1 > 0; col--) { if (combinations[row][col] + 1 > 1) combinations[row][col] = 0; else { combinations[row][col] += 1; break; } } } } // Compute inverse of Jacobian const double Jinv[2][2] = {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}}; // Declare transformation matrix // Declare pointer to two dimensional array and initialise double **transform = new double *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { transform[j] = new double [num_derivatives]; for (unsigned int k = 0; k < num_derivatives; k++) transform[j][k] = 1; } // Construct transformation matrix for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { for (unsigned int k = 0; k < n; k++) transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]]; } } // Reset values for (unsigned int j = 0; j < 1*num_derivatives; j++) values[j] = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Interesting (new) part // Tables of derivatives of the polynomial base (transpose) const static double dmats0[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.89897948556636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 9.48683298050514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4, 0, 7.07106781186548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.29150262212917, 0, -2.99332590941916, 13.6626010212795, 0, 0.611010092660777, 0, -1.27277816408026e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 4.38178046004133, 0, 0, 12.5219806739988, 0, 0, 0, -1.21552073961695e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.46410161513776, 0, 7.83836717690617, 0, 0, 8.4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 10.9544511501033, 0, 0, -3.83325938999965, 0, 17.7482393492989, 0, 0.553283335172478, 0, 0, 0, 0, 0, 0, 1.30575944758963e-14, 0, 0, 0, 0, 0}, {4.73286382647968, 0, 3.3466401061363, 4.36435780471985, 0, -5.07468037933238, 0, 17.0084012854152, 0, 1.52127765851134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 2.44948974278318, 0, 0, 9.14285714285713, 0, 0, -1.45463708554178e-14, 14.8461497791618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.09838667696594, 0, 7.66811580507233, 0, 0, 10.733126291999, 0, 0, 0, 9.2951600308978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.41602560309065, 0, -4.37680963545757, 15.7321327225523, 0, 2.01017818278147, 0, -4.03686713879668, 0, -0.515811962199122, 21.799082549502, 0, 0.451335466924226, 0, 0.0576695305542381, 0, 0, 0, 0, 0, 0}, {0, 6.85714285714286, 0, 0, 9.97292252418866, 0, 4.32049379893858, 0, -7.27309832077592, -1.59872115546023e-14, 0, 21.2540192277445, 0, 1.49078803979367, 0, 0, 0, 0, 0, 0, 0}, {4.32049379893858, 0, 5.93552661441898, 1.79284291400158, 0, -0.320713490294932, 0, 9.20087412456475, 0, -5.96639619853425, 0, 0, 19.8022632451351, 0, 2.53024038425528, 0, 1.17859985414066e-14, 0, 0, 0, -1.33686464676153e-14}, {0, 1.53330375599988, 1.24344978758018e-14, 0, 6.33793245113119, 0, 0, 0, 13.5526185435788, 1.4210854715202e-14, 0, 0, 0, 16.6675169851115, 0, 0, 0, 0, 0, 1.68753899743024e-14, 0}, {2.82842712474619, 0, 7.31428571428572, 0, 0, 11.337638238025, 0, 0, 0, 12.9299525702683, 0, 0, 0, 0, 9.93858693195777, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const static double dmats1[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.24264068711928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.58198889747161, 4.74341649025257, -0.912870929175276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 6.12372435695794, 3.53553390593274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.64575131106459, 5.18459255872629, -1.49666295470958, 6.83130051063974, -1.05830052442584, 0.30550504633039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.23606797749979, 2.19089023002066, 2.52982212813469, 8.08290376865476, 6.26099033699941, -1.80739222823012, 0, -1.56672320349306e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.73205080756888, -5.09116882454314, 3.91918358845308, 0, 9.69948452238571, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.00000000000001, 0, -2.8284271247462, 0, 0, 12.1243556529821, 0, 0, 0, -2.08002018386999e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.14001690032506e-14}, {2.68328157299975, 5.47722557505167, -1.89736659610103, 7.42307488958091, -1.91662969499983, 0.663940002206986, 8.87411967464944, -1.07142857142858, 0.276641667586237, -0.0958314847499917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.36643191323985, 2.89827534923789, 1.67332005306815, 2.18217890235992, 5.74704893215391, -2.53734018966619, 10.0623058987491, 8.50420064270761, -2.19577516413421, 0.760638829255665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1.2247448713916, 3.53553390593273, -7.37711113563318, 4.57142857142857, 1.64957219768464, 0, 11.4997781699989, 7.42307488958091, -2.57142857142858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.54919333848296, 6.64078308635361, 3.83405790253618, 0, -6.19677335393188, 5.3665631459995, 0, 0, 13.4164078649988, 4.64758001544891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-3.57770876399967, 0, 8.85437744847148, 0, 0, -3.09838667696592, 0, 0, -1.115968317663e-14, 16.0996894379985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.70801280154532, 5.68564249775213, -2.18840481772878, 7.86606636127615, -2.61129805863299, 1.00508909139074, 9.55297122675765, -2.01843356939834, 0.670059394260489, -0.257905981099558, 10.899541274751, -1.06805465250648, 0.225667733462112, -0.0749149177264378, 0.0288347652771189, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 3.42857142857144, 0.989743318610788, 3.04933917230523, 4.98646126209433, -2.72741187029097, 2.1602468994693, 8.34624849531682, -3.63654916038796, 1.5163507931515, 12.0498962651137, 10.6270096138723, -2.24536559755125, 0.745394019896833, -0.286902292026513, 0, 0, 0, 0, 0, 0}, {2.16024689946929, 1.81422947044429, 2.96776330720949, 0.896421457000793, 5.41604758366942, -0.160356745147465, -9.52579344415681, 4.60043706228237, 5.34522483824849, -2.98319809926713, 0, 13.3887736279041, 9.90113162256756, -3.28687867566959, 1.26512019212764, 0, 0, 0, 0, 0, 0}, {1.82574185835055, 0.76665187799994, 3.83609779052925, 8.6368042559214, 3.16896622556559, 3.65920700676626, 0, -8.74817765279707, 6.7763092717894, 0.521640530957295, 0, 0, 15.0623703313921, 8.33375849255573, -3.20766513935893, 0, 0, 0, 0, 1.07750480127221e-14, 0}, {1.4142135623731, -6.73025456655334, 3.65714285714287, 0, 9.4550278170087, 5.6688191190125, 0, 1.90406705745985e-14, -6.99854212223762, 6.46497628513416, 0, 0, 0, 17.2141375215909, 4.96929346597888, 0, 0, 0, 0, 1.47903916597301e-14, 0}, {5.71547606649408, 1.19544627798492e-14, -4.61880215351701, 0, 0, 12.7279220613579, 0, 0, 2.41311920846e-14, -3.2659863237109, 0, 0, 0, 0, 20.0831604418561, 0, 0, 0, 0, 0, 0}}; // Compute reference derivatives // Declare pointer to array of derivatives on FIAT element double *derivatives = new double [num_derivatives]; // Declare coefficients double coeff0_0 = 0; double coeff0_1 = 0; double coeff0_2 = 0; double coeff0_3 = 0; double coeff0_4 = 0; double coeff0_5 = 0; double coeff0_6 = 0; double coeff0_7 = 0; double coeff0_8 = 0; double coeff0_9 = 0; double coeff0_10 = 0; double coeff0_11 = 0; double coeff0_12 = 0; double coeff0_13 = 0; double coeff0_14 = 0; double coeff0_15 = 0; double coeff0_16 = 0; double coeff0_17 = 0; double coeff0_18 = 0; double coeff0_19 = 0; double coeff0_20 = 0; // Declare new coefficients double new_coeff0_0 = 0; double new_coeff0_1 = 0; double new_coeff0_2 = 0; double new_coeff0_3 = 0; double new_coeff0_4 = 0; double new_coeff0_5 = 0; double new_coeff0_6 = 0; double new_coeff0_7 = 0; double new_coeff0_8 = 0; double new_coeff0_9 = 0; double new_coeff0_10 = 0; double new_coeff0_11 = 0; double new_coeff0_12 = 0; double new_coeff0_13 = 0; double new_coeff0_14 = 0; double new_coeff0_15 = 0; double new_coeff0_16 = 0; double new_coeff0_17 = 0; double new_coeff0_18 = 0; double new_coeff0_19 = 0; double new_coeff0_20 = 0; // Loop possible derivatives for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++) { // Get values from coefficients array new_coeff0_0 = coefficients0[dof][0]; new_coeff0_1 = coefficients0[dof][1]; new_coeff0_2 = coefficients0[dof][2]; new_coeff0_3 = coefficients0[dof][3]; new_coeff0_4 = coefficients0[dof][4]; new_coeff0_5 = coefficients0[dof][5]; new_coeff0_6 = coefficients0[dof][6]; new_coeff0_7 = coefficients0[dof][7]; new_coeff0_8 = coefficients0[dof][8]; new_coeff0_9 = coefficients0[dof][9]; new_coeff0_10 = coefficients0[dof][10]; new_coeff0_11 = coefficients0[dof][11]; new_coeff0_12 = coefficients0[dof][12]; new_coeff0_13 = coefficients0[dof][13]; new_coeff0_14 = coefficients0[dof][14]; new_coeff0_15 = coefficients0[dof][15]; new_coeff0_16 = coefficients0[dof][16]; new_coeff0_17 = coefficients0[dof][17]; new_coeff0_18 = coefficients0[dof][18]; new_coeff0_19 = coefficients0[dof][19]; new_coeff0_20 = coefficients0[dof][20]; // Loop derivative order for (unsigned int j = 0; j < n; j++) { // Update old coefficients coeff0_0 = new_coeff0_0; coeff0_1 = new_coeff0_1; coeff0_2 = new_coeff0_2; coeff0_3 = new_coeff0_3; coeff0_4 = new_coeff0_4; coeff0_5 = new_coeff0_5; coeff0_6 = new_coeff0_6; coeff0_7 = new_coeff0_7; coeff0_8 = new_coeff0_8; coeff0_9 = new_coeff0_9; coeff0_10 = new_coeff0_10; coeff0_11 = new_coeff0_11; coeff0_12 = new_coeff0_12; coeff0_13 = new_coeff0_13; coeff0_14 = new_coeff0_14; coeff0_15 = new_coeff0_15; coeff0_16 = new_coeff0_16; coeff0_17 = new_coeff0_17; coeff0_18 = new_coeff0_18; coeff0_19 = new_coeff0_19; coeff0_20 = new_coeff0_20; if(combinations[deriv_num][j] == 0) { new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0] + coeff0_10*dmats0[10][0] + coeff0_11*dmats0[11][0] + coeff0_12*dmats0[12][0] + coeff0_13*dmats0[13][0] + coeff0_14*dmats0[14][0] + coeff0_15*dmats0[15][0] + coeff0_16*dmats0[16][0] + coeff0_17*dmats0[17][0] + coeff0_18*dmats0[18][0] + coeff0_19*dmats0[19][0] + coeff0_20*dmats0[20][0]; new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1] + coeff0_10*dmats0[10][1] + coeff0_11*dmats0[11][1] + coeff0_12*dmats0[12][1] + coeff0_13*dmats0[13][1] + coeff0_14*dmats0[14][1] + coeff0_15*dmats0[15][1] + coeff0_16*dmats0[16][1] + coeff0_17*dmats0[17][1] + coeff0_18*dmats0[18][1] + coeff0_19*dmats0[19][1] + coeff0_20*dmats0[20][1]; new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2] + coeff0_10*dmats0[10][2] + coeff0_11*dmats0[11][2] + coeff0_12*dmats0[12][2] + coeff0_13*dmats0[13][2] + coeff0_14*dmats0[14][2] + coeff0_15*dmats0[15][2] + coeff0_16*dmats0[16][2] + coeff0_17*dmats0[17][2] + coeff0_18*dmats0[18][2] + coeff0_19*dmats0[19][2] + coeff0_20*dmats0[20][2]; new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3] + coeff0_10*dmats0[10][3] + coeff0_11*dmats0[11][3] + coeff0_12*dmats0[12][3] + coeff0_13*dmats0[13][3] + coeff0_14*dmats0[14][3] + coeff0_15*dmats0[15][3] + coeff0_16*dmats0[16][3] + coeff0_17*dmats0[17][3] + coeff0_18*dmats0[18][3] + coeff0_19*dmats0[19][3] + coeff0_20*dmats0[20][3]; new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4] + coeff0_10*dmats0[10][4] + coeff0_11*dmats0[11][4] + coeff0_12*dmats0[12][4] + coeff0_13*dmats0[13][4] + coeff0_14*dmats0[14][4] + coeff0_15*dmats0[15][4] + coeff0_16*dmats0[16][4] + coeff0_17*dmats0[17][4] + coeff0_18*dmats0[18][4] + coeff0_19*dmats0[19][4] + coeff0_20*dmats0[20][4]; new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5] + coeff0_10*dmats0[10][5] + coeff0_11*dmats0[11][5] + coeff0_12*dmats0[12][5] + coeff0_13*dmats0[13][5] + coeff0_14*dmats0[14][5] + coeff0_15*dmats0[15][5] + coeff0_16*dmats0[16][5] + coeff0_17*dmats0[17][5] + coeff0_18*dmats0[18][5] + coeff0_19*dmats0[19][5] + coeff0_20*dmats0[20][5]; new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6] + coeff0_10*dmats0[10][6] + coeff0_11*dmats0[11][6] + coeff0_12*dmats0[12][6] + coeff0_13*dmats0[13][6] + coeff0_14*dmats0[14][6] + coeff0_15*dmats0[15][6] + coeff0_16*dmats0[16][6] + coeff0_17*dmats0[17][6] + coeff0_18*dmats0[18][6] + coeff0_19*dmats0[19][6] + coeff0_20*dmats0[20][6]; new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7] + coeff0_10*dmats0[10][7] + coeff0_11*dmats0[11][7] + coeff0_12*dmats0[12][7] + coeff0_13*dmats0[13][7] + coeff0_14*dmats0[14][7] + coeff0_15*dmats0[15][7] + coeff0_16*dmats0[16][7] + coeff0_17*dmats0[17][7] + coeff0_18*dmats0[18][7] + coeff0_19*dmats0[19][7] + coeff0_20*dmats0[20][7]; new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8] + coeff0_10*dmats0[10][8] + coeff0_11*dmats0[11][8] + coeff0_12*dmats0[12][8] + coeff0_13*dmats0[13][8] + coeff0_14*dmats0[14][8] + coeff0_15*dmats0[15][8] + coeff0_16*dmats0[16][8] + coeff0_17*dmats0[17][8] + coeff0_18*dmats0[18][8] + coeff0_19*dmats0[19][8] + coeff0_20*dmats0[20][8]; new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9] + coeff0_10*dmats0[10][9] + coeff0_11*dmats0[11][9] + coeff0_12*dmats0[12][9] + coeff0_13*dmats0[13][9] + coeff0_14*dmats0[14][9] + coeff0_15*dmats0[15][9] + coeff0_16*dmats0[16][9] + coeff0_17*dmats0[17][9] + coeff0_18*dmats0[18][9] + coeff0_19*dmats0[19][9] + coeff0_20*dmats0[20][9]; new_coeff0_10 = coeff0_0*dmats0[0][10] + coeff0_1*dmats0[1][10] + coeff0_2*dmats0[2][10] + coeff0_3*dmats0[3][10] + coeff0_4*dmats0[4][10] + coeff0_5*dmats0[5][10] + coeff0_6*dmats0[6][10] + coeff0_7*dmats0[7][10] + coeff0_8*dmats0[8][10] + coeff0_9*dmats0[9][10] + coeff0_10*dmats0[10][10] + coeff0_11*dmats0[11][10] + coeff0_12*dmats0[12][10] + coeff0_13*dmats0[13][10] + coeff0_14*dmats0[14][10] + coeff0_15*dmats0[15][10] + coeff0_16*dmats0[16][10] + coeff0_17*dmats0[17][10] + coeff0_18*dmats0[18][10] + coeff0_19*dmats0[19][10] + coeff0_20*dmats0[20][10]; new_coeff0_11 = coeff0_0*dmats0[0][11] + coeff0_1*dmats0[1][11] + coeff0_2*dmats0[2][11] + coeff0_3*dmats0[3][11] + coeff0_4*dmats0[4][11] + coeff0_5*dmats0[5][11] + coeff0_6*dmats0[6][11] + coeff0_7*dmats0[7][11] + coeff0_8*dmats0[8][11] + coeff0_9*dmats0[9][11] + coeff0_10*dmats0[10][11] + coeff0_11*dmats0[11][11] + coeff0_12*dmats0[12][11] + coeff0_13*dmats0[13][11] + coeff0_14*dmats0[14][11] + coeff0_15*dmats0[15][11] + coeff0_16*dmats0[16][11] + coeff0_17*dmats0[17][11] + coeff0_18*dmats0[18][11] + coeff0_19*dmats0[19][11] + coeff0_20*dmats0[20][11]; new_coeff0_12 = coeff0_0*dmats0[0][12] + coeff0_1*dmats0[1][12] + coeff0_2*dmats0[2][12] + coeff0_3*dmats0[3][12] + coeff0_4*dmats0[4][12] + coeff0_5*dmats0[5][12] + coeff0_6*dmats0[6][12] + coeff0_7*dmats0[7][12] + coeff0_8*dmats0[8][12] + coeff0_9*dmats0[9][12] + coeff0_10*dmats0[10][12] + coeff0_11*dmats0[11][12] + coeff0_12*dmats0[12][12] + coeff0_13*dmats0[13][12] + coeff0_14*dmats0[14][12] + coeff0_15*dmats0[15][12] + coeff0_16*dmats0[16][12] + coeff0_17*dmats0[17][12] + coeff0_18*dmats0[18][12] + coeff0_19*dmats0[19][12] + coeff0_20*dmats0[20][12]; new_coeff0_13 = coeff0_0*dmats0[0][13] + coeff0_1*dmats0[1][13] + coeff0_2*dmats0[2][13] + coeff0_3*dmats0[3][13] + coeff0_4*dmats0[4][13] + coeff0_5*dmats0[5][13] + coeff0_6*dmats0[6][13] + coeff0_7*dmats0[7][13] + coeff0_8*dmats0[8][13] + coeff0_9*dmats0[9][13] + coeff0_10*dmats0[10][13] + coeff0_11*dmats0[11][13] + coeff0_12*dmats0[12][13] + coeff0_13*dmats0[13][13] + coeff0_14*dmats0[14][13] + coeff0_15*dmats0[15][13] + coeff0_16*dmats0[16][13] + coeff0_17*dmats0[17][13] + coeff0_18*dmats0[18][13] + coeff0_19*dmats0[19][13] + coeff0_20*dmats0[20][13]; new_coeff0_14 = coeff0_0*dmats0[0][14] + coeff0_1*dmats0[1][14] + coeff0_2*dmats0[2][14] + coeff0_3*dmats0[3][14] + coeff0_4*dmats0[4][14] + coeff0_5*dmats0[5][14] + coeff0_6*dmats0[6][14] + coeff0_7*dmats0[7][14] + coeff0_8*dmats0[8][14] + coeff0_9*dmats0[9][14] + coeff0_10*dmats0[10][14] + coeff0_11*dmats0[11][14] + coeff0_12*dmats0[12][14] + coeff0_13*dmats0[13][14] + coeff0_14*dmats0[14][14] + coeff0_15*dmats0[15][14] + coeff0_16*dmats0[16][14] + coeff0_17*dmats0[17][14] + coeff0_18*dmats0[18][14] + coeff0_19*dmats0[19][14] + coeff0_20*dmats0[20][14]; new_coeff0_15 = coeff0_0*dmats0[0][15] + coeff0_1*dmats0[1][15] + coeff0_2*dmats0[2][15] + coeff0_3*dmats0[3][15] + coeff0_4*dmats0[4][15] + coeff0_5*dmats0[5][15] + coeff0_6*dmats0[6][15] + coeff0_7*dmats0[7][15] + coeff0_8*dmats0[8][15] + coeff0_9*dmats0[9][15] + coeff0_10*dmats0[10][15] + coeff0_11*dmats0[11][15] + coeff0_12*dmats0[12][15] + coeff0_13*dmats0[13][15] + coeff0_14*dmats0[14][15] + coeff0_15*dmats0[15][15] + coeff0_16*dmats0[16][15] + coeff0_17*dmats0[17][15] + coeff0_18*dmats0[18][15] + coeff0_19*dmats0[19][15] + coeff0_20*dmats0[20][15]; new_coeff0_16 = coeff0_0*dmats0[0][16] + coeff0_1*dmats0[1][16] + coeff0_2*dmats0[2][16] + coeff0_3*dmats0[3][16] + coeff0_4*dmats0[4][16] + coeff0_5*dmats0[5][16] + coeff0_6*dmats0[6][16] + coeff0_7*dmats0[7][16] + coeff0_8*dmats0[8][16] + coeff0_9*dmats0[9][16] + coeff0_10*dmats0[10][16] + coeff0_11*dmats0[11][16] + coeff0_12*dmats0[12][16] + coeff0_13*dmats0[13][16] + coeff0_14*dmats0[14][16] + coeff0_15*dmats0[15][16] + coeff0_16*dmats0[16][16] + coeff0_17*dmats0[17][16] + coeff0_18*dmats0[18][16] + coeff0_19*dmats0[19][16] + coeff0_20*dmats0[20][16]; new_coeff0_17 = coeff0_0*dmats0[0][17] + coeff0_1*dmats0[1][17] + coeff0_2*dmats0[2][17] + coeff0_3*dmats0[3][17] + coeff0_4*dmats0[4][17] + coeff0_5*dmats0[5][17] + coeff0_6*dmats0[6][17] + coeff0_7*dmats0[7][17] + coeff0_8*dmats0[8][17] + coeff0_9*dmats0[9][17] + coeff0_10*dmats0[10][17] + coeff0_11*dmats0[11][17] + coeff0_12*dmats0[12][17] + coeff0_13*dmats0[13][17] + coeff0_14*dmats0[14][17] + coeff0_15*dmats0[15][17] + coeff0_16*dmats0[16][17] + coeff0_17*dmats0[17][17] + coeff0_18*dmats0[18][17] + coeff0_19*dmats0[19][17] + coeff0_20*dmats0[20][17]; new_coeff0_18 = coeff0_0*dmats0[0][18] + coeff0_1*dmats0[1][18] + coeff0_2*dmats0[2][18] + coeff0_3*dmats0[3][18] + coeff0_4*dmats0[4][18] + coeff0_5*dmats0[5][18] + coeff0_6*dmats0[6][18] + coeff0_7*dmats0[7][18] + coeff0_8*dmats0[8][18] + coeff0_9*dmats0[9][18] + coeff0_10*dmats0[10][18] + coeff0_11*dmats0[11][18] + coeff0_12*dmats0[12][18] + coeff0_13*dmats0[13][18] + coeff0_14*dmats0[14][18] + coeff0_15*dmats0[15][18] + coeff0_16*dmats0[16][18] + coeff0_17*dmats0[17][18] + coeff0_18*dmats0[18][18] + coeff0_19*dmats0[19][18] + coeff0_20*dmats0[20][18]; new_coeff0_19 = coeff0_0*dmats0[0][19] + coeff0_1*dmats0[1][19] + coeff0_2*dmats0[2][19] + coeff0_3*dmats0[3][19] + coeff0_4*dmats0[4][19] + coeff0_5*dmats0[5][19] + coeff0_6*dmats0[6][19] + coeff0_7*dmats0[7][19] + coeff0_8*dmats0[8][19] + coeff0_9*dmats0[9][19] + coeff0_10*dmats0[10][19] + coeff0_11*dmats0[11][19] + coeff0_12*dmats0[12][19] + coeff0_13*dmats0[13][19] + coeff0_14*dmats0[14][19] + coeff0_15*dmats0[15][19] + coeff0_16*dmats0[16][19] + coeff0_17*dmats0[17][19] + coeff0_18*dmats0[18][19] + coeff0_19*dmats0[19][19] + coeff0_20*dmats0[20][19]; new_coeff0_20 = coeff0_0*dmats0[0][20] + coeff0_1*dmats0[1][20] + coeff0_2*dmats0[2][20] + coeff0_3*dmats0[3][20] + coeff0_4*dmats0[4][20] + coeff0_5*dmats0[5][20] + coeff0_6*dmats0[6][20] + coeff0_7*dmats0[7][20] + coeff0_8*dmats0[8][20] + coeff0_9*dmats0[9][20] + coeff0_10*dmats0[10][20] + coeff0_11*dmats0[11][20] + coeff0_12*dmats0[12][20] + coeff0_13*dmats0[13][20] + coeff0_14*dmats0[14][20] + coeff0_15*dmats0[15][20] + coeff0_16*dmats0[16][20] + coeff0_17*dmats0[17][20] + coeff0_18*dmats0[18][20] + coeff0_19*dmats0[19][20] + coeff0_20*dmats0[20][20]; } if(combinations[deriv_num][j] == 1) { new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0] + coeff0_10*dmats1[10][0] + coeff0_11*dmats1[11][0] + coeff0_12*dmats1[12][0] + coeff0_13*dmats1[13][0] + coeff0_14*dmats1[14][0] + coeff0_15*dmats1[15][0] + coeff0_16*dmats1[16][0] + coeff0_17*dmats1[17][0] + coeff0_18*dmats1[18][0] + coeff0_19*dmats1[19][0] + coeff0_20*dmats1[20][0]; new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1] + coeff0_10*dmats1[10][1] + coeff0_11*dmats1[11][1] + coeff0_12*dmats1[12][1] + coeff0_13*dmats1[13][1] + coeff0_14*dmats1[14][1] + coeff0_15*dmats1[15][1] + coeff0_16*dmats1[16][1] + coeff0_17*dmats1[17][1] + coeff0_18*dmats1[18][1] + coeff0_19*dmats1[19][1] + coeff0_20*dmats1[20][1]; new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2] + coeff0_10*dmats1[10][2] + coeff0_11*dmats1[11][2] + coeff0_12*dmats1[12][2] + coeff0_13*dmats1[13][2] + coeff0_14*dmats1[14][2] + coeff0_15*dmats1[15][2] + coeff0_16*dmats1[16][2] + coeff0_17*dmats1[17][2] + coeff0_18*dmats1[18][2] + coeff0_19*dmats1[19][2] + coeff0_20*dmats1[20][2]; new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3] + coeff0_10*dmats1[10][3] + coeff0_11*dmats1[11][3] + coeff0_12*dmats1[12][3] + coeff0_13*dmats1[13][3] + coeff0_14*dmats1[14][3] + coeff0_15*dmats1[15][3] + coeff0_16*dmats1[16][3] + coeff0_17*dmats1[17][3] + coeff0_18*dmats1[18][3] + coeff0_19*dmats1[19][3] + coeff0_20*dmats1[20][3]; new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4] + coeff0_10*dmats1[10][4] + coeff0_11*dmats1[11][4] + coeff0_12*dmats1[12][4] + coeff0_13*dmats1[13][4] + coeff0_14*dmats1[14][4] + coeff0_15*dmats1[15][4] + coeff0_16*dmats1[16][4] + coeff0_17*dmats1[17][4] + coeff0_18*dmats1[18][4] + coeff0_19*dmats1[19][4] + coeff0_20*dmats1[20][4]; new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5] + coeff0_10*dmats1[10][5] + coeff0_11*dmats1[11][5] + coeff0_12*dmats1[12][5] + coeff0_13*dmats1[13][5] + coeff0_14*dmats1[14][5] + coeff0_15*dmats1[15][5] + coeff0_16*dmats1[16][5] + coeff0_17*dmats1[17][5] + coeff0_18*dmats1[18][5] + coeff0_19*dmats1[19][5] + coeff0_20*dmats1[20][5]; new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6] + coeff0_10*dmats1[10][6] + coeff0_11*dmats1[11][6] + coeff0_12*dmats1[12][6] + coeff0_13*dmats1[13][6] + coeff0_14*dmats1[14][6] + coeff0_15*dmats1[15][6] + coeff0_16*dmats1[16][6] + coeff0_17*dmats1[17][6] + coeff0_18*dmats1[18][6] + coeff0_19*dmats1[19][6] + coeff0_20*dmats1[20][6]; new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7] + coeff0_10*dmats1[10][7] + coeff0_11*dmats1[11][7] + coeff0_12*dmats1[12][7] + coeff0_13*dmats1[13][7] + coeff0_14*dmats1[14][7] + coeff0_15*dmats1[15][7] + coeff0_16*dmats1[16][7] + coeff0_17*dmats1[17][7] + coeff0_18*dmats1[18][7] + coeff0_19*dmats1[19][7] + coeff0_20*dmats1[20][7]; new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8] + coeff0_10*dmats1[10][8] + coeff0_11*dmats1[11][8] + coeff0_12*dmats1[12][8] + coeff0_13*dmats1[13][8] + coeff0_14*dmats1[14][8] + coeff0_15*dmats1[15][8] + coeff0_16*dmats1[16][8] + coeff0_17*dmats1[17][8] + coeff0_18*dmats1[18][8] + coeff0_19*dmats1[19][8] + coeff0_20*dmats1[20][8]; new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9] + coeff0_10*dmats1[10][9] + coeff0_11*dmats1[11][9] + coeff0_12*dmats1[12][9] + coeff0_13*dmats1[13][9] + coeff0_14*dmats1[14][9] + coeff0_15*dmats1[15][9] + coeff0_16*dmats1[16][9] + coeff0_17*dmats1[17][9] + coeff0_18*dmats1[18][9] + coeff0_19*dmats1[19][9] + coeff0_20*dmats1[20][9]; new_coeff0_10 = coeff0_0*dmats1[0][10] + coeff0_1*dmats1[1][10] + coeff0_2*dmats1[2][10] + coeff0_3*dmats1[3][10] + coeff0_4*dmats1[4][10] + coeff0_5*dmats1[5][10] + coeff0_6*dmats1[6][10] + coeff0_7*dmats1[7][10] + coeff0_8*dmats1[8][10] + coeff0_9*dmats1[9][10] + coeff0_10*dmats1[10][10] + coeff0_11*dmats1[11][10] + coeff0_12*dmats1[12][10] + coeff0_13*dmats1[13][10] + coeff0_14*dmats1[14][10] + coeff0_15*dmats1[15][10] + coeff0_16*dmats1[16][10] + coeff0_17*dmats1[17][10] + coeff0_18*dmats1[18][10] + coeff0_19*dmats1[19][10] + coeff0_20*dmats1[20][10]; new_coeff0_11 = coeff0_0*dmats1[0][11] + coeff0_1*dmats1[1][11] + coeff0_2*dmats1[2][11] + coeff0_3*dmats1[3][11] + coeff0_4*dmats1[4][11] + coeff0_5*dmats1[5][11] + coeff0_6*dmats1[6][11] + coeff0_7*dmats1[7][11] + coeff0_8*dmats1[8][11] + coeff0_9*dmats1[9][11] + coeff0_10*dmats1[10][11] + coeff0_11*dmats1[11][11] + coeff0_12*dmats1[12][11] + coeff0_13*dmats1[13][11] + coeff0_14*dmats1[14][11] + coeff0_15*dmats1[15][11] + coeff0_16*dmats1[16][11] + coeff0_17*dmats1[17][11] + coeff0_18*dmats1[18][11] + coeff0_19*dmats1[19][11] + coeff0_20*dmats1[20][11]; new_coeff0_12 = coeff0_0*dmats1[0][12] + coeff0_1*dmats1[1][12] + coeff0_2*dmats1[2][12] + coeff0_3*dmats1[3][12] + coeff0_4*dmats1[4][12] + coeff0_5*dmats1[5][12] + coeff0_6*dmats1[6][12] + coeff0_7*dmats1[7][12] + coeff0_8*dmats1[8][12] + coeff0_9*dmats1[9][12] + coeff0_10*dmats1[10][12] + coeff0_11*dmats1[11][12] + coeff0_12*dmats1[12][12] + coeff0_13*dmats1[13][12] + coeff0_14*dmats1[14][12] + coeff0_15*dmats1[15][12] + coeff0_16*dmats1[16][12] + coeff0_17*dmats1[17][12] + coeff0_18*dmats1[18][12] + coeff0_19*dmats1[19][12] + coeff0_20*dmats1[20][12]; new_coeff0_13 = coeff0_0*dmats1[0][13] + coeff0_1*dmats1[1][13] + coeff0_2*dmats1[2][13] + coeff0_3*dmats1[3][13] + coeff0_4*dmats1[4][13] + coeff0_5*dmats1[5][13] + coeff0_6*dmats1[6][13] + coeff0_7*dmats1[7][13] + coeff0_8*dmats1[8][13] + coeff0_9*dmats1[9][13] + coeff0_10*dmats1[10][13] + coeff0_11*dmats1[11][13] + coeff0_12*dmats1[12][13] + coeff0_13*dmats1[13][13] + coeff0_14*dmats1[14][13] + coeff0_15*dmats1[15][13] + coeff0_16*dmats1[16][13] + coeff0_17*dmats1[17][13] + coeff0_18*dmats1[18][13] + coeff0_19*dmats1[19][13] + coeff0_20*dmats1[20][13]; new_coeff0_14 = coeff0_0*dmats1[0][14] + coeff0_1*dmats1[1][14] + coeff0_2*dmats1[2][14] + coeff0_3*dmats1[3][14] + coeff0_4*dmats1[4][14] + coeff0_5*dmats1[5][14] + coeff0_6*dmats1[6][14] + coeff0_7*dmats1[7][14] + coeff0_8*dmats1[8][14] + coeff0_9*dmats1[9][14] + coeff0_10*dmats1[10][14] + coeff0_11*dmats1[11][14] + coeff0_12*dmats1[12][14] + coeff0_13*dmats1[13][14] + coeff0_14*dmats1[14][14] + coeff0_15*dmats1[15][14] + coeff0_16*dmats1[16][14] + coeff0_17*dmats1[17][14] + coeff0_18*dmats1[18][14] + coeff0_19*dmats1[19][14] + coeff0_20*dmats1[20][14]; new_coeff0_15 = coeff0_0*dmats1[0][15] + coeff0_1*dmats1[1][15] + coeff0_2*dmats1[2][15] + coeff0_3*dmats1[3][15] + coeff0_4*dmats1[4][15] + coeff0_5*dmats1[5][15] + coeff0_6*dmats1[6][15] + coeff0_7*dmats1[7][15] + coeff0_8*dmats1[8][15] + coeff0_9*dmats1[9][15] + coeff0_10*dmats1[10][15] + coeff0_11*dmats1[11][15] + coeff0_12*dmats1[12][15] + coeff0_13*dmats1[13][15] + coeff0_14*dmats1[14][15] + coeff0_15*dmats1[15][15] + coeff0_16*dmats1[16][15] + coeff0_17*dmats1[17][15] + coeff0_18*dmats1[18][15] + coeff0_19*dmats1[19][15] + coeff0_20*dmats1[20][15]; new_coeff0_16 = coeff0_0*dmats1[0][16] + coeff0_1*dmats1[1][16] + coeff0_2*dmats1[2][16] + coeff0_3*dmats1[3][16] + coeff0_4*dmats1[4][16] + coeff0_5*dmats1[5][16] + coeff0_6*dmats1[6][16] + coeff0_7*dmats1[7][16] + coeff0_8*dmats1[8][16] + coeff0_9*dmats1[9][16] + coeff0_10*dmats1[10][16] + coeff0_11*dmats1[11][16] + coeff0_12*dmats1[12][16] + coeff0_13*dmats1[13][16] + coeff0_14*dmats1[14][16] + coeff0_15*dmats1[15][16] + coeff0_16*dmats1[16][16] + coeff0_17*dmats1[17][16] + coeff0_18*dmats1[18][16] + coeff0_19*dmats1[19][16] + coeff0_20*dmats1[20][16]; new_coeff0_17 = coeff0_0*dmats1[0][17] + coeff0_1*dmats1[1][17] + coeff0_2*dmats1[2][17] + coeff0_3*dmats1[3][17] + coeff0_4*dmats1[4][17] + coeff0_5*dmats1[5][17] + coeff0_6*dmats1[6][17] + coeff0_7*dmats1[7][17] + coeff0_8*dmats1[8][17] + coeff0_9*dmats1[9][17] + coeff0_10*dmats1[10][17] + coeff0_11*dmats1[11][17] + coeff0_12*dmats1[12][17] + coeff0_13*dmats1[13][17] + coeff0_14*dmats1[14][17] + coeff0_15*dmats1[15][17] + coeff0_16*dmats1[16][17] + coeff0_17*dmats1[17][17] + coeff0_18*dmats1[18][17] + coeff0_19*dmats1[19][17] + coeff0_20*dmats1[20][17]; new_coeff0_18 = coeff0_0*dmats1[0][18] + coeff0_1*dmats1[1][18] + coeff0_2*dmats1[2][18] + coeff0_3*dmats1[3][18] + coeff0_4*dmats1[4][18] + coeff0_5*dmats1[5][18] + coeff0_6*dmats1[6][18] + coeff0_7*dmats1[7][18] + coeff0_8*dmats1[8][18] + coeff0_9*dmats1[9][18] + coeff0_10*dmats1[10][18] + coeff0_11*dmats1[11][18] + coeff0_12*dmats1[12][18] + coeff0_13*dmats1[13][18] + coeff0_14*dmats1[14][18] + coeff0_15*dmats1[15][18] + coeff0_16*dmats1[16][18] + coeff0_17*dmats1[17][18] + coeff0_18*dmats1[18][18] + coeff0_19*dmats1[19][18] + coeff0_20*dmats1[20][18]; new_coeff0_19 = coeff0_0*dmats1[0][19] + coeff0_1*dmats1[1][19] + coeff0_2*dmats1[2][19] + coeff0_3*dmats1[3][19] + coeff0_4*dmats1[4][19] + coeff0_5*dmats1[5][19] + coeff0_6*dmats1[6][19] + coeff0_7*dmats1[7][19] + coeff0_8*dmats1[8][19] + coeff0_9*dmats1[9][19] + coeff0_10*dmats1[10][19] + coeff0_11*dmats1[11][19] + coeff0_12*dmats1[12][19] + coeff0_13*dmats1[13][19] + coeff0_14*dmats1[14][19] + coeff0_15*dmats1[15][19] + coeff0_16*dmats1[16][19] + coeff0_17*dmats1[17][19] + coeff0_18*dmats1[18][19] + coeff0_19*dmats1[19][19] + coeff0_20*dmats1[20][19]; new_coeff0_20 = coeff0_0*dmats1[0][20] + coeff0_1*dmats1[1][20] + coeff0_2*dmats1[2][20] + coeff0_3*dmats1[3][20] + coeff0_4*dmats1[4][20] + coeff0_5*dmats1[5][20] + coeff0_6*dmats1[6][20] + coeff0_7*dmats1[7][20] + coeff0_8*dmats1[8][20] + coeff0_9*dmats1[9][20] + coeff0_10*dmats1[10][20] + coeff0_11*dmats1[11][20] + coeff0_12*dmats1[12][20] + coeff0_13*dmats1[13][20] + coeff0_14*dmats1[14][20] + coeff0_15*dmats1[15][20] + coeff0_16*dmats1[16][20] + coeff0_17*dmats1[17][20] + coeff0_18*dmats1[18][20] + coeff0_19*dmats1[19][20] + coeff0_20*dmats1[20][20]; } } // Compute derivatives on reference element as dot product of coefficients and basisvalues derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9 + new_coeff0_10*basisvalue10 + new_coeff0_11*basisvalue11 + new_coeff0_12*basisvalue12 + new_coeff0_13*basisvalue13 + new_coeff0_14*basisvalue14 + new_coeff0_15*basisvalue15 + new_coeff0_16*basisvalue16 + new_coeff0_17*basisvalue17 + new_coeff0_18*basisvalue18 + new_coeff0_19*basisvalue19 + new_coeff0_20*basisvalue20; } // Transform derivatives back to physical element for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { values[row] += transform[row][col]*derivatives[col]; } } // Delete pointer to array of derivatives on FIAT element delete [] derivatives; // Delete pointer to array of combinations of derivatives and transform for (unsigned int row = 0; row < num_derivatives; row++) { delete [] combinations[row]; delete [] transform[row]; } delete [] combinations; delete [] transform; } /// Evaluate order n derivatives of all basis functions at given point in cell virtual void evaluate_basis_derivatives_all(unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented."); } /// Evaluate linear functional for dof i on the function f virtual double evaluate_dof(unsigned int i, const ufc::function& f, const ufc::cell& c) const { // The reference points, direction and weights: const static double X[21][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.8, 0.2}}, {{0.6, 0.4}}, {{0.4, 0.6}}, {{0.2, 0.8}}, {{0, 0.2}}, {{0, 0.4}}, {{0, 0.6}}, {{0, 0.8}}, {{0.2, 0}}, {{0.4, 0}}, {{0.6, 0}}, {{0.8, 0}}, {{0.2, 0.2}}, {{0.4, 0.2}}, {{0.6, 0.2}}, {{0.2, 0.4}}, {{0.4, 0.4}}, {{0.2, 0.6}}}; const static double W[21][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}; const static double D[21][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}}; const double * const * x = c.coordinates; double result = 0.0; // Iterate over the points: // Evaluate basis functions for affine mapping const double w0 = 1.0 - X[i][0][0] - X[i][0][1]; const double w1 = X[i][0][0]; const double w2 = X[i][0][1]; // Compute affine mapping y = F(X) double y[2]; y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0]; y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1]; // Evaluate function at physical points double values[1]; f.evaluate(values, y, c); // Map function values using appropriate mapping // Affine map: Do nothing // Note that we do not map the weights (yet). // Take directional components for(int k = 0; k < 1; k++) result += values[k]*D[i][0][k]; // Multiply by weights result *= W[i][0]; return result; } /// Evaluate linear functionals for all dofs on the function f virtual void evaluate_dofs(double* values, const ufc::function& f, const ufc::cell& c) const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Interpolate vertex values from dof values virtual void interpolate_vertex_values(double* vertex_values, const double* dof_values, const ufc::cell& c) const { // Evaluate at vertices and use affine mapping vertex_values[0] = dof_values[0]; vertex_values[1] = dof_values[1]; vertex_values[2] = dof_values[2]; } /// Return the number of sub elements (for a mixed element) virtual unsigned int num_sub_elements() const { return 1; } /// 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_Poisson2D_5BilinearForm_finite_element_1(); } }; /// This class defines the interface for a local-to-global mapping of /// degrees of freedom (dofs). class UFC_Poisson2D_5BilinearForm_dof_map_0: public ufc::dof_map { private: unsigned int __global_dimension; public: /// Constructor UFC_Poisson2D_5BilinearForm_dof_map_0() : ufc::dof_map() { __global_dimension = 0; } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm_dof_map_0() { // Do nothing } /// Return a string identifying the dof map virtual const char* signature() const { return "FFC dof map for Lagrange finite element of degree 5 on a triangle"; } /// Return true iff mesh entities of topological dimension d are needed virtual bool needs_mesh_entities(unsigned int d) const { switch ( d ) { case 0: return true; break; case 1: return true; break; case 2: return true; break; } return false; } /// Initialize dof map for mesh (return true iff init_cell() is needed) virtual bool init_mesh(const ufc::mesh& m) { __global_dimension = m.num_entities[0] + 4*m.num_entities[1] + 6*m.num_entities[2]; return false; } /// Initialize dof map for given cell virtual void init_cell(const ufc::mesh& m, const ufc::cell& c) { // Do nothing } /// Finish initialization of dof map for cells virtual void init_cell_finalize() { // Do nothing } /// Return the dimension of the global finite element function space virtual unsigned int global_dimension() const { return __global_dimension; } /// Return the dimension of the local finite element function space virtual unsigned int local_dimension() const { return 21; } // Return the geometric dimension of the coordinates this dof map provides virtual unsigned int geometric_dimension() const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Return the number of dofs on each cell facet virtual unsigned int num_facet_dofs() const { return 6; } /// 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]; unsigned int offset = m.num_entities[0]; dofs[3] = offset + 4*c.entity_indices[1][0]; dofs[4] = offset + 4*c.entity_indices[1][0] + 1; dofs[5] = offset + 4*c.entity_indices[1][0] + 2; dofs[6] = offset + 4*c.entity_indices[1][0] + 3; dofs[7] = offset + 4*c.entity_indices[1][1]; dofs[8] = offset + 4*c.entity_indices[1][1] + 1; dofs[9] = offset + 4*c.entity_indices[1][1] + 2; dofs[10] = offset + 4*c.entity_indices[1][1] + 3; dofs[11] = offset + 4*c.entity_indices[1][2]; dofs[12] = offset + 4*c.entity_indices[1][2] + 1; dofs[13] = offset + 4*c.entity_indices[1][2] + 2; dofs[14] = offset + 4*c.entity_indices[1][2] + 3; offset = offset + 4*m.num_entities[1]; dofs[15] = offset + 6*c.entity_indices[2][0]; dofs[16] = offset + 6*c.entity_indices[2][0] + 1; dofs[17] = offset + 6*c.entity_indices[2][0] + 2; dofs[18] = offset + 6*c.entity_indices[2][0] + 3; dofs[19] = offset + 6*c.entity_indices[2][0] + 4; dofs[20] = offset + 6*c.entity_indices[2][0] + 5; } /// Tabulate the local-to-local mapping from facet dofs to cell dofs virtual void tabulate_facet_dofs(unsigned int* dofs, unsigned int facet) const { switch ( facet ) { case 0: dofs[0] = 1; dofs[1] = 2; dofs[2] = 3; dofs[3] = 4; dofs[4] = 5; dofs[5] = 6; break; case 1: dofs[0] = 0; dofs[1] = 2; dofs[2] = 7; dofs[3] = 8; dofs[4] = 9; dofs[5] = 10; break; case 2: dofs[0] = 0; dofs[1] = 1; dofs[2] = 11; dofs[3] = 12; dofs[4] = 13; dofs[5] = 14; 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]; coordinates[3][0] = 0.8*x[1][0] + 0.2*x[2][0]; coordinates[3][1] = 0.8*x[1][1] + 0.2*x[2][1]; coordinates[4][0] = 0.6*x[1][0] + 0.4*x[2][0]; coordinates[4][1] = 0.6*x[1][1] + 0.4*x[2][1]; coordinates[5][0] = 0.4*x[1][0] + 0.6*x[2][0]; coordinates[5][1] = 0.4*x[1][1] + 0.6*x[2][1]; coordinates[6][0] = 0.2*x[1][0] + 0.8*x[2][0]; coordinates[6][1] = 0.2*x[1][1] + 0.8*x[2][1]; coordinates[7][0] = 0.8*x[0][0] + 0.2*x[2][0]; coordinates[7][1] = 0.8*x[0][1] + 0.2*x[2][1]; coordinates[8][0] = 0.6*x[0][0] + 0.4*x[2][0]; coordinates[8][1] = 0.6*x[0][1] + 0.4*x[2][1]; coordinates[9][0] = 0.4*x[0][0] + 0.6*x[2][0]; coordinates[9][1] = 0.4*x[0][1] + 0.6*x[2][1]; coordinates[10][0] = 0.2*x[0][0] + 0.8*x[2][0]; coordinates[10][1] = 0.2*x[0][1] + 0.8*x[2][1]; coordinates[11][0] = 0.8*x[0][0] + 0.2*x[1][0]; coordinates[11][1] = 0.8*x[0][1] + 0.2*x[1][1]; coordinates[12][0] = 0.6*x[0][0] + 0.4*x[1][0]; coordinates[12][1] = 0.6*x[0][1] + 0.4*x[1][1]; coordinates[13][0] = 0.4*x[0][0] + 0.6*x[1][0]; coordinates[13][1] = 0.4*x[0][1] + 0.6*x[1][1]; coordinates[14][0] = 0.2*x[0][0] + 0.8*x[1][0]; coordinates[14][1] = 0.2*x[0][1] + 0.8*x[1][1]; coordinates[15][0] = 0.6*x[0][0] + 0.2*x[1][0] + 0.2*x[2][0]; coordinates[15][1] = 0.6*x[0][1] + 0.2*x[1][1] + 0.2*x[2][1]; coordinates[16][0] = 0.4*x[0][0] + 0.4*x[1][0] + 0.2*x[2][0]; coordinates[16][1] = 0.4*x[0][1] + 0.4*x[1][1] + 0.2*x[2][1]; coordinates[17][0] = 0.2*x[0][0] + 0.6*x[1][0] + 0.2*x[2][0]; coordinates[17][1] = 0.2*x[0][1] + 0.6*x[1][1] + 0.2*x[2][1]; coordinates[18][0] = 0.4*x[0][0] + 0.2*x[1][0] + 0.4*x[2][0]; coordinates[18][1] = 0.4*x[0][1] + 0.2*x[1][1] + 0.4*x[2][1]; coordinates[19][0] = 0.2*x[0][0] + 0.4*x[1][0] + 0.4*x[2][0]; coordinates[19][1] = 0.2*x[0][1] + 0.4*x[1][1] + 0.4*x[2][1]; coordinates[20][0] = 0.2*x[0][0] + 0.2*x[1][0] + 0.6*x[2][0]; coordinates[20][1] = 0.2*x[0][1] + 0.2*x[1][1] + 0.6*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_Poisson2D_5BilinearForm_dof_map_0(); } }; /// This class defines the interface for a local-to-global mapping of /// degrees of freedom (dofs). class UFC_Poisson2D_5BilinearForm_dof_map_1: public ufc::dof_map { private: unsigned int __global_dimension; public: /// Constructor UFC_Poisson2D_5BilinearForm_dof_map_1() : ufc::dof_map() { __global_dimension = 0; } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm_dof_map_1() { // Do nothing } /// Return a string identifying the dof map virtual const char* signature() const { return "FFC dof map for Lagrange finite element of degree 5 on a triangle"; } /// Return true iff mesh entities of topological dimension d are needed virtual bool needs_mesh_entities(unsigned int d) const { switch ( d ) { case 0: return true; break; case 1: return true; break; case 2: return true; break; } return false; } /// Initialize dof map for mesh (return true iff init_cell() is needed) virtual bool init_mesh(const ufc::mesh& m) { __global_dimension = m.num_entities[0] + 4*m.num_entities[1] + 6*m.num_entities[2]; return false; } /// Initialize dof map for given cell virtual void init_cell(const ufc::mesh& m, const ufc::cell& c) { // Do nothing } /// Finish initialization of dof map for cells virtual void init_cell_finalize() { // Do nothing } /// Return the dimension of the global finite element function space virtual unsigned int global_dimension() const { return __global_dimension; } /// Return the dimension of the local finite element function space virtual unsigned int local_dimension() const { return 21; } // Return the geometric dimension of the coordinates this dof map provides virtual unsigned int geometric_dimension() const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Return the number of dofs on each cell facet virtual unsigned int num_facet_dofs() const { return 6; } /// 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]; unsigned int offset = m.num_entities[0]; dofs[3] = offset + 4*c.entity_indices[1][0]; dofs[4] = offset + 4*c.entity_indices[1][0] + 1; dofs[5] = offset + 4*c.entity_indices[1][0] + 2; dofs[6] = offset + 4*c.entity_indices[1][0] + 3; dofs[7] = offset + 4*c.entity_indices[1][1]; dofs[8] = offset + 4*c.entity_indices[1][1] + 1; dofs[9] = offset + 4*c.entity_indices[1][1] + 2; dofs[10] = offset + 4*c.entity_indices[1][1] + 3; dofs[11] = offset + 4*c.entity_indices[1][2]; dofs[12] = offset + 4*c.entity_indices[1][2] + 1; dofs[13] = offset + 4*c.entity_indices[1][2] + 2; dofs[14] = offset + 4*c.entity_indices[1][2] + 3; offset = offset + 4*m.num_entities[1]; dofs[15] = offset + 6*c.entity_indices[2][0]; dofs[16] = offset + 6*c.entity_indices[2][0] + 1; dofs[17] = offset + 6*c.entity_indices[2][0] + 2; dofs[18] = offset + 6*c.entity_indices[2][0] + 3; dofs[19] = offset + 6*c.entity_indices[2][0] + 4; dofs[20] = offset + 6*c.entity_indices[2][0] + 5; } /// Tabulate the local-to-local mapping from facet dofs to cell dofs virtual void tabulate_facet_dofs(unsigned int* dofs, unsigned int facet) const { switch ( facet ) { case 0: dofs[0] = 1; dofs[1] = 2; dofs[2] = 3; dofs[3] = 4; dofs[4] = 5; dofs[5] = 6; break; case 1: dofs[0] = 0; dofs[1] = 2; dofs[2] = 7; dofs[3] = 8; dofs[4] = 9; dofs[5] = 10; break; case 2: dofs[0] = 0; dofs[1] = 1; dofs[2] = 11; dofs[3] = 12; dofs[4] = 13; dofs[5] = 14; 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]; coordinates[3][0] = 0.8*x[1][0] + 0.2*x[2][0]; coordinates[3][1] = 0.8*x[1][1] + 0.2*x[2][1]; coordinates[4][0] = 0.6*x[1][0] + 0.4*x[2][0]; coordinates[4][1] = 0.6*x[1][1] + 0.4*x[2][1]; coordinates[5][0] = 0.4*x[1][0] + 0.6*x[2][0]; coordinates[5][1] = 0.4*x[1][1] + 0.6*x[2][1]; coordinates[6][0] = 0.2*x[1][0] + 0.8*x[2][0]; coordinates[6][1] = 0.2*x[1][1] + 0.8*x[2][1]; coordinates[7][0] = 0.8*x[0][0] + 0.2*x[2][0]; coordinates[7][1] = 0.8*x[0][1] + 0.2*x[2][1]; coordinates[8][0] = 0.6*x[0][0] + 0.4*x[2][0]; coordinates[8][1] = 0.6*x[0][1] + 0.4*x[2][1]; coordinates[9][0] = 0.4*x[0][0] + 0.6*x[2][0]; coordinates[9][1] = 0.4*x[0][1] + 0.6*x[2][1]; coordinates[10][0] = 0.2*x[0][0] + 0.8*x[2][0]; coordinates[10][1] = 0.2*x[0][1] + 0.8*x[2][1]; coordinates[11][0] = 0.8*x[0][0] + 0.2*x[1][0]; coordinates[11][1] = 0.8*x[0][1] + 0.2*x[1][1]; coordinates[12][0] = 0.6*x[0][0] + 0.4*x[1][0]; coordinates[12][1] = 0.6*x[0][1] + 0.4*x[1][1]; coordinates[13][0] = 0.4*x[0][0] + 0.6*x[1][0]; coordinates[13][1] = 0.4*x[0][1] + 0.6*x[1][1]; coordinates[14][0] = 0.2*x[0][0] + 0.8*x[1][0]; coordinates[14][1] = 0.2*x[0][1] + 0.8*x[1][1]; coordinates[15][0] = 0.6*x[0][0] + 0.2*x[1][0] + 0.2*x[2][0]; coordinates[15][1] = 0.6*x[0][1] + 0.2*x[1][1] + 0.2*x[2][1]; coordinates[16][0] = 0.4*x[0][0] + 0.4*x[1][0] + 0.2*x[2][0]; coordinates[16][1] = 0.4*x[0][1] + 0.4*x[1][1] + 0.2*x[2][1]; coordinates[17][0] = 0.2*x[0][0] + 0.6*x[1][0] + 0.2*x[2][0]; coordinates[17][1] = 0.2*x[0][1] + 0.6*x[1][1] + 0.2*x[2][1]; coordinates[18][0] = 0.4*x[0][0] + 0.2*x[1][0] + 0.4*x[2][0]; coordinates[18][1] = 0.4*x[0][1] + 0.2*x[1][1] + 0.4*x[2][1]; coordinates[19][0] = 0.2*x[0][0] + 0.4*x[1][0] + 0.4*x[2][0]; coordinates[19][1] = 0.2*x[0][1] + 0.4*x[1][1] + 0.4*x[2][1]; coordinates[20][0] = 0.2*x[0][0] + 0.2*x[1][0] + 0.6*x[2][0]; coordinates[20][1] = 0.2*x[0][1] + 0.2*x[1][1] + 0.6*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_Poisson2D_5BilinearForm_dof_map_1(); } }; /// This class defines the interface for the tabulation of the cell /// tensor corresponding to the local contribution to a form from /// the integral over a cell. class UFC_Poisson2D_5BilinearForm_cell_integral_0: public ufc::cell_integral { public: /// Constructor UFC_Poisson2D_5BilinearForm_cell_integral_0() : ufc::cell_integral() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm_cell_integral_0() { // Do nothing } /// Tabulate the tensor for the contribution from a local cell virtual void tabulate_tensor(double* A, const double * const * w, const ufc::cell& c) const { // Extract vertex coordinates const double * const * x = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = x[1][0] - x[0][0]; const double J_01 = x[2][0] - x[0][0]; const double J_10 = x[1][1] - x[0][1]; const double J_11 = x[2][1] - x[0][1]; // Compute determinant of Jacobian double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian const double Jinv_00 = J_11 / detJ; const double Jinv_01 = -J_01 / detJ; const double Jinv_10 = -J_10 / detJ; const double Jinv_11 = J_00 / detJ; // Set scale factor const double det = std::abs(detJ); // Compute geometry tensors const double G0_0_0 = det*(Jinv_00*Jinv_00 + Jinv_01*Jinv_01); const double G0_0_1 = det*(Jinv_00*Jinv_10 + Jinv_01*Jinv_11); const double G0_1_0 = det*(Jinv_10*Jinv_00 + Jinv_11*Jinv_01); const double G0_1_1 = det*(Jinv_10*Jinv_10 + Jinv_11*Jinv_11); // Compute element tensor A[0] = 0.342406580687829*G0_0_0 + 0.342406580687829*G0_0_1 + 0.342406580687829*G0_1_0 + 0.342406580687829*G0_1_1; A[1] = -0.040998401675485*G0_0_0 - 0.0409984016754851*G0_1_0; A[2] = -0.0409984016754842*G0_0_1 - 0.0409984016754843*G0_1_1; A[3] = -0.0408192791005292*G0_0_0 - 0.0408192791005293*G0_0_1 - 0.0408192791005291*G0_1_0 - 0.0408192791005293*G0_1_1; A[4] = -0.0379774305555552*G0_0_0 - 0.0379774305555554*G0_0_1 - 0.0379774305555554*G0_1_0 - 0.0379774305555555*G0_1_1; A[5] = -0.0379774305555561*G0_0_0 - 0.0379774305555562*G0_0_1 - 0.0379774305555557*G0_1_0 - 0.037977430555556*G0_1_1; A[6] = -0.0408192791005274*G0_0_0 - 0.0408192791005281*G0_0_1 - 0.0408192791005276*G0_1_0 - 0.0408192791005281*G0_1_1; A[7] = 0.202287946428572*G0_0_0 - 0.64802758487654*G0_0_1 + 0.202287946428572*G0_1_0 - 0.64802758487654*G0_1_1; A[8] = -0.0158454585537941*G0_0_0 + 0.594204695767191*G0_0_1 - 0.015845458553794*G0_1_0 + 0.594204695767191*G0_1_1; A[9] = -0.0696683476631375*G0_0_0 - 0.44995935295414*G0_0_1 - 0.0696683476631378*G0_1_0 - 0.449959352954141*G0_1_1; A[10] = 0.0408192791005273*G0_0_0 + 0.202374063051144*G0_0_1 + 0.0408192791005275*G0_1_0 + 0.202374063051144*G0_1_1; A[11] = -0.648027584876541*G0_0_0 + 0.202287946428571*G0_0_1 - 0.648027584876541*G0_1_0 + 0.202287946428571*G0_1_1; A[12] = 0.594204695767194*G0_0_0 - 0.0158454585537921*G0_0_1 + 0.594204695767194*G0_1_0 - 0.0158454585537919*G0_1_1; A[13] = -0.449959352954144*G0_0_0 - 0.069668347663139*G0_0_1 - 0.449959352954144*G0_1_0 - 0.0696683476631394*G0_1_1; A[14] = 0.202374063051146*G0_0_0 + 0.0408192791005296*G0_0_1 + 0.202374063051146*G0_1_0 + 0.0408192791005296*G0_1_1; A[15] = -0.215291556437391*G0_0_0 - 0.215291556437391*G0_0_1 - 0.215291556437391*G0_1_0 - 0.215291556437391*G0_1_1; A[16] = -0.0538228891093459*G0_0_0 - 0.0538228891093465*G0_0_1 - 0.053822889109346*G0_1_0 - 0.0538228891093462*G0_1_1; A[17] = 0.107645778218694*G0_0_0 + 0.107645778218694*G0_0_1 + 0.107645778218694*G0_1_0 + 0.107645778218694*G0_1_1; A[18] = -0.0538228891093451*G0_0_0 - 0.0538228891093449*G0_0_1 - 0.053822889109345*G0_1_0 - 0.053822889109345*G0_1_1; A[19] = 0.107645778218694*G0_0_0 + 0.107645778218695*G0_0_1 + 0.107645778218694*G0_1_0 + 0.107645778218694*G0_1_1; A[20] = 0.107645778218694*G0_0_0 + 0.107645778218693*G0_0_1 + 0.107645778218694*G0_1_0 + 0.107645778218693*G0_1_1; A[21] = -0.040998401675485*G0_0_0 - 0.0409984016754851*G0_0_1; A[22] = 0.342406580687829*G0_0_0; A[23] = 0.0409984016754848*G0_0_1; A[24] = 0.202287946428571*G0_0_0 + 0.850315531305111*G0_0_1; A[25] = -0.0158454585537924*G0_0_0 - 0.610050154320986*G0_0_1; A[26] = -0.0696683476631383*G0_0_0 + 0.380291005291004*G0_0_1; A[27] = 0.0408192791005284*G0_0_0 - 0.161554783950617*G0_0_1; A[28] = -0.040819279100529*G0_0_0; A[29] = -0.0379774305555552*G0_0_0; A[30] = -0.037977430555555*G0_0_0; A[31] = -0.0408192791005284*G0_0_0; A[32] = 0.202374063051146*G0_0_0 + 0.161554783950616*G0_0_1; A[33] = -0.449959352954144*G0_0_0 - 0.380291005291004*G0_0_1; A[34] = 0.594204695767194*G0_0_0 + 0.610050154320986*G0_0_1; A[35] = -0.648027584876541*G0_0_0 - 0.850315531305111*G0_0_1; A[36] = 0.107645778218694*G0_0_0; A[37] = -0.0538228891093457*G0_0_0; A[38] = -0.215291556437389*G0_0_0; A[39] = 0.107645778218694*G0_0_0; A[40] = -0.0538228891093463*G0_0_0; A[41] = 0.107645778218693*G0_0_0; A[42] = -0.0409984016754842*G0_1_0 - 0.0409984016754843*G0_1_1; A[43] = 0.0409984016754848*G0_1_0; A[44] = 0.342406580687829*G0_1_1; A[45] = -0.161554783950616*G0_1_0 + 0.0408192791005294*G0_1_1; A[46] = 0.380291005291003*G0_1_0 - 0.0696683476631393*G0_1_1; A[47] = -0.610050154320985*G0_1_0 - 0.0158454585537914*G0_1_1; A[48] = 0.850315531305112*G0_1_0 + 0.202287946428571*G0_1_1; A[49] = 0.161554783950617*G0_1_0 + 0.202374063051144*G0_1_1; A[50] = -0.380291005291004*G0_1_0 - 0.449959352954142*G0_1_1; A[51] = 0.610050154320986*G0_1_0 + 0.594204695767193*G0_1_1; A[52] = -0.850315531305111*G0_1_0 - 0.648027584876541*G0_1_1; A[53] = -0.0408192791005282*G0_1_1; A[54] = -0.0379774305555554*G0_1_1; A[55] = -0.037977430555555*G0_1_1; A[56] = -0.040819279100529*G0_1_1; A[57] = 0.107645778218694*G0_1_1; A[58] = 0.107645778218694*G0_1_1; A[59] = 0.107645778218694*G0_1_1; A[60] = -0.0538228891093483*G0_1_1; A[61] = -0.0538228891093466*G0_1_1; A[62] = -0.215291556437387*G0_1_1; A[63] = -0.0408192791005292*G0_0_0 - 0.0408192791005291*G0_0_1 - 0.0408192791005293*G0_1_0 - 0.0408192791005293*G0_1_1; A[64] = 0.202287946428571*G0_0_0 + 0.850315531305111*G0_1_0; A[65] = -0.161554783950616*G0_0_1 + 0.0408192791005293*G0_1_1; A[66] = 1.98929398148147*G0_0_0 + 1.28098476080246*G0_0_1 + 1.28098476080246*G0_1_0 + 2.56196952160493*G0_1_1; A[67] = -0.906377452601408*G0_0_0 + 0.796578758818337*G0_0_1 - 0.529617228835979*G0_1_0 - 1.39508928571428*G0_1_1; A[68] = 0.818107914462077*G0_0_0 - 0.482253086419752*G0_0_1 + 0.232514880952381*G0_1_0 + 0.895612874779539*G0_1_1; A[69] = -0.340160659171073*G0_0_0 + 0.329396081349206*G0_0_1 - 0.0710462136243382*G0_1_0 - 0.340160659171075*G0_1_1; A[70] = 0.142092427248678*G0_0_0 + 0.0710462136243385*G0_0_1 + 0.0710462136243394*G0_1_0; A[71] = 0.131327849426808*G0_0_0 + 0.0301408179012352*G0_0_1 + 0.0301408179012347*G0_1_0; A[72] = 0.172233245149912*G0_0_0 + 0.0301408179012344*G0_0_1 + 0.0301408179012371*G0_1_0; A[73] = 0.340160659171073*G0_0_0 + 0.0710462136243376*G0_0_1 + 0.0710462136243381*G0_1_0; A[74] = 0.1980682319224*G0_0_0 + 0.269114445546737*G0_0_1 + 0.269114445546737*G0_1_0 + 0.340160659171073*G0_1_1; A[75] = -0.359536899250443*G0_0_0 - 0.663097993827159*G0_0_1 - 0.663097993827161*G0_1_0 - 0.895612874779539*G0_1_1; A[76] = 0.28633777006173*G0_0_0 + 0.865472056878305*G0_0_1 + 0.865472056878307*G0_1_0 + 1.39508928571428*G0_1_1; A[77] = -0.286337770061729*G0_0_0 - 1.28098476080246*G0_0_1 - 1.28098476080247*G0_1_0 - 2.56196952160493*G0_1_1; A[78] = -0.667403824955907*G0_0_0 - 0.262655698853616*G0_0_1 - 0.262655698853617*G0_1_0; A[79] = 1.35633680555556*G0_0_0 + 0.572675540123458*G0_0_1 + 0.57267554012346*G0_1_0; A[80] = -2.8203193893298*G0_0_0 - 1.66205081569664*G0_0_1 - 1.66205081569664*G0_1_0; A[81] = -0.419818535052912*G0_0_0 - 0.073199129188712*G0_0_1 - 0.0731991291887153*G0_1_0; A[82] = 1.19486813822751*G0_0_0 + 0.572675540123455*G0_0_1 + 0.572675540123459*G0_1_0; A[83] = -0.990341159611989*G0_0_0 - 0.262655698853616*G0_0_1 - 0.262655698853618*G0_1_0; A[84] = -0.0379774305555552*G0_0_0 - 0.0379774305555554*G0_0_1 - 0.0379774305555554*G0_1_0 - 0.0379774305555555*G0_1_1; A[85] = -0.0158454585537924*G0_0_0 - 0.610050154320986*G0_1_0; A[86] = 0.380291005291003*G0_0_1 - 0.0696683476631394*G0_1_1; A[87] = -0.906377452601408*G0_0_0 - 0.529617228835979*G0_0_1 + 0.796578758818338*G0_1_0 - 1.39508928571428*G0_1_1; A[88] = 3.07436342592592*G0_0_0 + 1.17549189814815*G0_0_1 + 1.17549189814815*G0_1_0 + 3.6944031084656*G0_1_1; A[89] = -1.80414324294532*G0_0_0 + 0.699697558421511*G0_0_1 - 0.350925236992947*G0_1_0 - 1.80414324294532*G0_1_1; A[90] = 0.895612874779538*G0_0_0 - 0.482253086419752*G0_0_1 + 0.232514880952381*G0_1_0 + 0.818107914462078*G0_1_1; A[91] = 0.131327849426806*G0_0_0 + 0.101187031525573*G0_0_1 + 0.101187031525572*G0_1_0 + 0.0710462136243391*G0_1_1; A[92] = -0.297102347883596*G0_0_0 - 0.148551173941799*G0_0_1 - 0.148551173941797*G0_1_0 - 0.0172233245149925*G0_1_1; A[93] = -0.219597387566139*G0_0_0 - 0.0624345513668429*G0_0_1 - 0.0624345513668451*G0_1_0 - 0.0172233245149906*G0_1_1; A[94] = -0.895612874779537*G0_0_0 - 0.232514880952379*G0_0_1 - 0.232514880952381*G0_1_0 + 0.0710462136243376*G0_1_1; A[95] = 0.11195160934744*G0_0_0 + 0.142092427248675*G0_0_1 + 0.142092427248676*G0_1_0 + 0.172233245149912*G0_1_1; A[96] = -0.111951609347439*G0_0_0 - 0.157162836199293*G0_0_1 - 0.157162836199292*G0_1_0 - 0.219597387566137*G0_1_1; A[97] = 0.103339947089946*G0_0_0 + 0.13348076499118*G0_0_1 + 0.13348076499118*G0_1_0 + 0.266961529982361*G0_1_1; A[98] = -0.0495170579805987*G0_0_0 + 0.529617228835979*G0_0_1 + 0.529617228835978*G0_1_0 + 1.39508928571428*G0_1_1; A[99] = -0.34446649029982*G0_0_0 - 0.447806437389765*G0_0_1 - 0.447806437389768*G0_1_0 - 0.516699735449733*G0_1_1; A[100] = 0.387524801587292*G0_0_0 + 0.859013310185178*G0_0_1 + 0.859013310185179*G0_1_0 + 1.01187031525573*G0_1_1; A[101] = 0.73199129188713*G0_0_0 - 1.30897266313933*G0_0_1 - 1.30897266313932*G0_1_0 - 3.96136463844796*G0_1_1; A[102] = 1.03339947089947*G0_0_0 + 0.374607308201053*G0_0_1 + 0.374607308201057*G0_1_0 + 0.0430583112874751*G0_1_1; A[103] = -3.81066054894179*G0_0_0 - 1.4015480324074*G0_0_1 - 1.40154803240741*G0_1_0 + 1.01187031525573*G0_1_1; A[104] = 2.02374063051146*G0_0_0 + 0.413359788359789*G0_0_1 + 0.413359788359792*G0_1_0 - 0.516699735449732*G0_1_1; A[105] = -0.0379774305555561*G0_0_0 - 0.0379774305555557*G0_0_1 - 0.0379774305555562*G0_1_0 - 0.037977430555556*G0_1_1; A[106] = -0.0696683476631383*G0_0_0 + 0.380291005291004*G0_1_0; A[107] = -0.610050154320985*G0_0_1 - 0.0158454585537914*G0_1_1; A[108] = 0.818107914462077*G0_0_0 + 0.232514880952381*G0_0_1 - 0.482253086419751*G0_1_0 + 0.895612874779539*G0_1_1; A[109] = -1.80414324294532*G0_0_0 - 0.350925236992947*G0_0_1 + 0.699697558421511*G0_1_0 - 1.80414324294532*G0_1_1; A[110] = 3.69440310846559*G0_0_0 + 1.17549189814814*G0_0_1 + 1.17549189814814*G0_1_0 + 3.07436342592591*G0_1_1; A[111] = -1.39508928571428*G0_0_0 + 0.796578758818339*G0_0_1 - 0.529617228835977*G0_1_0 - 0.906377452601407*G0_1_1; A[112] = 0.172233245149912*G0_0_0 + 0.142092427248677*G0_0_1 + 0.142092427248676*G0_1_0 + 0.111951609347443*G0_1_1; A[113] = -0.219597387566133*G0_0_0 - 0.157162836199294*G0_0_1 - 0.157162836199291*G0_1_0 - 0.111951609347442*G0_1_1; A[114] = 0.266961529982359*G0_0_0 + 0.133480764991181*G0_0_1 + 0.13348076499118*G0_1_0 + 0.103339947089946*G0_1_1; A[115] = 1.39508928571428*G0_0_0 + 0.529617228835977*G0_0_1 + 0.529617228835977*G0_1_0 - 0.0495170579805984*G0_1_1; A[116] = 0.0710462136243404*G0_0_0 + 0.101187031525572*G0_0_1 + 0.101187031525574*G0_1_0 + 0.131327849426804*G0_1_1; A[117] = -0.017223324514993*G0_0_0 - 0.148551173941799*G0_0_1 - 0.148551173941799*G0_1_0 - 0.297102347883596*G0_1_1; A[118] = -0.0172233245149908*G0_0_0 - 0.0624345513668443*G0_0_1 - 0.0624345513668411*G0_1_0 - 0.219597387566137*G0_1_1; A[119] = 0.0710462136243378*G0_0_0 - 0.232514880952381*G0_0_1 - 0.232514880952381*G0_1_0 - 0.895612874779539*G0_1_1; A[120] = -0.516699735449734*G0_0_0 - 0.447806437389764*G0_0_1 - 0.447806437389767*G0_1_0 - 0.344466490299815*G0_1_1; A[121] = 0.04305831128748*G0_0_0 + 0.374607308201059*G0_0_1 + 0.374607308201055*G0_1_0 + 1.03339947089946*G0_1_1; A[122] = -0.516699735449735*G0_0_0 + 0.413359788359793*G0_0_1 + 0.413359788359787*G0_1_0 + 2.02374063051146*G0_1_1; A[123] = 1.01187031525572*G0_0_0 + 0.859013310185173*G0_0_1 + 0.859013310185175*G0_1_0 + 0.387524801587293*G0_1_1; A[124] = 1.01187031525573*G0_0_0 - 1.40154803240741*G0_0_1 - 1.40154803240739*G0_1_0 - 3.81066054894178*G0_1_1; A[125] = -3.96136463844795*G0_0_0 - 1.30897266313932*G0_0_1 - 1.30897266313932*G0_1_0 + 0.731991291887125*G0_1_1; A[126] = -0.0408192791005273*G0_0_0 - 0.0408192791005276*G0_0_1 - 0.0408192791005281*G0_1_0 - 0.0408192791005281*G0_1_1; A[127] = 0.0408192791005284*G0_0_0 - 0.161554783950617*G0_1_0; A[128] = 0.850315531305112*G0_0_1 + 0.202287946428571*G0_1_1; A[129] = -0.340160659171073*G0_0_0 - 0.0710462136243382*G0_0_1 + 0.329396081349206*G0_1_0 - 0.340160659171075*G0_1_1; A[130] = 0.895612874779538*G0_0_0 + 0.232514880952381*G0_0_1 - 0.482253086419751*G0_1_0 + 0.818107914462078*G0_1_1; A[131] = -1.39508928571428*G0_0_0 - 0.529617228835977*G0_0_1 + 0.796578758818339*G0_1_0 - 0.906377452601407*G0_1_1; A[132] = 2.56196952160493*G0_0_0 + 1.28098476080246*G0_0_1 + 1.28098476080246*G0_1_0 + 1.98929398148147*G0_1_1; A[133] = 0.340160659171075*G0_0_0 + 0.269114445546734*G0_0_1 + 0.269114445546737*G0_1_0 + 0.198068231922397*G0_1_1; A[134] = -0.89561287477954*G0_0_0 - 0.663097993827157*G0_0_1 - 0.663097993827158*G0_1_0 - 0.35953689925044*G0_1_1; A[135] = 1.39508928571428*G0_0_0 + 0.865472056878304*G0_0_1 + 0.865472056878303*G0_1_0 + 0.286337770061729*G0_1_1; A[136] = -2.56196952160493*G0_0_0 - 1.28098476080247*G0_0_1 - 1.28098476080246*G0_1_0 - 0.28633777006173*G0_1_1; A[137] = 0.071046213624341*G0_0_1 + 0.071046213624337*G0_1_0 + 0.142092427248679*G0_1_1; A[138] = 0.0301408179012341*G0_0_1 + 0.0301408179012353*G0_1_0 + 0.131327849426806*G0_1_1; A[139] = 0.0301408179012353*G0_0_1 + 0.0301408179012333*G0_1_0 + 0.17223324514991*G0_1_1; A[140] = 0.0710462136243391*G0_0_1 + 0.0710462136243396*G0_1_0 + 0.340160659171075*G0_1_1; A[141] = -0.262655698853619*G0_0_1 - 0.262655698853615*G0_1_0 - 0.667403824955907*G0_1_1; A[142] = -0.073199129188714*G0_0_1 - 0.0731991291887129*G0_1_0 - 0.419818535052907*G0_1_1; A[143] = -0.262655698853618*G0_0_1 - 0.262655698853614*G0_1_0 - 0.99034115961199*G0_1_1; A[144] = 0.572675540123454*G0_0_1 + 0.572675540123452*G0_1_0 + 1.35633680555555*G0_1_1; A[145] = 0.572675540123458*G0_0_1 + 0.572675540123457*G0_1_0 + 1.19486813822751*G0_1_1; A[146] = -1.66205081569664*G0_0_1 - 1.66205081569664*G0_1_0 - 2.82031938932979*G0_1_1; A[147] = 0.202287946428572*G0_0_0 + 0.202287946428572*G0_0_1 - 0.64802758487654*G0_1_0 - 0.64802758487654*G0_1_1; A[148] = -0.040819279100529*G0_0_0; A[149] = 0.161554783950617*G0_0_1 + 0.202374063051144*G0_1_1; A[150] = 0.142092427248678*G0_0_0 + 0.0710462136243394*G0_0_1 + 0.0710462136243385*G0_1_0; A[151] = 0.131327849426806*G0_0_0 + 0.101187031525572*G0_0_1 + 0.101187031525573*G0_1_0 + 0.0710462136243391*G0_1_1; A[152] = 0.172233245149912*G0_0_0 + 0.142092427248676*G0_0_1 + 0.142092427248677*G0_1_0 + 0.111951609347443*G0_1_1; A[153] = 0.340160659171075*G0_0_0 + 0.269114445546737*G0_0_1 + 0.269114445546734*G0_1_0 + 0.198068231922397*G0_1_1; A[154] = 1.98929398148147*G0_0_0 + 0.708309220679007*G0_0_1 + 0.708309220679007*G0_1_0 + 1.98929398148147*G0_1_1; A[155] = -0.906377452601408*G0_0_0 - 1.70295621141975*G0_0_1 - 0.376760223765425*G0_1_0 - 2.56842826829804*G0_1_1; A[156] = 0.818107914462077*G0_0_0 + 1.30036100088183*G0_0_1 + 0.585593033509694*G0_1_0 + 1.96345899470898*G0_1_1; A[157] = -0.340160659171075*G0_0_0 - 0.669556740520279*G0_0_1 - 0.269114445546733*G0_1_0 - 0.938671186067012*G0_1_1; A[158] = -0.28633777006173*G0_0_0 + 0.994646990740737*G0_0_1 + 0.994646990740736*G0_1_0 - 0.286337770061727*G0_1_1; A[159] = 0.28633777006173*G0_0_0 - 0.579134286816578*G0_0_1 - 0.579134286816577*G0_1_0 - 0.0495170579805992*G0_1_1; A[160] = -0.359536899250441*G0_0_0 + 0.303561094576719*G0_0_1 + 0.303561094576719*G0_1_0 + 0.0710462136243387*G0_1_1; A[161] = 0.198068231922398*G0_0_0 - 0.0710462136243388*G0_0_1 - 0.0710462136243386*G0_1_0; A[162] = -2.8203193893298*G0_0_0 - 1.15826857363315*G0_0_1 - 1.15826857363315*G0_1_0 + 0.503782242063494*G0_1_1; A[163] = 1.35633680555555*G0_0_0 + 0.783661265432098*G0_0_1 + 0.783661265432093*G0_1_0 + 0.210985725308639*G0_1_1; A[164] = -0.667403824955908*G0_0_0 - 0.404748126102292*G0_0_1 - 0.40474812610229*G0_1_0 - 0.142092427248676*G0_1_1; A[165] = 1.19486813822751*G0_0_0 + 0.622192598104051*G0_0_1 + 0.622192598104047*G0_1_0 + 0.049517057980593*G0_1_1; A[166] = -0.419818535052905*G0_0_0 - 0.346619405864197*G0_0_1 - 0.346619405864195*G0_1_0 - 0.273420276675483*G0_1_1; A[167] = -0.990341159611989*G0_0_0 - 0.727685460758372*G0_0_1 - 0.727685460758371*G0_1_0 - 0.465029761904757*G0_1_1; A[168] = -0.0158454585537941*G0_0_0 - 0.015845458553794*G0_0_1 + 0.594204695767191*G0_1_0 + 0.594204695767191*G0_1_1; A[169] = -0.0379774305555552*G0_0_0; A[170] = -0.380291005291004*G0_0_1 - 0.449959352954142*G0_1_1; A[171] = 0.131327849426808*G0_0_0 + 0.0301408179012347*G0_0_1 + 0.0301408179012352*G0_1_0; A[172] = -0.297102347883596*G0_0_0 - 0.148551173941797*G0_0_1 - 0.148551173941799*G0_1_0 - 0.0172233245149925*G0_1_1; A[173] = -0.219597387566133*G0_0_0 - 0.157162836199291*G0_0_1 - 0.157162836199294*G0_1_0 - 0.111951609347442*G0_1_1; A[174] = -0.89561287477954*G0_0_0 - 0.663097993827158*G0_0_1 - 0.663097993827157*G0_1_0 - 0.35953689925044*G0_1_1; A[175] = -0.906377452601408*G0_0_0 - 0.376760223765425*G0_0_1 - 1.70295621141975*G0_1_0 - 2.56842826829804*G0_1_1; A[176] = 3.07436342592591*G0_0_0 + 1.89887152777777*G0_0_1 + 1.89887152777777*G0_1_0 + 4.41778273809521*G0_1_1; A[177] = -1.80414324294532*G0_0_0 - 2.50384080136683*G0_0_1 - 1.45321800595237*G0_1_0 - 3.9570588073192*G0_1_1; A[178] = 0.895612874779539*G0_0_0 + 1.37786596119929*G0_0_1 + 0.663097993827156*G0_1_0 + 1.96345899470898*G0_1_1; A[179] = -0.0495170579805958*G0_0_0 - 0.579134286816579*G0_0_1 - 0.579134286816574*G0_1_0 + 0.286337770061726*G0_1_1; A[180] = 0.103339947089945*G0_0_0 - 0.0301408179012347*G0_0_1 - 0.0301408179012344*G0_1_0 + 0.103339947089947*G0_1_1; A[181] = -0.111951609347441*G0_0_0 + 0.0452112268518524*G0_0_1 + 0.0452112268518513*G0_1_0 - 0.017223324514991*G0_1_1; A[182] = 0.111951609347441*G0_0_0 - 0.0301408179012347*G0_0_1 - 0.030140817901235*G0_1_0; A[183] = 0.731991291887122*G0_0_0 + 2.04096395502645*G0_0_1 + 2.04096395502645*G0_1_0 - 0.611428020282186*G0_1_1; A[184] = 0.387524801587302*G0_0_0 - 0.471488508597879*G0_0_1 - 0.47148850859788*G0_1_0 - 0.318631503527334*G0_1_1; A[185] = -0.344466490299825*G0_0_0 + 0.103339947089944*G0_0_1 + 0.103339947089945*G0_1_0 + 0.0344466490299815*G0_1_1; A[186] = -3.81066054894178*G0_0_0 - 2.40911251653438*G0_0_1 - 2.40911251653438*G0_1_0 + 0.00430583112875357*G0_1_1; A[187] = 1.03339947089946*G0_0_0 + 0.658792162698405*G0_0_1 + 0.658792162698409*G0_1_0 + 0.327243165784831*G0_1_1; A[188] = 2.02374063051145*G0_0_0 + 1.61038084215167*G0_0_1 + 1.61038084215167*G0_1_0 + 0.680321318342146*G0_1_1; A[189] = -0.0696683476631375*G0_0_0 - 0.0696683476631378*G0_0_1 - 0.449959352954141*G0_1_0 - 0.449959352954141*G0_1_1; A[190] = -0.037977430555555*G0_0_0; A[191] = 0.610050154320986*G0_0_1 + 0.594204695767193*G0_1_1; A[192] = 0.172233245149912*G0_0_0 + 0.0301408179012371*G0_0_1 + 0.0301408179012343*G0_1_0; A[193] = -0.219597387566139*G0_0_0 - 0.0624345513668451*G0_0_1 - 0.0624345513668429*G0_1_0 - 0.0172233245149905*G0_1_1; A[194] = 0.26696152998236*G0_0_0 + 0.13348076499118*G0_0_1 + 0.133480764991181*G0_1_0 + 0.103339947089946*G0_1_1; A[195] = 1.39508928571428*G0_0_0 + 0.865472056878303*G0_0_1 + 0.865472056878304*G0_1_0 + 0.286337770061729*G0_1_1; A[196] = 0.818107914462077*G0_0_0 + 0.585593033509694*G0_0_1 + 1.30036100088183*G0_1_0 + 1.96345899470898*G0_1_1; A[197] = -1.80414324294532*G0_0_0 - 1.45321800595237*G0_0_1 - 2.50384080136683*G0_1_0 - 3.9570588073192*G0_1_1; A[198] = 3.69440310846559*G0_0_0 + 2.51891121031745*G0_0_1 + 2.51891121031745*G0_1_0 + 4.41778273809521*G0_1_1; A[199] = -1.39508928571428*G0_0_0 - 2.19166804453262*G0_0_1 - 0.865472056878303*G0_1_0 - 2.56842826829805*G0_1_1; A[200] = 0.0710462136243366*G0_0_0 + 0.303561094576721*G0_0_1 + 0.303561094576717*G0_1_0 - 0.359536899250436*G0_1_1; A[201] = -0.0172233245149921*G0_0_0 + 0.0452112268518514*G0_0_1 + 0.0452112268518503*G0_1_0 - 0.111951609347442*G0_1_1; A[202] = -0.0172233245149904*G0_0_0 + 0.131327849426808*G0_0_1 + 0.131327849426808*G0_1_0 - 0.0172233245149902*G0_1_1; A[203] = 0.0710462136243381*G0_0_0 - 0.030140817901236*G0_0_1 - 0.0301408179012344*G0_1_0; A[204] = -0.516699735449729*G0_0_0 - 0.930059523809523*G0_0_1 - 0.930059523809518*G0_1_0 + 0.680321318342145*G0_1_1; A[205] = 0.0430583112874762*G0_0_0 - 0.33154899691358*G0_0_1 - 0.33154899691358*G0_1_0 + 0.32724316578483*G0_1_1; A[206] = -0.516699735449735*G0_0_0 - 0.0688932980599639*G0_0_1 - 0.0688932980599646*G0_1_0 + 0.0344466490299822*G0_1_1; A[207] = 1.01187031525572*G0_0_0 + 2.41341834766312*G0_0_1 + 2.41341834766312*G0_1_0 + 0.00430583112874361*G0_1_1; A[208] = 1.01187031525574*G0_0_0 + 0.152857005070549*G0_0_1 + 0.152857005070549*G0_1_0 - 0.318631503527335*G0_1_1; A[209] = -3.96136463844795*G0_0_0 - 2.65239197530862*G0_0_1 - 2.65239197530863*G0_1_0 - 0.611428020282183*G0_1_1; A[210] = 0.0408192791005273*G0_0_0 + 0.0408192791005275*G0_0_1 + 0.202374063051144*G0_1_0 + 0.202374063051144*G0_1_1; A[211] = -0.0408192791005284*G0_0_0; A[212] = -0.850315531305111*G0_0_1 - 0.648027584876541*G0_1_1; A[213] = 0.340160659171073*G0_0_0 + 0.0710462136243381*G0_0_1 + 0.0710462136243376*G0_1_0; A[214] = -0.895612874779537*G0_0_0 - 0.232514880952381*G0_0_1 - 0.23251488095238*G0_1_0 + 0.0710462136243376*G0_1_1; A[215] = 1.39508928571428*G0_0_0 + 0.529617228835977*G0_0_1 + 0.529617228835977*G0_1_0 - 0.0495170579805984*G0_1_1; A[216] = -2.56196952160493*G0_0_0 - 1.28098476080246*G0_0_1 - 1.28098476080247*G0_1_0 - 0.286337770061729*G0_1_1; A[217] = -0.340160659171075*G0_0_0 - 0.269114445546733*G0_0_1 - 0.669556740520279*G0_1_0 - 0.938671186067011*G0_1_1; A[218] = 0.895612874779539*G0_0_0 + 0.663097993827156*G0_0_1 + 1.37786596119929*G0_1_0 + 1.96345899470898*G0_1_1; A[219] = -1.39508928571428*G0_0_0 - 0.865472056878303*G0_0_1 - 2.19166804453262*G0_1_0 - 2.56842826829805*G0_1_1; A[220] = 2.56196952160493*G0_0_0 + 1.28098476080247*G0_0_1 + 1.28098476080247*G0_1_0 + 1.98929398148147*G0_1_1; A[221] = -0.0710462136243408*G0_0_1 - 0.0710462136243367*G0_1_0 + 0.198068231922395*G0_1_1; A[222] = -0.030140817901234*G0_0_1 - 0.0301408179012337*G0_1_0 + 0.111951609347442*G0_1_1; A[223] = -0.0301408179012354*G0_0_1 - 0.0301408179012353*G0_1_0 + 0.0710462136243371*G0_1_1; A[224] = -0.0710462136243389*G0_0_1 - 0.0710462136243385*G0_1_0; A[225] = 0.262655698853619*G0_0_1 + 0.262655698853612*G0_1_0 - 0.465029761904756*G0_1_1; A[226] = 0.0731991291887139*G0_0_1 + 0.073199129188713*G0_1_0 - 0.273420276675483*G0_1_1; A[227] = 0.262655698853617*G0_0_1 + 0.262655698853616*G0_1_0 - 0.142092427248675*G0_1_1; A[228] = -0.572675540123453*G0_0_1 - 0.572675540123451*G0_1_0 + 0.0495170579806011*G0_1_1; A[229] = -0.572675540123458*G0_0_1 - 0.572675540123459*G0_1_0 + 0.210985725308639*G0_1_1; A[230] = 1.66205081569664*G0_0_1 + 1.66205081569664*G0_1_0 + 0.503782242063489*G0_1_1; A[231] = -0.648027584876541*G0_0_0 - 0.648027584876541*G0_0_1 + 0.202287946428571*G0_1_0 + 0.202287946428571*G0_1_1; A[232] = 0.202374063051146*G0_0_0 + 0.161554783950616*G0_1_0; A[233] = -0.0408192791005282*G0_1_1; A[234] = 0.1980682319224*G0_0_0 + 0.269114445546737*G0_0_1 + 0.269114445546737*G0_1_0 + 0.340160659171073*G0_1_1; A[235] = 0.11195160934744*G0_0_0 + 0.142092427248676*G0_0_1 + 0.142092427248675*G0_1_0 + 0.172233245149912*G0_1_1; A[236] = 0.0710462136243404*G0_0_0 + 0.101187031525574*G0_0_1 + 0.101187031525572*G0_1_0 + 0.131327849426804*G0_1_1; A[237] = 0.071046213624337*G0_0_1 + 0.071046213624341*G0_1_0 + 0.142092427248679*G0_1_1; A[238] = -0.28633777006173*G0_0_0 + 0.994646990740736*G0_0_1 + 0.994646990740737*G0_1_0 - 0.286337770061727*G0_1_1; A[239] = -0.0495170579805959*G0_0_0 - 0.579134286816574*G0_0_1 - 0.579134286816579*G0_1_0 + 0.286337770061726*G0_1_1; A[240] = 0.0710462136243366*G0_0_0 + 0.303561094576717*G0_0_1 + 0.303561094576721*G0_1_0 - 0.359536899250436*G0_1_1; A[241] = -0.0710462136243368*G0_0_1 - 0.0710462136243409*G0_1_0 + 0.198068231922395*G0_1_1; A[242] = 1.98929398148147*G0_0_0 + 0.708309220679008*G0_0_1 + 0.708309220679008*G0_1_0 + 1.98929398148147*G0_1_1; A[243] = -2.56842826829805*G0_0_0 - 0.37676022376543*G0_0_1 - 1.70295621141974*G0_1_0 - 0.906377452601407*G0_1_1; A[244] = 1.96345899470899*G0_0_0 + 0.585593033509698*G0_0_1 + 1.30036100088183*G0_1_0 + 0.818107914462078*G0_1_1; A[245] = -0.938671186067016*G0_0_0 - 0.269114445546738*G0_0_1 - 0.669556740520278*G0_1_0 - 0.340160659171073*G0_1_1; A[246] = 0.503782242063495*G0_0_0 - 1.15826857363315*G0_0_1 - 1.15826857363315*G0_1_0 - 2.8203193893298*G0_1_1; A[247] = 0.0495170579805979*G0_0_0 + 0.622192598104051*G0_0_1 + 0.622192598104055*G0_1_0 + 1.19486813822751*G0_1_1; A[248] = -0.465029761904762*G0_0_0 - 0.727685460758373*G0_0_1 - 0.727685460758376*G0_1_0 - 0.990341159611991*G0_1_1; A[249] = 0.210985725308636*G0_0_0 + 0.783661265432091*G0_0_1 + 0.783661265432096*G0_1_0 + 1.35633680555555*G0_1_1; A[250] = -0.27342027667548*G0_0_0 - 0.346619405864195*G0_0_1 - 0.346619405864192*G0_1_0 - 0.419818535052905*G0_1_1; A[251] = -0.142092427248677*G0_0_0 - 0.404748126102289*G0_0_1 - 0.404748126102293*G0_1_0 - 0.667403824955907*G0_1_1; A[252] = 0.594204695767194*G0_0_0 + 0.594204695767194*G0_0_1 - 0.0158454585537921*G0_1_0 - 0.0158454585537919*G0_1_1; A[253] = -0.449959352954144*G0_0_0 - 0.380291005291004*G0_1_0; A[254] = -0.0379774305555555*G0_1_1; A[255] = -0.359536899250443*G0_0_0 - 0.663097993827161*G0_0_1 - 0.663097993827159*G0_1_0 - 0.895612874779539*G0_1_1; A[256] = -0.111951609347439*G0_0_0 - 0.157162836199292*G0_0_1 - 0.157162836199293*G0_1_0 - 0.219597387566137*G0_1_1; A[257] = -0.017223324514993*G0_0_0 - 0.148551173941799*G0_0_1 - 0.148551173941799*G0_1_0 - 0.297102347883596*G0_1_1; A[258] = 0.0301408179012353*G0_0_1 + 0.0301408179012341*G0_1_0 + 0.131327849426806*G0_1_1; A[259] = 0.28633777006173*G0_0_0 - 0.579134286816577*G0_0_1 - 0.579134286816578*G0_1_0 - 0.0495170579805992*G0_1_1; A[260] = 0.103339947089945*G0_0_0 - 0.0301408179012344*G0_0_1 - 0.0301408179012347*G0_1_0 + 0.103339947089947*G0_1_1; A[261] = -0.0172233245149921*G0_0_0 + 0.0452112268518503*G0_0_1 + 0.0452112268518514*G0_1_0 - 0.111951609347442*G0_1_1; A[262] = -0.0301408179012337*G0_0_1 - 0.030140817901234*G0_1_0 + 0.111951609347442*G0_1_1; A[263] = -2.56842826829805*G0_0_0 - 1.70295621141974*G0_0_1 - 0.37676022376543*G0_1_0 - 0.906377452601407*G0_1_1; A[264] = 4.41778273809522*G0_0_0 + 1.89887152777777*G0_0_1 + 1.89887152777777*G0_1_0 + 3.07436342592591*G0_1_1; A[265] = -3.95705880731921*G0_0_0 - 1.45321800595238*G0_0_1 - 2.50384080136683*G0_1_0 - 1.80414324294532*G0_1_1; A[266] = 1.96345899470899*G0_0_0 + 0.663097993827162*G0_0_1 + 1.37786596119929*G0_1_0 + 0.895612874779539*G0_1_1; A[267] = -0.611428020282189*G0_0_0 + 2.04096395502644*G0_0_1 + 2.04096395502645*G0_1_0 + 0.731991291887122*G0_1_1; A[268] = 0.00430583112874796*G0_0_0 - 2.40911251653438*G0_0_1 - 2.40911251653439*G0_1_0 - 3.81066054894179*G0_1_1; A[269] = 0.680321318342153*G0_0_0 + 1.61038084215167*G0_0_1 + 1.61038084215167*G0_1_0 + 2.02374063051146*G0_1_1; A[270] = -0.318631503527331*G0_0_0 - 0.471488508597878*G0_0_1 - 0.47148850859788*G0_1_0 + 0.387524801587301*G0_1_1; A[271] = 0.327243165784825*G0_0_0 + 0.658792162698409*G0_0_1 + 0.658792162698407*G0_1_0 + 1.03339947089947*G0_1_1; A[272] = 0.0344466490299852*G0_0_0 + 0.103339947089946*G0_0_1 + 0.103339947089948*G0_1_0 - 0.344466490299822*G0_1_1; A[273] = -0.449959352954144*G0_0_0 - 0.449959352954144*G0_0_1 - 0.069668347663139*G0_1_0 - 0.0696683476631394*G0_1_1; A[274] = 0.594204695767194*G0_0_0 + 0.610050154320986*G0_1_0; A[275] = -0.037977430555555*G0_1_1; A[276] = 0.286337770061731*G0_0_0 + 0.865472056878307*G0_0_1 + 0.865472056878305*G0_1_0 + 1.39508928571428*G0_1_1; A[277] = 0.103339947089946*G0_0_0 + 0.13348076499118*G0_0_1 + 0.13348076499118*G0_1_0 + 0.266961529982361*G0_1_1; A[278] = -0.0172233245149908*G0_0_0 - 0.0624345513668411*G0_0_1 - 0.0624345513668443*G0_1_0 - 0.219597387566137*G0_1_1; A[279] = 0.0301408179012332*G0_0_1 + 0.0301408179012353*G0_1_0 + 0.17223324514991*G0_1_1; A[280] = -0.359536899250441*G0_0_0 + 0.303561094576719*G0_0_1 + 0.303561094576719*G0_1_0 + 0.0710462136243386*G0_1_1; A[281] = -0.111951609347441*G0_0_0 + 0.0452112268518513*G0_0_1 + 0.0452112268518524*G0_1_0 - 0.017223324514991*G0_1_1; A[282] = -0.0172233245149904*G0_0_0 + 0.131327849426808*G0_0_1 + 0.131327849426808*G0_1_0 - 0.0172233245149902*G0_1_1; A[283] = -0.0301408179012352*G0_0_1 - 0.0301408179012354*G0_1_0 + 0.0710462136243371*G0_1_1; A[284] = 1.96345899470899*G0_0_0 + 1.30036100088183*G0_0_1 + 0.585593033509698*G0_1_0 + 0.818107914462078*G0_1_1; A[285] = -3.95705880731921*G0_0_0 - 2.50384080136683*G0_0_1 - 1.45321800595238*G0_1_0 - 1.80414324294532*G0_1_1; A[286] = 4.41778273809522*G0_0_0 + 2.51891121031745*G0_0_1 + 2.51891121031745*G0_1_0 + 3.6944031084656*G0_1_1; A[287] = -2.56842826829805*G0_0_0 - 0.865472056878308*G0_0_1 - 2.19166804453262*G0_1_0 - 1.39508928571428*G0_1_1; A[288] = 0.680321318342151*G0_0_0 - 0.930059523809517*G0_0_1 - 0.930059523809523*G0_1_0 - 0.516699735449735*G0_1_1; A[289] = 0.00430583112874898*G0_0_0 + 2.41341834766313*G0_0_1 + 2.41341834766313*G0_1_0 + 1.01187031525573*G0_1_1; A[290] = -0.611428020282189*G0_0_0 - 2.65239197530863*G0_0_1 - 2.65239197530864*G0_1_0 - 3.96136463844796*G0_1_1; A[291] = 0.327243165784828*G0_0_0 - 0.331548996913582*G0_0_1 - 0.331548996913584*G0_1_0 + 0.043058311287478*G0_1_1; A[292] = -0.318631503527333*G0_0_0 + 0.152857005070546*G0_0_1 + 0.152857005070551*G0_1_0 + 1.01187031525573*G0_1_1; A[293] = 0.0344466490299812*G0_0_0 - 0.0688932980599634*G0_0_1 - 0.0688932980599638*G0_1_0 - 0.516699735449733*G0_1_1; A[294] = 0.202374063051146*G0_0_0 + 0.202374063051146*G0_0_1 + 0.0408192791005296*G0_1_0 + 0.0408192791005296*G0_1_1; A[295] = -0.648027584876541*G0_0_0 - 0.850315531305111*G0_1_0; A[296] = -0.040819279100529*G0_1_1; A[297] = -0.286337770061729*G0_0_0 - 1.28098476080247*G0_0_1 - 1.28098476080246*G0_1_0 - 2.56196952160493*G0_1_1; A[298] = -0.0495170579805987*G0_0_0 + 0.529617228835978*G0_0_1 + 0.529617228835979*G0_1_0 + 1.39508928571428*G0_1_1; A[299] = 0.0710462136243378*G0_0_0 - 0.232514880952381*G0_0_1 - 0.232514880952381*G0_1_0 - 0.895612874779539*G0_1_1; A[300] = 0.0710462136243397*G0_0_1 + 0.0710462136243391*G0_1_0 + 0.340160659171075*G0_1_1; A[301] = 0.198068231922398*G0_0_0 - 0.0710462136243386*G0_0_1 - 0.0710462136243388*G0_1_0; A[302] = 0.111951609347441*G0_0_0 - 0.030140817901235*G0_0_1 - 0.0301408179012347*G0_1_0; A[303] = 0.0710462136243381*G0_0_0 - 0.0301408179012344*G0_0_1 - 0.030140817901236*G0_1_0; A[304] = -0.0710462136243385*G0_0_1 - 0.071046213624339*G0_1_0; A[305] = -0.938671186067016*G0_0_0 - 0.669556740520278*G0_0_1 - 0.269114445546738*G0_1_0 - 0.340160659171073*G0_1_1; A[306] = 1.96345899470899*G0_0_0 + 1.37786596119929*G0_0_1 + 0.663097993827162*G0_1_0 + 0.895612874779539*G0_1_1; A[307] = -2.56842826829805*G0_0_0 - 2.19166804453262*G0_0_1 - 0.865472056878308*G0_1_0 - 1.39508928571428*G0_1_1; A[308] = 1.98929398148147*G0_0_0 + 1.28098476080247*G0_0_1 + 1.28098476080247*G0_1_0 + 2.56196952160493*G0_1_1; A[309] = -0.465029761904759*G0_0_0 + 0.262655698853614*G0_0_1 + 0.262655698853617*G0_1_0; A[310] = 0.0495170579805968*G0_0_0 - 0.572675540123455*G0_0_1 - 0.57267554012346*G0_1_0; A[311] = 0.503782242063492*G0_0_0 + 1.66205081569664*G0_0_1 + 1.66205081569664*G0_1_0; A[312] = -0.273420276675481*G0_0_0 + 0.073199129188712*G0_0_1 + 0.0731991291887139*G0_1_0; A[313] = 0.210985725308639*G0_0_0 - 0.572675540123454*G0_0_1 - 0.572675540123458*G0_1_0; A[314] = -0.142092427248676*G0_0_0 + 0.262655698853614*G0_0_1 + 0.262655698853617*G0_1_0; A[315] = -0.215291556437391*G0_0_0 - 0.215291556437391*G0_0_1 - 0.215291556437391*G0_1_0 - 0.215291556437391*G0_1_1; A[316] = 0.107645778218694*G0_0_0; A[317] = 0.107645778218694*G0_1_1; A[318] = -0.667403824955907*G0_0_0 - 0.262655698853617*G0_0_1 - 0.262655698853615*G0_1_0; A[319] = -0.34446649029982*G0_0_0 - 0.447806437389768*G0_0_1 - 0.447806437389765*G0_1_0 - 0.516699735449733*G0_1_1; A[320] = -0.516699735449734*G0_0_0 - 0.447806437389767*G0_0_1 - 0.447806437389764*G0_1_0 - 0.344466490299815*G0_1_1; A[321] = -0.262655698853615*G0_0_1 - 0.262655698853619*G0_1_0 - 0.667403824955907*G0_1_1; A[322] = -2.8203193893298*G0_0_0 - 1.15826857363315*G0_0_1 - 1.15826857363315*G0_1_0 + 0.503782242063494*G0_1_1; A[323] = 0.731991291887122*G0_0_0 + 2.04096395502645*G0_0_1 + 2.04096395502645*G0_1_0 - 0.611428020282185*G0_1_1; A[324] = -0.516699735449729*G0_0_0 - 0.930059523809518*G0_0_1 - 0.930059523809523*G0_1_0 + 0.680321318342145*G0_1_1; A[325] = 0.262655698853612*G0_0_1 + 0.262655698853619*G0_1_0 - 0.465029761904756*G0_1_1; A[326] = 0.503782242063495*G0_0_0 - 1.15826857363315*G0_0_1 - 1.15826857363315*G0_1_0 - 2.8203193893298*G0_1_1; A[327] = -0.61142802028219*G0_0_0 + 2.04096395502645*G0_0_1 + 2.04096395502644*G0_1_0 + 0.731991291887122*G0_1_1; A[328] = 0.680321318342152*G0_0_0 - 0.930059523809523*G0_0_1 - 0.930059523809517*G0_1_0 - 0.516699735449735*G0_1_1; A[329] = -0.46502976190476*G0_0_0 + 0.262655698853617*G0_0_1 + 0.262655698853614*G0_1_0; A[330] = 7.06156305114636*G0_0_0 + 3.1001984126984*G0_0_1 + 3.1001984126984*G0_1_0 + 7.06156305114636*G0_1_1; A[331] = -6.32957175925924*G0_0_0 - 3.05714010141093*G0_0_1 - 3.05714010141092*G0_1_0 - 1.80844907407406*G0_1_1; A[332] = 2.75573192239858*G0_0_0 + 1.37786596119929*G0_0_1 + 1.37786596119929*G0_1_0 + 1.03339947089947*G0_1_1; A[333] = -1.80844907407406*G0_0_0 - 3.05714010141092*G0_0_1 - 3.05714010141092*G0_1_0 - 6.32957175925924*G0_1_1; A[334] = 1.42092427248676*G0_0_0 + 1.46398258377424*G0_0_1 + 1.46398258377423*G0_1_0 + 1.42092427248676*G0_1_1; A[335] = 1.03339947089946*G0_0_0 + 1.37786596119929*G0_0_1 + 1.37786596119929*G0_1_0 + 2.75573192239858*G0_1_1; A[336] = -0.0538228891093459*G0_0_0 - 0.0538228891093459*G0_0_1 - 0.0538228891093464*G0_1_0 - 0.0538228891093462*G0_1_1; A[337] = -0.0538228891093457*G0_0_0; A[338] = 0.107645778218694*G0_1_1; A[339] = 1.35633680555556*G0_0_0 + 0.57267554012346*G0_0_1 + 0.572675540123458*G0_1_0; A[340] = 0.387524801587292*G0_0_0 + 0.859013310185179*G0_0_1 + 0.859013310185178*G0_1_0 + 1.01187031525573*G0_1_1; A[341] = 0.04305831128748*G0_0_0 + 0.374607308201055*G0_0_1 + 0.374607308201059*G0_1_0 + 1.03339947089946*G0_1_1; A[342] = -0.073199129188713*G0_0_1 - 0.073199129188714*G0_1_0 - 0.419818535052907*G0_1_1; A[343] = 1.35633680555555*G0_0_0 + 0.783661265432093*G0_0_1 + 0.783661265432098*G0_1_0 + 0.210985725308639*G0_1_1; A[344] = 0.387524801587302*G0_0_0 - 0.471488508597879*G0_0_1 - 0.471488508597879*G0_1_0 - 0.318631503527334*G0_1_1; A[345] = 0.0430583112874762*G0_0_0 - 0.33154899691358*G0_0_1 - 0.33154899691358*G0_1_0 + 0.32724316578483*G0_1_1; A[346] = 0.0731991291887129*G0_0_1 + 0.0731991291887139*G0_1_0 - 0.273420276675483*G0_1_1; A[347] = 0.0495170579805979*G0_0_0 + 0.622192598104055*G0_0_1 + 0.622192598104051*G0_1_0 + 1.19486813822751*G0_1_1; A[348] = 0.00430583112874752*G0_0_0 - 2.40911251653439*G0_0_1 - 2.40911251653438*G0_1_0 - 3.81066054894179*G0_1_1; A[349] = 0.00430583112874909*G0_0_0 + 2.41341834766313*G0_0_1 + 2.41341834766313*G0_1_0 + 1.01187031525573*G0_1_1; A[350] = 0.0495170579805966*G0_0_0 - 0.572675540123459*G0_0_1 - 0.572675540123455*G0_1_0; A[351] = -6.32957175925924*G0_0_0 - 3.05714010141092*G0_0_1 - 3.05714010141093*G0_1_0 - 1.80844907407406*G0_1_1; A[352] = 9.94646990740738*G0_0_0 + 4.97323495370369*G0_0_1 + 4.97323495370369*G0_1_0 + 8.65472056878303*G0_1_1; A[353] = -6.32957175925925*G0_0_0 - 3.27243165784831*G0_0_1 - 3.27243165784832*G0_1_0 - 2.02374063051146*G0_1_1; A[354] = -0.387524801587308*G0_0_0 + 2.55120494378305*G0_0_1 + 2.55120494378305*G0_1_0 - 0.387524801587311*G0_1_1; A[355] = -0.387524801587287*G0_0_0 - 2.93872974537036*G0_0_1 - 2.93872974537035*G0_1_0 - 5.87745949074072*G0_1_1; A[356] = -0.0861166225749551*G0_0_0 - 0.0430583112874722*G0_0_1 - 0.0430583112874784*G0_1_0 + 1.42092427248677*G0_1_1; A[357] = 0.107645778218694*G0_0_0 + 0.107645778218694*G0_0_1 + 0.107645778218694*G0_1_0 + 0.107645778218694*G0_1_1; A[358] = -0.215291556437389*G0_0_0; A[359] = 0.107645778218694*G0_1_1; A[360] = -2.8203193893298*G0_0_0 - 1.66205081569664*G0_0_1 - 1.66205081569664*G0_1_0; A[361] = 0.73199129188713*G0_0_0 - 1.30897266313932*G0_0_1 - 1.30897266313933*G0_1_0 - 3.96136463844796*G0_1_1; A[362] = -0.516699735449735*G0_0_0 + 0.413359788359787*G0_0_1 + 0.413359788359793*G0_1_0 + 2.02374063051146*G0_1_1; A[363] = -0.262655698853614*G0_0_1 - 0.262655698853618*G0_1_0 - 0.990341159611989*G0_1_1; A[364] = -0.667403824955908*G0_0_0 - 0.40474812610229*G0_0_1 - 0.404748126102292*G0_1_0 - 0.142092427248676*G0_1_1; A[365] = -0.344466490299825*G0_0_0 + 0.103339947089945*G0_0_1 + 0.103339947089944*G0_1_0 + 0.0344466490299815*G0_1_1; A[366] = -0.516699735449735*G0_0_0 - 0.0688932980599647*G0_0_1 - 0.0688932980599639*G0_1_0 + 0.0344466490299822*G0_1_1; A[367] = 0.262655698853616*G0_0_1 + 0.262655698853617*G0_1_0 - 0.142092427248675*G0_1_1; A[368] = -0.465029761904762*G0_0_0 - 0.727685460758376*G0_0_1 - 0.727685460758373*G0_1_0 - 0.990341159611991*G0_1_1; A[369] = 0.680321318342153*G0_0_0 + 1.61038084215167*G0_0_1 + 1.61038084215167*G0_1_0 + 2.02374063051146*G0_1_1; A[370] = -0.611428020282189*G0_0_0 - 2.65239197530864*G0_0_1 - 2.65239197530863*G0_1_0 - 3.96136463844796*G0_1_1; A[371] = 0.503782242063492*G0_0_0 + 1.66205081569664*G0_0_1 + 1.66205081569664*G0_1_0; A[372] = 2.75573192239858*G0_0_0 + 1.37786596119929*G0_0_1 + 1.37786596119929*G0_1_0 + 1.03339947089947*G0_1_1; A[373] = -6.32957175925925*G0_0_0 - 3.27243165784832*G0_0_1 - 3.27243165784831*G0_1_0 - 2.02374063051146*G0_1_1; A[374] = 7.06156305114637*G0_0_0 + 3.96136463844796*G0_0_1 + 3.96136463844796*G0_1_0 + 7.92272927689593*G0_1_1; A[375] = 1.42092427248678*G0_0_0 - 0.0430583112874734*G0_0_1 - 0.0430583112874687*G0_1_0 - 0.0861166225749513*G0_1_1; A[376] = -1.80844907407408*G0_0_0 + 1.24869102733686*G0_0_1 + 1.24869102733685*G0_1_0 - 2.02374063051147*G0_1_1; A[377] = 1.03339947089947*G0_0_0 - 0.344466490299826*G0_0_1 - 0.34446649029983*G0_1_0 + 1.03339947089946*G0_1_1; A[378] = -0.0538228891093451*G0_0_0 - 0.053822889109345*G0_0_1 - 0.0538228891093448*G0_1_0 - 0.053822889109345*G0_1_1; A[379] = 0.107645778218694*G0_0_0; A[380] = -0.0538228891093483*G0_1_1; A[381] = -0.419818535052912*G0_0_0 - 0.0731991291887153*G0_0_1 - 0.073199129188712*G0_1_0; A[382] = 1.03339947089947*G0_0_0 + 0.374607308201057*G0_0_1 + 0.374607308201054*G0_1_0 + 0.0430583112874751*G0_1_1; A[383] = 1.01187031525572*G0_0_0 + 0.859013310185175*G0_0_1 + 0.859013310185173*G0_1_0 + 0.387524801587293*G0_1_1; A[384] = 0.572675540123452*G0_0_1 + 0.572675540123454*G0_1_0 + 1.35633680555555*G0_1_1; A[385] = 1.19486813822751*G0_0_0 + 0.622192598104047*G0_0_1 + 0.622192598104051*G0_1_0 + 0.049517057980593*G0_1_1; A[386] = -3.81066054894178*G0_0_0 - 2.40911251653438*G0_0_1 - 2.40911251653438*G0_1_0 + 0.00430583112875357*G0_1_1; A[387] = 1.01187031525572*G0_0_0 + 2.41341834766312*G0_0_1 + 2.41341834766312*G0_1_0 + 0.00430583112874355*G0_1_1; A[388] = -0.572675540123451*G0_0_1 - 0.572675540123453*G0_1_0 + 0.049517057980601*G0_1_1; A[389] = 0.210985725308636*G0_0_0 + 0.783661265432096*G0_0_1 + 0.783661265432091*G0_1_0 + 1.35633680555555*G0_1_1; A[390] = -0.318631503527331*G0_0_0 - 0.47148850859788*G0_0_1 - 0.471488508597878*G0_1_0 + 0.387524801587301*G0_1_1; A[391] = 0.327243165784827*G0_0_0 - 0.331548996913584*G0_0_1 - 0.331548996913582*G0_1_0 + 0.043058311287478*G0_1_1; A[392] = -0.273420276675481*G0_0_0 + 0.0731991291887139*G0_0_1 + 0.0731991291887119*G0_1_0; A[393] = -1.80844907407406*G0_0_0 - 3.05714010141092*G0_0_1 - 3.05714010141092*G0_1_0 - 6.32957175925924*G0_1_1; A[394] = -0.387524801587309*G0_0_0 + 2.55120494378305*G0_0_1 + 2.55120494378305*G0_1_0 - 0.387524801587311*G0_1_1; A[395] = 1.42092427248678*G0_0_0 - 0.0430583112874686*G0_0_1 - 0.0430583112874733*G0_1_0 - 0.0861166225749512*G0_1_1; A[396] = 8.65472056878303*G0_0_0 + 4.97323495370368*G0_0_1 + 4.97323495370368*G0_1_0 + 9.94646990740736*G0_1_1; A[397] = -5.87745949074072*G0_0_0 - 2.93872974537035*G0_0_1 - 2.93872974537035*G0_1_0 - 0.387524801587287*G0_1_1; A[398] = -2.02374063051144*G0_0_0 - 3.2724316578483*G0_0_1 - 3.2724316578483*G0_1_0 - 6.32957175925923*G0_1_1; A[399] = 0.107645778218694*G0_0_0 + 0.107645778218694*G0_0_1 + 0.107645778218695*G0_1_0 + 0.107645778218694*G0_1_1; A[400] = -0.0538228891093463*G0_0_0; A[401] = -0.0538228891093466*G0_1_1; A[402] = 1.19486813822751*G0_0_0 + 0.572675540123459*G0_0_1 + 0.572675540123455*G0_1_0; A[403] = -3.81066054894179*G0_0_0 - 1.40154803240741*G0_0_1 - 1.4015480324074*G0_1_0 + 1.01187031525573*G0_1_1; A[404] = 1.01187031525573*G0_0_0 - 1.40154803240739*G0_0_1 - 1.40154803240741*G0_1_0 - 3.81066054894178*G0_1_1; A[405] = 0.572675540123457*G0_0_1 + 0.572675540123458*G0_1_0 + 1.19486813822751*G0_1_1; A[406] = -0.419818535052905*G0_0_0 - 0.346619405864195*G0_0_1 - 0.346619405864197*G0_1_0 - 0.273420276675483*G0_1_1; A[407] = 1.03339947089946*G0_0_0 + 0.658792162698409*G0_0_1 + 0.658792162698405*G0_1_0 + 0.327243165784831*G0_1_1; A[408] = 1.01187031525574*G0_0_0 + 0.152857005070549*G0_0_1 + 0.152857005070549*G0_1_0 - 0.318631503527335*G0_1_1; A[409] = -0.572675540123458*G0_0_1 - 0.572675540123458*G0_1_0 + 0.210985725308639*G0_1_1; A[410] = -0.27342027667548*G0_0_0 - 0.346619405864192*G0_0_1 - 0.346619405864195*G0_1_0 - 0.419818535052905*G0_1_1; A[411] = 0.327243165784825*G0_0_0 + 0.658792162698407*G0_0_1 + 0.658792162698409*G0_1_0 + 1.03339947089947*G0_1_1; A[412] = -0.318631503527333*G0_0_0 + 0.152857005070551*G0_0_1 + 0.152857005070547*G0_1_0 + 1.01187031525573*G0_1_1; A[413] = 0.210985725308639*G0_0_0 - 0.572675540123458*G0_0_1 - 0.572675540123454*G0_1_0; A[414] = 1.42092427248676*G0_0_0 + 1.46398258377423*G0_0_1 + 1.46398258377424*G0_1_0 + 1.42092427248676*G0_1_1; A[415] = -0.387524801587287*G0_0_0 - 2.93872974537035*G0_0_1 - 2.93872974537036*G0_1_0 - 5.87745949074072*G0_1_1; A[416] = -1.80844907407408*G0_0_0 + 1.24869102733685*G0_0_1 + 1.24869102733686*G0_1_0 - 2.02374063051147*G0_1_1; A[417] = -5.87745949074072*G0_0_0 - 2.93872974537035*G0_0_1 - 2.93872974537035*G0_1_0 - 0.387524801587287*G0_1_1; A[418] = 8.65472056878304*G0_0_0 + 3.68148561507934*G0_0_1 + 3.68148561507934*G0_1_0 + 8.65472056878304*G0_1_1; A[419] = -2.02374063051147*G0_0_0 + 1.24869102733685*G0_0_1 + 1.24869102733686*G0_1_0 - 1.80844907407407*G0_1_1; A[420] = 0.107645778218694*G0_0_0 + 0.107645778218694*G0_0_1 + 0.107645778218693*G0_1_0 + 0.107645778218693*G0_1_1; A[421] = 0.107645778218693*G0_0_0; A[422] = -0.215291556437387*G0_1_1; A[423] = -0.990341159611989*G0_0_0 - 0.262655698853618*G0_0_1 - 0.262655698853616*G0_1_0; A[424] = 2.02374063051146*G0_0_0 + 0.413359788359792*G0_0_1 + 0.413359788359789*G0_1_0 - 0.516699735449732*G0_1_1; A[425] = -3.96136463844795*G0_0_0 - 1.30897266313932*G0_0_1 - 1.30897266313932*G0_1_0 + 0.731991291887125*G0_1_1; A[426] = -1.66205081569664*G0_0_1 - 1.66205081569664*G0_1_0 - 2.82031938932979*G0_1_1; A[427] = -0.990341159611989*G0_0_0 - 0.727685460758371*G0_0_1 - 0.727685460758372*G0_1_0 - 0.465029761904757*G0_1_1; A[428] = 2.02374063051145*G0_0_0 + 1.61038084215167*G0_0_1 + 1.61038084215167*G0_1_0 + 0.680321318342146*G0_1_1; A[429] = -3.96136463844795*G0_0_0 - 2.65239197530863*G0_0_1 - 2.65239197530862*G0_1_0 - 0.611428020282183*G0_1_1; A[430] = 1.66205081569664*G0_0_1 + 1.66205081569664*G0_1_0 + 0.503782242063489*G0_1_1; A[431] = -0.142092427248677*G0_0_0 - 0.404748126102293*G0_0_1 - 0.404748126102289*G0_1_0 - 0.667403824955907*G0_1_1; A[432] = 0.0344466490299852*G0_0_0 + 0.103339947089948*G0_0_1 + 0.103339947089946*G0_1_0 - 0.344466490299822*G0_1_1; A[433] = 0.0344466490299812*G0_0_0 - 0.0688932980599638*G0_0_1 - 0.0688932980599636*G0_1_0 - 0.516699735449733*G0_1_1; A[434] = -0.142092427248676*G0_0_0 + 0.262655698853617*G0_0_1 + 0.262655698853614*G0_1_0; A[435] = 1.03339947089946*G0_0_0 + 1.37786596119929*G0_0_1 + 1.37786596119929*G0_1_0 + 2.75573192239858*G0_1_1; A[436] = -0.0861166225749551*G0_0_0 - 0.0430583112874783*G0_0_1 - 0.0430583112874724*G0_1_0 + 1.42092427248677*G0_1_1; A[437] = 1.03339947089947*G0_0_0 - 0.34446649029983*G0_0_1 - 0.344466490299826*G0_1_0 + 1.03339947089946*G0_1_1; A[438] = -2.02374063051144*G0_0_0 - 3.2724316578483*G0_0_1 - 3.2724316578483*G0_1_0 - 6.32957175925923*G0_1_1; A[439] = -2.02374063051147*G0_0_0 + 1.24869102733686*G0_0_1 + 1.24869102733685*G0_1_0 - 1.80844907407407*G0_1_1; A[440] = 7.92272927689591*G0_0_0 + 3.96136463844794*G0_0_1 + 3.96136463844794*G0_1_0 + 7.06156305114634*G0_1_1; } }; /// This class defines the interface for the assembly of the global /// tensor corresponding to a form with r + n arguments, that is, a /// mapping /// /// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R /// /// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r /// global tensor A is defined by /// /// A = a(V1, V2, ..., Vr, w1, w2, ..., wn), /// /// where each argument Vj represents the application to the /// sequence of basis functions of Vj and w1, w2, ..., wn are given /// fixed functions (coefficients). class UFC_Poisson2D_5BilinearForm: public ufc::form { public: /// Constructor UFC_Poisson2D_5BilinearForm() : ufc::form() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5BilinearForm() { // Do nothing } /// Return a string identifying the form virtual const char* signature() const { return "(dXa0/dxb0)(dXa1/dxb0) | ((d/dXa0)vi0)*((d/dXa1)vi1)*dX(0)"; } /// Return the rank of the global tensor (r) virtual unsigned int rank() const { return 2; } /// Return the number of coefficients (n) virtual unsigned int num_coefficients() const { return 0; } /// Return the number of cell integrals virtual unsigned int num_cell_integrals() const { 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_Poisson2D_5BilinearForm_finite_element_0(); break; case 1: return new UFC_Poisson2D_5BilinearForm_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_Poisson2D_5BilinearForm_dof_map_0(); break; case 1: return new UFC_Poisson2D_5BilinearForm_dof_map_1(); break; } return 0; } /// Create a new cell integral on sub domain i virtual ufc::cell_integral* create_cell_integral(unsigned int i) const { return new UFC_Poisson2D_5BilinearForm_cell_integral_0(); } /// Create a new exterior facet integral on sub domain i virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const { return 0; } /// Create a new interior facet integral on sub domain i virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const { return 0; } }; /// This class defines the interface for a finite element. class UFC_Poisson2D_5LinearForm_finite_element_0: public ufc::finite_element { public: /// Constructor UFC_Poisson2D_5LinearForm_finite_element_0() : ufc::finite_element() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5LinearForm_finite_element_0() { // Do nothing } /// Return a string identifying the finite element virtual const char* signature() const { return "Lagrange finite element of degree 5 on a triangle"; } /// 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 21; } /// 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; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Reset values *values = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Extract relevant coefficients const double coeff0_0 = coefficients0[dof][0]; const double coeff0_1 = coefficients0[dof][1]; const double coeff0_2 = coefficients0[dof][2]; const double coeff0_3 = coefficients0[dof][3]; const double coeff0_4 = coefficients0[dof][4]; const double coeff0_5 = coefficients0[dof][5]; const double coeff0_6 = coefficients0[dof][6]; const double coeff0_7 = coefficients0[dof][7]; const double coeff0_8 = coefficients0[dof][8]; const double coeff0_9 = coefficients0[dof][9]; const double coeff0_10 = coefficients0[dof][10]; const double coeff0_11 = coefficients0[dof][11]; const double coeff0_12 = coefficients0[dof][12]; const double coeff0_13 = coefficients0[dof][13]; const double coeff0_14 = coefficients0[dof][14]; const double coeff0_15 = coefficients0[dof][15]; const double coeff0_16 = coefficients0[dof][16]; const double coeff0_17 = coefficients0[dof][17]; const double coeff0_18 = coefficients0[dof][18]; const double coeff0_19 = coefficients0[dof][19]; const double coeff0_20 = coefficients0[dof][20]; // Compute value(s) *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9 + coeff0_10*basisvalue10 + coeff0_11*basisvalue11 + coeff0_12*basisvalue12 + coeff0_13*basisvalue13 + coeff0_14*basisvalue14 + coeff0_15*basisvalue15 + coeff0_16*basisvalue16 + coeff0_17*basisvalue17 + coeff0_18*basisvalue18 + coeff0_19*basisvalue19 + coeff0_20*basisvalue20; } /// Evaluate all basis functions at given point in cell virtual void evaluate_basis_all(double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented."); } /// Evaluate order n derivatives of basis function i at given point in cell virtual void evaluate_basis_derivatives(unsigned int i, unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { // Extract vertex coordinates const double * const * element_coordinates = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = element_coordinates[1][0] - element_coordinates[0][0]; const double J_01 = element_coordinates[2][0] - element_coordinates[0][0]; const double J_10 = element_coordinates[1][1] - element_coordinates[0][1]; const double J_11 = element_coordinates[2][1] - element_coordinates[0][1]; // Compute determinant of Jacobian const double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Compute number of derivatives unsigned int num_derivatives = 1; for (unsigned int j = 0; j < n; j++) num_derivatives *= 2; // Declare pointer to two dimensional array that holds combinations of derivatives and initialise unsigned int **combinations = new unsigned int *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { combinations[j] = new unsigned int [n]; for (unsigned int k = 0; k < n; k++) combinations[j][k] = 0; } // Generate combinations of derivatives for (unsigned int row = 1; row < num_derivatives; row++) { for (unsigned int num = 0; num < row; num++) { for (unsigned int col = n-1; col+1 > 0; col--) { if (combinations[row][col] + 1 > 1) combinations[row][col] = 0; else { combinations[row][col] += 1; break; } } } } // Compute inverse of Jacobian const double Jinv[2][2] = {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}}; // Declare transformation matrix // Declare pointer to two dimensional array and initialise double **transform = new double *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { transform[j] = new double [num_derivatives]; for (unsigned int k = 0; k < num_derivatives; k++) transform[j][k] = 1; } // Construct transformation matrix for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { for (unsigned int k = 0; k < n; k++) transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]]; } } // Reset values for (unsigned int j = 0; j < 1*num_derivatives; j++) values[j] = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Interesting (new) part // Tables of derivatives of the polynomial base (transpose) const static double dmats0[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.89897948556636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 9.48683298050514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4, 0, 7.07106781186548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.29150262212917, 0, -2.99332590941916, 13.6626010212795, 0, 0.611010092660777, 0, -1.27277816408026e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 4.38178046004133, 0, 0, 12.5219806739988, 0, 0, 0, -1.21552073961695e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.46410161513776, 0, 7.83836717690617, 0, 0, 8.4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 10.9544511501033, 0, 0, -3.83325938999965, 0, 17.7482393492989, 0, 0.553283335172478, 0, 0, 0, 0, 0, 0, 1.30575944758963e-14, 0, 0, 0, 0, 0}, {4.73286382647968, 0, 3.3466401061363, 4.36435780471985, 0, -5.07468037933238, 0, 17.0084012854152, 0, 1.52127765851134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 2.44948974278318, 0, 0, 9.14285714285713, 0, 0, -1.45463708554178e-14, 14.8461497791618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.09838667696594, 0, 7.66811580507233, 0, 0, 10.733126291999, 0, 0, 0, 9.2951600308978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.41602560309065, 0, -4.37680963545757, 15.7321327225523, 0, 2.01017818278147, 0, -4.03686713879668, 0, -0.515811962199122, 21.799082549502, 0, 0.451335466924226, 0, 0.0576695305542381, 0, 0, 0, 0, 0, 0}, {0, 6.85714285714286, 0, 0, 9.97292252418866, 0, 4.32049379893858, 0, -7.27309832077592, -1.59872115546023e-14, 0, 21.2540192277445, 0, 1.49078803979367, 0, 0, 0, 0, 0, 0, 0}, {4.32049379893858, 0, 5.93552661441898, 1.79284291400158, 0, -0.320713490294932, 0, 9.20087412456475, 0, -5.96639619853425, 0, 0, 19.8022632451351, 0, 2.53024038425528, 0, 1.17859985414066e-14, 0, 0, 0, -1.33686464676153e-14}, {0, 1.53330375599988, 1.24344978758018e-14, 0, 6.33793245113119, 0, 0, 0, 13.5526185435788, 1.4210854715202e-14, 0, 0, 0, 16.6675169851115, 0, 0, 0, 0, 0, 1.68753899743024e-14, 0}, {2.82842712474619, 0, 7.31428571428572, 0, 0, 11.337638238025, 0, 0, 0, 12.9299525702683, 0, 0, 0, 0, 9.93858693195777, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const static double dmats1[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.24264068711928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.58198889747161, 4.74341649025257, -0.912870929175276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 6.12372435695794, 3.53553390593274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.64575131106459, 5.18459255872629, -1.49666295470958, 6.83130051063974, -1.05830052442584, 0.30550504633039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.23606797749979, 2.19089023002066, 2.52982212813469, 8.08290376865476, 6.26099033699941, -1.80739222823012, 0, -1.56672320349306e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.73205080756888, -5.09116882454314, 3.91918358845308, 0, 9.69948452238571, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.00000000000001, 0, -2.8284271247462, 0, 0, 12.1243556529821, 0, 0, 0, -2.08002018386999e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.14001690032506e-14}, {2.68328157299975, 5.47722557505167, -1.89736659610103, 7.42307488958091, -1.91662969499983, 0.663940002206986, 8.87411967464944, -1.07142857142858, 0.276641667586237, -0.0958314847499917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.36643191323985, 2.89827534923789, 1.67332005306815, 2.18217890235992, 5.74704893215391, -2.53734018966619, 10.0623058987491, 8.50420064270761, -2.19577516413421, 0.760638829255665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1.2247448713916, 3.53553390593273, -7.37711113563318, 4.57142857142857, 1.64957219768464, 0, 11.4997781699989, 7.42307488958091, -2.57142857142858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.54919333848296, 6.64078308635361, 3.83405790253618, 0, -6.19677335393188, 5.3665631459995, 0, 0, 13.4164078649988, 4.64758001544891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-3.57770876399967, 0, 8.85437744847148, 0, 0, -3.09838667696592, 0, 0, -1.115968317663e-14, 16.0996894379985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.70801280154532, 5.68564249775213, -2.18840481772878, 7.86606636127615, -2.61129805863299, 1.00508909139074, 9.55297122675765, -2.01843356939834, 0.670059394260489, -0.257905981099558, 10.899541274751, -1.06805465250648, 0.225667733462112, -0.0749149177264378, 0.0288347652771189, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 3.42857142857144, 0.989743318610788, 3.04933917230523, 4.98646126209433, -2.72741187029097, 2.1602468994693, 8.34624849531682, -3.63654916038796, 1.5163507931515, 12.0498962651137, 10.6270096138723, -2.24536559755125, 0.745394019896833, -0.286902292026513, 0, 0, 0, 0, 0, 0}, {2.16024689946929, 1.81422947044429, 2.96776330720949, 0.896421457000793, 5.41604758366942, -0.160356745147465, -9.52579344415681, 4.60043706228237, 5.34522483824849, -2.98319809926713, 0, 13.3887736279041, 9.90113162256756, -3.28687867566959, 1.26512019212764, 0, 0, 0, 0, 0, 0}, {1.82574185835055, 0.76665187799994, 3.83609779052925, 8.6368042559214, 3.16896622556559, 3.65920700676626, 0, -8.74817765279707, 6.7763092717894, 0.521640530957295, 0, 0, 15.0623703313921, 8.33375849255573, -3.20766513935893, 0, 0, 0, 0, 1.07750480127221e-14, 0}, {1.4142135623731, -6.73025456655334, 3.65714285714287, 0, 9.4550278170087, 5.6688191190125, 0, 1.90406705745985e-14, -6.99854212223762, 6.46497628513416, 0, 0, 0, 17.2141375215909, 4.96929346597888, 0, 0, 0, 0, 1.47903916597301e-14, 0}, {5.71547606649408, 1.19544627798492e-14, -4.61880215351701, 0, 0, 12.7279220613579, 0, 0, 2.41311920846e-14, -3.2659863237109, 0, 0, 0, 0, 20.0831604418561, 0, 0, 0, 0, 0, 0}}; // Compute reference derivatives // Declare pointer to array of derivatives on FIAT element double *derivatives = new double [num_derivatives]; // Declare coefficients double coeff0_0 = 0; double coeff0_1 = 0; double coeff0_2 = 0; double coeff0_3 = 0; double coeff0_4 = 0; double coeff0_5 = 0; double coeff0_6 = 0; double coeff0_7 = 0; double coeff0_8 = 0; double coeff0_9 = 0; double coeff0_10 = 0; double coeff0_11 = 0; double coeff0_12 = 0; double coeff0_13 = 0; double coeff0_14 = 0; double coeff0_15 = 0; double coeff0_16 = 0; double coeff0_17 = 0; double coeff0_18 = 0; double coeff0_19 = 0; double coeff0_20 = 0; // Declare new coefficients double new_coeff0_0 = 0; double new_coeff0_1 = 0; double new_coeff0_2 = 0; double new_coeff0_3 = 0; double new_coeff0_4 = 0; double new_coeff0_5 = 0; double new_coeff0_6 = 0; double new_coeff0_7 = 0; double new_coeff0_8 = 0; double new_coeff0_9 = 0; double new_coeff0_10 = 0; double new_coeff0_11 = 0; double new_coeff0_12 = 0; double new_coeff0_13 = 0; double new_coeff0_14 = 0; double new_coeff0_15 = 0; double new_coeff0_16 = 0; double new_coeff0_17 = 0; double new_coeff0_18 = 0; double new_coeff0_19 = 0; double new_coeff0_20 = 0; // Loop possible derivatives for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++) { // Get values from coefficients array new_coeff0_0 = coefficients0[dof][0]; new_coeff0_1 = coefficients0[dof][1]; new_coeff0_2 = coefficients0[dof][2]; new_coeff0_3 = coefficients0[dof][3]; new_coeff0_4 = coefficients0[dof][4]; new_coeff0_5 = coefficients0[dof][5]; new_coeff0_6 = coefficients0[dof][6]; new_coeff0_7 = coefficients0[dof][7]; new_coeff0_8 = coefficients0[dof][8]; new_coeff0_9 = coefficients0[dof][9]; new_coeff0_10 = coefficients0[dof][10]; new_coeff0_11 = coefficients0[dof][11]; new_coeff0_12 = coefficients0[dof][12]; new_coeff0_13 = coefficients0[dof][13]; new_coeff0_14 = coefficients0[dof][14]; new_coeff0_15 = coefficients0[dof][15]; new_coeff0_16 = coefficients0[dof][16]; new_coeff0_17 = coefficients0[dof][17]; new_coeff0_18 = coefficients0[dof][18]; new_coeff0_19 = coefficients0[dof][19]; new_coeff0_20 = coefficients0[dof][20]; // Loop derivative order for (unsigned int j = 0; j < n; j++) { // Update old coefficients coeff0_0 = new_coeff0_0; coeff0_1 = new_coeff0_1; coeff0_2 = new_coeff0_2; coeff0_3 = new_coeff0_3; coeff0_4 = new_coeff0_4; coeff0_5 = new_coeff0_5; coeff0_6 = new_coeff0_6; coeff0_7 = new_coeff0_7; coeff0_8 = new_coeff0_8; coeff0_9 = new_coeff0_9; coeff0_10 = new_coeff0_10; coeff0_11 = new_coeff0_11; coeff0_12 = new_coeff0_12; coeff0_13 = new_coeff0_13; coeff0_14 = new_coeff0_14; coeff0_15 = new_coeff0_15; coeff0_16 = new_coeff0_16; coeff0_17 = new_coeff0_17; coeff0_18 = new_coeff0_18; coeff0_19 = new_coeff0_19; coeff0_20 = new_coeff0_20; if(combinations[deriv_num][j] == 0) { new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0] + coeff0_10*dmats0[10][0] + coeff0_11*dmats0[11][0] + coeff0_12*dmats0[12][0] + coeff0_13*dmats0[13][0] + coeff0_14*dmats0[14][0] + coeff0_15*dmats0[15][0] + coeff0_16*dmats0[16][0] + coeff0_17*dmats0[17][0] + coeff0_18*dmats0[18][0] + coeff0_19*dmats0[19][0] + coeff0_20*dmats0[20][0]; new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1] + coeff0_10*dmats0[10][1] + coeff0_11*dmats0[11][1] + coeff0_12*dmats0[12][1] + coeff0_13*dmats0[13][1] + coeff0_14*dmats0[14][1] + coeff0_15*dmats0[15][1] + coeff0_16*dmats0[16][1] + coeff0_17*dmats0[17][1] + coeff0_18*dmats0[18][1] + coeff0_19*dmats0[19][1] + coeff0_20*dmats0[20][1]; new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2] + coeff0_10*dmats0[10][2] + coeff0_11*dmats0[11][2] + coeff0_12*dmats0[12][2] + coeff0_13*dmats0[13][2] + coeff0_14*dmats0[14][2] + coeff0_15*dmats0[15][2] + coeff0_16*dmats0[16][2] + coeff0_17*dmats0[17][2] + coeff0_18*dmats0[18][2] + coeff0_19*dmats0[19][2] + coeff0_20*dmats0[20][2]; new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3] + coeff0_10*dmats0[10][3] + coeff0_11*dmats0[11][3] + coeff0_12*dmats0[12][3] + coeff0_13*dmats0[13][3] + coeff0_14*dmats0[14][3] + coeff0_15*dmats0[15][3] + coeff0_16*dmats0[16][3] + coeff0_17*dmats0[17][3] + coeff0_18*dmats0[18][3] + coeff0_19*dmats0[19][3] + coeff0_20*dmats0[20][3]; new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4] + coeff0_10*dmats0[10][4] + coeff0_11*dmats0[11][4] + coeff0_12*dmats0[12][4] + coeff0_13*dmats0[13][4] + coeff0_14*dmats0[14][4] + coeff0_15*dmats0[15][4] + coeff0_16*dmats0[16][4] + coeff0_17*dmats0[17][4] + coeff0_18*dmats0[18][4] + coeff0_19*dmats0[19][4] + coeff0_20*dmats0[20][4]; new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5] + coeff0_10*dmats0[10][5] + coeff0_11*dmats0[11][5] + coeff0_12*dmats0[12][5] + coeff0_13*dmats0[13][5] + coeff0_14*dmats0[14][5] + coeff0_15*dmats0[15][5] + coeff0_16*dmats0[16][5] + coeff0_17*dmats0[17][5] + coeff0_18*dmats0[18][5] + coeff0_19*dmats0[19][5] + coeff0_20*dmats0[20][5]; new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6] + coeff0_10*dmats0[10][6] + coeff0_11*dmats0[11][6] + coeff0_12*dmats0[12][6] + coeff0_13*dmats0[13][6] + coeff0_14*dmats0[14][6] + coeff0_15*dmats0[15][6] + coeff0_16*dmats0[16][6] + coeff0_17*dmats0[17][6] + coeff0_18*dmats0[18][6] + coeff0_19*dmats0[19][6] + coeff0_20*dmats0[20][6]; new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7] + coeff0_10*dmats0[10][7] + coeff0_11*dmats0[11][7] + coeff0_12*dmats0[12][7] + coeff0_13*dmats0[13][7] + coeff0_14*dmats0[14][7] + coeff0_15*dmats0[15][7] + coeff0_16*dmats0[16][7] + coeff0_17*dmats0[17][7] + coeff0_18*dmats0[18][7] + coeff0_19*dmats0[19][7] + coeff0_20*dmats0[20][7]; new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8] + coeff0_10*dmats0[10][8] + coeff0_11*dmats0[11][8] + coeff0_12*dmats0[12][8] + coeff0_13*dmats0[13][8] + coeff0_14*dmats0[14][8] + coeff0_15*dmats0[15][8] + coeff0_16*dmats0[16][8] + coeff0_17*dmats0[17][8] + coeff0_18*dmats0[18][8] + coeff0_19*dmats0[19][8] + coeff0_20*dmats0[20][8]; new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9] + coeff0_10*dmats0[10][9] + coeff0_11*dmats0[11][9] + coeff0_12*dmats0[12][9] + coeff0_13*dmats0[13][9] + coeff0_14*dmats0[14][9] + coeff0_15*dmats0[15][9] + coeff0_16*dmats0[16][9] + coeff0_17*dmats0[17][9] + coeff0_18*dmats0[18][9] + coeff0_19*dmats0[19][9] + coeff0_20*dmats0[20][9]; new_coeff0_10 = coeff0_0*dmats0[0][10] + coeff0_1*dmats0[1][10] + coeff0_2*dmats0[2][10] + coeff0_3*dmats0[3][10] + coeff0_4*dmats0[4][10] + coeff0_5*dmats0[5][10] + coeff0_6*dmats0[6][10] + coeff0_7*dmats0[7][10] + coeff0_8*dmats0[8][10] + coeff0_9*dmats0[9][10] + coeff0_10*dmats0[10][10] + coeff0_11*dmats0[11][10] + coeff0_12*dmats0[12][10] + coeff0_13*dmats0[13][10] + coeff0_14*dmats0[14][10] + coeff0_15*dmats0[15][10] + coeff0_16*dmats0[16][10] + coeff0_17*dmats0[17][10] + coeff0_18*dmats0[18][10] + coeff0_19*dmats0[19][10] + coeff0_20*dmats0[20][10]; new_coeff0_11 = coeff0_0*dmats0[0][11] + coeff0_1*dmats0[1][11] + coeff0_2*dmats0[2][11] + coeff0_3*dmats0[3][11] + coeff0_4*dmats0[4][11] + coeff0_5*dmats0[5][11] + coeff0_6*dmats0[6][11] + coeff0_7*dmats0[7][11] + coeff0_8*dmats0[8][11] + coeff0_9*dmats0[9][11] + coeff0_10*dmats0[10][11] + coeff0_11*dmats0[11][11] + coeff0_12*dmats0[12][11] + coeff0_13*dmats0[13][11] + coeff0_14*dmats0[14][11] + coeff0_15*dmats0[15][11] + coeff0_16*dmats0[16][11] + coeff0_17*dmats0[17][11] + coeff0_18*dmats0[18][11] + coeff0_19*dmats0[19][11] + coeff0_20*dmats0[20][11]; new_coeff0_12 = coeff0_0*dmats0[0][12] + coeff0_1*dmats0[1][12] + coeff0_2*dmats0[2][12] + coeff0_3*dmats0[3][12] + coeff0_4*dmats0[4][12] + coeff0_5*dmats0[5][12] + coeff0_6*dmats0[6][12] + coeff0_7*dmats0[7][12] + coeff0_8*dmats0[8][12] + coeff0_9*dmats0[9][12] + coeff0_10*dmats0[10][12] + coeff0_11*dmats0[11][12] + coeff0_12*dmats0[12][12] + coeff0_13*dmats0[13][12] + coeff0_14*dmats0[14][12] + coeff0_15*dmats0[15][12] + coeff0_16*dmats0[16][12] + coeff0_17*dmats0[17][12] + coeff0_18*dmats0[18][12] + coeff0_19*dmats0[19][12] + coeff0_20*dmats0[20][12]; new_coeff0_13 = coeff0_0*dmats0[0][13] + coeff0_1*dmats0[1][13] + coeff0_2*dmats0[2][13] + coeff0_3*dmats0[3][13] + coeff0_4*dmats0[4][13] + coeff0_5*dmats0[5][13] + coeff0_6*dmats0[6][13] + coeff0_7*dmats0[7][13] + coeff0_8*dmats0[8][13] + coeff0_9*dmats0[9][13] + coeff0_10*dmats0[10][13] + coeff0_11*dmats0[11][13] + coeff0_12*dmats0[12][13] + coeff0_13*dmats0[13][13] + coeff0_14*dmats0[14][13] + coeff0_15*dmats0[15][13] + coeff0_16*dmats0[16][13] + coeff0_17*dmats0[17][13] + coeff0_18*dmats0[18][13] + coeff0_19*dmats0[19][13] + coeff0_20*dmats0[20][13]; new_coeff0_14 = coeff0_0*dmats0[0][14] + coeff0_1*dmats0[1][14] + coeff0_2*dmats0[2][14] + coeff0_3*dmats0[3][14] + coeff0_4*dmats0[4][14] + coeff0_5*dmats0[5][14] + coeff0_6*dmats0[6][14] + coeff0_7*dmats0[7][14] + coeff0_8*dmats0[8][14] + coeff0_9*dmats0[9][14] + coeff0_10*dmats0[10][14] + coeff0_11*dmats0[11][14] + coeff0_12*dmats0[12][14] + coeff0_13*dmats0[13][14] + coeff0_14*dmats0[14][14] + coeff0_15*dmats0[15][14] + coeff0_16*dmats0[16][14] + coeff0_17*dmats0[17][14] + coeff0_18*dmats0[18][14] + coeff0_19*dmats0[19][14] + coeff0_20*dmats0[20][14]; new_coeff0_15 = coeff0_0*dmats0[0][15] + coeff0_1*dmats0[1][15] + coeff0_2*dmats0[2][15] + coeff0_3*dmats0[3][15] + coeff0_4*dmats0[4][15] + coeff0_5*dmats0[5][15] + coeff0_6*dmats0[6][15] + coeff0_7*dmats0[7][15] + coeff0_8*dmats0[8][15] + coeff0_9*dmats0[9][15] + coeff0_10*dmats0[10][15] + coeff0_11*dmats0[11][15] + coeff0_12*dmats0[12][15] + coeff0_13*dmats0[13][15] + coeff0_14*dmats0[14][15] + coeff0_15*dmats0[15][15] + coeff0_16*dmats0[16][15] + coeff0_17*dmats0[17][15] + coeff0_18*dmats0[18][15] + coeff0_19*dmats0[19][15] + coeff0_20*dmats0[20][15]; new_coeff0_16 = coeff0_0*dmats0[0][16] + coeff0_1*dmats0[1][16] + coeff0_2*dmats0[2][16] + coeff0_3*dmats0[3][16] + coeff0_4*dmats0[4][16] + coeff0_5*dmats0[5][16] + coeff0_6*dmats0[6][16] + coeff0_7*dmats0[7][16] + coeff0_8*dmats0[8][16] + coeff0_9*dmats0[9][16] + coeff0_10*dmats0[10][16] + coeff0_11*dmats0[11][16] + coeff0_12*dmats0[12][16] + coeff0_13*dmats0[13][16] + coeff0_14*dmats0[14][16] + coeff0_15*dmats0[15][16] + coeff0_16*dmats0[16][16] + coeff0_17*dmats0[17][16] + coeff0_18*dmats0[18][16] + coeff0_19*dmats0[19][16] + coeff0_20*dmats0[20][16]; new_coeff0_17 = coeff0_0*dmats0[0][17] + coeff0_1*dmats0[1][17] + coeff0_2*dmats0[2][17] + coeff0_3*dmats0[3][17] + coeff0_4*dmats0[4][17] + coeff0_5*dmats0[5][17] + coeff0_6*dmats0[6][17] + coeff0_7*dmats0[7][17] + coeff0_8*dmats0[8][17] + coeff0_9*dmats0[9][17] + coeff0_10*dmats0[10][17] + coeff0_11*dmats0[11][17] + coeff0_12*dmats0[12][17] + coeff0_13*dmats0[13][17] + coeff0_14*dmats0[14][17] + coeff0_15*dmats0[15][17] + coeff0_16*dmats0[16][17] + coeff0_17*dmats0[17][17] + coeff0_18*dmats0[18][17] + coeff0_19*dmats0[19][17] + coeff0_20*dmats0[20][17]; new_coeff0_18 = coeff0_0*dmats0[0][18] + coeff0_1*dmats0[1][18] + coeff0_2*dmats0[2][18] + coeff0_3*dmats0[3][18] + coeff0_4*dmats0[4][18] + coeff0_5*dmats0[5][18] + coeff0_6*dmats0[6][18] + coeff0_7*dmats0[7][18] + coeff0_8*dmats0[8][18] + coeff0_9*dmats0[9][18] + coeff0_10*dmats0[10][18] + coeff0_11*dmats0[11][18] + coeff0_12*dmats0[12][18] + coeff0_13*dmats0[13][18] + coeff0_14*dmats0[14][18] + coeff0_15*dmats0[15][18] + coeff0_16*dmats0[16][18] + coeff0_17*dmats0[17][18] + coeff0_18*dmats0[18][18] + coeff0_19*dmats0[19][18] + coeff0_20*dmats0[20][18]; new_coeff0_19 = coeff0_0*dmats0[0][19] + coeff0_1*dmats0[1][19] + coeff0_2*dmats0[2][19] + coeff0_3*dmats0[3][19] + coeff0_4*dmats0[4][19] + coeff0_5*dmats0[5][19] + coeff0_6*dmats0[6][19] + coeff0_7*dmats0[7][19] + coeff0_8*dmats0[8][19] + coeff0_9*dmats0[9][19] + coeff0_10*dmats0[10][19] + coeff0_11*dmats0[11][19] + coeff0_12*dmats0[12][19] + coeff0_13*dmats0[13][19] + coeff0_14*dmats0[14][19] + coeff0_15*dmats0[15][19] + coeff0_16*dmats0[16][19] + coeff0_17*dmats0[17][19] + coeff0_18*dmats0[18][19] + coeff0_19*dmats0[19][19] + coeff0_20*dmats0[20][19]; new_coeff0_20 = coeff0_0*dmats0[0][20] + coeff0_1*dmats0[1][20] + coeff0_2*dmats0[2][20] + coeff0_3*dmats0[3][20] + coeff0_4*dmats0[4][20] + coeff0_5*dmats0[5][20] + coeff0_6*dmats0[6][20] + coeff0_7*dmats0[7][20] + coeff0_8*dmats0[8][20] + coeff0_9*dmats0[9][20] + coeff0_10*dmats0[10][20] + coeff0_11*dmats0[11][20] + coeff0_12*dmats0[12][20] + coeff0_13*dmats0[13][20] + coeff0_14*dmats0[14][20] + coeff0_15*dmats0[15][20] + coeff0_16*dmats0[16][20] + coeff0_17*dmats0[17][20] + coeff0_18*dmats0[18][20] + coeff0_19*dmats0[19][20] + coeff0_20*dmats0[20][20]; } if(combinations[deriv_num][j] == 1) { new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0] + coeff0_10*dmats1[10][0] + coeff0_11*dmats1[11][0] + coeff0_12*dmats1[12][0] + coeff0_13*dmats1[13][0] + coeff0_14*dmats1[14][0] + coeff0_15*dmats1[15][0] + coeff0_16*dmats1[16][0] + coeff0_17*dmats1[17][0] + coeff0_18*dmats1[18][0] + coeff0_19*dmats1[19][0] + coeff0_20*dmats1[20][0]; new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1] + coeff0_10*dmats1[10][1] + coeff0_11*dmats1[11][1] + coeff0_12*dmats1[12][1] + coeff0_13*dmats1[13][1] + coeff0_14*dmats1[14][1] + coeff0_15*dmats1[15][1] + coeff0_16*dmats1[16][1] + coeff0_17*dmats1[17][1] + coeff0_18*dmats1[18][1] + coeff0_19*dmats1[19][1] + coeff0_20*dmats1[20][1]; new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2] + coeff0_10*dmats1[10][2] + coeff0_11*dmats1[11][2] + coeff0_12*dmats1[12][2] + coeff0_13*dmats1[13][2] + coeff0_14*dmats1[14][2] + coeff0_15*dmats1[15][2] + coeff0_16*dmats1[16][2] + coeff0_17*dmats1[17][2] + coeff0_18*dmats1[18][2] + coeff0_19*dmats1[19][2] + coeff0_20*dmats1[20][2]; new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3] + coeff0_10*dmats1[10][3] + coeff0_11*dmats1[11][3] + coeff0_12*dmats1[12][3] + coeff0_13*dmats1[13][3] + coeff0_14*dmats1[14][3] + coeff0_15*dmats1[15][3] + coeff0_16*dmats1[16][3] + coeff0_17*dmats1[17][3] + coeff0_18*dmats1[18][3] + coeff0_19*dmats1[19][3] + coeff0_20*dmats1[20][3]; new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4] + coeff0_10*dmats1[10][4] + coeff0_11*dmats1[11][4] + coeff0_12*dmats1[12][4] + coeff0_13*dmats1[13][4] + coeff0_14*dmats1[14][4] + coeff0_15*dmats1[15][4] + coeff0_16*dmats1[16][4] + coeff0_17*dmats1[17][4] + coeff0_18*dmats1[18][4] + coeff0_19*dmats1[19][4] + coeff0_20*dmats1[20][4]; new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5] + coeff0_10*dmats1[10][5] + coeff0_11*dmats1[11][5] + coeff0_12*dmats1[12][5] + coeff0_13*dmats1[13][5] + coeff0_14*dmats1[14][5] + coeff0_15*dmats1[15][5] + coeff0_16*dmats1[16][5] + coeff0_17*dmats1[17][5] + coeff0_18*dmats1[18][5] + coeff0_19*dmats1[19][5] + coeff0_20*dmats1[20][5]; new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6] + coeff0_10*dmats1[10][6] + coeff0_11*dmats1[11][6] + coeff0_12*dmats1[12][6] + coeff0_13*dmats1[13][6] + coeff0_14*dmats1[14][6] + coeff0_15*dmats1[15][6] + coeff0_16*dmats1[16][6] + coeff0_17*dmats1[17][6] + coeff0_18*dmats1[18][6] + coeff0_19*dmats1[19][6] + coeff0_20*dmats1[20][6]; new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7] + coeff0_10*dmats1[10][7] + coeff0_11*dmats1[11][7] + coeff0_12*dmats1[12][7] + coeff0_13*dmats1[13][7] + coeff0_14*dmats1[14][7] + coeff0_15*dmats1[15][7] + coeff0_16*dmats1[16][7] + coeff0_17*dmats1[17][7] + coeff0_18*dmats1[18][7] + coeff0_19*dmats1[19][7] + coeff0_20*dmats1[20][7]; new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8] + coeff0_10*dmats1[10][8] + coeff0_11*dmats1[11][8] + coeff0_12*dmats1[12][8] + coeff0_13*dmats1[13][8] + coeff0_14*dmats1[14][8] + coeff0_15*dmats1[15][8] + coeff0_16*dmats1[16][8] + coeff0_17*dmats1[17][8] + coeff0_18*dmats1[18][8] + coeff0_19*dmats1[19][8] + coeff0_20*dmats1[20][8]; new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9] + coeff0_10*dmats1[10][9] + coeff0_11*dmats1[11][9] + coeff0_12*dmats1[12][9] + coeff0_13*dmats1[13][9] + coeff0_14*dmats1[14][9] + coeff0_15*dmats1[15][9] + coeff0_16*dmats1[16][9] + coeff0_17*dmats1[17][9] + coeff0_18*dmats1[18][9] + coeff0_19*dmats1[19][9] + coeff0_20*dmats1[20][9]; new_coeff0_10 = coeff0_0*dmats1[0][10] + coeff0_1*dmats1[1][10] + coeff0_2*dmats1[2][10] + coeff0_3*dmats1[3][10] + coeff0_4*dmats1[4][10] + coeff0_5*dmats1[5][10] + coeff0_6*dmats1[6][10] + coeff0_7*dmats1[7][10] + coeff0_8*dmats1[8][10] + coeff0_9*dmats1[9][10] + coeff0_10*dmats1[10][10] + coeff0_11*dmats1[11][10] + coeff0_12*dmats1[12][10] + coeff0_13*dmats1[13][10] + coeff0_14*dmats1[14][10] + coeff0_15*dmats1[15][10] + coeff0_16*dmats1[16][10] + coeff0_17*dmats1[17][10] + coeff0_18*dmats1[18][10] + coeff0_19*dmats1[19][10] + coeff0_20*dmats1[20][10]; new_coeff0_11 = coeff0_0*dmats1[0][11] + coeff0_1*dmats1[1][11] + coeff0_2*dmats1[2][11] + coeff0_3*dmats1[3][11] + coeff0_4*dmats1[4][11] + coeff0_5*dmats1[5][11] + coeff0_6*dmats1[6][11] + coeff0_7*dmats1[7][11] + coeff0_8*dmats1[8][11] + coeff0_9*dmats1[9][11] + coeff0_10*dmats1[10][11] + coeff0_11*dmats1[11][11] + coeff0_12*dmats1[12][11] + coeff0_13*dmats1[13][11] + coeff0_14*dmats1[14][11] + coeff0_15*dmats1[15][11] + coeff0_16*dmats1[16][11] + coeff0_17*dmats1[17][11] + coeff0_18*dmats1[18][11] + coeff0_19*dmats1[19][11] + coeff0_20*dmats1[20][11]; new_coeff0_12 = coeff0_0*dmats1[0][12] + coeff0_1*dmats1[1][12] + coeff0_2*dmats1[2][12] + coeff0_3*dmats1[3][12] + coeff0_4*dmats1[4][12] + coeff0_5*dmats1[5][12] + coeff0_6*dmats1[6][12] + coeff0_7*dmats1[7][12] + coeff0_8*dmats1[8][12] + coeff0_9*dmats1[9][12] + coeff0_10*dmats1[10][12] + coeff0_11*dmats1[11][12] + coeff0_12*dmats1[12][12] + coeff0_13*dmats1[13][12] + coeff0_14*dmats1[14][12] + coeff0_15*dmats1[15][12] + coeff0_16*dmats1[16][12] + coeff0_17*dmats1[17][12] + coeff0_18*dmats1[18][12] + coeff0_19*dmats1[19][12] + coeff0_20*dmats1[20][12]; new_coeff0_13 = coeff0_0*dmats1[0][13] + coeff0_1*dmats1[1][13] + coeff0_2*dmats1[2][13] + coeff0_3*dmats1[3][13] + coeff0_4*dmats1[4][13] + coeff0_5*dmats1[5][13] + coeff0_6*dmats1[6][13] + coeff0_7*dmats1[7][13] + coeff0_8*dmats1[8][13] + coeff0_9*dmats1[9][13] + coeff0_10*dmats1[10][13] + coeff0_11*dmats1[11][13] + coeff0_12*dmats1[12][13] + coeff0_13*dmats1[13][13] + coeff0_14*dmats1[14][13] + coeff0_15*dmats1[15][13] + coeff0_16*dmats1[16][13] + coeff0_17*dmats1[17][13] + coeff0_18*dmats1[18][13] + coeff0_19*dmats1[19][13] + coeff0_20*dmats1[20][13]; new_coeff0_14 = coeff0_0*dmats1[0][14] + coeff0_1*dmats1[1][14] + coeff0_2*dmats1[2][14] + coeff0_3*dmats1[3][14] + coeff0_4*dmats1[4][14] + coeff0_5*dmats1[5][14] + coeff0_6*dmats1[6][14] + coeff0_7*dmats1[7][14] + coeff0_8*dmats1[8][14] + coeff0_9*dmats1[9][14] + coeff0_10*dmats1[10][14] + coeff0_11*dmats1[11][14] + coeff0_12*dmats1[12][14] + coeff0_13*dmats1[13][14] + coeff0_14*dmats1[14][14] + coeff0_15*dmats1[15][14] + coeff0_16*dmats1[16][14] + coeff0_17*dmats1[17][14] + coeff0_18*dmats1[18][14] + coeff0_19*dmats1[19][14] + coeff0_20*dmats1[20][14]; new_coeff0_15 = coeff0_0*dmats1[0][15] + coeff0_1*dmats1[1][15] + coeff0_2*dmats1[2][15] + coeff0_3*dmats1[3][15] + coeff0_4*dmats1[4][15] + coeff0_5*dmats1[5][15] + coeff0_6*dmats1[6][15] + coeff0_7*dmats1[7][15] + coeff0_8*dmats1[8][15] + coeff0_9*dmats1[9][15] + coeff0_10*dmats1[10][15] + coeff0_11*dmats1[11][15] + coeff0_12*dmats1[12][15] + coeff0_13*dmats1[13][15] + coeff0_14*dmats1[14][15] + coeff0_15*dmats1[15][15] + coeff0_16*dmats1[16][15] + coeff0_17*dmats1[17][15] + coeff0_18*dmats1[18][15] + coeff0_19*dmats1[19][15] + coeff0_20*dmats1[20][15]; new_coeff0_16 = coeff0_0*dmats1[0][16] + coeff0_1*dmats1[1][16] + coeff0_2*dmats1[2][16] + coeff0_3*dmats1[3][16] + coeff0_4*dmats1[4][16] + coeff0_5*dmats1[5][16] + coeff0_6*dmats1[6][16] + coeff0_7*dmats1[7][16] + coeff0_8*dmats1[8][16] + coeff0_9*dmats1[9][16] + coeff0_10*dmats1[10][16] + coeff0_11*dmats1[11][16] + coeff0_12*dmats1[12][16] + coeff0_13*dmats1[13][16] + coeff0_14*dmats1[14][16] + coeff0_15*dmats1[15][16] + coeff0_16*dmats1[16][16] + coeff0_17*dmats1[17][16] + coeff0_18*dmats1[18][16] + coeff0_19*dmats1[19][16] + coeff0_20*dmats1[20][16]; new_coeff0_17 = coeff0_0*dmats1[0][17] + coeff0_1*dmats1[1][17] + coeff0_2*dmats1[2][17] + coeff0_3*dmats1[3][17] + coeff0_4*dmats1[4][17] + coeff0_5*dmats1[5][17] + coeff0_6*dmats1[6][17] + coeff0_7*dmats1[7][17] + coeff0_8*dmats1[8][17] + coeff0_9*dmats1[9][17] + coeff0_10*dmats1[10][17] + coeff0_11*dmats1[11][17] + coeff0_12*dmats1[12][17] + coeff0_13*dmats1[13][17] + coeff0_14*dmats1[14][17] + coeff0_15*dmats1[15][17] + coeff0_16*dmats1[16][17] + coeff0_17*dmats1[17][17] + coeff0_18*dmats1[18][17] + coeff0_19*dmats1[19][17] + coeff0_20*dmats1[20][17]; new_coeff0_18 = coeff0_0*dmats1[0][18] + coeff0_1*dmats1[1][18] + coeff0_2*dmats1[2][18] + coeff0_3*dmats1[3][18] + coeff0_4*dmats1[4][18] + coeff0_5*dmats1[5][18] + coeff0_6*dmats1[6][18] + coeff0_7*dmats1[7][18] + coeff0_8*dmats1[8][18] + coeff0_9*dmats1[9][18] + coeff0_10*dmats1[10][18] + coeff0_11*dmats1[11][18] + coeff0_12*dmats1[12][18] + coeff0_13*dmats1[13][18] + coeff0_14*dmats1[14][18] + coeff0_15*dmats1[15][18] + coeff0_16*dmats1[16][18] + coeff0_17*dmats1[17][18] + coeff0_18*dmats1[18][18] + coeff0_19*dmats1[19][18] + coeff0_20*dmats1[20][18]; new_coeff0_19 = coeff0_0*dmats1[0][19] + coeff0_1*dmats1[1][19] + coeff0_2*dmats1[2][19] + coeff0_3*dmats1[3][19] + coeff0_4*dmats1[4][19] + coeff0_5*dmats1[5][19] + coeff0_6*dmats1[6][19] + coeff0_7*dmats1[7][19] + coeff0_8*dmats1[8][19] + coeff0_9*dmats1[9][19] + coeff0_10*dmats1[10][19] + coeff0_11*dmats1[11][19] + coeff0_12*dmats1[12][19] + coeff0_13*dmats1[13][19] + coeff0_14*dmats1[14][19] + coeff0_15*dmats1[15][19] + coeff0_16*dmats1[16][19] + coeff0_17*dmats1[17][19] + coeff0_18*dmats1[18][19] + coeff0_19*dmats1[19][19] + coeff0_20*dmats1[20][19]; new_coeff0_20 = coeff0_0*dmats1[0][20] + coeff0_1*dmats1[1][20] + coeff0_2*dmats1[2][20] + coeff0_3*dmats1[3][20] + coeff0_4*dmats1[4][20] + coeff0_5*dmats1[5][20] + coeff0_6*dmats1[6][20] + coeff0_7*dmats1[7][20] + coeff0_8*dmats1[8][20] + coeff0_9*dmats1[9][20] + coeff0_10*dmats1[10][20] + coeff0_11*dmats1[11][20] + coeff0_12*dmats1[12][20] + coeff0_13*dmats1[13][20] + coeff0_14*dmats1[14][20] + coeff0_15*dmats1[15][20] + coeff0_16*dmats1[16][20] + coeff0_17*dmats1[17][20] + coeff0_18*dmats1[18][20] + coeff0_19*dmats1[19][20] + coeff0_20*dmats1[20][20]; } } // Compute derivatives on reference element as dot product of coefficients and basisvalues derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9 + new_coeff0_10*basisvalue10 + new_coeff0_11*basisvalue11 + new_coeff0_12*basisvalue12 + new_coeff0_13*basisvalue13 + new_coeff0_14*basisvalue14 + new_coeff0_15*basisvalue15 + new_coeff0_16*basisvalue16 + new_coeff0_17*basisvalue17 + new_coeff0_18*basisvalue18 + new_coeff0_19*basisvalue19 + new_coeff0_20*basisvalue20; } // Transform derivatives back to physical element for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { values[row] += transform[row][col]*derivatives[col]; } } // Delete pointer to array of derivatives on FIAT element delete [] derivatives; // Delete pointer to array of combinations of derivatives and transform for (unsigned int row = 0; row < num_derivatives; row++) { delete [] combinations[row]; delete [] transform[row]; } delete [] combinations; delete [] transform; } /// Evaluate order n derivatives of all basis functions at given point in cell virtual void evaluate_basis_derivatives_all(unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented."); } /// Evaluate linear functional for dof i on the function f virtual double evaluate_dof(unsigned int i, const ufc::function& f, const ufc::cell& c) const { // The reference points, direction and weights: const static double X[21][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.8, 0.2}}, {{0.6, 0.4}}, {{0.4, 0.6}}, {{0.2, 0.8}}, {{0, 0.2}}, {{0, 0.4}}, {{0, 0.6}}, {{0, 0.8}}, {{0.2, 0}}, {{0.4, 0}}, {{0.6, 0}}, {{0.8, 0}}, {{0.2, 0.2}}, {{0.4, 0.2}}, {{0.6, 0.2}}, {{0.2, 0.4}}, {{0.4, 0.4}}, {{0.2, 0.6}}}; const static double W[21][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}; const static double D[21][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}}; const double * const * x = c.coordinates; double result = 0.0; // Iterate over the points: // Evaluate basis functions for affine mapping const double w0 = 1.0 - X[i][0][0] - X[i][0][1]; const double w1 = X[i][0][0]; const double w2 = X[i][0][1]; // Compute affine mapping y = F(X) double y[2]; y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0]; y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1]; // Evaluate function at physical points double values[1]; f.evaluate(values, y, c); // Map function values using appropriate mapping // Affine map: Do nothing // Note that we do not map the weights (yet). // Take directional components for(int k = 0; k < 1; k++) result += values[k]*D[i][0][k]; // Multiply by weights result *= W[i][0]; return result; } /// Evaluate linear functionals for all dofs on the function f virtual void evaluate_dofs(double* values, const ufc::function& f, const ufc::cell& c) const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Interpolate vertex values from dof values virtual void interpolate_vertex_values(double* vertex_values, const double* dof_values, const ufc::cell& c) const { // Evaluate at vertices and use affine mapping vertex_values[0] = dof_values[0]; vertex_values[1] = dof_values[1]; vertex_values[2] = dof_values[2]; } /// Return the number of sub elements (for a mixed element) virtual unsigned int num_sub_elements() const { return 1; } /// 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_Poisson2D_5LinearForm_finite_element_0(); } }; /// This class defines the interface for a finite element. class UFC_Poisson2D_5LinearForm_finite_element_1: public ufc::finite_element { public: /// Constructor UFC_Poisson2D_5LinearForm_finite_element_1() : ufc::finite_element() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5LinearForm_finite_element_1() { // Do nothing } /// Return a string identifying the finite element virtual const char* signature() const { return "Lagrange finite element of degree 5 on a triangle"; } /// 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 21; } /// 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; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Reset values *values = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Extract relevant coefficients const double coeff0_0 = coefficients0[dof][0]; const double coeff0_1 = coefficients0[dof][1]; const double coeff0_2 = coefficients0[dof][2]; const double coeff0_3 = coefficients0[dof][3]; const double coeff0_4 = coefficients0[dof][4]; const double coeff0_5 = coefficients0[dof][5]; const double coeff0_6 = coefficients0[dof][6]; const double coeff0_7 = coefficients0[dof][7]; const double coeff0_8 = coefficients0[dof][8]; const double coeff0_9 = coefficients0[dof][9]; const double coeff0_10 = coefficients0[dof][10]; const double coeff0_11 = coefficients0[dof][11]; const double coeff0_12 = coefficients0[dof][12]; const double coeff0_13 = coefficients0[dof][13]; const double coeff0_14 = coefficients0[dof][14]; const double coeff0_15 = coefficients0[dof][15]; const double coeff0_16 = coefficients0[dof][16]; const double coeff0_17 = coefficients0[dof][17]; const double coeff0_18 = coefficients0[dof][18]; const double coeff0_19 = coefficients0[dof][19]; const double coeff0_20 = coefficients0[dof][20]; // Compute value(s) *values = coeff0_0*basisvalue0 + coeff0_1*basisvalue1 + coeff0_2*basisvalue2 + coeff0_3*basisvalue3 + coeff0_4*basisvalue4 + coeff0_5*basisvalue5 + coeff0_6*basisvalue6 + coeff0_7*basisvalue7 + coeff0_8*basisvalue8 + coeff0_9*basisvalue9 + coeff0_10*basisvalue10 + coeff0_11*basisvalue11 + coeff0_12*basisvalue12 + coeff0_13*basisvalue13 + coeff0_14*basisvalue14 + coeff0_15*basisvalue15 + coeff0_16*basisvalue16 + coeff0_17*basisvalue17 + coeff0_18*basisvalue18 + coeff0_19*basisvalue19 + coeff0_20*basisvalue20; } /// Evaluate all basis functions at given point in cell virtual void evaluate_basis_all(double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis() is not yet implemented."); } /// Evaluate order n derivatives of basis function i at given point in cell virtual void evaluate_basis_derivatives(unsigned int i, unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { // Extract vertex coordinates const double * const * element_coordinates = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = element_coordinates[1][0] - element_coordinates[0][0]; const double J_01 = element_coordinates[2][0] - element_coordinates[0][0]; const double J_10 = element_coordinates[1][1] - element_coordinates[0][1]; const double J_11 = element_coordinates[2][1] - element_coordinates[0][1]; // Compute determinant of Jacobian const double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian // Get coordinates and map to the reference (UFC) element double x = (element_coordinates[0][1]*element_coordinates[2][0] -\ element_coordinates[0][0]*element_coordinates[2][1] +\ J_11*coordinates[0] - J_01*coordinates[1]) / detJ; double y = (element_coordinates[1][1]*element_coordinates[0][0] -\ element_coordinates[1][0]*element_coordinates[0][1] -\ J_10*coordinates[0] + J_00*coordinates[1]) / detJ; // Map coordinates to the reference square if (std::abs(y - 1.0) < 1e-14) x = -1.0; else x = 2.0 *x/(1.0 - y) - 1.0; y = 2.0*y - 1.0; // Compute number of derivatives unsigned int num_derivatives = 1; for (unsigned int j = 0; j < n; j++) num_derivatives *= 2; // Declare pointer to two dimensional array that holds combinations of derivatives and initialise unsigned int **combinations = new unsigned int *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { combinations[j] = new unsigned int [n]; for (unsigned int k = 0; k < n; k++) combinations[j][k] = 0; } // Generate combinations of derivatives for (unsigned int row = 1; row < num_derivatives; row++) { for (unsigned int num = 0; num < row; num++) { for (unsigned int col = n-1; col+1 > 0; col--) { if (combinations[row][col] + 1 > 1) combinations[row][col] = 0; else { combinations[row][col] += 1; break; } } } } // Compute inverse of Jacobian const double Jinv[2][2] = {{J_11 / detJ, -J_01 / detJ}, {-J_10 / detJ, J_00 / detJ}}; // Declare transformation matrix // Declare pointer to two dimensional array and initialise double **transform = new double *[num_derivatives]; for (unsigned int j = 0; j < num_derivatives; j++) { transform[j] = new double [num_derivatives]; for (unsigned int k = 0; k < num_derivatives; k++) transform[j][k] = 1; } // Construct transformation matrix for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { for (unsigned int k = 0; k < n; k++) transform[row][col] *= Jinv[combinations[col][k]][combinations[row][k]]; } } // Reset values for (unsigned int j = 0; j < 1*num_derivatives; j++) values[j] = 0; // Map degree of freedom to element degree of freedom const unsigned int dof = i; // Generate scalings const double scalings_y_0 = 1; const double scalings_y_1 = scalings_y_0*(0.5 - 0.5*y); const double scalings_y_2 = scalings_y_1*(0.5 - 0.5*y); const double scalings_y_3 = scalings_y_2*(0.5 - 0.5*y); const double scalings_y_4 = scalings_y_3*(0.5 - 0.5*y); const double scalings_y_5 = scalings_y_4*(0.5 - 0.5*y); // Compute psitilde_a const double psitilde_a_0 = 1; const double psitilde_a_1 = x; const double psitilde_a_2 = 1.5*x*psitilde_a_1 - 0.5*psitilde_a_0; const double psitilde_a_3 = 1.66666666666667*x*psitilde_a_2 - 0.666666666666667*psitilde_a_1; const double psitilde_a_4 = 1.75*x*psitilde_a_3 - 0.75*psitilde_a_2; const double psitilde_a_5 = 1.8*x*psitilde_a_4 - 0.8*psitilde_a_3; // Compute psitilde_bs const double psitilde_bs_0_0 = 1; const double psitilde_bs_0_1 = 1.5*y + 0.5; const double psitilde_bs_0_2 = 0.111111111111111*psitilde_bs_0_1 + 1.66666666666667*y*psitilde_bs_0_1 - 0.555555555555556*psitilde_bs_0_0; const double psitilde_bs_0_3 = 0.05*psitilde_bs_0_2 + 1.75*y*psitilde_bs_0_2 - 0.7*psitilde_bs_0_1; const double psitilde_bs_0_4 = 0.0285714285714286*psitilde_bs_0_3 + 1.8*y*psitilde_bs_0_3 - 0.771428571428571*psitilde_bs_0_2; const double psitilde_bs_0_5 = 0.0185185185185185*psitilde_bs_0_4 + 1.83333333333333*y*psitilde_bs_0_4 - 0.814814814814815*psitilde_bs_0_3; const double psitilde_bs_1_0 = 1; const double psitilde_bs_1_1 = 2.5*y + 1.5; const double psitilde_bs_1_2 = 0.54*psitilde_bs_1_1 + 2.1*y*psitilde_bs_1_1 - 0.56*psitilde_bs_1_0; const double psitilde_bs_1_3 = 0.285714285714286*psitilde_bs_1_2 + 2*y*psitilde_bs_1_2 - 0.714285714285714*psitilde_bs_1_1; const double psitilde_bs_1_4 = 0.178571428571429*psitilde_bs_1_3 + 1.96428571428571*y*psitilde_bs_1_3 - 0.785714285714286*psitilde_bs_1_2; const double psitilde_bs_2_0 = 1; const double psitilde_bs_2_1 = 3.5*y + 2.5; const double psitilde_bs_2_2 = 1.02040816326531*psitilde_bs_2_1 + 2.57142857142857*y*psitilde_bs_2_1 - 0.551020408163265*psitilde_bs_2_0; const double psitilde_bs_2_3 = 0.578703703703704*psitilde_bs_2_2 + 2.29166666666667*y*psitilde_bs_2_2 - 0.712962962962963*psitilde_bs_2_1; const double psitilde_bs_3_0 = 1; const double psitilde_bs_3_1 = 4.5*y + 3.5; const double psitilde_bs_3_2 = 1.51234567901235*psitilde_bs_3_1 + 3.05555555555556*y*psitilde_bs_3_1 - 0.54320987654321*psitilde_bs_3_0; const double psitilde_bs_4_0 = 1; const double psitilde_bs_4_1 = 5.5*y + 4.5; const double psitilde_bs_5_0 = 1; // Compute basisvalues const double basisvalue0 = 0.707106781186548*psitilde_a_0*scalings_y_0*psitilde_bs_0_0; const double basisvalue1 = 1.73205080756888*psitilde_a_1*scalings_y_1*psitilde_bs_1_0; const double basisvalue2 = psitilde_a_0*scalings_y_0*psitilde_bs_0_1; const double basisvalue3 = 2.73861278752583*psitilde_a_2*scalings_y_2*psitilde_bs_2_0; const double basisvalue4 = 2.12132034355964*psitilde_a_1*scalings_y_1*psitilde_bs_1_1; const double basisvalue5 = 1.22474487139159*psitilde_a_0*scalings_y_0*psitilde_bs_0_2; const double basisvalue6 = 3.74165738677394*psitilde_a_3*scalings_y_3*psitilde_bs_3_0; const double basisvalue7 = 3.16227766016838*psitilde_a_2*scalings_y_2*psitilde_bs_2_1; const double basisvalue8 = 2.44948974278318*psitilde_a_1*scalings_y_1*psitilde_bs_1_2; const double basisvalue9 = 1.4142135623731*psitilde_a_0*scalings_y_0*psitilde_bs_0_3; const double basisvalue10 = 4.74341649025257*psitilde_a_4*scalings_y_4*psitilde_bs_4_0; const double basisvalue11 = 4.18330013267038*psitilde_a_3*scalings_y_3*psitilde_bs_3_1; const double basisvalue12 = 3.53553390593274*psitilde_a_2*scalings_y_2*psitilde_bs_2_2; const double basisvalue13 = 2.73861278752583*psitilde_a_1*scalings_y_1*psitilde_bs_1_3; const double basisvalue14 = 1.58113883008419*psitilde_a_0*scalings_y_0*psitilde_bs_0_4; const double basisvalue15 = 5.74456264653803*psitilde_a_5*scalings_y_5*psitilde_bs_5_0; const double basisvalue16 = 5.19615242270663*psitilde_a_4*scalings_y_4*psitilde_bs_4_1; const double basisvalue17 = 4.58257569495584*psitilde_a_3*scalings_y_3*psitilde_bs_3_2; const double basisvalue18 = 3.87298334620742*psitilde_a_2*scalings_y_2*psitilde_bs_2_3; const double basisvalue19 = 3*psitilde_a_1*scalings_y_1*psitilde_bs_1_4; const double basisvalue20 = 1.73205080756888*psitilde_a_0*scalings_y_0*psitilde_bs_0_5; // Table(s) of coefficients const static double coefficients0[21][21] = \ {{0.0154328860973254, -0.00945067404923493, -0.0054563492063492, 0.0301875307266957, 0.0233831607535234, 0.013500274155551, -0.0231997605826757, -0.0196073763651313, -0.0151878084249949, -0.00876868528257127, 0.0213898651255978, 0.0188640878998484, 0.0159430641501296, 0.0123494443881937, 0.00712995504186593, -0.0179891757560038, -0.0162718217101153, -0.0143503978743156, -0.0121282998205249, -0.00939454064454066, -0.00542394057003842}, {0.0154328860973254, 0.00945067404923494, -0.00545634920634919, 0.0301875307266956, -0.0233831607535234, 0.013500274155551, 0.0231997605826757, -0.0196073763651313, 0.0151878084249949, -0.00876868528257128, 0.0213898651255978, -0.0188640878998484, 0.0159430641501296, -0.0123494443881937, 0.00712995504186593, 0.0179891757560038, -0.0162718217101153, 0.0143503978743156, -0.0121282998205249, 0.00939454064454065, -0.00542394057003842}, {0.0154328860973254, 0, 0.0109126984126984, 0, 0, 0.0405008224666531, 0, 0, 0, 0.0350747411302851, 0, 0, 0, 0, 0.0356497752093297, 0, 0, 0, 0, 0, 0.0325436434202306}, {0.0350747411302852, 0.126008987323133, -0.0843253968253968, 0.101882916202598, -0.0286443719230661, 0.00202504112333268, 0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838087, 0.0356497752093297, 0.0125760585998989, -0.0385290716961465, 0.0442521757243607, -0.0297081460077748, 0, 0.0325436434202305, -0.0516614323475361, 0.0582158391385194, -0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, -0.0329341671412733, 0.121527777777778, -0.0113203240225109, 0.0754106934301128, -0.0222754523566592, 0, 0.104572673947367, -0.101252056166633, 0.0584579018838085, 0, 0.0565922636995452, -0.00930012075424227, -0.0401356942616294, 0.0415914044108846, 0, 0, 0.0516614323475362, -0.101877718492409, 0.118371212121212, -0.0813591085505763}, {0.0350747411302852, 0.0887790592503889, -0.0892857142857142, 0.0301875307266957, 0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868418, 0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, -0.0308736109704842, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, -0.131523569023569, 0.108478811400768}, {0.0350747411302851, -0.010023442173431, 0.151289682539683, 0, 0.0502737956200753, 0.0931518916733021, 0, 0, 0.0506260280833164, 0.0643036920721893, 0, 0, 0, 0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, 0.0657617845117845, -0.0813591085505763}, {0.0350747411302849, -0.126008987323133, -0.0843253968253968, 0.101882916202598, 0.0286443719230662, 0.00202504112333261, -0.0773325352755857, -0.0261431684868418, 0, 0.00584579018838089, 0.0356497752093296, -0.012576058599899, -0.0385290716961465, -0.0442521757243607, -0.0297081460077747, 0, 0.0325436434202305, 0.051661432347536, 0.0582158391385194, 0.0526094276094276, 0.0325436434202305}, {0.0350747411302851, 0.0329341671412733, 0.121527777777778, -0.0113203240225109, -0.075410693430113, -0.0222754523566592, 0, 0.104572673947367, 0.101252056166633, 0.0584579018838084, 0, -0.0565922636995451, -0.00930012075424224, 0.0401356942616295, 0.0415914044108846, 0, 0, -0.0516614323475361, -0.101877718492409, -0.118371212121212, -0.0813591085505763}, {0.0350747411302851, -0.0887790592503889, -0.0892857142857142, 0.0301875307266957, -0.0432588473940183, -0.0594012062844245, 0, 0.0261431684868417, -0.101252056166633, -0.116915803767617, 0, 0, 0.0744009660339381, 0.0308736109704841, -0.0118832584031099, 0, 0, 0, 0.0679184789949393, 0.131523569023569, 0.108478811400768}, {0.0350747411302851, 0.010023442173431, 0.151289682539682, 0, -0.0502737956200753, 0.0931518916733021, 0, 0, -0.0506260280833164, 0.0643036920721893, 0, 0, 0, -0.0720384255977965, -0.0237665168062198, 0, 0, 0, 0, -0.0657617845117845, -0.0813591085505763}, {0.035074741130285, -0.136032429496564, -0.0669642857142857, 0.0369797251402022, 0.0789181675431415, 0.0600762199922021, -0.00773325352755857, -0.0457505448519731, -0.055688630891648, -0.0379976362244755, -0.0641695953767934, -0.012576058599899, 0.017271652829307, 0.0277862498734357, 0.0202015392852869, 0.0899458787800191, 0.0488154651303458, 0.0200905570240418, 0.00242565996410499, -0.00563672438672439, -0.00542394057003845}, {0.0350747411302852, 0.121713226391662, -0.0322420634920635, -0.0671672558668979, -0.0321518460360947, 0.0276755620188796, 0.139198563496054, 0.0653579212171044, -0.0101252056166633, -0.0292289509419042, 0.0427797302511956, -0.0565922636995451, -0.0332147169794366, 0.00926208329114533, 0.0202015392852868, -0.179891757560038, -0.0325436434202305, 0.0114803182994525, 0.00970263985641988, -0.00187890812890815, -0.0054239405700384}, {0.035074741130285, -0.121713226391662, -0.0322420634920635, -0.0671672558668978, 0.0321518460360947, 0.0276755620188796, -0.139198563496054, 0.0653579212171044, 0.0101252056166633, -0.0292289509419043, 0.0427797302511956, 0.0565922636995452, -0.0332147169794366, -0.00926208329114533, 0.0202015392852869, 0.179891757560038, -0.0325436434202305, -0.0114803182994525, 0.00970263985641991, 0.00187890812890816, -0.00542394057003844}, {0.0350747411302851, 0.136032429496564, -0.0669642857142857, 0.0369797251402022, -0.0789181675431415, 0.0600762199922021, 0.00773325352755856, -0.045750544851973, 0.055688630891648, -0.0379976362244755, -0.0641695953767934, 0.0125760585998989, 0.017271652829307, -0.0277862498734357, 0.0202015392852868, -0.0899458787800191, 0.0488154651303458, -0.0200905570240418, 0.00242565996410496, 0.00563672438672438, -0.00542394057003842}, {0.28059792904228, -0.214788046573521, -0.124007936507937, 0.090562592180087, 0.116915803767617, 0, 0.154665070551171, 0.0784295054605253, 0.101252056166633, 0.0818410626373319, -0.142599100837319, 0.0251521171997979, -0.0318861283002592, -0.107028518031012, -0.0950660672248791, 0, -0.130174573680922, -0.103322864695072, -0.0291079195692597, 0.0263047138047138, 0.0325436434202305}, {0.0350747411302851, 0, -0.124007936507936, -0.38489101676537, 0, 0.101252056166633, 0, -0.104572673947367, 0, 0.0467663215070467, 0.213898651255978, 0, 0.140830399992811, 0, -0.095066067224879, 0, 0.195261860521383, 0, -0.0582158391385193, 0, 0.0325436434202305}, {0.280597929042281, 0.214788046573522, -0.124007936507937, 0.090562592180087, -0.116915803767617, 0, -0.154665070551172, 0.0784295054605253, -0.101252056166633, 0.0818410626373319, -0.142599100837319, -0.0251521171997978, -0.0318861283002592, 0.107028518031012, -0.0950660672248792, 0, -0.130174573680922, 0.103322864695072, -0.0291079195692597, -0.0263047138047138, 0.0325436434202306}, {0.0350747411302851, -0.107394023286761, 0.0620039682539683, 0.0113203240225109, -0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070469, 0, 0.169776791098635, 0.00930012075424225, 0.126581804978985, 0.172307246845094, 0, 0, 0.154984297042608, 0.101877718492409, -0.0394570707070708, -0.0813591085505764}, {0.0350747411302849, 0.107394023286761, 0.0620039682539682, 0.0113203240225109, 0.306903984889995, -0.253130140416582, 0, -0.104572673947367, 0, 0.0467663215070468, 0, -0.169776791098635, 0.00930012075424227, -0.126581804978985, 0.172307246845093, 0, 0, -0.154984297042608, 0.101877718492409, 0.0394570707070707, -0.0813591085505763}, {0.280597929042281, 0, 0.248015873015873, -0.0603750614533914, 0, 0.13500274155551, 0, -0.0522863369736835, 0, -0.210448446781711, 0, 0, -0.148801932067876, 0, -0.142599100837319, 0, 0, 0, -0.135836957989879, 0, 0.108478811400768}}; // Interesting (new) part // Tables of derivatives of the polynomial base (transpose) const static double dmats0[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.89897948556636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 9.48683298050514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4, 0, 7.07106781186548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.29150262212917, 0, -2.99332590941916, 13.6626010212795, 0, 0.611010092660777, 0, -1.27277816408026e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 4.38178046004133, 0, 0, 12.5219806739988, 0, 0, 0, -1.21552073961695e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.46410161513776, 0, 7.83836717690617, 0, 0, 8.4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 10.9544511501033, 0, 0, -3.83325938999965, 0, 17.7482393492989, 0, 0.553283335172478, 0, 0, 0, 0, 0, 0, 1.30575944758963e-14, 0, 0, 0, 0, 0}, {4.73286382647968, 0, 3.3466401061363, 4.36435780471985, 0, -5.07468037933238, 0, 17.0084012854152, 0, 1.52127765851134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 2.44948974278318, 0, 0, 9.14285714285713, 0, 0, -1.45463708554178e-14, 14.8461497791618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {3.09838667696594, 0, 7.66811580507233, 0, 0, 10.733126291999, 0, 0, 0, 9.2951600308978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.41602560309065, 0, -4.37680963545757, 15.7321327225523, 0, 2.01017818278147, 0, -4.03686713879668, 0, -0.515811962199122, 21.799082549502, 0, 0.451335466924226, 0, 0.0576695305542381, 0, 0, 0, 0, 0, 0}, {0, 6.85714285714286, 0, 0, 9.97292252418866, 0, 4.32049379893858, 0, -7.27309832077592, -1.59872115546023e-14, 0, 21.2540192277445, 0, 1.49078803979367, 0, 0, 0, 0, 0, 0, 0}, {4.32049379893858, 0, 5.93552661441898, 1.79284291400158, 0, -0.320713490294932, 0, 9.20087412456475, 0, -5.96639619853425, 0, 0, 19.8022632451351, 0, 2.53024038425528, 0, 1.17859985414066e-14, 0, 0, 0, -1.33686464676153e-14}, {0, 1.53330375599988, 1.24344978758018e-14, 0, 6.33793245113119, 0, 0, 0, 13.5526185435788, 1.4210854715202e-14, 0, 0, 0, 16.6675169851115, 0, 0, 0, 0, 0, 1.68753899743024e-14, 0}, {2.82842712474619, 0, 7.31428571428572, 0, 0, 11.337638238025, 0, 0, 0, 12.9299525702683, 0, 0, 0, 0, 9.93858693195777, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; const static double dmats1[21][21] = \ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {4.24264068711928, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.58198889747161, 4.74341649025257, -0.912870929175276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 6.12372435695794, 3.53553390593274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-2.3094010767585, 0, 8.16496580927726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.64575131106459, 5.18459255872629, -1.49666295470958, 6.83130051063974, -1.05830052442584, 0.30550504633039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.23606797749979, 2.19089023002066, 2.52982212813469, 8.08290376865476, 6.26099033699941, -1.80739222823012, 0, -1.56672320349306e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.73205080756888, -5.09116882454314, 3.91918358845308, 0, 9.69948452238571, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {5.00000000000001, 0, -2.8284271247462, 0, 0, 12.1243556529821, 0, 0, 0, -2.08002018386999e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.14001690032506e-14}, {2.68328157299975, 5.47722557505167, -1.89736659610103, 7.42307488958091, -1.91662969499983, 0.663940002206986, 8.87411967464944, -1.07142857142858, 0.276641667586237, -0.0958314847499917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.36643191323985, 2.89827534923789, 1.67332005306815, 2.18217890235992, 5.74704893215391, -2.53734018966619, 10.0623058987491, 8.50420064270761, -2.19577516413421, 0.760638829255665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1.2247448713916, 3.53553390593273, -7.37711113563318, 4.57142857142857, 1.64957219768464, 0, 11.4997781699989, 7.42307488958091, -2.57142857142858, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1.54919333848296, 6.64078308635361, 3.83405790253618, 0, -6.19677335393188, 5.3665631459995, 0, 0, 13.4164078649988, 4.64758001544891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-3.57770876399967, 0, 8.85437744847148, 0, 0, -3.09838667696592, 0, 0, -1.115968317663e-14, 16.0996894379985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {2.70801280154532, 5.68564249775213, -2.18840481772878, 7.86606636127615, -2.61129805863299, 1.00508909139074, 9.55297122675765, -2.01843356939834, 0.670059394260489, -0.257905981099558, 10.899541274751, -1.06805465250648, 0.225667733462112, -0.0749149177264378, 0.0288347652771189, 0, 0, 0, 0, 0, 0}, {2.44948974278318, 3.42857142857144, 0.989743318610788, 3.04933917230523, 4.98646126209433, -2.72741187029097, 2.1602468994693, 8.34624849531682, -3.63654916038796, 1.5163507931515, 12.0498962651137, 10.6270096138723, -2.24536559755125, 0.745394019896833, -0.286902292026513, 0, 0, 0, 0, 0, 0}, {2.16024689946929, 1.81422947044429, 2.96776330720949, 0.896421457000793, 5.41604758366942, -0.160356745147465, -9.52579344415681, 4.60043706228237, 5.34522483824849, -2.98319809926713, 0, 13.3887736279041, 9.90113162256756, -3.28687867566959, 1.26512019212764, 0, 0, 0, 0, 0, 0}, {1.82574185835055, 0.76665187799994, 3.83609779052925, 8.6368042559214, 3.16896622556559, 3.65920700676626, 0, -8.74817765279707, 6.7763092717894, 0.521640530957295, 0, 0, 15.0623703313921, 8.33375849255573, -3.20766513935893, 0, 0, 0, 0, 1.07750480127221e-14, 0}, {1.4142135623731, -6.73025456655334, 3.65714285714287, 0, 9.4550278170087, 5.6688191190125, 0, 1.90406705745985e-14, -6.99854212223762, 6.46497628513416, 0, 0, 0, 17.2141375215909, 4.96929346597888, 0, 0, 0, 0, 1.47903916597301e-14, 0}, {5.71547606649408, 1.19544627798492e-14, -4.61880215351701, 0, 0, 12.7279220613579, 0, 0, 2.41311920846e-14, -3.2659863237109, 0, 0, 0, 0, 20.0831604418561, 0, 0, 0, 0, 0, 0}}; // Compute reference derivatives // Declare pointer to array of derivatives on FIAT element double *derivatives = new double [num_derivatives]; // Declare coefficients double coeff0_0 = 0; double coeff0_1 = 0; double coeff0_2 = 0; double coeff0_3 = 0; double coeff0_4 = 0; double coeff0_5 = 0; double coeff0_6 = 0; double coeff0_7 = 0; double coeff0_8 = 0; double coeff0_9 = 0; double coeff0_10 = 0; double coeff0_11 = 0; double coeff0_12 = 0; double coeff0_13 = 0; double coeff0_14 = 0; double coeff0_15 = 0; double coeff0_16 = 0; double coeff0_17 = 0; double coeff0_18 = 0; double coeff0_19 = 0; double coeff0_20 = 0; // Declare new coefficients double new_coeff0_0 = 0; double new_coeff0_1 = 0; double new_coeff0_2 = 0; double new_coeff0_3 = 0; double new_coeff0_4 = 0; double new_coeff0_5 = 0; double new_coeff0_6 = 0; double new_coeff0_7 = 0; double new_coeff0_8 = 0; double new_coeff0_9 = 0; double new_coeff0_10 = 0; double new_coeff0_11 = 0; double new_coeff0_12 = 0; double new_coeff0_13 = 0; double new_coeff0_14 = 0; double new_coeff0_15 = 0; double new_coeff0_16 = 0; double new_coeff0_17 = 0; double new_coeff0_18 = 0; double new_coeff0_19 = 0; double new_coeff0_20 = 0; // Loop possible derivatives for (unsigned int deriv_num = 0; deriv_num < num_derivatives; deriv_num++) { // Get values from coefficients array new_coeff0_0 = coefficients0[dof][0]; new_coeff0_1 = coefficients0[dof][1]; new_coeff0_2 = coefficients0[dof][2]; new_coeff0_3 = coefficients0[dof][3]; new_coeff0_4 = coefficients0[dof][4]; new_coeff0_5 = coefficients0[dof][5]; new_coeff0_6 = coefficients0[dof][6]; new_coeff0_7 = coefficients0[dof][7]; new_coeff0_8 = coefficients0[dof][8]; new_coeff0_9 = coefficients0[dof][9]; new_coeff0_10 = coefficients0[dof][10]; new_coeff0_11 = coefficients0[dof][11]; new_coeff0_12 = coefficients0[dof][12]; new_coeff0_13 = coefficients0[dof][13]; new_coeff0_14 = coefficients0[dof][14]; new_coeff0_15 = coefficients0[dof][15]; new_coeff0_16 = coefficients0[dof][16]; new_coeff0_17 = coefficients0[dof][17]; new_coeff0_18 = coefficients0[dof][18]; new_coeff0_19 = coefficients0[dof][19]; new_coeff0_20 = coefficients0[dof][20]; // Loop derivative order for (unsigned int j = 0; j < n; j++) { // Update old coefficients coeff0_0 = new_coeff0_0; coeff0_1 = new_coeff0_1; coeff0_2 = new_coeff0_2; coeff0_3 = new_coeff0_3; coeff0_4 = new_coeff0_4; coeff0_5 = new_coeff0_5; coeff0_6 = new_coeff0_6; coeff0_7 = new_coeff0_7; coeff0_8 = new_coeff0_8; coeff0_9 = new_coeff0_9; coeff0_10 = new_coeff0_10; coeff0_11 = new_coeff0_11; coeff0_12 = new_coeff0_12; coeff0_13 = new_coeff0_13; coeff0_14 = new_coeff0_14; coeff0_15 = new_coeff0_15; coeff0_16 = new_coeff0_16; coeff0_17 = new_coeff0_17; coeff0_18 = new_coeff0_18; coeff0_19 = new_coeff0_19; coeff0_20 = new_coeff0_20; if(combinations[deriv_num][j] == 0) { new_coeff0_0 = coeff0_0*dmats0[0][0] + coeff0_1*dmats0[1][0] + coeff0_2*dmats0[2][0] + coeff0_3*dmats0[3][0] + coeff0_4*dmats0[4][0] + coeff0_5*dmats0[5][0] + coeff0_6*dmats0[6][0] + coeff0_7*dmats0[7][0] + coeff0_8*dmats0[8][0] + coeff0_9*dmats0[9][0] + coeff0_10*dmats0[10][0] + coeff0_11*dmats0[11][0] + coeff0_12*dmats0[12][0] + coeff0_13*dmats0[13][0] + coeff0_14*dmats0[14][0] + coeff0_15*dmats0[15][0] + coeff0_16*dmats0[16][0] + coeff0_17*dmats0[17][0] + coeff0_18*dmats0[18][0] + coeff0_19*dmats0[19][0] + coeff0_20*dmats0[20][0]; new_coeff0_1 = coeff0_0*dmats0[0][1] + coeff0_1*dmats0[1][1] + coeff0_2*dmats0[2][1] + coeff0_3*dmats0[3][1] + coeff0_4*dmats0[4][1] + coeff0_5*dmats0[5][1] + coeff0_6*dmats0[6][1] + coeff0_7*dmats0[7][1] + coeff0_8*dmats0[8][1] + coeff0_9*dmats0[9][1] + coeff0_10*dmats0[10][1] + coeff0_11*dmats0[11][1] + coeff0_12*dmats0[12][1] + coeff0_13*dmats0[13][1] + coeff0_14*dmats0[14][1] + coeff0_15*dmats0[15][1] + coeff0_16*dmats0[16][1] + coeff0_17*dmats0[17][1] + coeff0_18*dmats0[18][1] + coeff0_19*dmats0[19][1] + coeff0_20*dmats0[20][1]; new_coeff0_2 = coeff0_0*dmats0[0][2] + coeff0_1*dmats0[1][2] + coeff0_2*dmats0[2][2] + coeff0_3*dmats0[3][2] + coeff0_4*dmats0[4][2] + coeff0_5*dmats0[5][2] + coeff0_6*dmats0[6][2] + coeff0_7*dmats0[7][2] + coeff0_8*dmats0[8][2] + coeff0_9*dmats0[9][2] + coeff0_10*dmats0[10][2] + coeff0_11*dmats0[11][2] + coeff0_12*dmats0[12][2] + coeff0_13*dmats0[13][2] + coeff0_14*dmats0[14][2] + coeff0_15*dmats0[15][2] + coeff0_16*dmats0[16][2] + coeff0_17*dmats0[17][2] + coeff0_18*dmats0[18][2] + coeff0_19*dmats0[19][2] + coeff0_20*dmats0[20][2]; new_coeff0_3 = coeff0_0*dmats0[0][3] + coeff0_1*dmats0[1][3] + coeff0_2*dmats0[2][3] + coeff0_3*dmats0[3][3] + coeff0_4*dmats0[4][3] + coeff0_5*dmats0[5][3] + coeff0_6*dmats0[6][3] + coeff0_7*dmats0[7][3] + coeff0_8*dmats0[8][3] + coeff0_9*dmats0[9][3] + coeff0_10*dmats0[10][3] + coeff0_11*dmats0[11][3] + coeff0_12*dmats0[12][3] + coeff0_13*dmats0[13][3] + coeff0_14*dmats0[14][3] + coeff0_15*dmats0[15][3] + coeff0_16*dmats0[16][3] + coeff0_17*dmats0[17][3] + coeff0_18*dmats0[18][3] + coeff0_19*dmats0[19][3] + coeff0_20*dmats0[20][3]; new_coeff0_4 = coeff0_0*dmats0[0][4] + coeff0_1*dmats0[1][4] + coeff0_2*dmats0[2][4] + coeff0_3*dmats0[3][4] + coeff0_4*dmats0[4][4] + coeff0_5*dmats0[5][4] + coeff0_6*dmats0[6][4] + coeff0_7*dmats0[7][4] + coeff0_8*dmats0[8][4] + coeff0_9*dmats0[9][4] + coeff0_10*dmats0[10][4] + coeff0_11*dmats0[11][4] + coeff0_12*dmats0[12][4] + coeff0_13*dmats0[13][4] + coeff0_14*dmats0[14][4] + coeff0_15*dmats0[15][4] + coeff0_16*dmats0[16][4] + coeff0_17*dmats0[17][4] + coeff0_18*dmats0[18][4] + coeff0_19*dmats0[19][4] + coeff0_20*dmats0[20][4]; new_coeff0_5 = coeff0_0*dmats0[0][5] + coeff0_1*dmats0[1][5] + coeff0_2*dmats0[2][5] + coeff0_3*dmats0[3][5] + coeff0_4*dmats0[4][5] + coeff0_5*dmats0[5][5] + coeff0_6*dmats0[6][5] + coeff0_7*dmats0[7][5] + coeff0_8*dmats0[8][5] + coeff0_9*dmats0[9][5] + coeff0_10*dmats0[10][5] + coeff0_11*dmats0[11][5] + coeff0_12*dmats0[12][5] + coeff0_13*dmats0[13][5] + coeff0_14*dmats0[14][5] + coeff0_15*dmats0[15][5] + coeff0_16*dmats0[16][5] + coeff0_17*dmats0[17][5] + coeff0_18*dmats0[18][5] + coeff0_19*dmats0[19][5] + coeff0_20*dmats0[20][5]; new_coeff0_6 = coeff0_0*dmats0[0][6] + coeff0_1*dmats0[1][6] + coeff0_2*dmats0[2][6] + coeff0_3*dmats0[3][6] + coeff0_4*dmats0[4][6] + coeff0_5*dmats0[5][6] + coeff0_6*dmats0[6][6] + coeff0_7*dmats0[7][6] + coeff0_8*dmats0[8][6] + coeff0_9*dmats0[9][6] + coeff0_10*dmats0[10][6] + coeff0_11*dmats0[11][6] + coeff0_12*dmats0[12][6] + coeff0_13*dmats0[13][6] + coeff0_14*dmats0[14][6] + coeff0_15*dmats0[15][6] + coeff0_16*dmats0[16][6] + coeff0_17*dmats0[17][6] + coeff0_18*dmats0[18][6] + coeff0_19*dmats0[19][6] + coeff0_20*dmats0[20][6]; new_coeff0_7 = coeff0_0*dmats0[0][7] + coeff0_1*dmats0[1][7] + coeff0_2*dmats0[2][7] + coeff0_3*dmats0[3][7] + coeff0_4*dmats0[4][7] + coeff0_5*dmats0[5][7] + coeff0_6*dmats0[6][7] + coeff0_7*dmats0[7][7] + coeff0_8*dmats0[8][7] + coeff0_9*dmats0[9][7] + coeff0_10*dmats0[10][7] + coeff0_11*dmats0[11][7] + coeff0_12*dmats0[12][7] + coeff0_13*dmats0[13][7] + coeff0_14*dmats0[14][7] + coeff0_15*dmats0[15][7] + coeff0_16*dmats0[16][7] + coeff0_17*dmats0[17][7] + coeff0_18*dmats0[18][7] + coeff0_19*dmats0[19][7] + coeff0_20*dmats0[20][7]; new_coeff0_8 = coeff0_0*dmats0[0][8] + coeff0_1*dmats0[1][8] + coeff0_2*dmats0[2][8] + coeff0_3*dmats0[3][8] + coeff0_4*dmats0[4][8] + coeff0_5*dmats0[5][8] + coeff0_6*dmats0[6][8] + coeff0_7*dmats0[7][8] + coeff0_8*dmats0[8][8] + coeff0_9*dmats0[9][8] + coeff0_10*dmats0[10][8] + coeff0_11*dmats0[11][8] + coeff0_12*dmats0[12][8] + coeff0_13*dmats0[13][8] + coeff0_14*dmats0[14][8] + coeff0_15*dmats0[15][8] + coeff0_16*dmats0[16][8] + coeff0_17*dmats0[17][8] + coeff0_18*dmats0[18][8] + coeff0_19*dmats0[19][8] + coeff0_20*dmats0[20][8]; new_coeff0_9 = coeff0_0*dmats0[0][9] + coeff0_1*dmats0[1][9] + coeff0_2*dmats0[2][9] + coeff0_3*dmats0[3][9] + coeff0_4*dmats0[4][9] + coeff0_5*dmats0[5][9] + coeff0_6*dmats0[6][9] + coeff0_7*dmats0[7][9] + coeff0_8*dmats0[8][9] + coeff0_9*dmats0[9][9] + coeff0_10*dmats0[10][9] + coeff0_11*dmats0[11][9] + coeff0_12*dmats0[12][9] + coeff0_13*dmats0[13][9] + coeff0_14*dmats0[14][9] + coeff0_15*dmats0[15][9] + coeff0_16*dmats0[16][9] + coeff0_17*dmats0[17][9] + coeff0_18*dmats0[18][9] + coeff0_19*dmats0[19][9] + coeff0_20*dmats0[20][9]; new_coeff0_10 = coeff0_0*dmats0[0][10] + coeff0_1*dmats0[1][10] + coeff0_2*dmats0[2][10] + coeff0_3*dmats0[3][10] + coeff0_4*dmats0[4][10] + coeff0_5*dmats0[5][10] + coeff0_6*dmats0[6][10] + coeff0_7*dmats0[7][10] + coeff0_8*dmats0[8][10] + coeff0_9*dmats0[9][10] + coeff0_10*dmats0[10][10] + coeff0_11*dmats0[11][10] + coeff0_12*dmats0[12][10] + coeff0_13*dmats0[13][10] + coeff0_14*dmats0[14][10] + coeff0_15*dmats0[15][10] + coeff0_16*dmats0[16][10] + coeff0_17*dmats0[17][10] + coeff0_18*dmats0[18][10] + coeff0_19*dmats0[19][10] + coeff0_20*dmats0[20][10]; new_coeff0_11 = coeff0_0*dmats0[0][11] + coeff0_1*dmats0[1][11] + coeff0_2*dmats0[2][11] + coeff0_3*dmats0[3][11] + coeff0_4*dmats0[4][11] + coeff0_5*dmats0[5][11] + coeff0_6*dmats0[6][11] + coeff0_7*dmats0[7][11] + coeff0_8*dmats0[8][11] + coeff0_9*dmats0[9][11] + coeff0_10*dmats0[10][11] + coeff0_11*dmats0[11][11] + coeff0_12*dmats0[12][11] + coeff0_13*dmats0[13][11] + coeff0_14*dmats0[14][11] + coeff0_15*dmats0[15][11] + coeff0_16*dmats0[16][11] + coeff0_17*dmats0[17][11] + coeff0_18*dmats0[18][11] + coeff0_19*dmats0[19][11] + coeff0_20*dmats0[20][11]; new_coeff0_12 = coeff0_0*dmats0[0][12] + coeff0_1*dmats0[1][12] + coeff0_2*dmats0[2][12] + coeff0_3*dmats0[3][12] + coeff0_4*dmats0[4][12] + coeff0_5*dmats0[5][12] + coeff0_6*dmats0[6][12] + coeff0_7*dmats0[7][12] + coeff0_8*dmats0[8][12] + coeff0_9*dmats0[9][12] + coeff0_10*dmats0[10][12] + coeff0_11*dmats0[11][12] + coeff0_12*dmats0[12][12] + coeff0_13*dmats0[13][12] + coeff0_14*dmats0[14][12] + coeff0_15*dmats0[15][12] + coeff0_16*dmats0[16][12] + coeff0_17*dmats0[17][12] + coeff0_18*dmats0[18][12] + coeff0_19*dmats0[19][12] + coeff0_20*dmats0[20][12]; new_coeff0_13 = coeff0_0*dmats0[0][13] + coeff0_1*dmats0[1][13] + coeff0_2*dmats0[2][13] + coeff0_3*dmats0[3][13] + coeff0_4*dmats0[4][13] + coeff0_5*dmats0[5][13] + coeff0_6*dmats0[6][13] + coeff0_7*dmats0[7][13] + coeff0_8*dmats0[8][13] + coeff0_9*dmats0[9][13] + coeff0_10*dmats0[10][13] + coeff0_11*dmats0[11][13] + coeff0_12*dmats0[12][13] + coeff0_13*dmats0[13][13] + coeff0_14*dmats0[14][13] + coeff0_15*dmats0[15][13] + coeff0_16*dmats0[16][13] + coeff0_17*dmats0[17][13] + coeff0_18*dmats0[18][13] + coeff0_19*dmats0[19][13] + coeff0_20*dmats0[20][13]; new_coeff0_14 = coeff0_0*dmats0[0][14] + coeff0_1*dmats0[1][14] + coeff0_2*dmats0[2][14] + coeff0_3*dmats0[3][14] + coeff0_4*dmats0[4][14] + coeff0_5*dmats0[5][14] + coeff0_6*dmats0[6][14] + coeff0_7*dmats0[7][14] + coeff0_8*dmats0[8][14] + coeff0_9*dmats0[9][14] + coeff0_10*dmats0[10][14] + coeff0_11*dmats0[11][14] + coeff0_12*dmats0[12][14] + coeff0_13*dmats0[13][14] + coeff0_14*dmats0[14][14] + coeff0_15*dmats0[15][14] + coeff0_16*dmats0[16][14] + coeff0_17*dmats0[17][14] + coeff0_18*dmats0[18][14] + coeff0_19*dmats0[19][14] + coeff0_20*dmats0[20][14]; new_coeff0_15 = coeff0_0*dmats0[0][15] + coeff0_1*dmats0[1][15] + coeff0_2*dmats0[2][15] + coeff0_3*dmats0[3][15] + coeff0_4*dmats0[4][15] + coeff0_5*dmats0[5][15] + coeff0_6*dmats0[6][15] + coeff0_7*dmats0[7][15] + coeff0_8*dmats0[8][15] + coeff0_9*dmats0[9][15] + coeff0_10*dmats0[10][15] + coeff0_11*dmats0[11][15] + coeff0_12*dmats0[12][15] + coeff0_13*dmats0[13][15] + coeff0_14*dmats0[14][15] + coeff0_15*dmats0[15][15] + coeff0_16*dmats0[16][15] + coeff0_17*dmats0[17][15] + coeff0_18*dmats0[18][15] + coeff0_19*dmats0[19][15] + coeff0_20*dmats0[20][15]; new_coeff0_16 = coeff0_0*dmats0[0][16] + coeff0_1*dmats0[1][16] + coeff0_2*dmats0[2][16] + coeff0_3*dmats0[3][16] + coeff0_4*dmats0[4][16] + coeff0_5*dmats0[5][16] + coeff0_6*dmats0[6][16] + coeff0_7*dmats0[7][16] + coeff0_8*dmats0[8][16] + coeff0_9*dmats0[9][16] + coeff0_10*dmats0[10][16] + coeff0_11*dmats0[11][16] + coeff0_12*dmats0[12][16] + coeff0_13*dmats0[13][16] + coeff0_14*dmats0[14][16] + coeff0_15*dmats0[15][16] + coeff0_16*dmats0[16][16] + coeff0_17*dmats0[17][16] + coeff0_18*dmats0[18][16] + coeff0_19*dmats0[19][16] + coeff0_20*dmats0[20][16]; new_coeff0_17 = coeff0_0*dmats0[0][17] + coeff0_1*dmats0[1][17] + coeff0_2*dmats0[2][17] + coeff0_3*dmats0[3][17] + coeff0_4*dmats0[4][17] + coeff0_5*dmats0[5][17] + coeff0_6*dmats0[6][17] + coeff0_7*dmats0[7][17] + coeff0_8*dmats0[8][17] + coeff0_9*dmats0[9][17] + coeff0_10*dmats0[10][17] + coeff0_11*dmats0[11][17] + coeff0_12*dmats0[12][17] + coeff0_13*dmats0[13][17] + coeff0_14*dmats0[14][17] + coeff0_15*dmats0[15][17] + coeff0_16*dmats0[16][17] + coeff0_17*dmats0[17][17] + coeff0_18*dmats0[18][17] + coeff0_19*dmats0[19][17] + coeff0_20*dmats0[20][17]; new_coeff0_18 = coeff0_0*dmats0[0][18] + coeff0_1*dmats0[1][18] + coeff0_2*dmats0[2][18] + coeff0_3*dmats0[3][18] + coeff0_4*dmats0[4][18] + coeff0_5*dmats0[5][18] + coeff0_6*dmats0[6][18] + coeff0_7*dmats0[7][18] + coeff0_8*dmats0[8][18] + coeff0_9*dmats0[9][18] + coeff0_10*dmats0[10][18] + coeff0_11*dmats0[11][18] + coeff0_12*dmats0[12][18] + coeff0_13*dmats0[13][18] + coeff0_14*dmats0[14][18] + coeff0_15*dmats0[15][18] + coeff0_16*dmats0[16][18] + coeff0_17*dmats0[17][18] + coeff0_18*dmats0[18][18] + coeff0_19*dmats0[19][18] + coeff0_20*dmats0[20][18]; new_coeff0_19 = coeff0_0*dmats0[0][19] + coeff0_1*dmats0[1][19] + coeff0_2*dmats0[2][19] + coeff0_3*dmats0[3][19] + coeff0_4*dmats0[4][19] + coeff0_5*dmats0[5][19] + coeff0_6*dmats0[6][19] + coeff0_7*dmats0[7][19] + coeff0_8*dmats0[8][19] + coeff0_9*dmats0[9][19] + coeff0_10*dmats0[10][19] + coeff0_11*dmats0[11][19] + coeff0_12*dmats0[12][19] + coeff0_13*dmats0[13][19] + coeff0_14*dmats0[14][19] + coeff0_15*dmats0[15][19] + coeff0_16*dmats0[16][19] + coeff0_17*dmats0[17][19] + coeff0_18*dmats0[18][19] + coeff0_19*dmats0[19][19] + coeff0_20*dmats0[20][19]; new_coeff0_20 = coeff0_0*dmats0[0][20] + coeff0_1*dmats0[1][20] + coeff0_2*dmats0[2][20] + coeff0_3*dmats0[3][20] + coeff0_4*dmats0[4][20] + coeff0_5*dmats0[5][20] + coeff0_6*dmats0[6][20] + coeff0_7*dmats0[7][20] + coeff0_8*dmats0[8][20] + coeff0_9*dmats0[9][20] + coeff0_10*dmats0[10][20] + coeff0_11*dmats0[11][20] + coeff0_12*dmats0[12][20] + coeff0_13*dmats0[13][20] + coeff0_14*dmats0[14][20] + coeff0_15*dmats0[15][20] + coeff0_16*dmats0[16][20] + coeff0_17*dmats0[17][20] + coeff0_18*dmats0[18][20] + coeff0_19*dmats0[19][20] + coeff0_20*dmats0[20][20]; } if(combinations[deriv_num][j] == 1) { new_coeff0_0 = coeff0_0*dmats1[0][0] + coeff0_1*dmats1[1][0] + coeff0_2*dmats1[2][0] + coeff0_3*dmats1[3][0] + coeff0_4*dmats1[4][0] + coeff0_5*dmats1[5][0] + coeff0_6*dmats1[6][0] + coeff0_7*dmats1[7][0] + coeff0_8*dmats1[8][0] + coeff0_9*dmats1[9][0] + coeff0_10*dmats1[10][0] + coeff0_11*dmats1[11][0] + coeff0_12*dmats1[12][0] + coeff0_13*dmats1[13][0] + coeff0_14*dmats1[14][0] + coeff0_15*dmats1[15][0] + coeff0_16*dmats1[16][0] + coeff0_17*dmats1[17][0] + coeff0_18*dmats1[18][0] + coeff0_19*dmats1[19][0] + coeff0_20*dmats1[20][0]; new_coeff0_1 = coeff0_0*dmats1[0][1] + coeff0_1*dmats1[1][1] + coeff0_2*dmats1[2][1] + coeff0_3*dmats1[3][1] + coeff0_4*dmats1[4][1] + coeff0_5*dmats1[5][1] + coeff0_6*dmats1[6][1] + coeff0_7*dmats1[7][1] + coeff0_8*dmats1[8][1] + coeff0_9*dmats1[9][1] + coeff0_10*dmats1[10][1] + coeff0_11*dmats1[11][1] + coeff0_12*dmats1[12][1] + coeff0_13*dmats1[13][1] + coeff0_14*dmats1[14][1] + coeff0_15*dmats1[15][1] + coeff0_16*dmats1[16][1] + coeff0_17*dmats1[17][1] + coeff0_18*dmats1[18][1] + coeff0_19*dmats1[19][1] + coeff0_20*dmats1[20][1]; new_coeff0_2 = coeff0_0*dmats1[0][2] + coeff0_1*dmats1[1][2] + coeff0_2*dmats1[2][2] + coeff0_3*dmats1[3][2] + coeff0_4*dmats1[4][2] + coeff0_5*dmats1[5][2] + coeff0_6*dmats1[6][2] + coeff0_7*dmats1[7][2] + coeff0_8*dmats1[8][2] + coeff0_9*dmats1[9][2] + coeff0_10*dmats1[10][2] + coeff0_11*dmats1[11][2] + coeff0_12*dmats1[12][2] + coeff0_13*dmats1[13][2] + coeff0_14*dmats1[14][2] + coeff0_15*dmats1[15][2] + coeff0_16*dmats1[16][2] + coeff0_17*dmats1[17][2] + coeff0_18*dmats1[18][2] + coeff0_19*dmats1[19][2] + coeff0_20*dmats1[20][2]; new_coeff0_3 = coeff0_0*dmats1[0][3] + coeff0_1*dmats1[1][3] + coeff0_2*dmats1[2][3] + coeff0_3*dmats1[3][3] + coeff0_4*dmats1[4][3] + coeff0_5*dmats1[5][3] + coeff0_6*dmats1[6][3] + coeff0_7*dmats1[7][3] + coeff0_8*dmats1[8][3] + coeff0_9*dmats1[9][3] + coeff0_10*dmats1[10][3] + coeff0_11*dmats1[11][3] + coeff0_12*dmats1[12][3] + coeff0_13*dmats1[13][3] + coeff0_14*dmats1[14][3] + coeff0_15*dmats1[15][3] + coeff0_16*dmats1[16][3] + coeff0_17*dmats1[17][3] + coeff0_18*dmats1[18][3] + coeff0_19*dmats1[19][3] + coeff0_20*dmats1[20][3]; new_coeff0_4 = coeff0_0*dmats1[0][4] + coeff0_1*dmats1[1][4] + coeff0_2*dmats1[2][4] + coeff0_3*dmats1[3][4] + coeff0_4*dmats1[4][4] + coeff0_5*dmats1[5][4] + coeff0_6*dmats1[6][4] + coeff0_7*dmats1[7][4] + coeff0_8*dmats1[8][4] + coeff0_9*dmats1[9][4] + coeff0_10*dmats1[10][4] + coeff0_11*dmats1[11][4] + coeff0_12*dmats1[12][4] + coeff0_13*dmats1[13][4] + coeff0_14*dmats1[14][4] + coeff0_15*dmats1[15][4] + coeff0_16*dmats1[16][4] + coeff0_17*dmats1[17][4] + coeff0_18*dmats1[18][4] + coeff0_19*dmats1[19][4] + coeff0_20*dmats1[20][4]; new_coeff0_5 = coeff0_0*dmats1[0][5] + coeff0_1*dmats1[1][5] + coeff0_2*dmats1[2][5] + coeff0_3*dmats1[3][5] + coeff0_4*dmats1[4][5] + coeff0_5*dmats1[5][5] + coeff0_6*dmats1[6][5] + coeff0_7*dmats1[7][5] + coeff0_8*dmats1[8][5] + coeff0_9*dmats1[9][5] + coeff0_10*dmats1[10][5] + coeff0_11*dmats1[11][5] + coeff0_12*dmats1[12][5] + coeff0_13*dmats1[13][5] + coeff0_14*dmats1[14][5] + coeff0_15*dmats1[15][5] + coeff0_16*dmats1[16][5] + coeff0_17*dmats1[17][5] + coeff0_18*dmats1[18][5] + coeff0_19*dmats1[19][5] + coeff0_20*dmats1[20][5]; new_coeff0_6 = coeff0_0*dmats1[0][6] + coeff0_1*dmats1[1][6] + coeff0_2*dmats1[2][6] + coeff0_3*dmats1[3][6] + coeff0_4*dmats1[4][6] + coeff0_5*dmats1[5][6] + coeff0_6*dmats1[6][6] + coeff0_7*dmats1[7][6] + coeff0_8*dmats1[8][6] + coeff0_9*dmats1[9][6] + coeff0_10*dmats1[10][6] + coeff0_11*dmats1[11][6] + coeff0_12*dmats1[12][6] + coeff0_13*dmats1[13][6] + coeff0_14*dmats1[14][6] + coeff0_15*dmats1[15][6] + coeff0_16*dmats1[16][6] + coeff0_17*dmats1[17][6] + coeff0_18*dmats1[18][6] + coeff0_19*dmats1[19][6] + coeff0_20*dmats1[20][6]; new_coeff0_7 = coeff0_0*dmats1[0][7] + coeff0_1*dmats1[1][7] + coeff0_2*dmats1[2][7] + coeff0_3*dmats1[3][7] + coeff0_4*dmats1[4][7] + coeff0_5*dmats1[5][7] + coeff0_6*dmats1[6][7] + coeff0_7*dmats1[7][7] + coeff0_8*dmats1[8][7] + coeff0_9*dmats1[9][7] + coeff0_10*dmats1[10][7] + coeff0_11*dmats1[11][7] + coeff0_12*dmats1[12][7] + coeff0_13*dmats1[13][7] + coeff0_14*dmats1[14][7] + coeff0_15*dmats1[15][7] + coeff0_16*dmats1[16][7] + coeff0_17*dmats1[17][7] + coeff0_18*dmats1[18][7] + coeff0_19*dmats1[19][7] + coeff0_20*dmats1[20][7]; new_coeff0_8 = coeff0_0*dmats1[0][8] + coeff0_1*dmats1[1][8] + coeff0_2*dmats1[2][8] + coeff0_3*dmats1[3][8] + coeff0_4*dmats1[4][8] + coeff0_5*dmats1[5][8] + coeff0_6*dmats1[6][8] + coeff0_7*dmats1[7][8] + coeff0_8*dmats1[8][8] + coeff0_9*dmats1[9][8] + coeff0_10*dmats1[10][8] + coeff0_11*dmats1[11][8] + coeff0_12*dmats1[12][8] + coeff0_13*dmats1[13][8] + coeff0_14*dmats1[14][8] + coeff0_15*dmats1[15][8] + coeff0_16*dmats1[16][8] + coeff0_17*dmats1[17][8] + coeff0_18*dmats1[18][8] + coeff0_19*dmats1[19][8] + coeff0_20*dmats1[20][8]; new_coeff0_9 = coeff0_0*dmats1[0][9] + coeff0_1*dmats1[1][9] + coeff0_2*dmats1[2][9] + coeff0_3*dmats1[3][9] + coeff0_4*dmats1[4][9] + coeff0_5*dmats1[5][9] + coeff0_6*dmats1[6][9] + coeff0_7*dmats1[7][9] + coeff0_8*dmats1[8][9] + coeff0_9*dmats1[9][9] + coeff0_10*dmats1[10][9] + coeff0_11*dmats1[11][9] + coeff0_12*dmats1[12][9] + coeff0_13*dmats1[13][9] + coeff0_14*dmats1[14][9] + coeff0_15*dmats1[15][9] + coeff0_16*dmats1[16][9] + coeff0_17*dmats1[17][9] + coeff0_18*dmats1[18][9] + coeff0_19*dmats1[19][9] + coeff0_20*dmats1[20][9]; new_coeff0_10 = coeff0_0*dmats1[0][10] + coeff0_1*dmats1[1][10] + coeff0_2*dmats1[2][10] + coeff0_3*dmats1[3][10] + coeff0_4*dmats1[4][10] + coeff0_5*dmats1[5][10] + coeff0_6*dmats1[6][10] + coeff0_7*dmats1[7][10] + coeff0_8*dmats1[8][10] + coeff0_9*dmats1[9][10] + coeff0_10*dmats1[10][10] + coeff0_11*dmats1[11][10] + coeff0_12*dmats1[12][10] + coeff0_13*dmats1[13][10] + coeff0_14*dmats1[14][10] + coeff0_15*dmats1[15][10] + coeff0_16*dmats1[16][10] + coeff0_17*dmats1[17][10] + coeff0_18*dmats1[18][10] + coeff0_19*dmats1[19][10] + coeff0_20*dmats1[20][10]; new_coeff0_11 = coeff0_0*dmats1[0][11] + coeff0_1*dmats1[1][11] + coeff0_2*dmats1[2][11] + coeff0_3*dmats1[3][11] + coeff0_4*dmats1[4][11] + coeff0_5*dmats1[5][11] + coeff0_6*dmats1[6][11] + coeff0_7*dmats1[7][11] + coeff0_8*dmats1[8][11] + coeff0_9*dmats1[9][11] + coeff0_10*dmats1[10][11] + coeff0_11*dmats1[11][11] + coeff0_12*dmats1[12][11] + coeff0_13*dmats1[13][11] + coeff0_14*dmats1[14][11] + coeff0_15*dmats1[15][11] + coeff0_16*dmats1[16][11] + coeff0_17*dmats1[17][11] + coeff0_18*dmats1[18][11] + coeff0_19*dmats1[19][11] + coeff0_20*dmats1[20][11]; new_coeff0_12 = coeff0_0*dmats1[0][12] + coeff0_1*dmats1[1][12] + coeff0_2*dmats1[2][12] + coeff0_3*dmats1[3][12] + coeff0_4*dmats1[4][12] + coeff0_5*dmats1[5][12] + coeff0_6*dmats1[6][12] + coeff0_7*dmats1[7][12] + coeff0_8*dmats1[8][12] + coeff0_9*dmats1[9][12] + coeff0_10*dmats1[10][12] + coeff0_11*dmats1[11][12] + coeff0_12*dmats1[12][12] + coeff0_13*dmats1[13][12] + coeff0_14*dmats1[14][12] + coeff0_15*dmats1[15][12] + coeff0_16*dmats1[16][12] + coeff0_17*dmats1[17][12] + coeff0_18*dmats1[18][12] + coeff0_19*dmats1[19][12] + coeff0_20*dmats1[20][12]; new_coeff0_13 = coeff0_0*dmats1[0][13] + coeff0_1*dmats1[1][13] + coeff0_2*dmats1[2][13] + coeff0_3*dmats1[3][13] + coeff0_4*dmats1[4][13] + coeff0_5*dmats1[5][13] + coeff0_6*dmats1[6][13] + coeff0_7*dmats1[7][13] + coeff0_8*dmats1[8][13] + coeff0_9*dmats1[9][13] + coeff0_10*dmats1[10][13] + coeff0_11*dmats1[11][13] + coeff0_12*dmats1[12][13] + coeff0_13*dmats1[13][13] + coeff0_14*dmats1[14][13] + coeff0_15*dmats1[15][13] + coeff0_16*dmats1[16][13] + coeff0_17*dmats1[17][13] + coeff0_18*dmats1[18][13] + coeff0_19*dmats1[19][13] + coeff0_20*dmats1[20][13]; new_coeff0_14 = coeff0_0*dmats1[0][14] + coeff0_1*dmats1[1][14] + coeff0_2*dmats1[2][14] + coeff0_3*dmats1[3][14] + coeff0_4*dmats1[4][14] + coeff0_5*dmats1[5][14] + coeff0_6*dmats1[6][14] + coeff0_7*dmats1[7][14] + coeff0_8*dmats1[8][14] + coeff0_9*dmats1[9][14] + coeff0_10*dmats1[10][14] + coeff0_11*dmats1[11][14] + coeff0_12*dmats1[12][14] + coeff0_13*dmats1[13][14] + coeff0_14*dmats1[14][14] + coeff0_15*dmats1[15][14] + coeff0_16*dmats1[16][14] + coeff0_17*dmats1[17][14] + coeff0_18*dmats1[18][14] + coeff0_19*dmats1[19][14] + coeff0_20*dmats1[20][14]; new_coeff0_15 = coeff0_0*dmats1[0][15] + coeff0_1*dmats1[1][15] + coeff0_2*dmats1[2][15] + coeff0_3*dmats1[3][15] + coeff0_4*dmats1[4][15] + coeff0_5*dmats1[5][15] + coeff0_6*dmats1[6][15] + coeff0_7*dmats1[7][15] + coeff0_8*dmats1[8][15] + coeff0_9*dmats1[9][15] + coeff0_10*dmats1[10][15] + coeff0_11*dmats1[11][15] + coeff0_12*dmats1[12][15] + coeff0_13*dmats1[13][15] + coeff0_14*dmats1[14][15] + coeff0_15*dmats1[15][15] + coeff0_16*dmats1[16][15] + coeff0_17*dmats1[17][15] + coeff0_18*dmats1[18][15] + coeff0_19*dmats1[19][15] + coeff0_20*dmats1[20][15]; new_coeff0_16 = coeff0_0*dmats1[0][16] + coeff0_1*dmats1[1][16] + coeff0_2*dmats1[2][16] + coeff0_3*dmats1[3][16] + coeff0_4*dmats1[4][16] + coeff0_5*dmats1[5][16] + coeff0_6*dmats1[6][16] + coeff0_7*dmats1[7][16] + coeff0_8*dmats1[8][16] + coeff0_9*dmats1[9][16] + coeff0_10*dmats1[10][16] + coeff0_11*dmats1[11][16] + coeff0_12*dmats1[12][16] + coeff0_13*dmats1[13][16] + coeff0_14*dmats1[14][16] + coeff0_15*dmats1[15][16] + coeff0_16*dmats1[16][16] + coeff0_17*dmats1[17][16] + coeff0_18*dmats1[18][16] + coeff0_19*dmats1[19][16] + coeff0_20*dmats1[20][16]; new_coeff0_17 = coeff0_0*dmats1[0][17] + coeff0_1*dmats1[1][17] + coeff0_2*dmats1[2][17] + coeff0_3*dmats1[3][17] + coeff0_4*dmats1[4][17] + coeff0_5*dmats1[5][17] + coeff0_6*dmats1[6][17] + coeff0_7*dmats1[7][17] + coeff0_8*dmats1[8][17] + coeff0_9*dmats1[9][17] + coeff0_10*dmats1[10][17] + coeff0_11*dmats1[11][17] + coeff0_12*dmats1[12][17] + coeff0_13*dmats1[13][17] + coeff0_14*dmats1[14][17] + coeff0_15*dmats1[15][17] + coeff0_16*dmats1[16][17] + coeff0_17*dmats1[17][17] + coeff0_18*dmats1[18][17] + coeff0_19*dmats1[19][17] + coeff0_20*dmats1[20][17]; new_coeff0_18 = coeff0_0*dmats1[0][18] + coeff0_1*dmats1[1][18] + coeff0_2*dmats1[2][18] + coeff0_3*dmats1[3][18] + coeff0_4*dmats1[4][18] + coeff0_5*dmats1[5][18] + coeff0_6*dmats1[6][18] + coeff0_7*dmats1[7][18] + coeff0_8*dmats1[8][18] + coeff0_9*dmats1[9][18] + coeff0_10*dmats1[10][18] + coeff0_11*dmats1[11][18] + coeff0_12*dmats1[12][18] + coeff0_13*dmats1[13][18] + coeff0_14*dmats1[14][18] + coeff0_15*dmats1[15][18] + coeff0_16*dmats1[16][18] + coeff0_17*dmats1[17][18] + coeff0_18*dmats1[18][18] + coeff0_19*dmats1[19][18] + coeff0_20*dmats1[20][18]; new_coeff0_19 = coeff0_0*dmats1[0][19] + coeff0_1*dmats1[1][19] + coeff0_2*dmats1[2][19] + coeff0_3*dmats1[3][19] + coeff0_4*dmats1[4][19] + coeff0_5*dmats1[5][19] + coeff0_6*dmats1[6][19] + coeff0_7*dmats1[7][19] + coeff0_8*dmats1[8][19] + coeff0_9*dmats1[9][19] + coeff0_10*dmats1[10][19] + coeff0_11*dmats1[11][19] + coeff0_12*dmats1[12][19] + coeff0_13*dmats1[13][19] + coeff0_14*dmats1[14][19] + coeff0_15*dmats1[15][19] + coeff0_16*dmats1[16][19] + coeff0_17*dmats1[17][19] + coeff0_18*dmats1[18][19] + coeff0_19*dmats1[19][19] + coeff0_20*dmats1[20][19]; new_coeff0_20 = coeff0_0*dmats1[0][20] + coeff0_1*dmats1[1][20] + coeff0_2*dmats1[2][20] + coeff0_3*dmats1[3][20] + coeff0_4*dmats1[4][20] + coeff0_5*dmats1[5][20] + coeff0_6*dmats1[6][20] + coeff0_7*dmats1[7][20] + coeff0_8*dmats1[8][20] + coeff0_9*dmats1[9][20] + coeff0_10*dmats1[10][20] + coeff0_11*dmats1[11][20] + coeff0_12*dmats1[12][20] + coeff0_13*dmats1[13][20] + coeff0_14*dmats1[14][20] + coeff0_15*dmats1[15][20] + coeff0_16*dmats1[16][20] + coeff0_17*dmats1[17][20] + coeff0_18*dmats1[18][20] + coeff0_19*dmats1[19][20] + coeff0_20*dmats1[20][20]; } } // Compute derivatives on reference element as dot product of coefficients and basisvalues derivatives[deriv_num] = new_coeff0_0*basisvalue0 + new_coeff0_1*basisvalue1 + new_coeff0_2*basisvalue2 + new_coeff0_3*basisvalue3 + new_coeff0_4*basisvalue4 + new_coeff0_5*basisvalue5 + new_coeff0_6*basisvalue6 + new_coeff0_7*basisvalue7 + new_coeff0_8*basisvalue8 + new_coeff0_9*basisvalue9 + new_coeff0_10*basisvalue10 + new_coeff0_11*basisvalue11 + new_coeff0_12*basisvalue12 + new_coeff0_13*basisvalue13 + new_coeff0_14*basisvalue14 + new_coeff0_15*basisvalue15 + new_coeff0_16*basisvalue16 + new_coeff0_17*basisvalue17 + new_coeff0_18*basisvalue18 + new_coeff0_19*basisvalue19 + new_coeff0_20*basisvalue20; } // Transform derivatives back to physical element for (unsigned int row = 0; row < num_derivatives; row++) { for (unsigned int col = 0; col < num_derivatives; col++) { values[row] += transform[row][col]*derivatives[col]; } } // Delete pointer to array of derivatives on FIAT element delete [] derivatives; // Delete pointer to array of combinations of derivatives and transform for (unsigned int row = 0; row < num_derivatives; row++) { delete [] combinations[row]; delete [] transform[row]; } delete [] combinations; delete [] transform; } /// Evaluate order n derivatives of all basis functions at given point in cell virtual void evaluate_basis_derivatives_all(unsigned int n, double* values, const double* coordinates, const ufc::cell& c) const { throw std::runtime_error("The vectorised version of evaluate_basis_derivatives() is not yet implemented."); } /// Evaluate linear functional for dof i on the function f virtual double evaluate_dof(unsigned int i, const ufc::function& f, const ufc::cell& c) const { // The reference points, direction and weights: const static double X[21][1][2] = {{{0, 0}}, {{1, 0}}, {{0, 1}}, {{0.8, 0.2}}, {{0.6, 0.4}}, {{0.4, 0.6}}, {{0.2, 0.8}}, {{0, 0.2}}, {{0, 0.4}}, {{0, 0.6}}, {{0, 0.8}}, {{0.2, 0}}, {{0.4, 0}}, {{0.6, 0}}, {{0.8, 0}}, {{0.2, 0.2}}, {{0.4, 0.2}}, {{0.6, 0.2}}, {{0.2, 0.4}}, {{0.4, 0.4}}, {{0.2, 0.6}}}; const static double W[21][1] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}; const static double D[21][1][1] = {{{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}, {{1}}}; const double * const * x = c.coordinates; double result = 0.0; // Iterate over the points: // Evaluate basis functions for affine mapping const double w0 = 1.0 - X[i][0][0] - X[i][0][1]; const double w1 = X[i][0][0]; const double w2 = X[i][0][1]; // Compute affine mapping y = F(X) double y[2]; y[0] = w0*x[0][0] + w1*x[1][0] + w2*x[2][0]; y[1] = w0*x[0][1] + w1*x[1][1] + w2*x[2][1]; // Evaluate function at physical points double values[1]; f.evaluate(values, y, c); // Map function values using appropriate mapping // Affine map: Do nothing // Note that we do not map the weights (yet). // Take directional components for(int k = 0; k < 1; k++) result += values[k]*D[i][0][k]; // Multiply by weights result *= W[i][0]; return result; } /// Evaluate linear functionals for all dofs on the function f virtual void evaluate_dofs(double* values, const ufc::function& f, const ufc::cell& c) const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Interpolate vertex values from dof values virtual void interpolate_vertex_values(double* vertex_values, const double* dof_values, const ufc::cell& c) const { // Evaluate at vertices and use affine mapping vertex_values[0] = dof_values[0]; vertex_values[1] = dof_values[1]; vertex_values[2] = dof_values[2]; } /// Return the number of sub elements (for a mixed element) virtual unsigned int num_sub_elements() const { return 1; } /// 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_Poisson2D_5LinearForm_finite_element_1(); } }; /// This class defines the interface for a local-to-global mapping of /// degrees of freedom (dofs). class UFC_Poisson2D_5LinearForm_dof_map_0: public ufc::dof_map { private: unsigned int __global_dimension; public: /// Constructor UFC_Poisson2D_5LinearForm_dof_map_0() : ufc::dof_map() { __global_dimension = 0; } /// Destructor virtual ~UFC_Poisson2D_5LinearForm_dof_map_0() { // Do nothing } /// Return a string identifying the dof map virtual const char* signature() const { return "FFC dof map for Lagrange finite element of degree 5 on a triangle"; } /// Return true iff mesh entities of topological dimension d are needed virtual bool needs_mesh_entities(unsigned int d) const { switch ( d ) { case 0: return true; break; case 1: return true; break; case 2: return true; break; } return false; } /// Initialize dof map for mesh (return true iff init_cell() is needed) virtual bool init_mesh(const ufc::mesh& m) { __global_dimension = m.num_entities[0] + 4*m.num_entities[1] + 6*m.num_entities[2]; return false; } /// Initialize dof map for given cell virtual void init_cell(const ufc::mesh& m, const ufc::cell& c) { // Do nothing } /// Finish initialization of dof map for cells virtual void init_cell_finalize() { // Do nothing } /// Return the dimension of the global finite element function space virtual unsigned int global_dimension() const { return __global_dimension; } /// Return the dimension of the local finite element function space virtual unsigned int local_dimension() const { return 21; } // Return the geometric dimension of the coordinates this dof map provides virtual unsigned int geometric_dimension() const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Return the number of dofs on each cell facet virtual unsigned int num_facet_dofs() const { return 6; } /// 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]; unsigned int offset = m.num_entities[0]; dofs[3] = offset + 4*c.entity_indices[1][0]; dofs[4] = offset + 4*c.entity_indices[1][0] + 1; dofs[5] = offset + 4*c.entity_indices[1][0] + 2; dofs[6] = offset + 4*c.entity_indices[1][0] + 3; dofs[7] = offset + 4*c.entity_indices[1][1]; dofs[8] = offset + 4*c.entity_indices[1][1] + 1; dofs[9] = offset + 4*c.entity_indices[1][1] + 2; dofs[10] = offset + 4*c.entity_indices[1][1] + 3; dofs[11] = offset + 4*c.entity_indices[1][2]; dofs[12] = offset + 4*c.entity_indices[1][2] + 1; dofs[13] = offset + 4*c.entity_indices[1][2] + 2; dofs[14] = offset + 4*c.entity_indices[1][2] + 3; offset = offset + 4*m.num_entities[1]; dofs[15] = offset + 6*c.entity_indices[2][0]; dofs[16] = offset + 6*c.entity_indices[2][0] + 1; dofs[17] = offset + 6*c.entity_indices[2][0] + 2; dofs[18] = offset + 6*c.entity_indices[2][0] + 3; dofs[19] = offset + 6*c.entity_indices[2][0] + 4; dofs[20] = offset + 6*c.entity_indices[2][0] + 5; } /// Tabulate the local-to-local mapping from facet dofs to cell dofs virtual void tabulate_facet_dofs(unsigned int* dofs, unsigned int facet) const { switch ( facet ) { case 0: dofs[0] = 1; dofs[1] = 2; dofs[2] = 3; dofs[3] = 4; dofs[4] = 5; dofs[5] = 6; break; case 1: dofs[0] = 0; dofs[1] = 2; dofs[2] = 7; dofs[3] = 8; dofs[4] = 9; dofs[5] = 10; break; case 2: dofs[0] = 0; dofs[1] = 1; dofs[2] = 11; dofs[3] = 12; dofs[4] = 13; dofs[5] = 14; 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]; coordinates[3][0] = 0.8*x[1][0] + 0.2*x[2][0]; coordinates[3][1] = 0.8*x[1][1] + 0.2*x[2][1]; coordinates[4][0] = 0.6*x[1][0] + 0.4*x[2][0]; coordinates[4][1] = 0.6*x[1][1] + 0.4*x[2][1]; coordinates[5][0] = 0.4*x[1][0] + 0.6*x[2][0]; coordinates[5][1] = 0.4*x[1][1] + 0.6*x[2][1]; coordinates[6][0] = 0.2*x[1][0] + 0.8*x[2][0]; coordinates[6][1] = 0.2*x[1][1] + 0.8*x[2][1]; coordinates[7][0] = 0.8*x[0][0] + 0.2*x[2][0]; coordinates[7][1] = 0.8*x[0][1] + 0.2*x[2][1]; coordinates[8][0] = 0.6*x[0][0] + 0.4*x[2][0]; coordinates[8][1] = 0.6*x[0][1] + 0.4*x[2][1]; coordinates[9][0] = 0.4*x[0][0] + 0.6*x[2][0]; coordinates[9][1] = 0.4*x[0][1] + 0.6*x[2][1]; coordinates[10][0] = 0.2*x[0][0] + 0.8*x[2][0]; coordinates[10][1] = 0.2*x[0][1] + 0.8*x[2][1]; coordinates[11][0] = 0.8*x[0][0] + 0.2*x[1][0]; coordinates[11][1] = 0.8*x[0][1] + 0.2*x[1][1]; coordinates[12][0] = 0.6*x[0][0] + 0.4*x[1][0]; coordinates[12][1] = 0.6*x[0][1] + 0.4*x[1][1]; coordinates[13][0] = 0.4*x[0][0] + 0.6*x[1][0]; coordinates[13][1] = 0.4*x[0][1] + 0.6*x[1][1]; coordinates[14][0] = 0.2*x[0][0] + 0.8*x[1][0]; coordinates[14][1] = 0.2*x[0][1] + 0.8*x[1][1]; coordinates[15][0] = 0.6*x[0][0] + 0.2*x[1][0] + 0.2*x[2][0]; coordinates[15][1] = 0.6*x[0][1] + 0.2*x[1][1] + 0.2*x[2][1]; coordinates[16][0] = 0.4*x[0][0] + 0.4*x[1][0] + 0.2*x[2][0]; coordinates[16][1] = 0.4*x[0][1] + 0.4*x[1][1] + 0.2*x[2][1]; coordinates[17][0] = 0.2*x[0][0] + 0.6*x[1][0] + 0.2*x[2][0]; coordinates[17][1] = 0.2*x[0][1] + 0.6*x[1][1] + 0.2*x[2][1]; coordinates[18][0] = 0.4*x[0][0] + 0.2*x[1][0] + 0.4*x[2][0]; coordinates[18][1] = 0.4*x[0][1] + 0.2*x[1][1] + 0.4*x[2][1]; coordinates[19][0] = 0.2*x[0][0] + 0.4*x[1][0] + 0.4*x[2][0]; coordinates[19][1] = 0.2*x[0][1] + 0.4*x[1][1] + 0.4*x[2][1]; coordinates[20][0] = 0.2*x[0][0] + 0.2*x[1][0] + 0.6*x[2][0]; coordinates[20][1] = 0.2*x[0][1] + 0.2*x[1][1] + 0.6*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_Poisson2D_5LinearForm_dof_map_0(); } }; /// This class defines the interface for a local-to-global mapping of /// degrees of freedom (dofs). class UFC_Poisson2D_5LinearForm_dof_map_1: public ufc::dof_map { private: unsigned int __global_dimension; public: /// Constructor UFC_Poisson2D_5LinearForm_dof_map_1() : ufc::dof_map() { __global_dimension = 0; } /// Destructor virtual ~UFC_Poisson2D_5LinearForm_dof_map_1() { // Do nothing } /// Return a string identifying the dof map virtual const char* signature() const { return "FFC dof map for Lagrange finite element of degree 5 on a triangle"; } /// Return true iff mesh entities of topological dimension d are needed virtual bool needs_mesh_entities(unsigned int d) const { switch ( d ) { case 0: return true; break; case 1: return true; break; case 2: return true; break; } return false; } /// Initialize dof map for mesh (return true iff init_cell() is needed) virtual bool init_mesh(const ufc::mesh& m) { __global_dimension = m.num_entities[0] + 4*m.num_entities[1] + 6*m.num_entities[2]; return false; } /// Initialize dof map for given cell virtual void init_cell(const ufc::mesh& m, const ufc::cell& c) { // Do nothing } /// Finish initialization of dof map for cells virtual void init_cell_finalize() { // Do nothing } /// Return the dimension of the global finite element function space virtual unsigned int global_dimension() const { return __global_dimension; } /// Return the dimension of the local finite element function space virtual unsigned int local_dimension() const { return 21; } // Return the geometric dimension of the coordinates this dof map provides virtual unsigned int geometric_dimension() const { throw std::runtime_error("Not implemented (introduced in UFC v1.1)."); } /// Return the number of dofs on each cell facet virtual unsigned int num_facet_dofs() const { return 6; } /// 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]; unsigned int offset = m.num_entities[0]; dofs[3] = offset + 4*c.entity_indices[1][0]; dofs[4] = offset + 4*c.entity_indices[1][0] + 1; dofs[5] = offset + 4*c.entity_indices[1][0] + 2; dofs[6] = offset + 4*c.entity_indices[1][0] + 3; dofs[7] = offset + 4*c.entity_indices[1][1]; dofs[8] = offset + 4*c.entity_indices[1][1] + 1; dofs[9] = offset + 4*c.entity_indices[1][1] + 2; dofs[10] = offset + 4*c.entity_indices[1][1] + 3; dofs[11] = offset + 4*c.entity_indices[1][2]; dofs[12] = offset + 4*c.entity_indices[1][2] + 1; dofs[13] = offset + 4*c.entity_indices[1][2] + 2; dofs[14] = offset + 4*c.entity_indices[1][2] + 3; offset = offset + 4*m.num_entities[1]; dofs[15] = offset + 6*c.entity_indices[2][0]; dofs[16] = offset + 6*c.entity_indices[2][0] + 1; dofs[17] = offset + 6*c.entity_indices[2][0] + 2; dofs[18] = offset + 6*c.entity_indices[2][0] + 3; dofs[19] = offset + 6*c.entity_indices[2][0] + 4; dofs[20] = offset + 6*c.entity_indices[2][0] + 5; } /// Tabulate the local-to-local mapping from facet dofs to cell dofs virtual void tabulate_facet_dofs(unsigned int* dofs, unsigned int facet) const { switch ( facet ) { case 0: dofs[0] = 1; dofs[1] = 2; dofs[2] = 3; dofs[3] = 4; dofs[4] = 5; dofs[5] = 6; break; case 1: dofs[0] = 0; dofs[1] = 2; dofs[2] = 7; dofs[3] = 8; dofs[4] = 9; dofs[5] = 10; break; case 2: dofs[0] = 0; dofs[1] = 1; dofs[2] = 11; dofs[3] = 12; dofs[4] = 13; dofs[5] = 14; 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]; coordinates[3][0] = 0.8*x[1][0] + 0.2*x[2][0]; coordinates[3][1] = 0.8*x[1][1] + 0.2*x[2][1]; coordinates[4][0] = 0.6*x[1][0] + 0.4*x[2][0]; coordinates[4][1] = 0.6*x[1][1] + 0.4*x[2][1]; coordinates[5][0] = 0.4*x[1][0] + 0.6*x[2][0]; coordinates[5][1] = 0.4*x[1][1] + 0.6*x[2][1]; coordinates[6][0] = 0.2*x[1][0] + 0.8*x[2][0]; coordinates[6][1] = 0.2*x[1][1] + 0.8*x[2][1]; coordinates[7][0] = 0.8*x[0][0] + 0.2*x[2][0]; coordinates[7][1] = 0.8*x[0][1] + 0.2*x[2][1]; coordinates[8][0] = 0.6*x[0][0] + 0.4*x[2][0]; coordinates[8][1] = 0.6*x[0][1] + 0.4*x[2][1]; coordinates[9][0] = 0.4*x[0][0] + 0.6*x[2][0]; coordinates[9][1] = 0.4*x[0][1] + 0.6*x[2][1]; coordinates[10][0] = 0.2*x[0][0] + 0.8*x[2][0]; coordinates[10][1] = 0.2*x[0][1] + 0.8*x[2][1]; coordinates[11][0] = 0.8*x[0][0] + 0.2*x[1][0]; coordinates[11][1] = 0.8*x[0][1] + 0.2*x[1][1]; coordinates[12][0] = 0.6*x[0][0] + 0.4*x[1][0]; coordinates[12][1] = 0.6*x[0][1] + 0.4*x[1][1]; coordinates[13][0] = 0.4*x[0][0] + 0.6*x[1][0]; coordinates[13][1] = 0.4*x[0][1] + 0.6*x[1][1]; coordinates[14][0] = 0.2*x[0][0] + 0.8*x[1][0]; coordinates[14][1] = 0.2*x[0][1] + 0.8*x[1][1]; coordinates[15][0] = 0.6*x[0][0] + 0.2*x[1][0] + 0.2*x[2][0]; coordinates[15][1] = 0.6*x[0][1] + 0.2*x[1][1] + 0.2*x[2][1]; coordinates[16][0] = 0.4*x[0][0] + 0.4*x[1][0] + 0.2*x[2][0]; coordinates[16][1] = 0.4*x[0][1] + 0.4*x[1][1] + 0.2*x[2][1]; coordinates[17][0] = 0.2*x[0][0] + 0.6*x[1][0] + 0.2*x[2][0]; coordinates[17][1] = 0.2*x[0][1] + 0.6*x[1][1] + 0.2*x[2][1]; coordinates[18][0] = 0.4*x[0][0] + 0.2*x[1][0] + 0.4*x[2][0]; coordinates[18][1] = 0.4*x[0][1] + 0.2*x[1][1] + 0.4*x[2][1]; coordinates[19][0] = 0.2*x[0][0] + 0.4*x[1][0] + 0.4*x[2][0]; coordinates[19][1] = 0.2*x[0][1] + 0.4*x[1][1] + 0.4*x[2][1]; coordinates[20][0] = 0.2*x[0][0] + 0.2*x[1][0] + 0.6*x[2][0]; coordinates[20][1] = 0.2*x[0][1] + 0.2*x[1][1] + 0.6*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_Poisson2D_5LinearForm_dof_map_1(); } }; /// This class defines the interface for the tabulation of the cell /// tensor corresponding to the local contribution to a form from /// the integral over a cell. class UFC_Poisson2D_5LinearForm_cell_integral_0: public ufc::cell_integral { public: /// Constructor UFC_Poisson2D_5LinearForm_cell_integral_0() : ufc::cell_integral() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5LinearForm_cell_integral_0() { // Do nothing } /// Tabulate the tensor for the contribution from a local cell virtual void tabulate_tensor(double* A, const double * const * w, const ufc::cell& c) const { // Extract vertex coordinates const double * const * x = c.coordinates; // Compute Jacobian of affine map from reference cell const double J_00 = x[1][0] - x[0][0]; const double J_01 = x[2][0] - x[0][0]; const double J_10 = x[1][1] - x[0][1]; const double J_11 = x[2][1] - x[0][1]; // Compute determinant of Jacobian double detJ = J_00*J_11 - J_01*J_10; // Compute inverse of Jacobian // Set scale factor const double det = std::abs(detJ); // Compute coefficients const double c0_0_0_0 = w[0][0]; const double c0_0_0_1 = w[0][1]; const double c0_0_0_2 = w[0][2]; const double c0_0_0_3 = w[0][3]; const double c0_0_0_4 = w[0][4]; const double c0_0_0_5 = w[0][5]; const double c0_0_0_6 = w[0][6]; const double c0_0_0_7 = w[0][7]; const double c0_0_0_8 = w[0][8]; const double c0_0_0_9 = w[0][9]; const double c0_0_0_10 = w[0][10]; const double c0_0_0_11 = w[0][11]; const double c0_0_0_12 = w[0][12]; const double c0_0_0_13 = w[0][13]; const double c0_0_0_14 = w[0][14]; const double c0_0_0_15 = w[0][15]; const double c0_0_0_16 = w[0][16]; const double c0_0_0_17 = w[0][17]; const double c0_0_0_18 = w[0][18]; const double c0_0_0_19 = w[0][19]; const double c0_0_0_20 = w[0][20]; // Compute geometry tensors const double G0_0 = det*c0_0_0_0; const double G0_1 = det*c0_0_0_1; const double G0_2 = det*c0_0_0_2; const double G0_3 = det*c0_0_0_3; const double G0_4 = det*c0_0_0_4; const double G0_5 = det*c0_0_0_5; const double G0_6 = det*c0_0_0_6; const double G0_7 = det*c0_0_0_7; const double G0_8 = det*c0_0_0_8; const double G0_9 = det*c0_0_0_9; const double G0_10 = det*c0_0_0_10; const double G0_11 = det*c0_0_0_11; const double G0_12 = det*c0_0_0_12; const double G0_13 = det*c0_0_0_13; const double G0_14 = det*c0_0_0_14; const double G0_15 = det*c0_0_0_15; const double G0_16 = det*c0_0_0_16; const double G0_17 = det*c0_0_0_17; const double G0_18 = det*c0_0_0_18; const double G0_19 = det*c0_0_0_19; const double G0_20 = det*c0_0_0_20; // Compute element tensor A[0] = 0.00138945256132761*G0_0 + 0.000123877456776766*G0_1 + 0.000123877456776767*G0_2 + 0.000363647010782442*G0_3 + 0.000207201813104597*G0_4 + 0.000207201813104599*G0_5 + 0.00036364701078244*G0_6 + 0.00118136348605102*G0_7 - 0.000958243145743178*G0_8 + 0.000462681126743642*G0_9 - 2.29644326866544e-05*G0_10 + 0.00118136348605103*G0_11 - 0.000958243145743176*G0_12 + 0.000462681126743641*G0_13 - 2.29644326866532e-05*G0_14 + 0.000892481361231391*G0_15 - 0.000974683591871127*G0_16 + 0.000879433388113977*G0_17 - 0.000974683591871126*G0_18 + 0.000649789061247414*G0_19 + 0.000879433388113974*G0_20; A[1] = 0.000123877456776766*G0_0 + 0.00138945256132761*G0_1 + 0.000123877456776767*G0_2 + 0.00118136348605102*G0_3 - 0.000958243145743179*G0_4 + 0.000462681126743643*G0_5 - 2.29644326866554e-05*G0_6 + 0.000363647010782438*G0_7 + 0.000207201813104597*G0_8 + 0.000207201813104597*G0_9 + 0.00036364701078244*G0_10 - 2.2964432686657e-05*G0_11 + 0.000462681126743647*G0_12 - 0.000958243145743184*G0_13 + 0.00118136348605103*G0_14 + 0.000879433388113969*G0_15 - 0.000974683591871122*G0_16 + 0.000892481361231389*G0_17 + 0.000649789061247415*G0_18 - 0.000974683591871127*G0_19 + 0.000879433388113975*G0_20; A[2] = 0.000123877456776767*G0_0 + 0.000123877456776767*G0_1 + 0.00138945256132761*G0_2 - 2.29644326866535e-05*G0_3 + 0.000462681126743639*G0_4 - 0.000958243145743174*G0_5 + 0.00118136348605102*G0_6 - 2.29644326866556e-05*G0_7 + 0.000462681126743641*G0_8 - 0.000958243145743177*G0_9 + 0.00118136348605102*G0_10 + 0.00036364701078244*G0_11 + 0.000207201813104599*G0_12 + 0.000207201813104597*G0_13 + 0.000363647010782441*G0_14 + 0.000879433388113973*G0_15 + 0.000649789061247418*G0_16 + 0.000879433388113975*G0_17 - 0.000974683591871128*G0_18 - 0.000974683591871127*G0_19 + 0.000892481361231392*G0_20; A[3] = 0.000363647010782442*G0_0 + 0.00118136348605102*G0_1 - 2.29644326866535e-05*G0_2 + 0.0147050657033301*G0_3 - 0.00958373625474353*G0_4 + 0.00770482812583534*G0_5 - 0.00396984582097443*G0_6 - 0.000411011153198668*G0_7 - 0.0014483250160334*G0_8 - 4.56679059109646e-05*G0_9 - 0.00248237688558877*G0_10 - 0.00248237688558878*G0_11 + 0.00576068013134007*G0_12 - 0.00735253285166507*G0_13 + 0.00735253285166507*G0_14 + 0.000782878387045095*G0_15 - 0.00381653213684478*G0_16 + 0.0102426588971732*G0_17 - 0.0013700371773289*G0_18 + 9.78597983806311e-05*G0_19 - 0.00280531422024487*G0_20; A[4] = 0.000207201813104597*G0_0 - 0.000958243145743179*G0_1 + 0.000462681126743639*G0_2 - 0.00958373625474353*G0_3 + 0.0220771705146713*G0_4 - 0.0134785562302928*G0_5 + 0.00770482812583533*G0_6 - 0.0014483250160334*G0_7 + 0.00281836219336229*G0_8 - 0.00135698920421147*G0_9 + 0.00576068013134005*G0_10 - 4.56679059109601e-05*G0_11 - 0.00135698920421148*G0_12 + 0.00294884192453649*G0_13 - 0.00735253285166506*G0_14 + 0.00313151354818031*G0_15 - 0.00548014870931556*G0_16 - 0.00143527704291599*G0_17 - 0.000587158790283797*G0_18 + 0.00528442911255428*G0_19 + 0.00508870951579303*G0_20; A[5] = 0.000207201813104599*G0_0 + 0.000462681126743643*G0_1 - 0.000958243145743174*G0_2 + 0.00770482812583534*G0_3 - 0.0134785562302928*G0_4 + 0.0220771705146713*G0_5 - 0.00958373625474352*G0_6 - 4.56679059109656e-05*G0_7 - 0.00135698920421147*G0_8 + 0.00294884192453646*G0_9 - 0.00735253285166504*G0_10 - 0.0014483250160334*G0_11 + 0.0028183621933623*G0_12 - 0.00135698920421149*G0_13 + 0.00576068013134006*G0_14 + 0.00313151354818033*G0_15 - 0.000587158790283817*G0_16 + 0.00508870951579304*G0_17 - 0.00548014870931556*G0_18 + 0.0052844291125543*G0_19 - 0.00143527704291598*G0_20; A[6] = 0.00036364701078244*G0_0 - 2.29644326866554e-05*G0_1 + 0.00118136348605102*G0_2 - 0.00396984582097443*G0_3 + 0.00770482812583533*G0_4 - 0.00958373625474352*G0_5 + 0.0147050657033301*G0_6 - 0.00248237688558878*G0_7 + 0.00576068013134005*G0_8 - 0.00735253285166504*G0_9 + 0.00735253285166504*G0_10 - 0.000411011153198666*G0_11 - 0.0014483250160334*G0_12 - 4.56679059109584e-05*G0_13 - 0.00248237688558878*G0_14 + 0.000782878387045071*G0_15 - 0.00137003717732889*G0_16 - 0.00280531422024488*G0_17 - 0.00381653213684478*G0_18 + 9.78597983806304e-05*G0_19 + 0.0102426588971732*G0_20; A[7] = 0.00118136348605102*G0_0 + 0.000363647010782438*G0_1 - 2.29644326866556e-05*G0_2 - 0.000411011153198668*G0_3 - 0.0014483250160334*G0_4 - 4.56679059109656e-05*G0_5 - 0.00248237688558878*G0_6 + 0.0147050657033301*G0_7 - 0.00958373625474352*G0_8 + 0.00770482812583533*G0_9 - 0.00396984582097443*G0_10 + 0.00735253285166504*G0_11 - 0.00735253285166504*G0_12 + 0.00576068013134004*G0_13 - 0.00248237688558877*G0_14 + 0.0102426588971731*G0_15 - 0.00381653213684477*G0_16 + 0.000782878387045065*G0_17 + 9.78597983806279e-05*G0_18 - 0.00137003717732888*G0_19 - 0.00280531422024489*G0_20; A[8] = -0.000958243145743178*G0_0 + 0.000207201813104597*G0_1 + 0.00046268112674364*G0_2 - 0.0014483250160334*G0_3 + 0.00281836219336229*G0_4 - 0.00135698920421147*G0_5 + 0.00576068013134005*G0_6 - 0.00958373625474352*G0_7 + 0.0220771705146713*G0_8 - 0.0134785562302928*G0_9 + 0.00770482812583533*G0_10 - 0.00735253285166505*G0_11 + 0.00294884192453647*G0_12 - 0.00135698920421147*G0_13 - 4.56679059109608e-05*G0_14 - 0.001435277042916*G0_15 - 0.00548014870931556*G0_16 + 0.00313151354818031*G0_17 + 0.0052844291125543*G0_18 - 0.000587158790283813*G0_19 + 0.00508870951579302*G0_20; A[9] = 0.000462681126743642*G0_0 + 0.000207201813104597*G0_1 - 0.000958243145743177*G0_2 - 4.56679059109647e-05*G0_3 - 0.00135698920421147*G0_4 + 0.00294884192453646*G0_5 - 0.00735253285166504*G0_6 + 0.00770482812583533*G0_7 - 0.0134785562302928*G0_8 + 0.0220771705146713*G0_9 - 0.00958373625474352*G0_10 + 0.00576068013134005*G0_11 - 0.00135698920421147*G0_12 + 0.00281836219336229*G0_13 - 0.0014483250160334*G0_14 + 0.00508870951579303*G0_15 - 0.000587158790283804*G0_16 + 0.00313151354818032*G0_17 + 0.00528442911255428*G0_18 - 0.00548014870931556*G0_19 - 0.00143527704291598*G0_20; A[10] = -2.29644326866545e-05*G0_0 + 0.00036364701078244*G0_1 + 0.00118136348605102*G0_2 - 0.00248237688558877*G0_3 + 0.00576068013134005*G0_4 - 0.00735253285166504*G0_5 + 0.00735253285166504*G0_6 - 0.00396984582097443*G0_7 + 0.00770482812583533*G0_8 - 0.00958373625474352*G0_9 + 0.0147050657033301*G0_10 - 0.00248237688558878*G0_11 - 4.56679059109649e-05*G0_12 - 0.0014483250160334*G0_13 - 0.000411011153198667*G0_14 - 0.00280531422024488*G0_15 - 0.00137003717732889*G0_16 + 0.000782878387045078*G0_17 + 9.78597983806346e-05*G0_18 - 0.00381653213684477*G0_19 + 0.0102426588971732*G0_20; A[11] = 0.00118136348605103*G0_0 - 2.2964432686657e-05*G0_1 + 0.00036364701078244*G0_2 - 0.00248237688558878*G0_3 - 4.56679059109602e-05*G0_4 - 0.0014483250160334*G0_5 - 0.000411011153198666*G0_6 + 0.00735253285166504*G0_7 - 0.00735253285166505*G0_8 + 0.00576068013134005*G0_9 - 0.00248237688558878*G0_10 + 0.0147050657033301*G0_11 - 0.00958373625474353*G0_12 + 0.00770482812583534*G0_13 - 0.00396984582097443*G0_14 + 0.0102426588971731*G0_15 + 9.78597983806439e-05*G0_16 - 0.0028053142202449*G0_17 - 0.00381653213684478*G0_18 - 0.00137003717732888*G0_19 + 0.000782878387045073*G0_20; A[12] = -0.000958243145743176*G0_0 + 0.000462681126743647*G0_1 + 0.000207201813104599*G0_2 + 0.00576068013134007*G0_3 - 0.00135698920421148*G0_4 + 0.0028183621933623*G0_5 - 0.0014483250160334*G0_6 - 0.00735253285166504*G0_7 + 0.00294884192453647*G0_8 - 0.00135698920421147*G0_9 - 4.56679059109647e-05*G0_10 - 0.00958373625474353*G0_11 + 0.0220771705146713*G0_12 - 0.0134785562302928*G0_13 + 0.00770482812583536*G0_14 - 0.00143527704291596*G0_15 + 0.00528442911255429*G0_16 + 0.00508870951579307*G0_17 - 0.00548014870931557*G0_18 - 0.000587158790283827*G0_19 + 0.00313151354818033*G0_20; A[13] = 0.000462681126743641*G0_0 - 0.000958243145743184*G0_1 + 0.000207201813104597*G0_2 - 0.00735253285166507*G0_3 + 0.00294884192453649*G0_4 - 0.00135698920421148*G0_5 - 4.56679059109583e-05*G0_6 + 0.00576068013134004*G0_7 - 0.00135698920421147*G0_8 + 0.00281836219336229*G0_9 - 0.0014483250160334*G0_10 + 0.00770482812583534*G0_11 - 0.0134785562302928*G0_12 + 0.0220771705146713*G0_13 - 0.00958373625474356*G0_14 + 0.00508870951579301*G0_15 + 0.0052844291125543*G0_16 - 0.00143527704291603*G0_17 - 0.000587158790283812*G0_18 - 0.00548014870931556*G0_19 + 0.00313151354818031*G0_20; A[14] = -2.29644326866532e-05*G0_0 + 0.00118136348605103*G0_1 + 0.000363647010782442*G0_2 + 0.00735253285166507*G0_3 - 0.00735253285166506*G0_4 + 0.00576068013134006*G0_5 - 0.00248237688558878*G0_6 - 0.00248237688558877*G0_7 - 4.56679059109609e-05*G0_8 - 0.0014483250160334*G0_9 - 0.000411011153198667*G0_10 - 0.00396984582097443*G0_11 + 0.00770482812583536*G0_12 - 0.00958373625474356*G0_13 + 0.0147050657033301*G0_14 - 0.00280531422024486*G0_15 + 9.78597983806169e-05*G0_16 + 0.0102426588971732*G0_17 - 0.00137003717732889*G0_18 - 0.00381653213684478*G0_19 + 0.000782878387045085*G0_20; A[15] = 0.000892481361231391*G0_0 + 0.000879433388113969*G0_1 + 0.000879433388113973*G0_2 + 0.000782878387045095*G0_3 + 0.00313151354818031*G0_4 + 0.00313151354818033*G0_5 + 0.000782878387045071*G0_6 + 0.0102426588971731*G0_7 - 0.001435277042916*G0_8 + 0.00508870951579303*G0_9 - 0.00280531422024488*G0_10 + 0.0102426588971731*G0_11 - 0.00143527704291596*G0_12 + 0.00508870951579301*G0_13 - 0.00280531422024486*G0_14 + 0.0704590548340572*G0_15 - 0.0156575677409016*G0_16 + 0.0117431758056762*G0_17 - 0.0156575677409016*G0_18 + 0.00391439193522538*G0_19 + 0.0117431758056762*G0_20; A[16] = -0.000974683591871127*G0_0 - 0.000974683591871122*G0_1 + 0.000649789061247418*G0_2 - 0.00381653213684478*G0_3 - 0.00548014870931556*G0_4 - 0.000587158790283817*G0_5 - 0.00137003717732889*G0_6 - 0.00381653213684477*G0_7 - 0.00548014870931556*G0_8 - 0.000587158790283805*G0_9 - 0.00137003717732889*G0_10 + 9.78597983806429e-05*G0_11 + 0.00528442911255429*G0_12 + 0.0052844291125543*G0_13 + 9.78597983806166e-05*G0_14 - 0.0156575677409016*G0_15 + 0.0763306427368954*G0_16 - 0.0156575677409016*G0_17 - 0.0117431758056762*G0_18 - 0.0117431758056762*G0_19 + 0.00391439193522542*G0_20; A[17] = 0.000879433388113977*G0_0 + 0.000892481361231389*G0_1 + 0.000879433388113974*G0_2 + 0.0102426588971732*G0_3 - 0.00143527704291599*G0_4 + 0.00508870951579304*G0_5 - 0.00280531422024488*G0_6 + 0.000782878387045065*G0_7 + 0.00313151354818032*G0_8 + 0.00313151354818032*G0_9 + 0.000782878387045078*G0_10 - 0.0028053142202449*G0_11 + 0.00508870951579307*G0_12 - 0.00143527704291603*G0_13 + 0.0102426588971732*G0_14 + 0.0117431758056762*G0_15 - 0.0156575677409016*G0_16 + 0.0704590548340573*G0_17 + 0.00391439193522541*G0_18 - 0.0156575677409016*G0_19 + 0.0117431758056762*G0_20; A[18] = -0.000974683591871126*G0_0 + 0.000649789061247415*G0_1 - 0.000974683591871128*G0_2 - 0.0013700371773289*G0_3 - 0.000587158790283798*G0_4 - 0.00548014870931556*G0_5 - 0.00381653213684478*G0_6 + 9.78597983806274e-05*G0_7 + 0.0052844291125543*G0_8 + 0.00528442911255428*G0_9 + 9.78597983806347e-05*G0_10 - 0.00381653213684478*G0_11 - 0.00548014870931557*G0_12 - 0.000587158790283812*G0_13 - 0.00137003717732889*G0_14 - 0.0156575677409016*G0_15 - 0.0117431758056762*G0_16 + 0.00391439193522541*G0_17 + 0.0763306427368954*G0_18 - 0.0117431758056762*G0_19 - 0.0156575677409016*G0_20; A[19] = 0.000649789061247414*G0_0 - 0.000974683591871126*G0_1 - 0.000974683591871128*G0_2 + 9.78597983806311e-05*G0_3 + 0.00528442911255428*G0_4 + 0.0052844291125543*G0_5 + 9.78597983806309e-05*G0_6 - 0.00137003717732888*G0_7 - 0.000587158790283813*G0_8 - 0.00548014870931556*G0_9 - 0.00381653213684477*G0_10 - 0.00137003717732888*G0_11 - 0.000587158790283827*G0_12 - 0.00548014870931555*G0_13 - 0.00381653213684478*G0_14 + 0.00391439193522538*G0_15 - 0.0117431758056762*G0_16 - 0.0156575677409016*G0_17 - 0.0117431758056762*G0_18 + 0.0763306427368954*G0_19 - 0.0156575677409017*G0_20; A[20] = 0.000879433388113974*G0_0 + 0.000879433388113975*G0_1 + 0.000892481361231392*G0_2 - 0.00280531422024487*G0_3 + 0.00508870951579303*G0_4 - 0.00143527704291598*G0_5 + 0.0102426588971732*G0_6 - 0.00280531422024489*G0_7 + 0.00508870951579303*G0_8 - 0.00143527704291599*G0_9 + 0.0102426588971732*G0_10 + 0.000782878387045073*G0_11 + 0.00313151354818033*G0_12 + 0.00313151354818031*G0_13 + 0.000782878387045085*G0_14 + 0.0117431758056762*G0_15 + 0.00391439193522542*G0_16 + 0.0117431758056762*G0_17 - 0.0156575677409016*G0_18 - 0.0156575677409017*G0_19 + 0.0704590548340573*G0_20; } }; /// This class defines the interface for the assembly of the global /// tensor corresponding to a form with r + n arguments, that is, a /// mapping /// /// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R /// /// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r /// global tensor A is defined by /// /// A = a(V1, V2, ..., Vr, w1, w2, ..., wn), /// /// where each argument Vj represents the application to the /// sequence of basis functions of Vj and w1, w2, ..., wn are given /// fixed functions (coefficients). class UFC_Poisson2D_5LinearForm: public ufc::form { public: /// Constructor UFC_Poisson2D_5LinearForm() : ufc::form() { // Do nothing } /// Destructor virtual ~UFC_Poisson2D_5LinearForm() { // Do nothing } /// Return a string identifying the form virtual const char* signature() const { return "w0_a0 | vi0*va0*dX(0)"; } /// Return the rank of the global tensor (r) virtual unsigned int rank() const { return 1; } /// Return the number of coefficients (n) virtual unsigned int num_coefficients() const { return 1; } /// Return the number of cell integrals virtual unsigned int num_cell_integrals() const { 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_Poisson2D_5LinearForm_finite_element_0(); break; case 1: return new UFC_Poisson2D_5LinearForm_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_Poisson2D_5LinearForm_dof_map_0(); break; case 1: return new UFC_Poisson2D_5LinearForm_dof_map_1(); break; } return 0; } /// Create a new cell integral on sub domain i virtual ufc::cell_integral* create_cell_integral(unsigned int i) const { return new UFC_Poisson2D_5LinearForm_cell_integral_0(); } /// Create a new exterior facet integral on sub domain i virtual ufc::exterior_facet_integral* create_exterior_facet_integral(unsigned int i) const { return 0; } /// Create a new interior facet integral on sub domain i virtual ufc::interior_facet_integral* create_interior_facet_integral(unsigned int i) const { return 0; } }; // DOLFIN wrappers #include class Poisson2D_5BilinearForm : public dolfin::Form { public: Poisson2D_5BilinearForm() : dolfin::Form() { // Do nothing } /// Return UFC form virtual const ufc::form& form() const { return __form; } /// Return array of coefficients virtual const dolfin::Array& coefficients() const { return __coefficients; } private: // UFC form UFC_Poisson2D_5BilinearForm __form; /// Array of coefficients dolfin::Array __coefficients; }; class Poisson2D_5LinearForm : public dolfin::Form { public: Poisson2D_5LinearForm(dolfin::Function& w0) : dolfin::Form() { __coefficients.push_back(&w0); } /// Return UFC form virtual const ufc::form& form() const { return __form; } /// Return array of coefficients virtual const dolfin::Array& coefficients() const { return __coefficients; } private: // UFC form UFC_Poisson2D_5LinearForm __form; /// Array of coefficients dolfin::Array __coefficients; }; #endif