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>
259 const UpdateFlags flags)
const
261 UpdateFlags out = flags;
263 if (flags & (update_values | update_gradients | update_hessians))
264 out |= update_quadrature_points;
275 template <
int dim,
int spacedim>
276 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
278 const UpdateFlags update_flags,
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(
324 (fe_internal.
update_each & update_values) ? this->dofs_per_cell : 0);
325 std::vector<Tensor<1, dim>> grads(
326 (fe_internal.
update_each & update_gradients) ? this->dofs_per_cell : 0);
327 std::vector<Tensor<2, dim>> grad_grads(
328 (fe_internal.
update_each & update_hessians) ? this->dofs_per_cell : 0);
329 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
330 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
332 if (fe_internal.
update_each & (update_values | update_gradients))
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(
380 (fe_internal.
update_each & update_values) ? this->dofs_per_cell : 0);
381 std::vector<Tensor<1, dim>> grads(
382 (fe_internal.
update_each & update_gradients) ? this->dofs_per_cell : 0);
383 std::vector<Tensor<2, dim>> grad_grads(
384 (fe_internal.
update_each & update_hessians) ? this->dofs_per_cell : 0);
385 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
386 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
388 if (fe_internal.
update_each & (update_values | update_gradients))
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(
437 (fe_internal.
update_each & update_values) ? this->dofs_per_cell : 0);
438 std::vector<Tensor<1, dim>> grads(
439 (fe_internal.
update_each & update_gradients) ? this->dofs_per_cell : 0);
440 std::vector<Tensor<2, dim>> grad_grads(
441 (fe_internal.
update_each & update_hessians) ? this->dofs_per_cell : 0);
442 std::vector<Tensor<3, dim>> empty_vector_of_3rd_order_tensors;
443 std::vector<Tensor<4, dim>> empty_vector_of_4th_order_tensors;
445 if (fe_internal.
update_each & (update_values | update_gradients))
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