24#ifndef VULPES_ASSEMBLE_INTEGRATOR_QFREE_HPP_
25#define VULPES_ASSEMBLE_INTEGRATOR_QFREE_HPP_
35#include <unsupported/Eigen/CXX11/Tensor>
62template <std::
size_t Dim>
72 std::vector<std::pair<double, std::array<uint8_t, Dim * 2>>>
gather;
228 typename FeExpressionTuple,
229 typename FeExpressionFaceTuple = std::tuple<>>
233 FeExpressionFaceTuple> {
239 FeExpressionFaceTuple>;
241 static inline constexpr std::size_t
dim = MeshType::self_dim;
263 std::tuple_element_t<0, FeExpressionTuple>>::FeSpaceType;
265 using PolyType = FeType::FeSpaceType::PolynomialFast;
276 std::decay_t<
decltype(
PolyType{}.template liftDimension<0, 2 * dim>())>;
307 const MeshType& mesh,
309 const FeExpressionTuple& fe_expression,
310 const FeExpressionFaceTuple& fe_expression_face =
311 FeExpressionFaceTuple{});
387 gathered_monos_table);
415 gathered_monos_table);
445 Eigen::Matrix<double, dim, 2> neigh_flat_mapping;
451 const auto periodic_shift = this->
m_cell_manager.getPeriodicShift(
456 neigh_flat_mapping.col(0) = neigh_map.getJacobianInv().array() *
458 neigh_flat_mapping.col(1) =
459 neigh_map.getJacobianInv().array() *
460 (this->
m_mapping->getTranslation().array() +
461 periodic_shift.array()) +
462 neigh_map.getTranslationInv().array();
464 return neigh_flat_mapping;
504 using TypeIJ = std::array<Eigen::Index, 3>;
510 using TypeI = std::array<Eigen::Index, 2>;
535 std::array<RepeatingTableI, s_n_expr_linear>
542 std::array<FlatPolyType, s_n_face_expr_bilinear>
545 std::array<RepeatingTableIJ, s_n_face_expr_bilinear>
552 std::array<FlatPolyType, s_n_face_expr_linear>
555 std::array<RepeatingTableI, s_n_face_expr_linear>
561 std::array<FlatPolyTypeLifted, s_n_face_expr_bilinear>
564 std::array<CompressedListGatheredPoly, s_n_face_expr_bilinear>
568 std::array<CompressedListGatheredPoly, s_n_face_expr_bilinear>
571 std::array<RepeatingTableIJ, s_n_face_expr_bilinear>
611 typename FeExpressionTuple,
612 typename FeExpressionFaceTuple>
616 FeExpressionFaceTuple>::FlatPolyType
621 FeExpressionFaceTuple>
::MonoType>& uncompressed_table) {
623 const auto compr_table_uncompr_monos =
627 compr_table_compr_monos.
indices() = compr_table_uncompr_monos.indices();
628 std::array<std::size_t, dim> exp;
629 for (
const auto& mono : compr_table_uncompr_monos.data()) {
630 for (std::size_t d = 0; d <
dim; ++d) {
631 exp[d] = mono.exp()[d];
633 compr_table_compr_monos.
data().emplace_back(
636 return compr_table_compr_monos;
641 typename FeExpressionTuple,
642 typename FeExpressionFaceTuple>
645 const MeshType& mesh,
647 const FeExpressionTuple& fe_expression,
648 const FeExpressionFaceTuple& fe_expression_face)
650 mesh, cell_manager, fe_expression, fe_expression_face) {
651 const Eigen::Index n_dof_loc = this->
m_fe_space.getBasis().size();
657 const auto [bilinear_exprs, linear_exprs] =
661 bilinear_exprs, [
this, n_dof_loc](
const auto& expr, std::size_t idx) {
663 std::size_t poly_idx = 0;
664 for (Eigen::Index bj = 0; bj <
s_n_blocks; ++bj) {
665 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
666 for (Eigen::Index j = 0; j < n_dof_loc; ++j) {
667 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
668 const Eigen::Matrix<
PolyType, 1, -1> poly_comps =
669 expr->evaluatePoly(this->
m_fe_values, j, i, bj, bi)
670 .unaryExpr([](
const auto& p) {
671 return p.template to<double>();
674 for (Eigen::Index k = 0; k < poly_comps.size(); ++k) {
675 auto& row = poly_table_tmp.
getRow(poly_idx);
676 for (
const auto&
monomial : poly_comps[k].data()) {
689 linear_exprs, [
this, n_dof_loc](
const auto& expr, std::size_t idx) {
691 std::size_t poly_idx = 0;
692 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
693 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
694 const Eigen::Matrix<
PolyType, 1, -1> poly_comps =
697 [](
const auto& p) {
return p.template to<double>(); });
699 for (Eigen::Index k = 0; k < poly_comps.size(); ++k) {
700 auto& row = poly_table_tmp.
getRow(poly_idx);
701 for (
const auto&
monomial : poly_comps[k].data()) {
713 const auto [bilinear_face_exprs, linear_face_exprs] =
718 [
this, n_dof_loc](
const auto& expr, std::size_t idx) {
719 using PolyMatType = std::decay_t<
decltype(expr->evaluatePoly(
721 constexpr auto expr_poly_dim = PolyMatType::Scalar::dim;
724 std::conditional_t<expr_poly_dim == dim, MonoType, MonoTypeLifted>;
726 std::size_t poly_idx = 0;
727 for (Eigen::Index bj = 0; bj <
s_n_blocks; ++bj) {
728 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
729 for (Eigen::Index j = 0; j < n_dof_loc; ++j) {
730 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
731 using ExprPolyType = std::conditional_t<
733 const Eigen::Matrix<ExprPolyType, 1, -1> poly_comps =
734 expr->evaluatePoly(this->
m_fe_values, j, i, bj, bi)
735 .unaryExpr([](
const auto& p) {
736 return p.template to<double>();
739 for (Eigen::Index k = 0; k < poly_comps.size(); ++k) {
740 auto& row = poly_table_tmp.
getRow(poly_idx);
741 for (
const auto&
monomial : poly_comps[k].data()) {
751 if constexpr (expr_poly_dim ==
dim) {
762 linear_face_exprs, [
this, n_dof_loc](
const auto& expr, std::size_t idx) {
764 std::size_t poly_idx = 0;
765 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
766 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
767 const Eigen::Matrix<
PolyType, 1, -1> poly_comps =
770 [](
const auto& p) {
return p.template to<double>(); });
772 for (Eigen::Index k = 0; k < poly_comps.size(); ++k) {
773 auto& row = poly_table_tmp.
getRow(poly_idx);
774 for (
const auto&
monomial : poly_comps[k].data()) {
794 typename FeExpressionTuple,
795 typename FeExpressionFaceTuple>
800 const Eigen::Index n_dof_loc = this->
m_fe_space.getBasis().size();
804 const auto bilinear_tables = std::tuple(
819 auto tpt = std::get<0>(tpts);
820 auto tpt_nodup = std::get<1>(tpts);
821 auto tpt_ijk = std::get<2>(tpts);
822 for (std::size_t exi = 0; exi < tpt->size(); ++exi) {
823 using MonomialType = std::decay_t<
decltype((*tpt)[0][0][0])>;
824 using PolynomialType = std::vector<MonomialType>;
825 const auto npolys = (*tpt)[exi].size();
827 const auto n_k_comps = npolys / slice_size;
830 std::vector<index_t> keep_idxs;
832 std::map<PolynomialType, std::size_t> unq_polys;
835 for (Eigen::Index bj = 0; bj <
s_n_blocks; ++bj) {
836 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
837 for (Eigen::Index j = 0; j < n_dof_loc; ++j) {
838 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
839 for (Eigen::Index k = 0; k < n_k_comps; ++k) {
840 const auto kbibj = &dummy(k, bi, bj) - dummy.data();
844 for (
auto mono : (*tpt)[exi][poly_idx]) {
845 poly.push_back(mono);
847 std::sort(poly.begin(), poly.end());
849 const auto [it, inserted] =
850 unq_polys.emplace(poly, unq_polys.size());
851 table.
getRow(it->second).push_back(ij);
853 keep_idxs.push_back(poly_idx);
863 (*tpt_nodup)[exi] = (*tpt)[exi].slice(keep_idxs);
869 const auto linear_tables = std::tuple(
879 auto tpt = std::get<0>(tpts);
880 auto tpt_nodup = std::get<1>(tpts);
881 auto tpt_i = std::get<2>(tpts);
882 for (std::size_t exi = 0; exi < tpt->size(); ++exi) {
883 using MonomialType = std::decay_t<
decltype((*tpt)[0][0][0])>;
884 using PolynomialType = std::vector<MonomialType>;
885 const auto npolys = (*tpt)[exi].size();
886 const auto slice_size = n_dof_loc *
s_n_blocks;
887 const auto n_k_comps = npolys / slice_size;
890 std::vector<index_t> keep_idxs;
892 std::map<PolynomialType, std::size_t> unq_polys;
894 Eigen::Tensor<double, 2> dummy(n_k_comps,
s_n_blocks);
895 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
896 for (Eigen::Index i = 0; i < n_dof_loc; ++i) {
897 for (Eigen::Index k = 0; k < n_k_comps; ++k) {
898 const auto kbi = &dummy(k, bi) - dummy.data();
901 for (
auto mono : (*tpt)[exi][poly_idx]) {
902 poly.push_back(mono);
904 std::sort(poly.begin(), poly.end());
906 const auto [it, inserted] =
907 unq_polys.emplace(poly, unq_polys.size());
908 table.
getRow(it->second).push_back(i_entry);
910 keep_idxs.push_back(poly_idx);
918 (*tpt_nodup)[exi] = (*tpt)[exi].slice(keep_idxs);
926 typename FeExpressionTuple,
927 typename FeExpressionFaceTuple>
932 FeExpressionFaceTuple>::GatheredPolynomial>,
936 FeExpressionFaceTuple>::s_n_face_expr_bilinear>
941 gathered_monos_table;
944 for (
index_t poly_id = 0; poly_id < old_table.size(); ++poly_id) {
946 for (
const auto& mono : old_table[poly_id]) {
951 std::array<uint32_t, dim> int_ids;
952 for (std::size_t d = 0; d <
dim; ++d) {
953 int_ids[d] = mono.exp()[d];
955 std::array<uint8_t, dim * 2> eva_ids;
956 for (std::size_t d = 0; d <
dim * 2; ++d) {
957 eva_ids[d] = mono.exp()[d +
dim];
960 if (lin_id > std::numeric_limits<uint16_t>::max()) {
961 throw std::length_error(
962 "QFree: polynomial degree too high for the 16-bit monomial "
963 "index, use the Simplexify integrator");
965 const uint16_t int_id = lin_id;
969 std::size_t mono_id = -1;
970 for (std::size_t j = 0; j < gathered_poly.size(); ++j) {
971 if (gathered_poly[j].integr_id == int_id) {
976 if (mono_id == std::size_t(-1)) {
981 .gather = {{mono.coef(), eva_ids}}});
984 gathered_poly[mono_id].gather.push_back({mono.coef(), eva_ids});
989 for (
auto& mono : gathered_poly) {
990 std::array<uint8_t, dim * 2> min_id;
993 for (
const auto& c : mono.gather) {
994 for (std::size_t d = 0; d <
dim * 2; ++d) {
995 min_id[d] = std::min(min_id[d], c.second[d]);
999 mono.evalut_id = min_id;
1000 for (
auto& c : mono.gather) {
1001 for (std::size_t d = 0; d <
dim * 2; ++d) {
1002 c.second[d] -= min_id[d];
1006 gathered_monos_table[i].push_back(gathered_poly);
1009 return gathered_monos_table;
1015 typename FeExpressionTuple,
1016 typename FeExpressionFaceTuple>
1017std::vector<std::array<
1022 FeExpressionFaceTuple>::dim *
1027 std::vector<GatheredPolynomial>,
1029 std::set<std::array<uint8_t, dim * 2>> eva_set;
1030 for (
const auto& gathered_monos : gathered_monos_table) {
1031 for (
const auto& poly : gathered_monos) {
1032 for (
const auto& mono : poly) {
1033 eva_set.insert(mono.evalut_id);
1034 for (
const auto& entry : mono.gather) {
1035 eva_set.insert(entry.second);
1040 return std::vector<std::array<uint8_t, dim * 2>>(
1041 eva_set.begin(), eva_set.end());
1046 typename FeExpressionTuple,
1047 typename FeExpressionFaceTuple>
1051 FeExpressionFaceTuple>::
1052 compressGatheredLiftedPolynomials(
1054 std::vector<GatheredPolynomial>,
1057 throw std::length_error(
1058 "QFree: too many evaluation monomials for the 16-bit index, use the "
1059 "Simplexify integrator");
1065 std::map<GatheredPolynomialCoef, uint32_t> gather_table;
1066 using CompressedGatheredPolynomial = std::vector<CompressedGatheredMonomial>;
1068 compr_gathered_monos_table;
1069 for (std::size_t expr_id = 0; expr_id < compr_gathered_monos_table.size();
1071 auto& compr_gathered_monos = compr_gathered_monos_table[expr_id];
1072 compr_gathered_monos.resize(gathered_monos_table[expr_id].size());
1073 for (std::size_t i = 0; i < gathered_monos_table[expr_id].size(); ++i) {
1074 const auto& poly = gathered_monos_table[expr_id][i];
1075 compr_gathered_monos[i].resize(poly.size());
1076 for (std::size_t j = 0; j < poly.size(); ++j) {
1077 const auto& mono = poly[j];
1078 auto& compr_mono = compr_gathered_monos[i][j];
1079 compr_mono.integr_id = mono.integr_id;
1081 const auto it = std::lower_bound(
1084 assert(*it == mono.evalut_id);
1088 std::vector<std::pair<double, uint16_t>> sorted_gather;
1089 for (
const auto& [coef, eval_id] : mono.gather) {
1090 const auto eval_it = std::lower_bound(
1093 assert(*eval_it == eval_id);
1094 sorted_gather.push_back(
1097 std::sort(sorted_gather.begin(), sorted_gather.end());
1098 const auto [gather_it, inserted] =
1099 gather_table.emplace(sorted_gather, (uint32_t)gather_table.size());
1100 compr_mono.gather_id = gather_it->second;
1107 if (gather_table.size() > std::numeric_limits<uint32_t>::max()) {
1108 throw std::length_error(
"QFree: gather table exceeds the 32-bit index");
1111 std::vector<GatheredPolynomialCoef> gather_table_flat(gather_table.size());
1112 for (
const auto& [gather,
id] : gather_table) {
1113 gather_table_flat[id] = gather;
1120 typename FeExpressionTuple,
1121 typename FeExpressionFaceTuple>
1135 typename FeExpressionTuple,
1136 typename FeExpressionFaceTuple>
1142 const double jac_det = this->
m_mapping->jacobianDet({});
1143 std::vector<double> buffer;
1145 const auto [bilinear_exprs, linear_exprs] =
1149 bilinear_exprs, [
this, jac_det, aints_data, &buffer](
1150 const auto& expr, Eigen::Index expr_id) {
1153 buffer.resize(table.size());
1154 for (
index_t i = 0; i < table.size(); ++i) {
1155 double integral = 0.0;
1156 for (
const auto mono : table[i]) {
1157 integral += mono.coef * aints_data[mono.integr_id];
1159 buffer[i] = integral;
1168 for (Eigen::Index bj = 0; bj <
s_n_blocks; ++bj) {
1169 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
1170 const auto coef = expr->evaluatePolyCoef(
1172 assert(coef.size() == K);
1173 assert(coef.rows() == 1);
1174 for (Eigen::Index k = 0; k < K; ++k) {
1175 coefs(k, bi, bj) = coef(0, k);
1181 for (
index_t pid = 0; pid < table.size(); ++pid) {
1182 const auto integral = jac_det * buffer[pid];
1183 for (
const auto ijk : table[pid]) {
1185 coefs.data()[ijk[2]] * integral;
1192 linear_exprs, [
this, jac_det, aints_data, &buffer](
1193 const auto& expr, Eigen::Index expr_id) {
1196 buffer.resize(table.size());
1197 for (
index_t i = 0; i < table.size(); ++i) {
1198 double integral = 0.0;
1199 for (
const auto mono : table[i]) {
1200 integral += mono.coef * aints_data[mono.integr_id];
1202 buffer[i] = integral;
1209 Eigen::Tensor<double, 2> coefs(K,
s_n_blocks);
1210 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
1211 const auto coef = expr->evaluatePolyCoef(
1213 assert(coef.size() == K);
1214 assert(coef.rows() == 1);
1215 for (Eigen::Index k = 0; k < K; ++k) {
1216 coefs(k, bi) = coef(0, k);
1220 for (
index_t pid = 0; pid < table.size(); ++pid) {
1221 const auto integral = jac_det * buffer[pid];
1222 for (
const auto ij : table[pid]) {
1223 this->
m_rhs(ij[0], expr_id) += coefs.data()[ij[1]] * integral;
1234 typename FeExpressionTuple,
1235 typename FeExpressionFaceTuple>
1239 const double jac_det = this->
m_mapping->jacobianDet({});
1240 const auto jac = this->
m_mapping->getJacobian();
1242 const Eigen::Vector<double, dim> ns = cell.normals().col(this->
m_face_id);
1243 const Eigen::Vector<double, dim> Fns = jac.array() * ns.array();
1249 const double nanson = jac_det / Fns.norm();
1255 typename FeExpressionTuple,
1256 typename FeExpressionFaceTuple>
1263 Eigen::Matrix<double,
dim * 2, -1> eval_table(
dim * 2, 32);
1264 eval_table.col(0) = Eigen::VectorXd::Ones(
dim * 2);
1266 Eigen::Map<const Eigen::VectorXd>(neigh_map.data(),
dim * 2);
1267 for (Eigen::Index i = 2; i < eval_table.cols(); ++i) {
1269 eval_table.col(i - 1).array() * eval_table.col(1).array();
1274 for (std::size_t d = 0; d < 2 *
dim; ++d) {
1278 Profiler::stop(
"integrate::precomputeMonomialCoefsForFace::pt1");
1288 Profiler::stop(
"integrate::precomputeMonomialCoefsForFace::pt2");
1293 typename FeExpressionTuple,
1294 typename FeExpressionFaceTuple>
1298 FeExpressionFaceTuple>::
1299 integrateFaceCell(
const double* eints_data,
double nanson) {
1300 std::vector<double> buffer;
1301 const auto [bilinear_face_exprs, linear_face_exprs] =
1305 bilinear_face_exprs, [
this, nanson, eints_data, &buffer](
1306 const auto& expr, Eigen::Index expr_id) {
1307 using PolyMatType = std::decay_t<
decltype(expr->evaluatePoly(
1309 constexpr auto expr_poly_dim = PolyMatType::Scalar::dim;
1312 if (!curr_integral.size()) {
1318 if constexpr (expr_poly_dim ==
dim) {
1320 buffer.resize(table.size());
1321 for (
index_t i = 0; i < table.size(); ++i) {
1322 double integral = 0.0;
1323 for (
const auto mono : table[i]) {
1324 integral += mono.coef * eints_data[mono.integr_id];
1326 buffer[i] = integral;
1331 buffer.resize(table.size());
1332 for (
index_t i = 0; i < table.size(); ++i) {
1333 double integral = 0.0;
1334 for (
const auto mono : table[i]) {
1337 eints_data[mono.integr_id];
1339 buffer[i] = integral;
1349 for (Eigen::Index bj = 0; bj <
s_n_blocks; ++bj) {
1350 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
1351 const auto coef = expr->evaluatePolyCoef(
1353 assert(coef.size() == K);
1354 assert(coef.rows() == 1);
1355 for (Eigen::Index k = 0; k < K; ++k) {
1356 coefs(k, bi, bj) = coef(0, k);
1365 using TableType = std::decay_t<std::conditional_t<
1368 const TableType* table =
nullptr;
1369 if constexpr (expr_poly_dim ==
dim) {
1374 for (
index_t pid = 0; pid < (*table).size(); ++pid) {
1375 const auto integral = nanson * buffer[pid];
1376 for (
const auto ijk : (*table)[pid]) {
1377 curr_integral(ijk[0], ijk[1]) += coefs.data()[ijk[2]] * integral;
1385 linear_face_exprs, [
this, nanson, eints_data, &buffer](
1386 const auto& expr, Eigen::Index expr_id) {
1388 if (!curr_rhs.size()) {
1393 buffer.resize(table.size());
1394 for (
index_t i = 0; i < table.size(); ++i) {
1395 double integral = 0.0;
1396 for (
const auto mono : table[i]) {
1397 integral += mono.coef * eints_data[mono.integr_id];
1399 buffer[i] = integral;
1403 Eigen::Tensor<double, 2> coefs(K,
s_n_blocks);
1404 for (Eigen::Index bi = 0; bi <
s_n_blocks; ++bi) {
1405 const auto coef = expr->evaluatePolyCoef(
1407 assert(coef.size() == K);
1408 assert(coef.rows() == 1);
1409 for (Eigen::Index k = 0; k < K; ++k) {
1410 coefs(k, bi) = coef(0, k);
1414 const auto& ij_table =
1416 for (
index_t pid = 0; pid < ij_table.size(); ++pid) {
1417 const auto integral = nanson * buffer[pid];
1418 for (
const auto ij : ij_table[pid]) {
1419 curr_rhs(ij[0]) += coefs.data()[ij[1]] * integral;
1428 typename FeExpressionTuple,
1429 typename FeExpressionFaceTuple>
1440 const auto integrateMonomials =
1442 const auto [aints, eints] = integrateMonomials(cell, order);
1447 const auto eints_data = eints.begin();
1448 const auto slice_dim = aints.numel();
1452 const double* eints_curr_data = eints_data + this->
m_face_id * slice_dim;
static void stop(const char *label)
stop(label) when recording is on.
Definition profiler.hpp:90
static void start(const char *label)
start(label) when recording is on.
Definition profiler.hpp:84
Manages geometrical information about the cell and its mapping to the reference element.
Definition cell_manager.hpp:62
A class that behaves like a vector of vectors, providing automatic row range checking.
Definition crs_map.hpp:758
SmallVector< DataType, N > & getRow(std::size_t row_idx)
Access a row of the matrix as a mutable reference.
Definition crs_map.hpp:857
Definition crs_map.hpp:72
const auto & indices() const
Constant accessor to the indices buffer.
Definition crs_map.hpp:442
const auto & data() const
Constant accessor to the data buffer.
Definition crs_map.hpp:438
constexpr auto split_expression_tuple(std::tuple< Ts... > t)
Definition integrator_traits.hpp:145
Definition cell_manager.hpp:39
Definition monomial.hpp:44
T getLinearIndex(const std::array< T, Dim > &monomial)
Computes the linear index given the exponents of the monomial.
Definition monomial.hpp:218
auto integrateMonomialsQFree(const geometry::Cell< Dim, FloatType, IndexType > &elem, IndexType deg)
Definition qfree.hpp:264
void for_each_idxed(Tuple &&tuple, Func &&func)
Apply func to every element of tuple together with its index.
Definition vvutils.hpp:165
void for_each(Tuple &&tuple, Func &&func)
Apply func to every element of tuple, in order.
Definition vvutils.hpp:142
Definition cell_manager.hpp:38
A fully compressed representation of a gathered monomial GatheredMonomial for face integrals.
Definition integrator_qfree.hpp:107
uint16_t evalut_id
ID for the common evaluation part (lookup for mapping-related coefficients).
Definition integrator_qfree.hpp:113
bool operator<(const CompressedGatheredMonomial &other) const
Comparison operator to allow sorting and storing in ordered containers.
Definition integrator_qfree.hpp:124
uint32_t gather_id
ID for the gathered sum of terms (lookup for the expression in parentheses).
Definition integrator_qfree.hpp:116
uint16_t integr_id
ID for the integrable part of the monomial (lookup for ).
Definition integrator_qfree.hpp:110
A compressed representation of a standard monomial.
Definition integrator_qfree.hpp:81
double coef
The coefficient of the monomial.
Definition integrator_qfree.hpp:83
bool operator<(const CompressedMonomial &other) const
Comparison operator to allow sorting and storing in ordered containers.
Definition integrator_qfree.hpp:94
std::size_t integr_id
A unique ID representing the monomial's exponents, obtained via linearization (e.g....
Definition integrator_qfree.hpp:86
Represents a monomial after the "gathering" process for face integrals.
Definition integrator_qfree.hpp:63
std::vector< std::pair< double, std::array< uint8_t, Dim *2 > > > gather
A collection of remaining terms. Each pair contains a coefficient and the exponents of the non-common...
Definition integrator_qfree.hpp:72
std::array< uint8_t, Dim *2 > evalut_id
A unique ID for the common evaluation part of the monomial (e.g., the term in ).
Definition integrator_qfree.hpp:69
uint16_t integr_id
A unique ID representing the part of the monomial to be integrated (e.g., ).
Definition integrator_qfree.hpp:66