1#include "dirac_operator.h"
41 lf::assemble::AssembleMatrixLocally<lf::assemble::COOMatrix<double>>(
42 0, dof_handler_vert, dof_handler_edge, matrix_grad_provider, coo_A_21);
45 lf::assemble::AssembleMatrixLocally<lf::assemble::COOMatrix<double>>(
46 0, dof_handler_cell, dof_handler_edge, matrix_div_provider, coo_A_23_m);
50 n_dofs_vert + n_dofs_edge + n_dofs_cell,
51 n_dofs_vert + n_dofs_edge + n_dofs_cell);
53 full_matrix.setZero();
57 const std::vector<Eigen::Triplet<double>> triplets_A_21 = coo_A_21.
triplets();
58 const std::vector<Eigen::Triplet<double>> triplets_A_23_m =
62 for (Eigen::Triplet<double> triplet : triplets_A_21) {
63 int col = triplet.col();
64 int row = triplet.row();
67 full_matrix.AddToEntry(row + n_dofs_vert, col, val);
69 full_matrix.AddToEntry(col, row + n_dofs_vert, val);
73 for (Eigen::Triplet<double> triplet : triplets_A_23_m) {
74 int col = triplet.col();
75 int row = triplet.row();
79 full_matrix.AddToEntry(row + n_dofs_vert, col + n_dofs_vert + n_dofs_edge,
83 full_matrix.AddToEntry(col + n_dofs_vert + n_dofs_edge, row + n_dofs_vert,
91 vector_provider_0(
f0_);
94 vector_provider_1(
f1_);
97 vector_provider_2(
f2_);
100 Eigen::Matrix<complex, Eigen::Dynamic, 1> phi0(n_dofs_vert);
102 Eigen::Matrix<complex, Eigen::Dynamic, 1> phi1(n_dofs_edge);
104 Eigen::Matrix<complex, Eigen::Dynamic, 1> phi2(n_dofs_cell);
113 Eigen::Matrix<complex, Eigen::Dynamic, 1> full_vec(n_dofs_vert + n_dofs_edge +
116 full_vec.head(n_dofs_vert) = phi0;
117 full_vec.segment(n_dofs_vert, n_dofs_edge) = phi1;
118 full_vec.tail(n_dofs_cell) = phi2;
136 "Mesh must be Triangular, unsupported cell " << tria->
RefEl());
140 LF_ASSERT_MSG(mesh_p->DimWorld() == 3,
141 "World Dimension must be 3 but is" << mesh_p->DimWorld());
A temporary data structure for matrix in COO format.
void setZero()
Erase all entries of the matrix.
TripletVec & triplets()
Gives access to the vector of triplets.
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
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
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 Vector Provider for scalar valued load functions using picewise linear barycentric basis func...
Element matrix provider for rotated whitney one form.
Element matrix provider Whitney one forms, surface vector fields.
Element vector provider for Whitney one forms.
Element vector provider for piecewise constant whitney two forms.
std::function< complex(const Eigen::Matrix< double, 3, 1 > &)> f0_
void SetMesh(std::shared_ptr< const lf::mesh::Mesh > mesh_p)
Sets the mesh and creates dof_handler.
std::shared_ptr< const lf::mesh::Mesh > mesh_p_
Eigen::Matrix< complex, Eigen::Dynamic, 1 > phi_
std::function< complex(const Eigen::Matrix< double, 3, 1 > &)> f2_
std::function< Eigen::Matrix< complex, 3, 1 >(const Eigen::Matrix< double, 3, 1 > &)> f1_
void Compute()
Computes the Galerkin LSE.
lf::assemble::COOMatrix< complex > coo_matrix_
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
std::complex< double > complex
Implementation of the thesis Hogde Laplacians and Dirac Operators on the surface of the 3-Sphere.