LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
rot_whitney_one_div_matrix_provider.cc
1#include "rot_whitney_one_div_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 // correct for orientation
18 auto edgeOrientations = entity.RelativeOrientations();
19 double s0 = lf::mesh::to_sign(edgeOrientations[0]);
20 double s1 = lf::mesh::to_sign(edgeOrientations[1]);
21 double s2 = lf::mesh::to_sign(edgeOrientations[2]);
22
23 // Compute the element matrix for the product of baricentric functions
24 Eigen::MatrixXd elem_mat(3, 1);
25 elem_mat << -s0, -s1, -s2;
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 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.
Eigen::MatrixXd Eval(const lf::mesh::Entity &entity) const
Compute the element matrix for some triangle of a mesh.
int to_sign(Orientation o)
Definition: entity.cc:7
Collection of matrix and vector element providers.
Definition: assemble.h:26