📄 poisson2d_5.h
字号:
// This code conforms with the UFC specification version 1.0// and was automatically generated by FFC version 0.5.0.//// 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 <cmath>#include <stdexcept>#include <fstream>#include <ufc.h>/// 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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -