93 const unsigned int face_no = 0;
97 std::vector<FullMatrix<double>> face_embeddings(
98 this->
reference_cell().face_reference_cell(0).
template n_children<dim - 1>(
100 for (
auto &face_embedding : face_embeddings)
110 unsigned int target_row = 0;
111 for (
const auto &face_embedding : face_embeddings)
112 for (
unsigned int i = 0; i < face_embedding.m(); ++i)
114 for (
unsigned int j = 0; j < face_embedding.n(); ++j)
141 std::ostringstream namebuf;
142 namebuf <<
"FE_RaviartThomas<" << dim <<
">(" << this->
degree - 1 <<
")";
144 return namebuf.str();
149std::unique_ptr<FiniteElement<dim, dim>>
152 return std::make_unique<FE_RaviartThomas<dim>>(*this);
166 const unsigned int n_interior_points = (deg > 0) ? cell_quadrature.size() : 0;
171 const unsigned int face_no = 0;
173 unsigned int n_face_points = (dim > 1) ? 1 : 0;
175 for (
unsigned int d = 1; d < dim; ++d)
176 n_face_points *= deg + 1;
180 this->
reference_cell().n_faces() * n_face_points + n_interior_points);
184 unsigned int current = 0;
188 const QGauss<dim - 1> face_points(deg + 1);
194 for (
unsigned int k = 0; k < n_face_points; ++k)
197 face_points.point(k);
201 for (
unsigned int i = 0; i < legendre.n(); ++i)
204 face_points.weight(k) *
205 legendre.compute_value(i, face_points.point(k));
213 for (
unsigned int face_no = 0;
214 face_no < GeometryInfo<dim>::faces_per_cell;
222 for (
unsigned int face_point = 0; face_point < n_face_points;
227 faces.
point(offset + face_point);
237 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
238 for (
unsigned int dd = 0; dd < dim; ++dd)
240 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
241 for (
unsigned int d = 0; d < dim; ++d)
245 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
251 for (
unsigned int k = 0; k < cell_quadrature.size(); ++k)
254 for (
unsigned int i = 0; i < polynomials[0]->n(); ++i)
255 for (
unsigned int d = 0; d < dim; ++d)
257 cell_quadrature.weight(k) *
258 polynomials[d]->compute_value(i, cell_quadrature.point(k));
282 const unsigned int face_no = 0;
345 for (
unsigned int local_face_dof = 0;
350 unsigned int i = local_face_dof % n;
351 unsigned int j = local_face_dof / n;
356 for (
const bool face_orientation : {
false,
true})
357 for (
const bool face_flip : {
false,
true})
358 for (
const bool face_rotation : {
false,
true})
365 if (((!face_orientation) && (!face_rotation)) ||
366 ((face_orientation) && (face_rotation)))
371 ->adjust_quad_dof_index_for_face_orientation_table[face_no](
372 local_face_dof, case_no) = j + i * n - local_face_dof;
378 ->adjust_quad_dof_index_for_face_orientation_table[face_no](
379 local_face_dof, case_no) = 0;
383 const unsigned int new_local_face_dof =
386 local_face_dof, case_no);
388 i = new_local_face_dof % n;
389 j = new_local_face_dof / n;
396 if (!face_flip && face_rotation)
399 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
400 local_face_dof, case_no) = ((j % 2) == 1);
403 else if (face_flip && !face_rotation)
408 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
409 local_face_dof, case_no) =
410 ((j % 2) == 1) != ((i % 2) == 1);
413 else if (face_flip && face_rotation)
416 ->adjust_quad_dof_sign_for_face_orientation_table[face_no](
417 local_face_dof, case_no) = ((i % 2) == 1);
427 if (!face_orientation)
429 local_face_dof, case_no) =
432 local_face_dof, case_no);
445 for (
auto &restriction_matrix : this->
restriction[0])
446 restriction_matrix.reinit(0, 0);
468 const unsigned int n_face_points = q_base.size();
471 for (
const unsigned int face : this->
reference_cell().face_indices())
487 for (
unsigned int k = 0; k < q_face.
size(); ++k)
493 .face_reference_cell(face)
494 .template n_children<dim - 1>();
523 for (
unsigned int k = 0; k < n_face_points; ++k)
524 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
526 for (
unsigned int i_face = 0;
536 face * this->n_dofs_per_face(face) + i_face, i_child) +=
538 cached_values_on_face(i_child, k) *
540 face * this->n_dofs_per_face(face) + i_face,
552 std::unique_ptr<AnisotropicPolynomials<dim>> polynomials[dim];
553 for (
unsigned int dd = 0; dd < dim; ++dd)
555 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
556 for (
unsigned int d = 0; d < dim; ++d)
562 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
568 const unsigned int face_no = 0;
571 const unsigned int start_cell_dofs =
580 for (
unsigned int k = 0; k < q_cell.size(); ++k)
582 for (
unsigned int d = 0; d < dim; ++d)
583 cached_values_on_cell(i, k, d) =
586 for (
unsigned int child = 0;
595 for (
unsigned int k = 0; k < q_sub.
size(); ++k)
596 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
598 for (
unsigned int d = 0; d < dim; ++d)
599 for (
unsigned int i_weight = 0; i_weight < polynomials[d]->n();
602 this->
restriction[iso][child](start_cell_dofs + i_weight * dim +
605 q_sub.
weight(k) * cached_values_on_cell(i_child, k, d) *
606 polynomials[d]->compute_value(i_weight, q_sub.
point(k));
614std::vector<unsigned int>
620 for (
unsigned int d = 1; d < dim; ++d)
624 const unsigned int interior_dofs = dim * deg *
dofs_per_face;
626 std::vector<unsigned int> dpo(dim + 1);
628 dpo[dim] = interior_dofs;
636std::pair<Table<2, bool>, std::vector<unsigned int>>
640 for (
unsigned int d = 0; d < dim; ++d)
642 constant_modes(d, i) =
true;
645 for (
unsigned int d = 0; d < dim; ++d)
647 return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
661 const unsigned int face_index)
const
682 return (face_index !=
701std::vector<unsigned int>
705 std::vector<unsigned int> lexicographic_numbering;
707 for (
unsigned int j = 0; j < n_dofs_face; ++j)
709 lexicographic_numbering.push_back(j);
710 for (
unsigned int i = n_dofs_face * 2 * dim;
711 i < n_dofs_face * 2 * dim +
degree;
713 lexicographic_numbering.push_back(i + j *
degree);
714 lexicographic_numbering.push_back(n_dofs_face + j);
718 unsigned int layers = (dim == 3) ?
degree + 1 : 1;
719 for (
unsigned int k = 0; k < layers; ++k)
721 unsigned int k_add = k * (
degree + 1);
722 for (
unsigned int j = n_dofs_face * 2; j < n_dofs_face * 2 +
degree + 1;
724 lexicographic_numbering.push_back(j + k_add);
726 for (
unsigned int i = n_dofs_face * (2 * dim +
degree);
730 lexicographic_numbering.push_back(i + k_add *
degree);
732 for (
unsigned int j = n_dofs_face * 3; j < n_dofs_face * 3 +
degree + 1;
734 lexicographic_numbering.push_back(j + k_add);
740 for (
unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i)
741 lexicographic_numbering.push_back(i);
742 for (
unsigned int i = 6 * n_dofs_face + n_dofs_face * 2 *
degree;
743 i < 6 * n_dofs_face + n_dofs_face * 3 *
degree;
745 lexicographic_numbering.push_back(i);
746 for (
unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i)
747 lexicographic_numbering.push_back(i);
750 return lexicographic_numbering;
759 std::vector<double> &nodal_values)
const
761 Assert(support_point_values.size() == this->generalized_support_points.size(),
763 this->generalized_support_points.size()));
764 Assert(nodal_values.size() == this->n_dofs_per_cell(),
770 std::fill(nodal_values.begin(), nodal_values.end(), 0.);
773 for (
const unsigned int face : this->
reference_cell().face_indices())
774 for (
unsigned int k = 0; k < n_face_points; ++k)
779 support_point_values[face * n_face_points + k](
786 const unsigned int face_no = 0;
788 const unsigned int start_cell_dofs =
790 const unsigned int start_cell_points =
795 for (
unsigned int d = 0; d < dim; ++d)
796 nodal_values[start_cell_dofs + i * dim + d] +=
798 support_point_values[k + start_cell_points](d);
814#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
ReferenceCell reference_cell() 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())
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 &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 &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
static Quadrature< dim > project_to_child(const ReferenceCell &reference_cell, const Quadrature< dim > &quadrature, const unsigned int child_no)
static void project_to_subface(const ReferenceCell &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 &reference_cell, 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
#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