LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
mesh_function_velocity.h
1#ifndef THESIS_POST_PROCESSING_MESH_FUNCTION_VELOCITY_H
2#define THESIS_POST_PROCESSING_MESH_FUNCTION_VELOCITY_H
3
10#include <lf/fe/fe.h>
11#include <lf/uscalfe/uscalfe.h>
12
13namespace projects::ipdg_stokes {
14
15namespace post_processing {
16
23template <typename SCALAR_FE, typename SCALAR_COEFF>
25 public:
36 fe_space,
37 const Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1>& dof_vector)
38 : grad_(fe_space, dof_vector) {}
39
40 auto operator()(const lf::mesh::Entity& entity,
41 const Eigen::MatrixXd& local) const {
42 // Compute the curl by rotating the gradient
43 auto gradients = grad_(entity, local);
44 Eigen::Matrix2d rot;
45 rot << 0, 1, -1, 0;
46 for (auto& g : gradients) {
47 g = rot * g;
48 }
49 return gradients;
50 }
51
52 private:
54};
55
56template <typename T, typename SCALAR_COEFF>
57MeshFunctionVelocity(std::shared_ptr<T>,
58 const Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1>&)
60
61} // end namespace post_processing
62
63} // end namespace projects::ipdg_stokes
64
65#endif // THESIS_POST_PROCESSING_MESH_FUNCTION_VELOCITY_H
A MeshFunction representing the gradient of a function from a finite element space (e....
Interface class representing a topological entity in a cellular complex
Definition: entity.h:39
Space of scalar valued finite element functions on a hybrid 2D mesh
A MeshFunction returning the velocity computed from the basis function coefficients of a vector poten...
MeshFunctionVelocity(std::shared_ptr< const lf::uscalfe::UniformScalarFESpace< SCALAR_FE > > fe_space, const Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > &dof_vector)
Create a new MeshFunctionVelocity from a scalar finite element space and a coefficient vector.
const lf::fe::MeshFunctionGradFE< SCALAR_FE, SCALAR_COEFF > grad_
auto operator()(const lf::mesh::Entity &entity, const Eigen::MatrixXd &local) const
MeshFunctionVelocity(std::shared_ptr< T >, const Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > &) -> MeshFunctionVelocity< typename T::Scalar, SCALAR_COEFF >