91 const unsigned int face_no = 0;
96 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
99 FETools::compute_face_embedding_matrices<dim, double>(*
this,
106 unsigned int target_row = 0;
107 for (
unsigned int d = 0; d < GeometryInfo<dim>::max_children_per_face; ++d)
108 for (
unsigned int i = 0; i < face_embeddings[d].
m(); ++i)
110 for (
unsigned int j = 0; j < face_embeddings[d].
n(); ++j)
137 std::ostringstream namebuf;
138 namebuf <<
"FE_RaviartThomas<" << dim <<
">(" << this->degree - 1 <<
")";
140 return namebuf.str();
145std::unique_ptr<FiniteElement<dim, dim>>
148 return std::make_unique<FE_RaviartThomas<dim>>(*this);
162 const unsigned int n_interior_points = (deg > 0) ? cell_quadrature.
size() : 0;
167 const unsigned int face_no = 0;
169 unsigned int n_face_points = (dim > 1) ? 1 : 0;
171 for (
unsigned int d = 1; d < dim; ++d)
172 n_face_points *= deg + 1;
175 this->generalized_support_points.resize(
177 this->generalized_face_support_points[face_no].resize(n_face_points);
180 unsigned int current = 0;
184 QGauss<dim - 1> face_points(deg + 1);
188 boundary_weights.reinit(n_face_points, legendre.n());
190 for (
unsigned int k = 0; k < n_face_points; ++k)
192 this->generalized_face_support_points[face_no][k] =
193 face_points.point(k);
197 for (
unsigned int i = 0; i < legendre.n(); ++i)
199 boundary_weights(k, i) =
200 face_points.weight(k) *
201 legendre.compute_value(i, face_points.point(k));
208 for (; current < GeometryInfo<dim>::faces_per_cell * n_face_points;
213 this->generalized_support_points[current] = faces.
point(
216 this->reference_cell(), 0,
true,
false,
false, n_face_points));
224 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
225 for (
unsigned int dd = 0; dd < dim; ++dd)
227 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
228 for (
unsigned int d = 0; d < dim; ++d)
232 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
235 interior_weights.reinit(
238 for (
unsigned int k = 0; k < cell_quadrature.
size(); ++k)
240 this->generalized_support_points[current++] = cell_quadrature.
point(k);
241 for (
unsigned int i = 0; i < polynomials[0]->n(); ++i)
242 for (
unsigned int d = 0; d < dim; ++d)
243 interior_weights(k, i, d) =
244 cell_quadrature.
weight(k) *
245 polynomials[d]->compute_value(i, cell_quadrature.
point(k));
248 Assert(current == this->generalized_support_points.size(),
269 const unsigned int face_no = 0;
271 Assert(this->adjust_quad_dof_index_for_face_orientation_table[0]
272 .n_elements() == 8 * this->n_dofs_per_quad(face_no),
276 const unsigned int n = this->tensor_degree();
330 for (
unsigned int local_face_dof = 0;
331 local_face_dof < this->n_dofs_per_quad(face_no);
335 unsigned int i = local_face_dof % n;
336 unsigned int j = local_face_dof / n;
341 for (
unsigned int case_no = 0; case_no < 8; ++case_no)
348 if (((!face_orientation) && (!face_rotation)) ||
349 ((face_orientation) && (face_rotation)))
353 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
354 local_face_dof, case_no) = j + i * n - local_face_dof;
359 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
360 local_face_dof, case_no) = 0;
364 const unsigned int new_local_face_dof =
366 this->adjust_quad_dof_index_for_face_orientation_table[face_no](
367 local_face_dof, case_no);
369 i = new_local_face_dof % n;
370 j = new_local_face_dof / n;
377 if (!face_flip && face_rotation)
379 this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
380 local_face_dof, case_no) = ((j % 2) == 1);
383 else if (face_flip && !face_rotation)
387 this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
388 local_face_dof, case_no) = ((j % 2) == 1) != ((i % 2) == 1);
391 else if (face_flip && face_rotation)
393 this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
394 local_face_dof, case_no) = ((i % 2) == 1);
403 if (!face_orientation)
404 this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
405 local_face_dof, case_no) =
406 !this->adjust_quad_dof_sign_for_face_orientation_table[face_no](
407 local_face_dof, case_no);
420 for (
unsigned int i = 0; i < GeometryInfo<1>::max_children_per_cell; ++i)
421 this->restriction[0][i].reinit(0, 0);
442 QGauss<dim - 1> q_base(this->degree);
443 const unsigned int n_face_points = q_base.size();
459 for (
unsigned int k = 0; k < q_face.
size(); ++k)
460 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
461 cached_values_on_face(i, k) = this->shape_value_component(
464 for (
unsigned int sub = 0; sub < GeometryInfo<dim>::max_children_per_face;
472 this->reference_cell(), q_base, face, sub);
488 for (
unsigned int k = 0; k < n_face_points; ++k)
489 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
491 for (
unsigned int i_face = 0;
492 i_face < this->n_dofs_per_face(face);
500 this->restriction[iso][child](
501 face * this->n_dofs_per_face(face) + i_face, i_child) +=
502 Utilities::fixed_power<dim - 1>(.5) * q_sub.
weight(k) *
503 cached_values_on_face(i_child, k) *
504 this->shape_value_component(
505 face * this->n_dofs_per_face(face) + i_face,
512 if (this->degree == 1)
517 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
518 for (
unsigned int dd = 0; dd < dim; ++dd)
520 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
521 for (
unsigned int d = 0; d < dim; ++d)
527 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
533 const unsigned int face_no = 0;
536 const unsigned int start_cell_dofs =
545 for (
unsigned int k = 0; k < q_cell.
size(); ++k)
546 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
547 for (
unsigned int d = 0; d < dim; ++d)
548 cached_values_on_cell(i, k, d) =
549 this->shape_value_component(i, q_cell.
point(k), d);
551 for (
unsigned int child = 0; child < GeometryInfo<dim>::max_children_per_cell;
559 for (
unsigned int k = 0; k < q_sub.
size(); ++k)
560 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
562 for (
unsigned int d = 0; d < dim; ++d)
563 for (
unsigned int i_weight = 0; i_weight < polynomials[d]->n();
566 this->restriction[iso][child](start_cell_dofs + i_weight * dim +
569 q_sub.
weight(k) * cached_values_on_cell(i_child, k, d) *
570 polynomials[d]->compute_value(i_weight, q_sub.
point(k));
578std::vector<unsigned int>
583 unsigned int dofs_per_face = 1;
584 for (
unsigned int d = 1; d < dim; ++d)
585 dofs_per_face *= deg + 1;
588 const unsigned int interior_dofs = dim * deg * dofs_per_face;
590 std::vector<unsigned int> dpo(dim + 1);
591 dpo[dim - 1] = dofs_per_face;
592 dpo[dim] = interior_dofs;
600std::pair<Table<2, bool>, std::vector<unsigned int>>
604 for (
unsigned int d = 0; d < dim; ++d)
605 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
606 constant_modes(d, i) =
true;
607 std::vector<unsigned int> components;
608 for (
unsigned int d = 0; d < dim; ++d)
609 components.push_back(d);
610 return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
624 const unsigned int face_index)
const
632 switch (this->degree)
645 return (face_index !=
667 std::vector<double> & nodal_values)
const
669 Assert(support_point_values.size() == this->generalized_support_points.size(),
671 this->generalized_support_points.size()));
672 Assert(nodal_values.size() == this->n_dofs_per_cell(),
674 Assert(support_point_values[0].size() == this->n_components(),
676 this->n_components()));
678 std::fill(nodal_values.begin(), nodal_values.end(), 0.);
680 const unsigned int n_face_points = boundary_weights.size(0);
682 for (
unsigned int k = 0; k < n_face_points; ++k)
683 for (
unsigned int i = 0; i < boundary_weights.size(1); ++i)
685 nodal_values[i + face * this->n_dofs_per_face(face)] +=
686 boundary_weights(k, i) *
687 support_point_values[face * n_face_points + k](
694 const unsigned int face_no = 0;
696 const unsigned int start_cell_dofs =
698 const unsigned int start_cell_points =
701 for (
unsigned int k = 0; k < interior_weights.size(0); ++k)
702 for (
unsigned int i = 0; i < interior_weights.size(1); ++i)
703 for (
unsigned int d = 0; d < dim; ++d)
704 nodal_values[start_cell_dofs + i * dim + d] +=
705 interior_weights(k, i, d) *
706 support_point_values[k + start_cell_points](d);
722#include "fe_raviart_thomas.inst"
FullMatrix< double > inverse_node_matrix
std::vector< MappingKind > mapping_kind
virtual std::size_t memory_consumption() const override
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const override
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
void initialize_restriction()
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
void initialize_quad_dof_index_permutation_and_sign_change()
virtual std::unique_ptr< FiniteElement< dim, dim > > clone() const override
friend class FE_RaviartThomas
void initialize_support_points(const unsigned int rt_degree)
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
virtual std::string get_name() const override
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_unique_faces() const
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
FullMatrix< double > interface_constraints
std::vector< std::vector< FullMatrix< double > > > prolongation
void invert(const FullMatrix< number2 > &M)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
static void project_to_subface(const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, std::vector< Point< dim > > &q_points, const RefinementCase< dim - 1 > &ref_case=RefinementCase< dim - 1 >::isotropic_refinement)
static Quadrature< dim > project_to_all_faces(const Quadrature< dim - 1 > &quadrature)
static Quadrature< dim > project_to_child(const Quadrature< dim > &quadrature, const unsigned int child_no)
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
const Point< dim > & point(const unsigned int i) const
double weight(const unsigned int i) const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
bool get_bit(const unsigned char number, const unsigned int n)
static unsigned int child_cell_on_face(const RefinementCase< dim > &ref_case, const unsigned int face, const unsigned int subface, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false, const RefinementCase< dim - 1 > &face_refinement_case=RefinementCase< dim - 1 >::isotropic_refinement)