1#include "whitney_one_grad_matrix_provider.h"
3#include <lf/uscalfe/lagr_fe.h>
15 "Unsupported cell type " << entity.
RefEl());
18 const auto *geom = entity.
Geometry();
26 const Eigen::MatrixXd ref_grads =
30 const Eigen::MatrixXd J_inv_trans =
31 geom->JacobianInverseGramian(Eigen::VectorXd::Zero(2));
34 const Eigen::MatrixXd grad = J_inv_trans * ref_grads;
37 Eigen::MatrixXd bs(grad.rows(), 3);
38 bs.col(0) = grad.col(1) - grad.col(0);
39 bs.col(1) = grad.col(2) - grad.col(1);
40 bs.col(2) = grad.col(0) - grad.col(2);
49 Eigen::MatrixXd elem_mat(3, 3);
50 elem_mat = bs.transpose() * grad;
const Eigen::MatrixXd & NodeCoords() const
Get the coordinates of the nodes of this reference element.
static constexpr RefEl kTria()
Returns the reference triangle.
virtual Eigen::MatrixXd Global(const Eigen::MatrixXd &local) const =0
Map a number of points in local coordinates into the global coordinate system.
Interface class representing a topological entity in a cellular complex
virtual const geometry::Geometry * Geometry() const =0
Describes the geometry of this entity.
virtual nonstd::span< const Orientation > RelativeOrientations() const =0
return span of relative orientations of sub-entities of the next higher co-dimension.
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
Linear Lagrange finite element on triangular reference element.
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > GradientsReferenceShapeFunctions(const Eigen::MatrixXd &refcoords) const override
Computation of the gradients of all reference shape functions in a number of points.
Eigen::MatrixXd Eval(const lf::mesh::Entity &entity) const
Compute the element matrix for some cell of a mesh.
double Volume(const Geometry &geo)
Compute the (approximate) volume (area) of a shape.
int to_sign(Orientation o)
Collection of matrix and vector element providers.