17 #include <deal.II/base/qprojector.h> 18 #include <deal.II/base/quadrature_lib.h> 19 #include <deal.II/base/std_cxx14/memory.h> 21 #include <deal.II/dofs/dof_accessor.h> 23 #include <deal.II/fe/fe.h> 24 #include <deal.II/fe/fe_nothing.h> 25 #include <deal.II/fe/fe_raviart_thomas.h> 26 #include <deal.II/fe/fe_tools.h> 27 #include <deal.II/fe/fe_values.h> 28 #include <deal.II/fe/mapping.h> 30 #include <deal.II/grid/tria.h> 31 #include <deal.II/grid/tria_iterator.h> 36 DEAL_II_NAMESPACE_OPEN
50 std::vector<bool>(dim, true)))
77 ref_case < RefinementCase<dim>::isotropic_refinement + 1;
80 const unsigned int nc =
83 for (
unsigned int i = 0; i < nc; ++i)
84 this->
prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs);
91 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
93 FETools::compute_face_embedding_matrices<dim, double>(*
this,
99 unsigned int target_row = 0;
100 for (
unsigned int d = 0; d < GeometryInfo<dim>::max_children_per_face; ++d)
101 for (
unsigned int i = 0; i < face_embeddings[d].m(); ++i)
103 for (
unsigned int j = 0; j < face_embeddings[d].n(); ++j)
126 std::ostringstream namebuf;
127 namebuf <<
"FE_RaviartThomasNodal<" << dim <<
">(" << this->degree - 1 <<
")";
129 return namebuf.str();
134 std::unique_ptr<FiniteElement<dim, dim>>
137 return std_cxx14::make_unique<FE_RaviartThomasNodal<dim>>(*this);
151 this->generalized_support_points.resize(this->dofs_per_cell);
152 this->generalized_face_support_points.resize(this->dofs_per_face);
155 unsigned int current = 0;
165 QGauss<dim - 1> face_points(deg + 1);
167 for (
unsigned int k = 0; k < this->dofs_per_face; ++k)
168 this->generalized_face_support_points[k] = face_points.point(k);
171 for (
unsigned int k = 0;
174 this->generalized_support_points[k] =
176 0,
true,
false,
false, this->dofs_per_face));
189 for (
unsigned int d = 0; d < dim; ++d)
191 std::unique_ptr<QAnisotropic<dim>> quadrature;
195 quadrature = std_cxx14::make_unique<QAnisotropic<dim>>(high);
198 quadrature = std_cxx14::make_unique<QAnisotropic<dim>>(
199 ((d == 0) ? low : high), ((d == 1) ? low : high));
203 std_cxx14::make_unique<QAnisotropic<dim>>(((d == 0) ? low : high),
204 ((d == 1) ? low : high),
212 for (
unsigned int k = 0; k < quadrature->size(); ++k)
213 this->generalized_support_points[current++] = quadrature->point(k);
221 std::vector<unsigned int>
226 unsigned int dofs_per_face = 1;
227 for (
unsigned int d = 1; d < dim; ++d)
228 dofs_per_face *= deg + 1;
231 const unsigned int interior_dofs = dim * deg * dofs_per_face;
233 std::vector<unsigned int> dpo(dim + 1);
234 dpo[dim - 1] = dofs_per_face;
235 dpo[dim] = interior_dofs;
247 return std::vector<bool>();
256 const unsigned int dofs_per_cell =
258 unsigned int dofs_per_face = deg + 1;
259 for (
unsigned int d = 2; d < dim; ++d)
260 dofs_per_face *= deg + 1;
266 std::vector<bool> ret_val(dofs_per_cell,
false);
279 const unsigned int shape_index,
280 const unsigned int face_index)
const 282 Assert(shape_index < this->dofs_per_cell,
290 const unsigned int support_face = shape_index / this->degree;
311 std::vector<double> & nodal_values)
const 313 Assert(support_point_values.size() == this->generalized_support_points.size(),
315 this->generalized_support_points.size()));
316 Assert(nodal_values.size() == this->dofs_per_cell,
326 unsigned int fbase = 0;
328 for (; f < GeometryInfo<dim>::faces_per_cell;
329 ++f, fbase += this->dofs_per_face)
331 for (
unsigned int i = 0; i < this->dofs_per_face; ++i)
333 nodal_values[fbase + i] = support_point_values[fbase + i](
340 const unsigned int istep = (this->dofs_per_cell - fbase) / dim;
344 while (fbase < this->dofs_per_cell)
346 for (
unsigned int i = 0; i < istep; ++i)
348 nodal_values[fbase + i] = support_point_values[fbase + i](f);
373 std::vector<std::pair<unsigned int, unsigned int>>
383 return std::vector<std::pair<unsigned int, unsigned int>>();
385 return std::vector<std::pair<unsigned int, unsigned int>>();
389 return std::vector<std::pair<unsigned int, unsigned int>>();
396 std::vector<std::pair<unsigned int, unsigned int>>
410 return std::vector<std::pair<unsigned int, unsigned int>>();
431 const unsigned int p = this->degree - 1;
432 const unsigned int q = fe_q_other->
degree - 1;
434 std::vector<std::pair<unsigned int, unsigned int>> identities;
437 for (
unsigned int i = 0; i < p + 1; ++i)
438 identities.emplace_back(i, i);
440 else if (p % 2 == 0 && q % 2 == 0)
441 identities.emplace_back(p / 2, q / 2);
449 return std::vector<std::pair<unsigned int, unsigned int>>();
454 return std::vector<std::pair<unsigned int, unsigned int>>();
460 std::vector<std::pair<unsigned int, unsigned int>>
474 return std::vector<std::pair<unsigned int, unsigned int>>();
478 const unsigned int p = this->dofs_per_quad;
481 std::vector<std::pair<unsigned int, unsigned int>> identities;
484 for (
unsigned int i = 0; i < p; ++i)
485 identities.emplace_back(i, i);
487 else if (p % 2 != 0 && q % 2 != 0)
488 identities.emplace_back(p / 2, q / 2);
496 return std::vector<std::pair<unsigned int, unsigned int>>();
501 return std::vector<std::pair<unsigned int, unsigned int>>();
510 const unsigned int codim)
const 520 if (this->degree < fe_rt_nodal_other->degree)
522 else if (this->degree == fe_rt_nodal_other->degree)
530 if (fe_nothing->is_dominating())
578 &x_source_fe) !=
nullptr),
581 Assert(interpolation_matrix.
n() == this->dofs_per_face,
620 double eps = 2
e-13 * this->degree * (dim - 1);
630 const Point<dim> &p = face_projection.point(i);
632 for (
unsigned int j = 0; j < this->dofs_per_face; ++j)
634 double matrix_entry =
635 this->shape_value_component(this->face_to_cell_index(j, 0), p, 0);
643 if (std::fabs(matrix_entry - 1.0) < eps)
645 if (std::fabs(matrix_entry) < eps)
648 interpolation_matrix(i, j) = matrix_entry;
661 for (
unsigned int i = 0; i < this->dofs_per_face; ++i)
662 sum += interpolation_matrix(j, i);
664 Assert(std::fabs(
sum - 1) < 2e-13 * this->degree * (dim - 1),
674 const unsigned int subface,
682 &x_source_fe) !=
nullptr),
685 Assert(interpolation_matrix.
n() == this->dofs_per_face,
724 double eps = 2
e-13 * this->degree * (dim - 1);
735 const Point<dim> &p = subface_projection.point(i);
737 for (
unsigned int j = 0; j < this->dofs_per_face; ++j)
739 double matrix_entry =
740 this->shape_value_component(this->face_to_cell_index(j, 0), p, 0);
748 if (std::fabs(matrix_entry - 1.0) < eps)
750 if (std::fabs(matrix_entry) < eps)
753 interpolation_matrix(i, j) = matrix_entry;
766 for (
unsigned int i = 0; i < this->dofs_per_face; ++i)
767 sum += interpolation_matrix(j, i);
769 Assert(std::fabs(
sum - 1) < 2e-13 * this->degree * (dim - 1),
777 #include "fe_raviart_thomas_nodal.inst" 780 DEAL_II_NAMESPACE_CLOSE
FullMatrix< double > interface_constraints
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)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
FE_RaviartThomasNodal(const unsigned int p)
const unsigned int dofs_per_quad
const unsigned int degree
const Point< dim > & point(const unsigned int i) const
virtual std::unique_ptr< FiniteElement< dim, dim > > clone() 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
static unsigned int compute_n_pols(unsigned int degree)
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
virtual bool hp_constraints_are_implemented() const override
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
std::vector< std::vector< FullMatrix< double > > > prolongation
void invert(const FullMatrix< number2 > &M)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void initialize_support_points(const unsigned int rt_degree)
virtual std::string get_name() const =0
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
const unsigned int dofs_per_cell
virtual std::string get_name() const override
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
static Quadrature< dim > project_to_all_faces(const SubQuadrature &quadrature)
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim >> &q_points)
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim > &fe_other, const unsigned int codim=0) const override final
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
const unsigned int dofs_per_face
static ::ExceptionBase & ExcNotImplemented()
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
FullMatrix< double > inverse_node_matrix
static ::ExceptionBase & ExcInternalError()
static std::vector< bool > get_ria_vector(const unsigned int degree)
const std::vector< Point< dim - 1 > > & get_generalized_face_support_points() const