LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
whitney_two_mass_matrix_provider.cc
1#include "whitney_two_mass_matrix_provider.h"
2
3#include <lf/uscalfe/lagr_fe.h>
4
5#include <cmath>
6#include <iomanip>
7#include <iostream>
8
10
12 const lf::mesh::Entity &entity) const {
13 // Only triangles are supported
14 LF_VERIFY_MSG(entity.RefEl() == lf::base::RefEl::kTria(),
15 "Unsupported cell type " << entity.RefEl());
16
17 // Get the geometry of the entity
18 const auto *geom = entity.Geometry();
19
20 // Compute the element matrix for the product of baricentric functions
21 Eigen::MatrixXd elem_mat(1, 1);
22 // clang-format off
23 elem_mat << 1;
24 // clang-format on
25 elem_mat *= lf::geometry::Volume(*geom);
26
27 return elem_mat;
28}
29
30} // namespace projects::hldo_sphere::assemble
static constexpr RefEl kTria()
Returns the reference triangle.
Definition: ref_el.h:158
Interface class representing a topological entity in a cellular complex
Definition: entity.h:39
virtual const geometry::Geometry * Geometry() const =0
Describes the geometry of this entity.
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
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.
Collection of matrix and vector element providers.
Definition: assemble.h:26