17 #include <deal.II/base/quadrature.h> 18 #include <deal.II/base/std_cxx14/memory.h> 20 #include <deal.II/dofs/dof_accessor.h> 22 #include <deal.II/fe/fe.h> 23 #include <deal.II/fe/fe_dgp_nonparametric.h> 24 #include <deal.II/fe/fe_nothing.h> 25 #include <deal.II/fe/fe_values.h> 26 #include <deal.II/fe/mapping.h> 28 #include <deal.II/grid/tria.h> 29 #include <deal.II/grid/tria_iterator.h> 34 DEAL_II_NAMESPACE_OPEN
36 template <
int dim,
int spacedim>
38 const unsigned int degree)
49 std::vector<bool>(1, true)))
50 , polynomial_space(
Polynomials::Legendre::generate_complete_basis(degree))
54 ref_case < RefinementCase<dim>::isotropic_refinement + 1;
63 const unsigned int nc =
65 for (
unsigned int i = 0; i < nc; ++i)
67 this->
prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs);
70 for (
unsigned int j = 0; j < n_dofs; ++j)
106 template <
int dim,
int spacedim>
117 std::ostringstream namebuf;
119 <<
">(" << this->degree <<
")";
121 return namebuf.str();
126 template <
int dim,
int spacedim>
127 std::unique_ptr<FiniteElement<dim, spacedim>>
130 return std_cxx14::make_unique<FE_DGPNonparametric<dim, spacedim>>(*this);
135 template <
int dim,
int spacedim>
150 template <
int dim,
int spacedim>
153 const unsigned int i,
155 const unsigned int component)
const 169 template <
int dim,
int spacedim>
183 template <
int dim,
int spacedim>
186 const unsigned int i,
188 const unsigned int component)
const 202 template <
int dim,
int spacedim>
217 template <
int dim,
int spacedim>
220 const unsigned int i,
222 const unsigned int component)
const 240 template <
int dim,
int spacedim>
241 std::vector<unsigned int>
244 std::vector<unsigned int> dpo(dim + 1, static_cast<unsigned int>(0));
246 for (
unsigned int i = 1; i < dim; ++i)
248 dpo[dim] *= deg + 1 + i;
256 template <
int dim,
int spacedim>
275 template <
int dim,
int spacedim>
276 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
286 auto data_ptr = std_cxx14::make_unique<
288 data_ptr->
update_each = requires_update_flags(update_flags);
302 template <
int dim,
int spacedim>
310 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
321 const unsigned int n_q_points = mapping_data.quadrature_points.size();
323 std::vector<double> values(
325 std::vector<Tensor<1, dim>> grads(
327 std::vector<Tensor<2, dim>> grad_grads(
329 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
330 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
333 for (
unsigned int i = 0; i < n_q_points; ++i)
335 polynomial_space.compute(mapping_data.quadrature_points[i],
339 empty_vector_of_3rd_order_tensors,
340 empty_vector_of_4th_order_tensors);
343 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
344 output_data.shape_values[k][i] = values[k];
347 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
348 output_data.shape_gradients[k][i] = grads[k];
351 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
352 output_data.shape_hessians[k][i] = grad_grads[k];
358 template <
int dim,
int spacedim>
366 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
377 const unsigned int n_q_points = mapping_data.quadrature_points.size();
379 std::vector<double> values(
381 std::vector<Tensor<1, dim>> grads(
383 std::vector<Tensor<2, dim>> grad_grads(
385 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
386 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
389 for (
unsigned int i = 0; i < n_q_points; ++i)
391 polynomial_space.compute(mapping_data.quadrature_points[i],
395 empty_vector_of_3rd_order_tensors,
396 empty_vector_of_4th_order_tensors);
399 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
400 output_data.shape_values[k][i] = values[k];
403 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
404 output_data.shape_gradients[k][i] = grads[k];
407 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
408 output_data.shape_hessians[k][i] = grad_grads[k];
414 template <
int dim,
int spacedim>
423 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
434 const unsigned int n_q_points = mapping_data.quadrature_points.size();
436 std::vector<double> values(
438 std::vector<Tensor<1, dim>> grads(
440 std::vector<Tensor<2, dim>> grad_grads(
442 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
443 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
446 for (
unsigned int i = 0; i < n_q_points; ++i)
448 polynomial_space.compute(mapping_data.quadrature_points[i],
452 empty_vector_of_3rd_order_tensors,
453 empty_vector_of_4th_order_tensors);
456 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
457 output_data.shape_values[k][i] = values[k];
460 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
461 output_data.shape_gradients[k][i] = grads[k];
464 for (
unsigned int k = 0; k < this->dofs_per_cell; ++k)
465 output_data.shape_hessians[k][i] = grad_grads[k];
471 template <
int dim,
int spacedim>
483 (void)interpolation_matrix;
485 (x_source_fe.
get_name().find(
"FE_DGPNonparametric<") == 0) ||
490 Assert(interpolation_matrix.
m() == 0,
492 Assert(interpolation_matrix.
n() == 0,
498 template <
int dim,
int spacedim>
511 (void)interpolation_matrix;
513 (x_source_fe.
get_name().find(
"FE_DGPNonparametric<") == 0) ||
518 Assert(interpolation_matrix.
m() == 0,
520 Assert(interpolation_matrix.
n() == 0,
526 template <
int dim,
int spacedim>
535 template <
int dim,
int spacedim>
536 std::vector<std::pair<unsigned int, unsigned int>>
544 return std::vector<std::pair<unsigned int, unsigned int>>();
548 return std::vector<std::pair<unsigned int, unsigned int>>();
554 template <
int dim,
int spacedim>
555 std::vector<std::pair<unsigned int, unsigned int>>
563 return std::vector<std::pair<unsigned int, unsigned int>>();
567 return std::vector<std::pair<unsigned int, unsigned int>>();
573 template <
int dim,
int spacedim>
574 std::vector<std::pair<unsigned int, unsigned int>>
582 return std::vector<std::pair<unsigned int, unsigned int>>();
586 return std::vector<std::pair<unsigned int, unsigned int>>();
592 template <
int dim,
int spacedim>
596 const unsigned int codim)
const 613 if (this->degree < fe_nonparametric_other->degree)
615 else if (this->degree == fe_nonparametric_other->degree)
623 if (fe_nothing->is_dominating())
638 template <
int dim,
int spacedim>
642 const unsigned int)
const 649 template <
int dim,
int spacedim>
659 template <
int dim,
int spacedim>
669 #include "fe_dgp_nonparametric.inst" 672 DEAL_II_NAMESPACE_CLOSE
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const override
friend class FE_DGPNonparametric
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
virtual std::size_t memory_consumption() const override
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const override
virtual double shape_value(const unsigned int i, const Point< dim > &p) const override
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
Transformed quadrature points.
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual bool hp_constraints_are_implemented() const override
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
unsigned int get_degree() const
std::vector< std::vector< FullMatrix< double > > > prolongation
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
Abstract base class for mapping classes.
virtual std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const override
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
virtual std::string get_name() const =0
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
Second derivatives of shape functions.
std::string dim_string(const int dim, const int spacedim)
const unsigned int dofs_per_cell
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const override
Shape function gradients.
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
virtual std::string get_name() const override
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
static ::ExceptionBase & ExcNotImplemented()
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
static ::ExceptionBase & ExcInternalError()