91 const unsigned int face_no = 0;
95 std::vector<FullMatrix<double>> face_embeddings(
98 for (
auto &face_embedding : face_embeddings)
108 unsigned int target_row = 0;
109 for (
const auto &face_embedding : face_embeddings)
110 for (
unsigned int i = 0; i < face_embedding.m(); ++i)
112 for (
unsigned int j = 0; j < face_embedding.n(); ++j)
139 std::ostringstream namebuf;
140 namebuf <<
"FE_RaviartThomas<" << dim <<
">(" << this->
degree - 1 <<
")";
142 return namebuf.str();
147std::unique_ptr<FiniteElement<dim, dim>>
150 return std::make_unique<FE_RaviartThomas<dim>>(*this);
164 const unsigned int n_interior_points = (deg > 0) ? cell_quadrature.size() : 0;
169 const unsigned int face_no = 0;
171 unsigned int n_face_points = (dim > 1) ? 1 : 0;
173 for (
unsigned int d = 1; d < dim; ++d)
174 n_face_points *= deg + 1;
178 this->
reference_cell().n_faces() * n_face_points + n_interior_points);
182 unsigned int current = 0;
186 const QGauss<dim - 1> face_points(deg + 1);
192 for (
unsigned int k = 0; k < n_face_points; ++k)
195 face_points.point(k);
199 for (
unsigned int i = 0; i < legendre.n(); ++i)
202 face_points.weight(k) *
203 legendre.compute_value(i, face_points.point(k));
211 for (
unsigned int face_no = 0;
212 face_no < GeometryInfo<dim>::faces_per_cell;
220 for (
unsigned int face_point = 0; face_point < n_face_points;
225 faces.
point(offset + face_point);
235 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
236 for (
unsigned int dd = 0; dd < dim; ++dd)
238 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
239 for (
unsigned int d = 0; d < dim; ++d)
243 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
249 for (
unsigned int k = 0; k < cell_quadrature.size(); ++k)
252 for (
unsigned int i = 0; i < polynomials[0]->n(); ++i)
253 for (
unsigned int d = 0; d < dim; ++d)
255 cell_quadrature.weight(k) *
256 polynomials[d]->compute_value(i, cell_quadrature.point(k));
280 const unsigned int face_no = 0;
343 for (
unsigned int local_face_dof = 0;
348 unsigned int i = local_face_dof % n;
349 unsigned int j = local_face_dof / n;
354 for (
const bool face_orientation : {
false,
true})
355 for (
const bool face_flip : {
false,
true})
356 for (
const bool face_rotation : {
false,
true})
363 if (((!face_orientation) && (!face_rotation)) ||
364 ((face_orientation) && (face_rotation)))
369 ->adjust_quad_dof_index_for_face_orientation_table[face_no](
370 local_face_dof, case_no) = j + i * n - local_face_dof;
376 ->adjust_quad_dof_index_for_face_orientation_table[face_no](
377 local_face_dof, case_no) = 0;
381 const unsigned int new_local_face_dof =
384 local_face_dof, case_no);
386 i = new_local_face_dof % n;
387 j = new_local_face_dof / n;
394 if (!face_flip && face_rotation)
397 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
398 local_face_dof, case_no) = ((j % 2) == 1);
401 else if (face_flip && !face_rotation)
406 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
407 local_face_dof, case_no) =
408 ((j % 2) == 1) != ((i % 2) == 1);
411 else if (face_flip && face_rotation)
414 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
415 local_face_dof, case_no) = ((i % 2) == 1);
425 if (!face_orientation)
427 local_face_dof, case_no) =
430 local_face_dof, case_no);
443 for (
auto &restriction_matrix : this->
restriction[0])
444 restriction_matrix.reinit(0, 0);
466 const unsigned int n_face_points = q_base.size();
469 for (
const unsigned int face : this->
reference_cell().face_indices())
485 for (
unsigned int k = 0; k < q_face.
size(); ++k)
490 for (
unsigned int sub = 0;
491 sub < this->
reference_cell().face_reference_cell(face).n_children();
520 for (
unsigned int k = 0; k < n_face_points; ++k)
521 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
523 for (
unsigned int i_face = 0;
533 face * this->n_dofs_per_face(face) + i_face, i_child) +=
535 cached_values_on_face(i_child, k) *
537 face * this->n_dofs_per_face(face) + i_face,
549 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
550 for (
unsigned int dd = 0; dd < dim; ++dd)
552 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
553 for (
unsigned int d = 0; d < dim; ++d)
559 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
565 const unsigned int face_no = 0;
568 const unsigned int start_cell_dofs =
577 for (
unsigned int k = 0; k < q_cell.size(); ++k)
579 for (
unsigned int d = 0; d < dim; ++d)
580 cached_values_on_cell(i, k, d) =
583 for (
unsigned int child = 0; child < this->
reference_cell().n_children();
591 for (
unsigned int k = 0; k < q_sub.
size(); ++k)
592 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
594 for (
unsigned int d = 0; d < dim; ++d)
595 for (
unsigned int i_weight = 0; i_weight < polynomials[d]->n();
598 this->
restriction[iso][child](start_cell_dofs + i_weight * dim +
601 q_sub.
weight(k) * cached_values_on_cell(i_child, k, d) *
602 polynomials[d]->compute_value(i_weight, q_sub.
point(k));
610std::vector<unsigned int>
616 for (
unsigned int d = 1; d < dim; ++d)
620 const unsigned int interior_dofs = dim * deg *
dofs_per_face;
622 std::vector<unsigned int> dpo(dim + 1);
624 dpo[dim] = interior_dofs;
632std::pair<Table<2, bool>, std::vector<unsigned int>>
636 for (
unsigned int d = 0; d < dim; ++d)
638 constant_modes(d, i) =
true;
641 for (
unsigned int d = 0; d < dim; ++d)
643 return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
657 const unsigned int face_index)
const
678 return (face_index !=
697std::vector<unsigned int>
701 std::vector<unsigned int> lexicographic_numbering;
703 for (
unsigned int j = 0; j < n_dofs_face; ++j)
705 lexicographic_numbering.push_back(j);
706 for (
unsigned int i = n_dofs_face * 2 * dim;
707 i < n_dofs_face * 2 * dim +
degree;
709 lexicographic_numbering.push_back(i + j *
degree);
710 lexicographic_numbering.push_back(n_dofs_face + j);
714 unsigned int layers = (dim == 3) ?
degree + 1 : 1;
715 for (
unsigned int k = 0; k < layers; ++k)
717 unsigned int k_add = k * (
degree + 1);
718 for (
unsigned int j = n_dofs_face * 2; j < n_dofs_face * 2 +
degree + 1;
720 lexicographic_numbering.push_back(j + k_add);
722 for (
unsigned int i = n_dofs_face * (2 * dim +
degree);
726 lexicographic_numbering.push_back(i + k_add *
degree);
728 for (
unsigned int j = n_dofs_face * 3; j < n_dofs_face * 3 +
degree + 1;
730 lexicographic_numbering.push_back(j + k_add);
736 for (
unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i)
737 lexicographic_numbering.push_back(i);
738 for (
unsigned int i = 6 * n_dofs_face + n_dofs_face * 2 *
degree;
739 i < 6 * n_dofs_face + n_dofs_face * 3 *
degree;
741 lexicographic_numbering.push_back(i);
742 for (
unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i)
743 lexicographic_numbering.push_back(i);
746 return lexicographic_numbering;
755 std::vector<double> &nodal_values)
const
757 Assert(support_point_values.size() == this->generalized_support_points.size(),
759 this->generalized_support_points.size()));
760 Assert(nodal_values.size() == this->n_dofs_per_cell(),
766 std::fill(nodal_values.begin(), nodal_values.end(), 0.);
769 for (
const unsigned int face : this->
reference_cell().face_indices())
770 for (
unsigned int k = 0; k < n_face_points; ++k)
775 support_point_values[face * n_face_points + k](
782 const unsigned int face_no = 0;
784 const unsigned int start_cell_dofs =
786 const unsigned int start_cell_points =
791 for (
unsigned int d = 0; d < dim; ++d)
792 nodal_values[start_cell_dofs + i * dim + d] +=
794 support_point_values[k + start_cell_points](d);
810#include "fe/fe_raviart_thomas.inst"
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
std::vector< Table< 2, bool > > adjust_quad_dof_sign_for_face_orientation_table
FullMatrix< double > inverse_node_matrix
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
std::vector< MappingKind > mapping_kind
FE_PolyTensor(const TensorPolynomialsBase< dim > &polynomials, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
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()
Table< 3, double > interior_weights
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
Table< 2, double > boundary_weights
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
static std::vector< unsigned int > get_lexicographic_numbering(const unsigned int degree)
const unsigned int components
const unsigned int degree
unsigned int n_dofs_per_cell() const
const unsigned int dofs_per_face
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int tensor_degree() const
unsigned int n_components() const
unsigned int n_unique_faces() const
unsigned int n_dofs_per_quad(unsigned int face_no=0) const
FiniteElementData(const std::vector< unsigned int > &dofs_per_object, const unsigned int n_components, const unsigned int degree, const Conformity conformity=unknown, const BlockIndices &block_indices=BlockIndices())
ReferenceCell< dim > reference_cell() const
std::vector< std::vector< FullMatrix< double > > > restriction
std::vector< Table< 2, int > > adjust_quad_dof_index_for_face_orientation_table
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
std::vector< std::vector< Point< dim - 1 > > > generalized_face_support_points
FullMatrix< double > interface_constraints
std::vector< Point< dim > > generalized_support_points
std::vector< std::vector< FullMatrix< double > > > prolongation
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
static DataSetDescriptor face(const ReferenceCell< dim > &reference_cell, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points)
static Quadrature< dim > project_to_all_faces(const ReferenceCell< dim > &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
static void project_to_subface(const ReferenceCell< dim > &reference_cell, 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 void project_to_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
static Quadrature< dim > project_to_child(const ReferenceCell< dim > &reference_cell, const Quadrature< dim > &quadrature, const unsigned int child_no)
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
#define DEAL_II_NOT_IMPLEMENTED()
#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)
constexpr T fixed_power(const T t)
constexpr T pow(const T base, const int iexp)
types::geometric_orientation combined_face_orientation(const bool face_orientation, const bool face_rotation, const bool face_flip)
constexpr types::geometric_orientation default_geometric_orientation
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)
static constexpr std::array< unsigned int, faces_per_cell > unit_normal_direction
static constexpr std::array< unsigned int, faces_per_cell > opposite_face