58 std::vector<
bool>(dim, true)))
93 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
95 FETools::compute_face_embedding_matrices<dim, double>(*
this,
101 unsigned int target_row = 0;
102 for (
unsigned int d = 0; d < GeometryInfo<dim>::max_children_per_face; ++
d)
103 for (
unsigned int i = 0; i < face_embeddings[
d].
m(); ++i)
105 for (
unsigned int j = 0; j < face_embeddings[
d].
n(); ++j)
128 std::ostringstream namebuf;
129 namebuf <<
"FE_RaviartThomas<" << dim <<
">(" << this->degree - 1 <<
")";
131 return namebuf.str();
136 std::unique_ptr<FiniteElement<dim, dim>>
139 return std_cxx14::make_unique<FE_RaviartThomas<dim>>(*this);
153 const unsigned int n_interior_points = (deg > 0) ? cell_quadrature.
size() : 0;
155 unsigned int n_face_points = (dim > 1) ? 1 : 0;
157 for (
unsigned int d = 1;
d < dim; ++
d)
158 n_face_points *= deg + 1;
161 this->generalized_support_points.resize(
163 this->generalized_face_support_points.resize(n_face_points);
166 unsigned int current = 0;
170 QGauss<dim - 1> face_points(deg + 1);
174 boundary_weights.reinit(n_face_points, legendre.n());
179 for (
unsigned int k = 0; k < n_face_points; ++k)
181 this->generalized_face_support_points[k] = face_points.point(k);
185 for (
unsigned int i = 0; i < legendre.n(); ++i)
187 boundary_weights(k, i) =
188 face_points.weight(k) *
189 legendre.compute_value(i, face_points.point(k));
195 for (; current < GeometryInfo<dim>::faces_per_cell * n_face_points;
200 this->generalized_support_points[current] =
202 0,
true,
false,
false, n_face_points));
210 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
211 for (
unsigned int dd = 0; dd < dim; ++dd)
213 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
214 for (
unsigned int d = 0;
d < dim; ++
d)
219 std_cxx14::make_unique<AnisotropicPolynomials<dim>>(poly);
222 interior_weights.reinit(
225 for (
unsigned int k = 0; k < cell_quadrature.
size(); ++k)
227 this->generalized_support_points[current++] = cell_quadrature.
point(k);
228 for (
unsigned int i = 0; i < polynomials[0]->n(); ++i)
229 for (
unsigned int d = 0;
d < dim; ++
d)
230 interior_weights(k, i,
d) =
231 cell_quadrature.
weight(k) *
232 polynomials[
d]->compute_value(i, cell_quadrature.
point(k));
235 Assert(current == this->generalized_support_points.size(),
248 for (
unsigned int i = 0; i < GeometryInfo<1>::max_children_per_cell; ++i)
249 this->restriction[0][i].
reinit(0, 0);
270 QGauss<dim - 1> q_base(this->degree);
271 const unsigned int n_face_points = q_base.size();
286 for (
unsigned int k = 0; k < q_face.
size(); ++k)
287 for (
unsigned int i = 0; i < this->dofs_per_cell; ++i)
288 cached_values_on_face(i, k) = this->shape_value_component(
291 for (
unsigned int sub = 0; sub < GeometryInfo<dim>::max_children_per_face;
315 for (
unsigned int k = 0; k < n_face_points; ++k)
316 for (
unsigned int i_child = 0; i_child < this->dofs_per_cell;
318 for (
unsigned int i_face = 0; i_face < this->dofs_per_face;
326 this->restriction[iso][child](face * this->dofs_per_face +
329 Utilities::fixed_power<dim - 1>(.5) * q_sub.
weight(k) *
330 cached_values_on_face(i_child, k) *
331 this->shape_value_component(
332 face * this->dofs_per_face + i_face,
339 if (this->degree == 1)
344 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
345 for (
unsigned int dd = 0; dd < dim; ++dd)
347 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
348 for (
unsigned int d = 0;
d < dim; ++
d)
355 std_cxx14::make_unique<AnisotropicPolynomials<dim>>(poly);
359 const unsigned int start_cell_dofs =
368 for (
unsigned int k = 0; k < q_cell.
size(); ++k)
369 for (
unsigned int i = 0; i < this->dofs_per_cell; ++i)
370 for (
unsigned int d = 0;
d < dim; ++
d)
371 cached_values_on_cell(i, k,
d) =
372 this->shape_value_component(i, q_cell.
point(k),
d);
374 for (
unsigned int child = 0; child < GeometryInfo<dim>::max_children_per_cell;
379 for (
unsigned int k = 0; k < q_sub.
size(); ++k)
380 for (
unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child)
381 for (
unsigned int d = 0;
d < dim; ++
d)
382 for (
unsigned int i_weight = 0; i_weight < polynomials[
d]->n();
385 this->restriction[iso][child](start_cell_dofs + i_weight * dim +
388 q_sub.
weight(k) * cached_values_on_cell(i_child, k,
d) *
389 polynomials[
d]->compute_value(i_weight, q_sub.
point(k));
397 std::vector<unsigned int>
402 unsigned int dofs_per_face = 1;
403 for (
unsigned int d = 1;
d < dim; ++
d)
404 dofs_per_face *= deg + 1;
407 const unsigned int interior_dofs = dim * deg * dofs_per_face;
409 std::vector<unsigned int> dpo(dim + 1);
410 dpo[dim - 1] = dofs_per_face;
411 dpo[dim] = interior_dofs;
419 std::pair<Table<2, bool>, std::vector<unsigned int>>
423 for (
unsigned int d = 0;
d < dim; ++
d)
424 for (
unsigned int i = 0; i < this->dofs_per_cell; ++i)
425 constant_modes(
d, i) =
true;
426 std::vector<unsigned int> components;
427 for (
unsigned int d = 0;
d < dim; ++
d)
428 components.push_back(
d);
429 return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
443 const unsigned int face_index)
const
451 switch (this->degree)
464 return (face_index !=
486 std::vector<double> & nodal_values)
const
488 Assert(support_point_values.size() == this->generalized_support_points.size(),
490 this->generalized_support_points.size()));
491 Assert(nodal_values.size() == this->dofs_per_cell,
497 std::fill(nodal_values.begin(), nodal_values.end(), 0.);
499 const unsigned int n_face_points = boundary_weights.size(0);
501 for (
unsigned int k = 0; k < n_face_points; ++k)
502 for (
unsigned int i = 0; i < boundary_weights.size(1); ++i)
504 nodal_values[i + face * this->dofs_per_face] +=
505 boundary_weights(k, i) *
506 support_point_values[face * n_face_points + k](
510 const unsigned int start_cell_dofs =
512 const unsigned int start_cell_points =
515 for (
unsigned int k = 0; k < interior_weights.size(0); ++k)
516 for (
unsigned int i = 0; i < interior_weights.size(1); ++i)
517 for (
unsigned int d = 0;
d < dim; ++
d)
518 nodal_values[start_cell_dofs + i * dim +
d] +=
519 interior_weights(k, i,
d) *
520 support_point_values[k + start_cell_points](
d);
536 #include "fe_raviart_thomas.inst"