1#ifndef HLDO_SPHERE_OPERATORS_WHITNEY_ZERO_HODGE_LAPLACE_H
2#define HLDO_SPHERE_OPERATORS_WHITNEY_ZERO_HODEE_LAPLACE_H
10#include <laplace_matrix_provider.h>
11#include <lf/assemble/assembler.h>
12#include <lf/assemble/coomatrix.h>
13#include <lf/assemble/dofhandler.h>
14#include <lf/mesh/entity.h>
15#include <lf/mesh/hybrid2d/mesh.h>
16#include <lf/mesh/hybrid2d/mesh_factory.h>
17#include <lf/mesh/mesh_interface.h>
18#include <load_vector_provider.h>
19#include <sphere_triag_mesh_builder.h>
44template <
typename SCALAR>
57 std::unique_ptr<lf::mesh::MeshFactory> factory =
58 std::make_unique<lf::mesh::hybrid2d::MeshFactory>(3);
60 std::shared_ptr<projects::hldo_sphere::mesh::SphereTriagMeshBuilder>
61 sphere = std::make_shared<
70 auto f = [](Eigen::Matrix<double, 3, 1> x) -> SCALAR {
return 0; };
95 lf::assemble::AssembleMatrixLocally<lf::assemble::COOMatrix<SCALAR>>(
96 0, dof_handler, dof_handler, matrix_provider, coo_mat);
103 Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> phi(n_dofs);
122 void SetMesh(std::shared_ptr<const lf::mesh::Mesh> mesh_p) {
127 "Mesh must be Triangular, unsupported cell " << tria->
RefEl());
131 LF_ASSERT_MSG(mesh_p->DimWorld() == 3,
132 "World Dimension must be 3 but is" << mesh_p->DimWorld());
148 std::function<SCALAR(
const Eigen::Matrix<double, 3, 1>&)>& f) {
175 std::shared_ptr<const lf::mesh::Mesh>
mesh_p_;
176 std::function<SCALAR(
const Eigen::Matrix<double, 3, 1>&)>
f_;
178 Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>
phi_;
A temporary data structure for matrix in COO format.
void setZero()
Erase all entries of the matrix.
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
virtual size_type NumDofs() const =0
total number of dof's handled by the object
constexpr RefEl(RefElType type) noexcept
Create a RefEl from a lf::base::RefElType enum.
static constexpr RefEl kPoint()
Returns the (0-dimensional) reference point.
static constexpr RefEl kTria()
Returns the reference triangle.
Interface class representing a topological entity in a cellular complex
Element Matrix Provider for the Laplace operator using picewise linear barycentric basis functions.
Element Vector Provider for scalar valued load functions using picewise linear barycentric basis func...
A mesh builder for regular 3-Sphere.
void setRefinementLevel(lf::base::size_type n)
Set the refinement level.
Computes the Galerkin LSE for the Hodge Laplacian of the whitney zero form.
std::shared_ptr< const lf::mesh::Mesh > mesh_p_
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > phi_
void Compute()
Computes the Galerkin LSE.
lf::assemble::COOMatrix< SCALAR > coo_matrix_
void SetMesh(std::shared_ptr< const lf::mesh::Mesh > mesh_p)
Sets the mesh for later computations.
lf::assemble::COOMatrix< SCALAR > GetGalerkinMatrix()
returns the Galerkin Matrix
std::function< SCALAR(const Eigen::Matrix< double, 3, 1 > &)> f_
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > GetLoadVector()
returns the Loadvector
WhitneyZeroHodgeLaplace()
Basic Constructor.
void SetLoadFunction(std::function< SCALAR(const Eigen::Matrix< double, 3, 1 > &)> &f)
Sets the load function for later computations.
void AssembleVectorLocally(dim_t codim, const DofHandler &dof_handler, ENTITY_VECTOR_PROVIDER &entity_vector_provider, VECTOR &resultvector)
entity-local assembly of (right-hand-side) vectors from element vectors
lf::base::size_type size_type
Implementation of the thesis Hogde Laplacians and Dirac Operators on the surface of the 3-Sphere.