1#ifndef PROJECTS_DPG_LOC_COMP_DPG
2#define PROJECTS_DPG_LOC_COMP_DPG
13#include <lf/base/base.h>
14#include <lf/mesh/mesh.h>
15#include <lf/mesh/utils/utils.h>
16#include <lf/quad/quad.h>
17#include <lf/uscalfe/uscalfe.h>
21#include "product_fe_space.h"
22#include "sub_element_matrix_provider.h"
23#include "sub_element_vector_provider.h"
69template <
typename SCALAR,
typename DIFF_COEFF>
71 static_assert(lf::mesh::utils::isMeshFunction<DIFF_COEFF>);
135 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
140 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
150template <
class PTR,
class DIFF_COEFF>
153 size_type test_component, DIFF_COEFF alpha)
158template <
typename SCALAR,
typename DIFF_COEFF>
164 : alpha_(std::move(alpha)),
165 trial_component_(trial_component),
166 test_component_(test_component),
173 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
180 if (fe_trial !=
nullptr && fe_test !=
nullptr) {
183 size_type degree = fe_trial->Degree() + fe_test->Degree();
194template <
typename SCALAR,
typename DIFF_COEFF>
201 fe_precomp_trial_[cell.
RefEl().
Id()];
203 fe_precomp_test_[cell.
RefEl().
Id()];
207 "No local shape function on trial space for entity type "
211 "No local shape function on test space for entity type " << cell.
RefEl());
220 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
221 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
227 const Eigen::VectorXd determinants(
229 LF_ASSERT_MSG(determinants.size() == pfe_trial.
Qr().
NumPoints(),
230 "Mismatch " << determinants.size() <<
" <-> "
233 const Eigen::MatrixXd JinvT(
237 JinvT.rows() == world_dim,
238 "Mismatch " << JinvT.cols() <<
" <-> " << 2 * pfe_trial.
Qr().
NumPoints());
241 auto alphaeval = alpha_(cell, pfe_trial.
Qr().
Points());
249 for (
size_type k = 0; k < pfe_trial.
Qr().NumPoints(); ++k) {
251 const double w = pfe_trial.
Qr().
Weights()[k] * determinants[k];
254 const auto trf_trial_grad(
255 JinvT.block(0, 2 * k, world_dim, 2) *
257 .block(0, 2 * k, mat.cols(), 2)
259 const auto trf_test_grad(JinvT.block(0, 2 * k, world_dim, 2) *
261 .block(0, 2 * k, mat.rows(), 2)
264 mat += w * trf_test_grad.transpose() * alphaeval[k] * trf_trial_grad;
302template <
typename SCALAR,
typename REACTION_COEFF>
304 static_assert(lf::mesh::utils::isMeshFunction<REACTION_COEFF>);
335 REACTION_COEFF gamma);
367 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
372 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
383template <
class PTR,
class REACTION_COEFF>
386 size_type test_component, REACTION_COEFF gamma)
391template <
typename SCALAR,
typename REACTION_COEFF>
397 REACTION_COEFF gamma)
398 : gamma_(std::move(gamma)),
399 trial_component_(trial_component),
400 test_component_(test_component),
407 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
414 if (fe_trial !=
nullptr && fe_test !=
nullptr) {
417 size_type degree = fe_trial->Degree() + fe_test->Degree();
428template <
typename SCALAR,
typename REACTION_COEFF>
435 fe_precomp_trial_[cell.
RefEl().
Id()];
437 fe_precomp_test_[cell.
RefEl().
Id()];
441 "No local shape function on trial space for entity type "
445 "No local shape function on test space for entity type " << cell.
RefEl());
454 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
455 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
460 const Eigen::VectorXd determinants(
462 LF_ASSERT_MSG(determinants.size() == pfe_trial.
Qr().
NumPoints(),
463 "Mismatch " << determinants.size() <<
" <-> "
467 auto gammaeval = gamma_(cell, pfe_trial.
Qr().
Points());
474 for (
size_type k = 0; k < pfe_trial.
Qr().NumPoints(); ++k) {
476 const double w = pfe_trial.
Qr().
Weights()[k] * determinants[k];
529template <
typename SCALAR,
typename CONVECTION_COEFF_1,
530 typename CONVECTION_COEFF_2>
533 static_assert(lf::mesh::utils::isMeshFunction<CONVECTION_COEFF_1>);
534 static_assert(lf::mesh::utils::isMeshFunction<CONVECTION_COEFF_2>);
569 CONVECTION_COEFF_1 beta_1, CONVECTION_COEFF_2 beta_2);
601 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
606 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
616template <
class PTR,
typename CONVECTION_COEFF_1,
typename CONVECTION_COEFF_2>
620 CONVECTION_COEFF_1 beta_1,
621 CONVECTION_COEFF_2 beta_2)
623 CONVECTION_COEFF_1, CONVECTION_COEFF_2>;
626template <
typename SCALAR,
typename CONVECTION_COEFF_1,
627 typename CONVECTION_COEFF_2>
629 CONVECTION_COEFF_2>
::
634 CONVECTION_COEFF_1 beta_1, CONVECTION_COEFF_2 beta_2)
635 : beta_1_(std::move(beta_1)),
636 beta_2_(std::move(beta_2)),
637 trial_component_(trial_component),
638 test_component_(test_component),
645 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
652 if (fe_trial !=
nullptr && fe_test !=
nullptr) {
655 size_type degree = fe_trial->Degree() + fe_test->Degree();
666template <
typename SCALAR,
typename CONVECTION_COEFF_1,
667 typename CONVECTION_COEFF_2>
669 CONVECTION_COEFF_2>::ElemMat
671 SCALAR, CONVECTION_COEFF_1,
676 fe_precomp_trial_[cell.
RefEl().
Id()];
678 fe_precomp_test_[cell.
RefEl().
Id()];
682 "No local shape function on trial space for entity type "
686 "No local shape function on test space for entity type " << cell.
RefEl());
695 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
696 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
702 const Eigen::VectorXd determinants(
704 LF_ASSERT_MSG(determinants.size() == pfe_trial.
Qr().
NumPoints(),
705 "Mismatch " << determinants.size() <<
" <-> "
708 const Eigen::MatrixXd JinvT(
712 JinvT.rows() == world_dim,
713 "Mismatch " << JinvT.cols() <<
" <-> " << 2 * pfe_trial.
Qr().
NumPoints());
716 auto beta_1_eval = beta_1_(cell, pfe_trial.
Qr().
Points());
717 auto beta_2_eval = beta_2_(cell, pfe_trial.
Qr().
Points());
725 for (
size_type k = 0; k < pfe_trial.
Qr().NumPoints(); ++k) {
727 const double w = pfe_trial.
Qr().
Weights()[k] * determinants[k];
730 const auto trf_trial_grad(
731 JinvT.block(0, 2 * k, world_dim, 2) *
733 .block(0, 2 * k, mat.cols(), 2)
735 const auto trf_test_grad(JinvT.block(0, 2 * k, world_dim, 2) *
737 .block(0, 2 * k, mat.rows(), 2)
740 const auto trf_trial_eval(
745 const auto beta_trf_test_grad = beta_1_eval[k].transpose() * trf_test_grad;
746 const auto beta_trf_trial_grad =
747 beta_2_eval[k].transpose() * trf_trial_grad;
748 mat += w * (beta_trf_test_grad.transpose() * trf_trial_eval.transpose() +
749 trf_test_eval * beta_trf_trial_grad);
788template <
typename SCALAR,
typename DIFF_COEFF>
790 static_assert(lf::mesh::utils::isMeshFunction<DIFF_COEFF>);
858 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
866 std::vector<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>>,
879template <
class PTR,
class DIFF_COEFF>
887template <
typename SCALAR,
typename DIFF_COEFF>
892 : alpha_(std::move(alpha)),
893 trial_component_(trial_component),
894 test_component_(test_component),
895 sign_provider_(fe_space_trial->Mesh()),
897 fe_precomp_trial_() {
899 auto fe_trial = fe_space_trial->ShapeFunctionLayout(
901 LF_ASSERT_MSG(fe_trial !=
nullptr,
"Missing description of flux space");
902 LF_ASSERT_MSG(fe_trial->NumRefShapeFunctions(1) == 0,
903 "shape functions associated with endpoints not supported.");
906 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
913 if (fe_test !=
nullptr) {
916 int degree = fe_trial->Degree() + fe_test->Degree();
926 std::vector<lf::quad::QuadRule> boundaryQr =
928 int numSegments = ref_el.NumSubEntities(1);
929 LF_ASSERT_MSG(boundaryQr.size() == numSegments,
930 "boundaryQr.size() = " << boundaryQr.size() <<
" <-> "
931 <<
"numSegments= " << numSegments);
934 for (
int segment = 0; segment < numSegments; segment++) {
939 fe_test, boundaryQr[segment]);
945template <
typename SCALAR,
typename DIFF_COEFF>
950 auto& pfe_trial = fe_precomp_trial_[cell.
RefEl().
Id()];
951 auto& pfes_test = fe_precomp_test_[cell.
RefEl().
Id()];
956 LF_ASSERT_MSG(pfes_test.size() == numSegments,
957 "Missing local shape functions for test space on ref_el "
959 LF_ASSERT_MSG(pfe_trial.isInitialized(),
960 "missing local shape functions for trial space on ref_el"
962 for (
int i = 0; i < numSegments; ++i) {
963 LF_ASSERT_MSG(pfes_test[i].isInitialized(),
964 "missing local shape functions for test space on ref_el "
966 LF_ASSERT_MSG(pfes_test[i].Qr().NumPoints() == pfe_trial.Qr().NumPoints(),
967 "qr missmatch between trial and test space.");
972 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
973 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
976 elem_mat_t mat(pfes_test[0].NumRefShapeFunctions(),
977 pfe_trial.NumRefShapeFunctions() * numSegments);
981 for (
int segment = 0; segment < numSegments; segment++) {
983 const auto segment_geo_ptr = geo_ptr->
SubGeometry(1, segment);
984 LF_ASSERT_MSG(segment_geo_ptr !=
nullptr,
"Invalid geometry");
987 const Eigen::VectorXd determinants =
988 segment_geo_ptr->IntegrationElement(pfe_trial.Qr().Points());
989 LF_ASSERT_MSG(determinants.size() == pfe_trial.Qr().NumPoints(),
990 "Mismatch " << determinants.size() <<
" <-> "
991 << pfe_trial.Qr().NumPoints());
994 auto alphaeval = alpha_(cell, pfes_test[segment].Qr().Points());
996 sign_provider_.PrescribedSign(cell, *cell.
SubEntities(1)[segment]);
999 for (
size_type k = 0; k < pfe_trial.Qr().NumPoints(); ++k) {
1001 const double w = pfe_trial.Qr().Weights()[k] * determinants[k] * sgn;
1002 const auto trial_eval = pfe_trial.PrecompReferenceShapeFunctions().col(k);
1003 const auto test_eval =
1004 pfes_test[segment].PrecompReferenceShapeFunctions().col(k);
1009 mat.block(0, segment * pfe_trial.NumRefShapeFunctions(),
1010 pfes_test[segment].NumRefShapeFunctions(),
1011 pfe_trial.NumRefShapeFunctions()) +=
1012 alphaeval[k] * w * test_eval * trial_eval.transpose();
1052template <
typename SCALAR,
typename COEFF>
1054 static_assert(lf::mesh::utils::isMeshFunction<COEFF>);
1118 std::vector<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>>,
1127 std::vector<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>>,
1142template <
class PTR,
class COEFF>
1149template <
typename SCALAR,
typename COEFF>
1154 : beta_(std::move(beta)),
1155 trial_component_(trial_component),
1156 test_component_(test_component),
1158 fe_precomp_trial_() {
1163 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
1170 if (fe_trial !=
nullptr && fe_test !=
nullptr) {
1173 size_type degree = fe_trial->Degree() + fe_test->Degree();
1181 std::vector<lf::quad::QuadRule> boundary_qr =
1183 int num_segments = ref_el.NumSubEntities(1);
1185 boundary_qr.size() == num_segments,
1186 "boundary_qr.size() = " << boundary_qr.size() <<
"<->"
1187 <<
"num_segments = " << num_segments);
1192 for (
int segment = 0; segment < num_segments; segment++) {
1196 fe_trial, boundary_qr[segment]);
1199 fe_test, boundary_qr[segment]);
1205template <
typename SCALAR,
typename COEFF>
1210 auto& pfes_trial = fe_precomp_trial_[cell.
RefEl().
Id()];
1211 auto& pfes_test = fe_precomp_test_[cell.
RefEl().
Id()];
1214 auto& segment_qr = segment_qr_[cell.
RefEl().
Id()];
1220 LF_ASSERT_MSG(pfes_trial.size() == num_segments,
1221 "Missing local shape functions on trial space for ref_el"
1224 pfes_test.size() == num_segments,
1225 "Missing local shape functions on test space for ref_el" << cell.
RefEl());
1228 for (
size_type segment = 0; segment < num_segments; segment++) {
1229 LF_ASSERT_MSG(pfes_trial[segment].isInitialized(),
1230 "missing local shape functions on trial space for ref_el"
1232 LF_ASSERT_MSG(pfes_test[segment].isInitialized(),
1233 "missing local shape functions on trial space for ref_el"
1236 pfes_trial[segment].Qr().Points() == pfes_test[segment].Qr().Points() &&
1237 pfes_trial[segment].Qr().Weights() ==
1238 pfes_test[segment].Qr().Weights() &&
1239 pfes_trial[segment].Qr().NumPoints() ==
1240 pfes_test[segment].Qr().NumPoints(),
1245 LF_ASSERT_MSG(segment_qr.NumPoints() == pfes_trial[0].Qr().NumPoints(),
1250 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
1251 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
1254 elem_mat_t mat(pfes_test[0].NumRefShapeFunctions(),
1255 pfes_trial[0].NumRefShapeFunctions());
1260 LF_ASSERT_MSG(normals.cols() == num_segments,
1261 "normals.cols()= " << normals.cols() <<
"<->"
1262 <<
"num_segments= " << num_segments);
1265 for (
size_type segment = 0; segment < num_segments; segment++) {
1267 const auto segment_ptr = geo_ptr->
SubGeometry(1, segment);
1268 LF_ASSERT_MSG(segment_ptr !=
nullptr,
"Invalid geometry");
1271 auto& pfe_trial = pfes_trial[segment];
1272 auto& pfe_test = pfes_test[segment];
1275 const Eigen::VectorXd determinants(
1276 segment_ptr->IntegrationElement(segment_qr.Points()));
1277 LF_ASSERT_MSG(determinants.size() == pfe_trial.Qr().NumPoints(),
1278 "Mismatch " << determinants.size() <<
" <-> "
1279 << segment_qr.NumPoints());
1282 auto betaeval = beta_(cell, pfe_trial.Qr().Points());
1285 for (
size_type k = 0; k < pfe_trial.Qr().NumPoints(); ++k) {
1287 const double w = segment_qr.Weights()[k] * determinants[k];
1289 const auto trial_eval = pfe_trial.PrecompReferenceShapeFunctions().col(k);
1290 const auto test_eval = pfe_test.PrecompReferenceShapeFunctions().col(k);
1291 const auto beta_dot_n = normals.col(segment).transpose() * betaeval[k];
1294 mat += w * test_eval * trial_eval.transpose() * beta_dot_n;
1329template <
typename SCALAR,
typename FUNCTOR>
1331 static_assert(lf::mesh::utils::isMeshFunction<FUNCTOR>);
1378 std::array<lf::uscalfe::PrecomputedScalarReferenceFiniteElement<SCALAR>, 5>
1386template <
class PTR,
class FUNCTOR>
1392template <
typename SCALAR,
typename FUNCTOR>
1396 : f_(std::move(f)), test_component_(test_component), fe_precomp_test_() {
1399 auto fe_test = fe_space_test->ShapeFunctionLayout(ref_el,
test_component_);
1404 if (fe_test !=
nullptr) {
1415template <
typename SCALAR,
typename FUNCTOR>
1420 auto& pfe_test = fe_precomp_test_[cell.
RefEl().
Id()];
1423 LF_ASSERT_MSG(pfe_test.isInitialized(),
1424 "missing local shape function on ref_el " << cell.
RefEl());
1428 LF_ASSERT_MSG(geo_ptr !=
nullptr,
"Invalid geometry");
1429 LF_ASSERT_MSG(geo_ptr->
DimLocal() == 2,
"Only 2D implementation available");
1432 const Eigen::VectorXd determinants(
1434 LF_ASSERT_MSG(determinants.size() == pfe_test.Qr().NumPoints(),
1435 "Mismatch " << determinants.size() <<
" <-> "
1436 << pfe_test.Qr().NumPoints());
1439 auto fval = f_(cell, pfe_test.Qr().Points());
1442 elem_vec_t vec(pfe_test.NumRefShapeFunctions());
1446 for (
size_type k = 0; k < pfe_test.Qr().NumPoints(); ++k) {
1448 const double w = pfe_test.Qr().Weights()[k] * determinants[k];
1449 vec += fval[k] * w * pfe_test.PrecompReferenceShapeFunctions().col(k);
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
constexpr unsigned int Id() const
Return a unique id for this reference element.
constexpr size_type NumSubEntities(dim_t sub_codim) const
Get the number of sub-entities of this RefEl with the given codimension.
static constexpr RefEl kTria()
Returns the reference triangle.
static constexpr RefEl kQuad()
Returns the reference quadrilateral.
Interface class for shape information on a mesh cell in the spirit of parametric finite element metho...
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...
virtual std::unique_ptr< Geometry > SubGeometry(dim_t codim, dim_t i) const =0
Construct a new Geometry() object that describes the geometry of the i-th sub-entity with codimension...
Interface class representing a topological entity in a cellular complex
virtual const geometry::Geometry * Geometry() const =0
Describes the geometry of this entity.
virtual nonstd::span< const Entity *const > SubEntities(unsigned rel_codim) const =0
Return all sub entities of this entity that have the given codimension (w.r.t. this entity!...
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
Represents a Quadrature Rule over one of the Reference Elements.
const Eigen::VectorXd & Weights() const
All quadrature weights as a vector.
const Eigen::MatrixXd & Points() const
All quadrature points as column vectors.
base::size_type NumPoints() const
Return the total number of quadrature points (num of columns of points/weights)
Helper class which stores a ScalarReferenceFiniteElement with precomputed values at the nodes of a qu...
bool isInitialized() const
Tells initialization status of object.
size_type NumRefShapeFunctions() const override
Total number of reference shape functions associated with the reference cell.
const Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > & PrecompReferenceShapeFunctions() const
Value of EvalReferenceShapeFunctions(Qr().Points())
const quad::QuadRule & Qr() const
Return the Quadrature rule at which the shape functions (and their gradients) have been precomputed.
const Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > & PrecompGradientsReferenceShapeFunctions() const
Value of EvalGradientsReferenceShapeFunctions(Qr().Points())
Class for local quadrature based computations sub element matrices corresponding to convection-like e...
CONVECTION_COEFF_2 beta_2_
functor providing the "second" convection coefficient
ConvectionElementMatrixProvider(const ConvectionElementMatrixProvider &)=delete
~ConvectionElementMatrixProvider() override=default
ElemMat Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element matrices
typename SubElementMatrixProvider< SCALAR >::elem_mat_t elem_mat_t
inherited types for element matrices
size_type TestComponent() const override
returns the index of the test space component which is the test space for the bilinear form
size_type trial_component_
index of the involved trial component
size_type test_component_
index of the involved test component
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_trial_
array containing the precomputed information for the trial space: fe_precomp_trial[i] contains the pr...
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_test_
array containing the precomputed information for the test space: fe_precomp_trial[i] contains the pre...
typename SubElementMatrixProvider< SCALAR >::ElemMat ElemMat
size_type TrialComponent() const override
returns the index of the trial space component which is the trial space for the bilinear form
CONVECTION_COEFF_1 beta_1_
functor providing "first" convection coefficient
ConvectionElementMatrixProvider(ConvectionElementMatrixProvider &&) noexcept=default
Class for local quadrature based computations of sub element matrices corresponding to diffusion elem...
DiffusionElementMatrixProvider(DiffusionElementMatrixProvider &&) noexcept=default
typename SubElementMatrixProvider< SCALAR >::ElemMat ElemMat
size_type trial_component_
index of trial component u
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_trial_
array containing the precomputed information for the trial space: fe_precomp_trial[i] contains the pr...
DIFF_COEFF alpha_
functor providing the diffusion coefficient
DiffusionElementMatrixProvider(const DiffusionElementMatrixProvider &)=delete
size_type TestComponent() const override
returns the index of the test space component which is the test space for the bilinear form
~DiffusionElementMatrixProvider() override=default
ElemMat Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element matrices
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_test_
array containing the precomputed information for the test space: fe_precomp_trial[i] contains the pre...
size_type test_component_
index of test component v
size_type TrialComponent() const override
returns the index of the trial space component which is the trial space for the bilinear form
typename SubElementMatrixProvider< SCALAR >::elem_mat_t elem_mat_t
inherited types for element matrices
class for local quadrature based computations of sub element matrices corresponding to element matric...
ElemMat Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element matrices
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_trial_
array containing the precomputed information for the trial space flux component: fe_precomp_trial[i] ...
typename SubElementMatrixProvider< SCALAR >::ElemMat ElemMat
size_type TestComponent() const override
returns the index of the test space component which is the test space for the bilinear form
typename SubElementMatrixProvider< SCALAR >::elem_mat_t elem_mat_t
inherited types for element matrices
size_type trial_component_
index of the trial component
FluxElementMatrixProvider(FluxElementMatrixProvider &&) noexcept=default
DIFF_COEFF alpha_
functor providing the coefficient invoved in the bilinear form
PrescribedSignProvider sign_provider_
helper class, to evaluate the sgn_K function
std::array< std::vector< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR > >, 5 > fe_precomp_test_
array containing the precomputed information for the trial space: fe_precomp_trial[i][j] contains the...
FluxElementMatrixProvider(const FluxElementMatrixProvider &)=delete
~FluxElementMatrixProvider() override=default
size_type TrialComponent() const override
returns the index of the trial space component which is the trial space for the bilinear form
size_type test_component_
index of test component v
Class for local quadrature based computations of sub vectors corresponding to load vectors.
typename SubElementVectorProvider< SCALAR >::elem_vec_t elem_vec_t
inherited types for element vectors
~LoadElementVectorProvider() override=default
LoadElementVectorProvider(LoadElementVectorProvider &&) noexcept=default
size_type test_component_
index of test component v
LoadElementVectorProvider(const LoadElementVectorProvider &)=delete
FUNCTOR f_
functor providing the source function
ElemVec Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element vectors
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_test_
array containing precomputed information for the test space: fe_precomp_test_[i] contains the precomp...
size_type TestComponent() const override
returns the index of the test space component which is the test space for the linear form
typename SubElementVectorProvider< SCALAR >::ElemVec ElemVec
Class which allows evaluation of the function.
Class for local quadrature based computations of sub element matrices corresponding to reaction eleme...
typename SubElementMatrixProvider< SCALAR >::elem_mat_t elem_mat_t
inherited types for element matrices
size_type test_component_
index of test component v
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_trial_
array containing the precomputed information for the trial space: fe_precomp_trial[i] contains the pr...
typename SubElementMatrixProvider< SCALAR >::ElemMat ElemMat
size_type TestComponent() const override
returns the index of the test space component which is the test space for the bilinear form
std::array< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR >, 5 > fe_precomp_test_
array containing the precomputed information for the test space: fe_precomp_trial[i] contains the pre...
size_type trial_component_
index of trial component u
ReactionElementMatrixProvider(ReactionElementMatrixProvider &&) noexcept=default
ElemMat Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element matrices
size_type TrialComponent() const override
returns the index of the trial space component which is the trial space for the bilinear form
REACTION_COEFF gamma_
functor providing reaction coefficient
~ReactionElementMatrixProvider() override=default
ReactionElementMatrixProvider(const ReactionElementMatrixProvider &)=delete
Interface class providing sub element matrices associated with bilinear forms between components of C...
lf::uscalfe::size_type size_type
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > elem_mat_t
internal type for element matrices
Interface class providing element vectors associated with linear forms of a component of a cartesian/...
lf::uscalfe::size_type size_type
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > elem_vec_t
internal type for element vectors
Class for local quadrature based computations of sub element matrices corresponding to element matric...
typename SubElementMatrixProvider< SCALAR >::ElemMat ElemMat
COEFF beta_
functor providing the coefficient invoved in the bilinear form
size_type test_component_
index of test component v
size_type TestComponent() const override
returns the index of the test space component which is the test space for the bilinear form
std::array< std::vector< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR > >, 5 > fe_precomp_test_
array containing the precomputed information for the test space: fe_precomp_trial[i][j] contains the ...
std::array< lf::quad::QuadRule, 5 > segment_qr_
the original segment quad rule used to construct the quadrules on ref_el boundaries....
typename SubElementMatrixProvider< SCALAR >::elem_mat_t elem_mat_t
inherited types for element matrices
~TraceElementMatrixProvider() override=default
TraceElementMatrixProvider(TraceElementMatrixProvider &&) noexcept=default
ElemMat Eval(const lf::mesh::Entity &cell) override
main routine for the computation of element matrices
std::array< std::vector< lf::uscalfe::PrecomputedScalarReferenceFiniteElement< SCALAR > >, 5 > fe_precomp_trial_
array containing the precomputed information for the trial space: fe_precomp_trial[i][j] contains the...
size_type TrialComponent() const override
returns the index of the trial space component which is the trial space for the bilinear form
TraceElementMatrixProvider(const TraceElementMatrixProvider &)=delete
size_type trial_component_
index of trial component
QuadRule make_QuadRule(base::RefEl ref_el, unsigned degree)
Returns a QuadRule object for the given Reference Element and Degree.
lf::assemble::dim_t dim_t
std::map< lf::base::RefEl, lf::quad::QuadRule > quad_rule_collection_t
Auxiliary data structure for passing collections of quadrature rules.
Contains functionality for the implementation of DPG methods.
std::vector< lf::quad::QuadRule > BoundaryQuadRule(lf::base::RefEl ref_el, const lf::quad::QuadRule &qr)
Constructs a quadrature rule on the boundary of a reference element.
FluxElementMatrixProvider(PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, DIFF_COEFF alpha) -> FluxElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF >
lf::uscalfe::quad_rule_collection_t quad_rule_collection_t
data structure for passing collections of quadrature rules, see lf::uscalfe for more information.
DiffusionElementMatrixProvider(PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, DIFF_COEFF alpha) -> DiffusionElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF >
ConvectionElementMatrixProvider(PTR fe_trial, PTR fe_test, size_type trial_component, size_type test_component, CONVECTION_COEFF_1 beta_1, CONVECTION_COEFF_2 beta_2) -> ConvectionElementMatrixProvider< typename PTR::element_type::SCALAR, CONVECTION_COEFF_1, CONVECTION_COEFF_2 >
LoadElementVectorProvider(PTR fe_space_test, size_type test_component, FUNCTOR f) -> LoadElementVectorProvider< typename PTR::element_type::SCALAR, FUNCTOR >
ReactionElementMatrixProvider(PTR fe_trial, PTR fe_test, size_type trial_component, size_type test_component, REACTION_COEFF gamma) -> ReactionElementMatrixProvider< typename PTR::element_type::SCALAR, REACTION_COEFF >
lf::uscalfe::size_type size_type
Type for vector length/matrix sizes.
Eigen::MatrixXd OuterNormals(const lf::geometry::Geometry &geometry)
Compute the outer normals of a geometry object.
TraceElementMatrixProvider(PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, COEFF alpha) -> TraceElementMatrixProvider< typename PTR::element_type::SCALAR, COEFF >