2#include "solution_to_mesh_data_set.h"
4#include <lf/uscalfe/lagr_fe.h>
9 const std::shared_ptr<const lf::mesh::Mesh> &mesh,
12 for (
const auto *
const node : mesh->Entities(2)) {
19 const std::shared_ptr<const lf::mesh::Mesh> &mesh,
22 for (
const auto *
const cell : mesh->Entities(0)) {
23 const auto *geom = cell->Geometry();
26 const Eigen::MatrixXd ref_grads =
29 const Eigen::MatrixXd J_inv_trans =
30 geom->JacobianInverseGramian(Eigen::VectorXd::Zero(2));
31 const Eigen::MatrixXd grads = J_inv_trans * ref_grads;
32 Eigen::MatrixXd basis_funct(2, 3);
33 basis_funct << grads.row(1), -grads.row(0);
35 velocity(*cell) = solution[idx[0]] * basis_funct.col(0) +
36 solution[idx[1]] * basis_funct.col(1) +
37 solution[idx[2]] * basis_funct.col(2);
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
virtual nonstd::span< const gdof_idx_t > GlobalDofIndices(const lf::mesh::Entity &entity) const =0
access to indices of global dof's belonging to an entity
A MeshDataSet that attaches data of type T to every entity of a mesh that has a specified codimension...
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.
lf::mesh::utils::CodimMeshDataSet< Eigen::Vector2d > extractVelocity(const std::shared_ptr< const lf::mesh::Mesh > &mesh, const lf::assemble::DofHandler &dofh, const Eigen::VectorXd &solution)
Extract the flow velocity on cells from the solution vector.
lf::mesh::utils::CodimMeshDataSet< double > extractBasisFunctionCoefficients(const std::shared_ptr< const lf::mesh::Mesh > &mesh, const lf::assemble::DofHandler &dofh, const Eigen::VectorXd &solution)
Extract the basis function coefficients from the solution vector.