LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
loc_comp_ellbvp.h
1
9#ifndef LF_FE_LOCCOMPELLBVP
10#define LF_FE_LOCCOMPELLBVP
11/***************************************************************************
12 * LehrFEM++ - A simple C++ finite element libray for teaching
13 * Developed from 2018 at the Seminar of Applied Mathematics of ETH Zurich,
14 * lead developers Dr. R. Casagrande and Prof. R. Hiptmair
15 ***************************************************************************/
16#include <lf/mesh/utils/utils.h>
17#include <lf/quad/quad.h>
18
19#include <iostream>
20#include <map>
21
22#include "scalar_fe_space.h"
23#include "scalar_reference_finite_element.h"
24
25namespace lf::fe {
75template <base::Scalar SCALAR, mesh::utils::MeshFunction DIFF_COEFF>
77 public:
81 using Scalar =
83 Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>())::Scalar;
84 using ElemMat = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
85
89 delete;
91 default;
93 const DiffusionElementMatrixProvider &) = delete;
95 delete;
111 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, DIFF_COEFF alpha);
112
116 bool isActive(const lf::mesh::Entity & /*cell*/) const { return true; }
131 ElemMat Eval(const lf::mesh::Entity &cell) const;
132
135
136 private:
140 DIFF_COEFF alpha_;
144 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space_;
145
147};
148
152std::shared_ptr<spdlog::logger> &DiffusionElementMatrixProviderLogger();
153
154template <class PTR, class DIFF_COEFF>
155DiffusionElementMatrixProvider(PTR fe_space, DIFF_COEFF alpha)
156 -> DiffusionElementMatrixProvider<typename PTR::element_type::Scalar,
157 DIFF_COEFF>;
158
159// First constructor (internal construction of quadrature rules
160template <base::Scalar SCALAR, mesh::utils::MeshFunction DIFF_COEFF>
163 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, DIFF_COEFF alpha)
164 : alpha_(std::move(alpha)), fe_space_(std::move(fe_space)) {}
165
166// TODO(craffael) remove const once
167// https://developercommunity.visualstudio.com/content/problem/180948/vs2017-155-c-cv-qualifiers-lost-on-type-alias-used.html
168// is resolved
169template <base::Scalar SCALAR, mesh::utils::MeshFunction DIFF_COEFF>
172 const lf::mesh::Entity &cell) const {
173 // Query the shape of the cell
174 const lf::geometry::Geometry *geo_ptr = cell.Geometry();
175 LF_ASSERT_MSG(geo_ptr != nullptr, "Invalid geometry!");
176 LF_ASSERT_MSG((geo_ptr->DimLocal() == 2),
177 "Only 2D implementation available!");
178 SPDLOG_LOGGER_TRACE(DiffusionElementMatrixProviderLogger(),
179 "{}, shape = \n{}", cell.RefEl(),
180 geo_ptr->Global(cell.RefEl().NodeCoords()));
181 // Physical dimension of the cell
182 const dim_t world_dim = geo_ptr->DimGlobal();
183
184 // Get a quadrature rule of sufficiently high degree on the element
185 const auto sfl = fe_space_->ShapeFunctionLayout(cell);
186 const lf::quad::QuadRule qr = qr_cache_.Get(cell.RefEl(), 2 * sfl->Degree());
187
188 const Eigen::VectorXd determinants(geo_ptr->IntegrationElement(qr.Points()));
189 LF_ASSERT_MSG(
190 determinants.size() == qr.NumPoints(),
191 "Mismatch " << determinants.size() << " <-> " << qr.NumPoints());
192 // Fetch the transformation matrices for the gradients
193 const Eigen::MatrixXd JinvT(geo_ptr->JacobianInverseGramian(qr.Points()));
194 LF_ASSERT_MSG(JinvT.cols() == static_cast<std::ptrdiff_t>(2) * qr.NumPoints(),
195 "Mismatch " << JinvT.cols() << " <-> " << 2 * qr.NumPoints());
196 LF_ASSERT_MSG(JinvT.rows() == world_dim,
197 "Mismatch " << JinvT.rows() << " <-> " << world_dim);
198 // Fetch values of diffusion coefficient alpha at quadrature points:
199 auto alphaval = alpha_(cell, qr.Points());
200 // The requested element matrix is square, size = number of local shape
201 // functions
202 ElemMat mat(sfl->NumRefShapeFunctions(), sfl->NumRefShapeFunctions());
203 mat.setZero();
204 // Compute the gradients of the reference shape functions in the quadrature
205 // points
206 const auto grsf = sfl->GradientsReferenceShapeFunctions(qr.Points());
207 // Quadrature formula: loop over quadrature points
208 for (base::size_type k = 0; k < qr.NumPoints(); ++k) {
209 const double w = qr.Weights()[k] * determinants[k];
210 // Transformed gradient in current quadrature node
211 const auto trf_grad(
212 JinvT.block(0, static_cast<Eigen::Index>(2) * k, world_dim, 2) *
213 grsf.block(0, static_cast<Eigen::Index>(2) * k, mat.rows(), 2)
214 .transpose());
215 // Transformed gradients multiplied with coefficient
216 mat += w * trf_grad.adjoint() * (alphaval[k] * trf_grad);
217 }
218 return mat;
219}
220
255template <base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
257 public:
261 using Scalar =
263 Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>())::Scalar;
264 using ElemMat = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
265
271 delete;
288 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space,
289 REACTION_COEFF gamma);
290
295 bool isActive(const lf::mesh::Entity & /*cell*/) const { return true; }
312 ElemMat Eval(const lf::mesh::Entity &cell) const;
313
316
317 private:
321 REACTION_COEFF gamma_;
325 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space_;
326
328};
329
333std::shared_ptr<spdlog::logger> &MassElementMatrixProviderLogger();
334
335template <class PTR, class REACTION_COEFF>
336MassElementMatrixProvider(PTR fe_space, REACTION_COEFF gamma)
337 -> MassElementMatrixProvider<typename PTR::element_type::Scalar,
338 REACTION_COEFF>;
339
340// First constructor
341template <base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
343 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, REACTION_COEFF gamma)
344 : gamma_(std::move(gamma)), fe_space_(std::move(fe_space)) {}
345
346// TODO(craffael) remove const once
347// https://developercommunity.visualstudio.com/content/problem/180948/vs2017-155-c-cv-qualifiers-lost-on-type-alias-used.html
348// is resolved
349template <base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
352 const lf::mesh::Entity &cell) const {
353 // Query the shape of the cell
354 const lf::geometry::Geometry *geo_ptr = cell.Geometry();
355 LF_ASSERT_MSG(geo_ptr != nullptr, "Invalid geometry!");
356 LF_ASSERT_MSG((geo_ptr->DimLocal() == 2),
357 "Only 2D implementation available!");
358 SPDLOG_LOGGER_TRACE(MassElementMatrixProviderLogger(), "{}, shape = \n{}",
359 cell.RefEl(), geo_ptr->Global(cell.RefEl().NodeCoords()));
360 // Physical dimension of the cell
361 const dim_t world_dim = geo_ptr->DimGlobal();
362
363 // Get a quadrature rule of sufficiently high degree on the element
364 const auto sfl = fe_space_->ShapeFunctionLayout(cell);
365 const lf::quad::QuadRule qr = qr_cache_.Get(cell.RefEl(), 2 * sfl->Degree());
366 // Metric factors in quadrature nodes
367 const Eigen::VectorXd determinants(geo_ptr->IntegrationElement(qr.Points()));
368 LF_ASSERT_MSG(
369 determinants.size() == qr.NumPoints(),
370 "Mismatch " << determinants.size() << " <-> " << qr.NumPoints());
371 // Fetch values of reaction coefficient gamma at quadrature points:
372 auto gammaval = gamma_(cell, qr.Points());
373 // Alocated element matrix
374 ElemMat mat(sfl->NumRefShapeFunctions(), sfl->NumRefShapeFunctions());
375 mat.setZero();
376 // Compute the reference shape functions in the quadrature points
377 const auto rsf = sfl->EvalReferenceShapeFunctions(qr.Points());
378 // Loop over quadrature points to evaluate quadrature formula
379 for (base::size_type k = 0; k < qr.NumPoints(); ++k) {
380 const double w = qr.Weights()[k] * determinants[k];
381 mat += w * ((gammaval[k] * rsf.col(k)) * (rsf.col(k).adjoint()));
382 }
383 return mat;
384}
385
411template <typename SCALAR, typename COEFF, typename EDGESELECTOR>
413 public:
414 using scalar_t =
415 decltype(SCALAR(0) * mesh::utils::MeshFunctionReturnType<COEFF>(0));
416 using ElemMat = Eigen::Matrix<scalar_t, Eigen::Dynamic, Eigen::Dynamic>;
417
422 MassEdgeMatrixProvider &operator=(const MassEdgeMatrixProvider &) = delete;
437 MassEdgeMatrixProvider(std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space,
438 COEFF gamma,
439 EDGESELECTOR edge_selector = base::PredicateTrue{})
440 : gamma_(std::move(gamma)),
441 edge_sel_(std::move(edge_selector)),
442 fe_space_(fe_space) {}
443
450 bool isActive(const lf::mesh::Entity &edge) const {
451 LF_ASSERT_MSG(edge.RefEl() == lf::base::RefEl::kSegment(),
452 "Wrong type for an edge");
453 return edge_sel_(edge);
454 }
455
471 ElemMat Eval(const lf::mesh::Entity &edge) const;
472
474
475 private:
476 COEFF gamma_; // functor for coefficient
477 EDGESELECTOR edge_sel_; // Defines the active edges
478 // FE Space
479 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space_;
480
482};
483
487std::shared_ptr<spdlog::logger> &MassEdgeMatrixProviderLogger();
488
489// deduction guide:
490template <class PTR, class COEFF, class EDGESELECTOR = base::PredicateTrue>
491MassEdgeMatrixProvider(PTR, COEFF coeff,
492 EDGESELECTOR edge_predicate = base::PredicateTrue{})
493 -> MassEdgeMatrixProvider<typename PTR::element_type::Scalar, COEFF,
494 EDGESELECTOR>;
495
496// Eval() method
497// TODO(craffael) remove const once
498// https://
499// developercommunity.visualstudio.com/content/problem/180948/vs2017-155-c-cv-qualifiers-lost-on-type-alias-used.html
500// is resolved
501template <class SCALAR, class COEFF, class EDGESELECTOR>
504 const lf::mesh::Entity &edge) const {
505 const lf::geometry::Geometry *geo_ptr = edge.Geometry();
506 // Get the shape function layout on the edge
507 const auto sfl = fe_space_->ShapeFunctionLayout(edge);
508 // Compute a quadrature rule on the given entity
509 const lf::quad::QuadRule qr = qr_cache_.Get(edge.RefEl(), 2 * sfl->Degree());
510 // Obtain the metric factors for the quadrature points
511 const Eigen::VectorXd determinants(geo_ptr->IntegrationElement(qr.Points()));
512 LF_ASSERT_MSG(
513 determinants.size() == qr.NumPoints(),
514 "Mismatch " << determinants.size() << " <-> " << qr.NumPoints());
515
516 // Element matrix
517 ElemMat mat(sfl->NumRefShapeFunctions(), sfl->NumRefShapeFunctions());
518 mat.setZero();
519
520 auto gammaval = gamma_(edge, qr.Points());
521
522 // Compute the reference shape functions
523 const auto rsf = sfl->EvalReferenceShapeFunctions(qr.Points());
524 // Loop over quadrature points
525 for (long k = 0; k < determinants.size(); ++k) {
526 // Build local matrix by summing rank-1 contributions
527 // from quadrature points.
528 const auto w = (qr.Weights()[k] * determinants[k]) * gammaval[k];
529 mat += ((rsf.col(k)) * (rsf.col(k).adjoint())) * w;
530 }
531 return mat;
532}
533
568template <base::Scalar SCALAR, mesh::utils::MeshFunction MESH_FUNCTION>
570 public:
571 using scalar_t =
572 decltype(static_cast<SCALAR>(0) *
574 0));
575 using ElemVec = Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>;
576
580 delete;
582 default;
584 const ScalarLoadElementVectorProvider &) = delete;
598 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, MESH_FUNCTION f);
600 bool isActive(const lf::mesh::Entity & /*cell*/) const { return true; }
601 /*
602 * @brief Main method for computing the element vector
603 *
604 * @param cell current cell for which the element vector is desired
605 * @return local load vector as column vector
606 *
607 */
608 ElemVec Eval(const lf::mesh::Entity &cell) const;
609
611
612 private:
614 MESH_FUNCTION f_;
615
616 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space_;
617
619};
620
624std::shared_ptr<spdlog::logger> &ScalarLoadElementVectorProviderLogger();
625
626// Deduction guide
627template <class PTR, class MESH_FUNCTION>
628ScalarLoadElementVectorProvider(PTR fe_space, MESH_FUNCTION mf)
629 -> ScalarLoadElementVectorProvider<typename PTR::element_type::Scalar,
630 MESH_FUNCTION>;
631
632// Constructors
633template <base::Scalar SCALAR, mesh::utils::MeshFunction MESH_FUNCTION>
636 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, MESH_FUNCTION f)
637 : f_(std::move(f)), fe_space_(std::move(fe_space)) {}
638
639// TODO(craffael) remove const once
640// http://developercommunity.visualstudio.com/content/problem/180948/vs2017-155-c-cv-qualifiers-lost-on-type-alias-used.html
641// is resolved
642template <base::Scalar SCALAR, mesh::utils::MeshFunction MESH_FUNCTION>
645 const lf::mesh::Entity &cell) const {
646 // Type for source function
648
649 // Get the shape function layout for the given cell
650 const auto sfl = fe_space_->ShapeFunctionLayout(cell);
651
652 // Initialize a quadrature rule of sufficiently high degree
653 const lf::quad::QuadRule qr = qr_cache_.Get(cell.RefEl(), 2 * sfl->Degree());
654
655 // Query the shape of the cell
656 const lf::geometry::Geometry *geo_ptr = cell.Geometry();
657 LF_ASSERT_MSG(geo_ptr != nullptr, "Invalid geometry!");
658 LF_ASSERT_MSG((geo_ptr->DimLocal() == 2),
659 "Only 2D implementation available!");
660 SPDLOG_LOGGER_TRACE(ScalarLoadElementVectorProviderLogger(),
661 "{}, shape = \n{}", cell.RefEl(),
662 geo_ptr->Global(cell.RefEl().NodeCoords()));
663
664 // Obtain the metric factors for the quadrature points
665 const Eigen::VectorXd determinants(geo_ptr->IntegrationElement(qr.Points()));
666 LF_ASSERT_MSG(
667 determinants.size() == qr.NumPoints(),
668 "Mismatch " << determinants.size() << " <-> " << qr.NumPoints());
669 SPDLOG_LOGGER_TRACE(ScalarLoadElementVectorProviderLogger(),
670 "LOCVEC({}): Metric factors :\n{}", cell.RefEl(),
671 determinants.transpose());
672 // Element vector
673 ElemVec vec(sfl->NumRefShapeFunctions());
674 vec.setZero();
675
676 auto fval = f_(cell, qr.Points());
677
678 // Compute the reference shape functions
679 const auto rsf = sfl->EvalReferenceShapeFunctions(qr.Points());
680
681 // Loop over quadrature points
682 for (long k = 0; k < determinants.size(); ++k) {
683 SPDLOG_LOGGER_TRACE(ScalarLoadElementVectorProviderLogger(),
684 "LOCVEC: [{}] -> [weight = {}]",
685 qr.Points().transpose(), qr.Weights()[k]);
686 // Contribution of current quadrature point
687 vec +=
688 (qr.Weights()[k] * determinants[k] * fval[k]) * rsf.col(k).conjugate();
689 }
690
691 SPDLOG_LOGGER_TRACE(ScalarLoadElementVectorProviderLogger(), "LOCVEC = \n{}",
692 vec.transpose());
693 return vec;
694}
695
728template <base::Scalar SCALAR, mesh::utils::MeshFunction FUNCTOR,
729 class EDGESELECTOR = base::PredicateTrue>
731 public:
732 using Scalar =
733 decltype(SCALAR(0) * mesh::utils::MeshFunctionReturnType<FUNCTOR>(0));
734 using ElemVec = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>;
735
740 default;
742 const ScalarLoadEdgeVectorProvider &) = delete;
744 delete;
758 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space, FUNCTOR g,
759 EDGESELECTOR edge_sel = base::PredicateTrue{})
760 : g_(std::move(g)), edge_sel_(std::move(edge_sel)), fe_space_(fe_space) {}
761
763 bool isActive(const lf::mesh::Entity &cell) const { return edge_sel_(cell); }
764 /*
765 * @brief Main method for computing the element vector
766 *
767 * @param cell current cell for which the element vector is desired
768 * @return local load vector as column vector
769 *
770 */
771 ElemVec Eval(const lf::mesh::Entity &edge) const;
772
774
775 private:
776 FUNCTOR g_; // source function
777 EDGESELECTOR edge_sel_; // selects edges
778 std::shared_ptr<const ScalarFESpace<SCALAR>> fe_space_;
779
781};
782
786std::shared_ptr<spdlog::logger> &ScalarLoadEdgeVectorProviderLogger();
787
788// deduction guide
789template <class PTR, class FUNCTOR, class EDGESELECTOR = base::PredicateTrue>
791 -> ScalarLoadEdgeVectorProvider<typename PTR::element_type::Scalar, FUNCTOR,
792 EDGESELECTOR>;
793
794// Eval() method
795// TODO(craffael) remove const once
796// https://developercommunity.visualstudio.com/content/problem/180948/vs2017-155-c-cv-qualifiers-lost-on-type-alias-used.html
797// is resolved
798template <base::Scalar SCALAR, mesh::utils::MeshFunction FUNCTOR,
799 class EDGESELECTOR>
802 const lf::mesh::Entity &edge) const {
803 // Query the shape of the edge
804 const lf::geometry::Geometry *geo_ptr = edge.Geometry();
805 LF_ASSERT_MSG(geo_ptr != nullptr, "Invalid geometry!");
806 LF_ASSERT_MSG(geo_ptr->DimLocal() == 1, "The passed entity is not an edge!");
807
808 // Get the shape function layout of the given edge
809 const auto sfl = fe_space_->ShapeFunctionLayout(edge);
810
811 // Quadrature points on physical edge
812 const lf::quad::QuadRule qr = qr_cache_.Get(edge.RefEl(), 2 * sfl->Degree());
813
814 // Obtain the metric factors for the quadrature points
815 const Eigen::VectorXd determinants(geo_ptr->IntegrationElement(qr.Points()));
816 LF_ASSERT_MSG(
817 determinants.size() == qr.NumPoints(),
818 "Mismatch " << determinants.size() << " <-> " << qr.NumPoints());
819
820 // Element vector
821 ElemVec vec(sfl->NumRefShapeFunctions());
822 vec.setZero();
823
824 auto g_vals = g_(edge, qr.Points());
825
826 // Compute the reference shape functions
827 const auto rsf = sfl->EvalReferenceShapeFunctions(qr.Points());
828
829 // Loop over quadrature points
830 for (base::size_type k = 0; k < qr.NumPoints(); ++k) {
831 // Add contribution of quadrature point to local vector
832 const auto w = (qr.Weights()[k] * determinants[k]) * g_vals[k];
833 vec += rsf.col(k).conjugate() * w;
834 }
835 return vec;
836}
837
838} // namespace lf::fe
839
840#endif
A Function Object that can be invoked with any arguments and that always returns the value true.
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
Definition ref_el.h:153
const Eigen::MatrixXd & NodeCoords() const
Get the coordinates of the nodes of this reference element.
Definition ref_el.h:241
Class for computing element matrices for general scalar-valued finite elements and homogeneous 2nd-or...
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > ElemMat
DiffusionElementMatrixProvider(DiffusionElementMatrixProvider &&) noexcept=default
ElemMat Eval(const lf::mesh::Entity &cell) const
Routine for the computation of element matrices.
DiffusionElementMatrixProvider(const DiffusionElementMatrixProvider &)=delete
standard constructors
std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
bool isActive(const lf::mesh::Entity &) const
All cells are considered active.
typename decltype(mesh::utils::MeshFunctionReturnType< DIFF_COEFF >() * Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >())::Scalar Scalar
type of returned element matrix
Quadrature-based computation of local mass matrix for an edge.
MassEdgeMatrixProvider(MassEdgeMatrixProvider &&) noexcept=default
decltype(SCALAR(0) *mesh::utils::MeshFunctionReturnType< COEFF >(0)) scalar_t
bool isActive(const lf::mesh::Entity &edge) const
If true, then an edge is taken into account during assembly.
ElemMat Eval(const lf::mesh::Entity &edge) const
actual computation of edge mass matrix
Eigen::Matrix< scalar_t, Eigen::Dynamic, Eigen::Dynamic > ElemMat
MassEdgeMatrixProvider(const MassEdgeMatrixProvider &)=delete
std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
Class for local quadrature based computation of element matrix for Lagrangian finite elements and a w...
MassElementMatrixProvider(const MassElementMatrixProvider &)=delete
standard constructors
std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
typename decltype(mesh::utils::MeshFunctionReturnType< REACTION_COEFF >() * Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >())::Scalar Scalar
type of returned element matrix
ElemMat Eval(const lf::mesh::Entity &cell) const
main routine for the computation of element matrices
MassElementMatrixProvider(MassElementMatrixProvider &&) noexcept=default
bool isActive(const lf::mesh::Entity &) const
All cells are considered active.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > ElemMat
Space of scalar valued finite element functions on a Mesh.
Local edge contributions to element vector.
ElemVec Eval(const lf::mesh::Entity &edge) const
std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
ScalarLoadEdgeVectorProvider(ScalarLoadEdgeVectorProvider &&) noexcept=default
decltype(SCALAR(0) *mesh::utils::MeshFunctionReturnType< FUNCTOR >(0)) Scalar
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > ElemVec
ScalarLoadEdgeVectorProvider(const ScalarLoadEdgeVectorProvider &)=delete
bool isActive(const lf::mesh::Entity &cell) const
all edges are active
Local computation of general element (load) vector for scalar finite elements; volume contributions o...
bool isActive(const lf::mesh::Entity &) const
all cells are active
ElemVec Eval(const lf::mesh::Entity &cell) const
decltype(static_cast< SCALAR >(0) * static_cast< mesh::utils::MeshFunctionReturnType< MESH_FUNCTION > >( 0)) scalar_t
MESH_FUNCTION f_
An object providing the source function.
ScalarLoadElementVectorProvider(const ScalarLoadElementVectorProvider &)=delete
ScalarLoadElementVectorProvider(ScalarLoadElementVectorProvider &&) noexcept=default
std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > ElemVec
Interface class for shape information on a mesh cell in the spirit of parametric finite element metho...
virtual Eigen::MatrixXd Global(const Eigen::MatrixXd &local) const =0
Map a number of points in local coordinates into the global coordinate system.
virtual dim_t DimLocal() const =0
Dimension of the domain of this mapping.
virtual dim_t DimGlobal() const =0
Dimension of the image of this mapping.
virtual Eigen::MatrixXd JacobianInverseGramian(const Eigen::MatrixXd &local) const =0
Evaluate the Jacobian * Inverse Gramian ( ) simultaneously at numPoints.
virtual Eigen::VectorXd IntegrationElement(const Eigen::MatrixXd &local) const =0
The integration element (factor appearing in integral transformation formula, see below) at number of...
Interface class representing a topological entity in a cellular complex
Definition entity.h:42
virtual const geometry::Geometry * Geometry() const =0
Describes the geometry of this entity.
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
A cache for make_QuadRule()
Represents a Quadrature Rule over one of the Reference Elements.
Definition quad_rule.h:58
const Eigen::VectorXd & Weights() const
All quadrature weights as a vector.
Definition quad_rule.h:152
const Eigen::MatrixXd & Points() const
All quadrature points as column vectors.
Definition quad_rule.h:145
base::size_type NumPoints() const
Return the total number of quadrature points (num of columns of points/weights)
Definition quad_rule.h:158
Concept which is fulfilled if a type T is a scalar type, i.e. if it is a "field" in the mathematical ...
A MeshFunction is a function object that can be evaluated at any point on the mesh.
unsigned int size_type
general type for variables related to size of arrays
Definition types.h:20
Collects data structures and algorithms designed for scalar finite element methods primarily meant fo...
Definition fe.h:47
std::shared_ptr< spdlog::logger > & MassElementMatrixProviderLogger()
logger for MassElementMatrixProvider
std::shared_ptr< spdlog::logger > & ScalarLoadElementVectorProviderLogger()
logger used by ScalarLoadElementVectorProvider
ScalarLoadElementVectorProvider(PTR fe_space, MESH_FUNCTION mf) -> ScalarLoadElementVectorProvider< typename PTR::element_type::Scalar, MESH_FUNCTION >
ScalarLoadEdgeVectorProvider(PTR, FUNCTOR, EDGESELECTOR=base::PredicateTrue{}) -> ScalarLoadEdgeVectorProvider< typename PTR::element_type::Scalar, FUNCTOR, EDGESELECTOR >
std::shared_ptr< spdlog::logger > & DiffusionElementMatrixProviderLogger()
logger for DiffusionElementMatrixProvider
std::shared_ptr< spdlog::logger > & MassEdgeMatrixProviderLogger()
logger for MassEdgeMatrixProvider
MassEdgeMatrixProvider(PTR, COEFF coeff, EDGESELECTOR edge_predicate=base::PredicateTrue{}) -> MassEdgeMatrixProvider< typename PTR::element_type::Scalar, COEFF, EDGESELECTOR >
MassElementMatrixProvider(PTR fe_space, REACTION_COEFF gamma) -> MassElementMatrixProvider< typename PTR::element_type::Scalar, REACTION_COEFF >
lf::assemble::dim_t dim_t
Definition fe.h:56
DiffusionElementMatrixProvider(PTR fe_space, DIFF_COEFF alpha) -> DiffusionElementMatrixProvider< typename PTR::element_type::Scalar, DIFF_COEFF >
std::shared_ptr< spdlog::logger > & ScalarLoadEdgeVectorProviderLogger()
logger for ScalarLoadEdgeVectorProvider class template.
internal::VectorElement_t< internal::MeshFunctionReturnType_t< R > > MeshFunctionReturnType
Determine the type of objects returned by a MeshFunction.
Definition assemble.h:31