68 const Point<dim> centroid = reference_cell.barycenter();
78 points.push_back(centroid);
85 for (
const auto &face_no : reference_cell.face_indices())
88 for (
const auto face_vertex_no :
89 reference_cell.face_reference_cell(0).vertex_indices())
91 const auto vertex_no =
92 reference_cell.face_to_cell_vertices(
97 midpoint += reference_cell.vertex(vertex_no);
101 reference_cell.face_reference_cell(0).n_vertices();
102 points.push_back(midpoint);
105 points.push_back(centroid);
132 const auto reference_cell = ReferenceCells::get_simplex<dim>();
133 const Point<dim> centroid = reference_cell.barycenter();
135 auto M = [](
const unsigned int d) {
155 for (
const auto &vertex : reference_cell.vertex_indices())
156 c_bubble = c_bubble * M(vertex);
157 c_bubble = c_bubble / c_bubble.
value(centroid);
159 std::vector<BarycentricPolynomial<dim>> bubble_functions;
162 bubble_functions.push_back(c_bubble);
169 for (
const auto &face_no : reference_cell.face_indices())
171 std::vector<unsigned int> vertices;
172 for (
const auto face_vertex_no :
173 reference_cell.face_reference_cell(0).vertex_indices())
174 vertices.push_back(reference_cell.face_to_cell_vertices(
181 27.0 * M(vertices[0]) * M(vertices[1]) * M(vertices[2]);
182 bubble_functions.push_back(b -
183 b.value(centroid) * c_bubble);
186 bubble_functions.push_back(c_bubble);
191 const std::vector<Point<dim>> support_points =
192 unit_support_points<dim>(degree);
193 const std::vector<Point<dim>> bubble_support_points(
194 support_points.begin() + fe_p.n(), support_points.end());
195 Assert(bubble_support_points.size() == bubble_functions.size(),
197 const unsigned int n_bubbles = bubble_support_points.size();
200 std::vector<BarycentricPolynomial<dim>> lump_polys;
201 for (
unsigned int i = 0; i < fe_p.n(); ++i)
205 for (
unsigned int j = 0; j < n_bubbles; ++j)
208 p.
value(bubble_support_points[j]) * bubble_functions[j];
211 lump_polys.push_back(p);
214 for (
auto &p : bubble_functions)
215 lump_polys.push_back(std::move(p));
221 for (
const auto &p : lump_polys)
225 for (
unsigned int d = 0; d < dim; ++d)