70 const Point<dim> centroid = reference_cell.template barycenter<dim>();
80 points.push_back(centroid);
87 for (
const auto &face_no : reference_cell.face_indices())
90 for (
const auto face_vertex_no :
91 reference_cell.face_reference_cell(0).vertex_indices())
93 const auto vertex_no =
94 reference_cell.face_to_cell_vertices(
100 reference_cell.template vertex<dim>(vertex_no);
104 reference_cell.face_reference_cell(0).n_vertices();
105 points.push_back(midpoint);
108 points.push_back(centroid);
135 const auto reference_cell = ReferenceCells::get_simplex<dim>();
136 const Point<dim> centroid = reference_cell.template barycenter<dim>();
138 auto M = [](
const unsigned int d) {
158 for (
const auto &vertex : reference_cell.vertex_indices())
159 c_bubble = c_bubble * M(vertex);
160 c_bubble = c_bubble / c_bubble.
value(centroid);
162 std::vector<BarycentricPolynomial<dim>> bubble_functions;
165 bubble_functions.push_back(c_bubble);
172 for (
const auto &face_no : reference_cell.face_indices())
174 std::vector<unsigned int> vertices;
175 for (
const auto face_vertex_no :
176 reference_cell.face_reference_cell(0).vertex_indices())
177 vertices.push_back(reference_cell.face_to_cell_vertices(
184 27.0 * M(vertices[0]) * M(vertices[1]) * M(vertices[2]);
185 bubble_functions.push_back(b -
186 b.value(centroid) * c_bubble);
189 bubble_functions.push_back(c_bubble);
194 const std::vector<Point<dim>> support_points =
195 unit_support_points<dim>(degree);
196 const std::vector<Point<dim>> bubble_support_points(
197 support_points.begin() + fe_p.n(), support_points.end());
198 Assert(bubble_support_points.size() == bubble_functions.size(),
200 const unsigned int n_bubbles = bubble_support_points.size();
203 std::vector<BarycentricPolynomial<dim>> lump_polys;
204 for (
unsigned int i = 0; i < fe_p.n(); ++i)
208 for (
unsigned int j = 0; j < n_bubbles; ++j)
211 p.
value(bubble_support_points[j]) * bubble_functions[j];
214 lump_polys.push_back(p);
217 for (
auto &p : bubble_functions)
218 lump_polys.push_back(std::move(p));
223 for (
const auto &p : lump_polys)
227 for (
unsigned int d = 0; d < dim; ++d)