88 const unsigned int face_no = 0;
92 std::vector<FullMatrix<double>> face_embeddings(
103 unsigned int target_row = 0;
104 for (
const auto &face_embedding : face_embeddings)
105 for (
unsigned int i = 0; i < face_embedding.m(); ++i)
107 for (
unsigned int j = 0; j < face_embedding.n(); ++j)
142 std::ostringstream namebuf;
144 namebuf <<
"FE_ABF<" << dim <<
">(" << rt_order <<
")";
146 return namebuf.str();
152std::unique_ptr<FiniteElement<dim, dim>>
155 return std::make_unique<FE_ABF<dim>>(rt_order);
171 const unsigned int n_interior_points = cell_quadrature.size();
176 const unsigned int face_no = 0;
178 unsigned int n_face_points = (dim > 1) ? 1 : 0;
180 for (
unsigned int d = 1; d < dim; ++d)
181 n_face_points *= deg + 1;
183 this->generalized_support_points.resize(
185 this->generalized_face_support_points[face_no].resize(n_face_points);
190 std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials_abf;
193 for (
unsigned int dd = 0; dd < dim; ++dd)
195 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
196 for (
unsigned int d = 0; d < dim; ++d)
200 polynomials_abf[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
204 unsigned int current = 0;
208 const QGauss<dim - 1> face_points(deg + 1);
212 boundary_weights.reinit(n_face_points, legendre.n());
217 for (
unsigned int k = 0; k < n_face_points; ++k)
219 this->generalized_face_support_points[face_no][k] =
220 face_points.point(k);
224 for (
unsigned int i = 0; i < legendre.n(); ++i)
226 boundary_weights(k, i) =
227 face_points.weight(k) *
228 legendre.compute_value(i, face_points.point(k));
235 for (
unsigned int face_no = 0;
236 face_no < GeometryInfo<dim>::faces_per_cell;
240 this->reference_cell(),
244 for (
unsigned int face_point = 0; face_point < n_face_points;
248 this->generalized_support_points[current] =
249 faces.
point(offset + face_point);
260 boundary_weights_abf.reinit(faces.
size(), polynomials_abf[0]->n() * dim);
261 for (
unsigned int k = 0; k < faces.
size(); ++k)
263 for (
unsigned int i = 0; i < polynomials_abf[0]->n() * dim; ++i)
265 boundary_weights_abf(k, i) =
266 polynomials_abf[i % dim]->compute_value(i / dim,
277 std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials;
279 for (
unsigned int dd = 0; dd < dim; ++dd)
281 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
282 for (
unsigned int d = 0; d < dim; ++d)
286 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
289 interior_weights.reinit(
292 for (
unsigned int k = 0; k < cell_quadrature.size(); ++k)
294 for (
unsigned int i = 0; i < polynomials[0]->n(); ++i)
295 for (
unsigned int d = 0; d < dim; ++d)
296 interior_weights(k, i, d) =
297 cell_quadrature.weight(k) *
298 polynomials[d]->compute_value(i, cell_quadrature.point(k));
305 for (
unsigned int k = 0; k < cell_quadrature.size(); ++k)
306 this->generalized_support_points[current++] = cell_quadrature.point(k);
313 polynomials_abf[0]->n() * dim,
317 for (
unsigned int k = 0; k < cell_quadrature.size(); ++k)
319 for (
unsigned int i = 0; i < polynomials_abf[0]->n() * dim; ++i)
322 polynomials_abf[i % dim]->compute_grad(i / dim,
323 cell_quadrature.point(k)) *
324 cell_quadrature.weight(k);
327 for (
unsigned int d = 0; d < dim; ++d)
328 interior_weights_abf(k, i, d) = -poly_grad[d];
332 Assert(current == this->generalized_support_points.size(),
355 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_cell;
357 this->restriction[iso][i].reinit(0, 0);
361 const QGauss<dim - 1> q_base(rt_order + 1);
362 const unsigned int n_face_points = q_base.size();
372 this->reference_cell(),
381 for (
unsigned int k = 0; k < q_face.
size(); ++k)
382 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
383 cached_values_face(i, k) = this->shape_value_component(
386 for (
unsigned int sub = 0; sub < GeometryInfo<dim>::max_children_per_face;
394 this->reference_cell(),
415 for (
unsigned int k = 0; k < n_face_points; ++k)
416 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
418 for (
unsigned int i_face = 0;
419 i_face < this->n_dofs_per_face(face);
427 this->restriction[iso][child](
428 face * this->n_dofs_per_face(face) + i_face, i_child) +=
429 Utilities::fixed_power<dim - 1>(.5) * q_sub.
weight(k) *
430 cached_values_face(i_child, k) *
431 this->shape_value_component(
432 face * this->n_dofs_per_face(face) + i_face,
445 std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials;
446 for (
unsigned int dd = 0; dd < dim; ++dd)
448 std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
449 for (
unsigned int d = 0; d < dim; ++d)
453 polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
459 const unsigned int face_no = 0;
462 const unsigned int start_cell_dofs =
471 for (
unsigned int k = 0; k < q_cell.size(); ++k)
472 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
473 for (
unsigned int d = 0; d < dim; ++d)
474 cached_values_cell(i, k, d) =
475 this->shape_value_component(i, q_cell.point(k), d);
477 for (
unsigned int child = 0; child < GeometryInfo<dim>::max_children_per_cell;
485 for (
unsigned int k = 0; k < q_sub.
size(); ++k)
486 for (
unsigned int i_child = 0; i_child < this->n_dofs_per_cell();
488 for (
unsigned int d = 0; d < dim; ++d)
489 for (
unsigned int i_weight = 0; i_weight < polynomials[d]->n();
492 this->restriction[iso][child](start_cell_dofs + i_weight * dim +
495 q_sub.
weight(k) * cached_values_cell(i_child, k, d) *
496 polynomials[d]->compute_value(i_weight, q_sub.
point(k));
504std::vector<unsigned int>
510 return std::vector<unsigned int>();
518 unsigned int dofs_per_face = 1;
519 for (
unsigned int d = 0; d < dim - 1; ++d)
520 dofs_per_face *= rt_order + 1;
523 const unsigned int interior_dofs = dim * (rt_order + 1) * dofs_per_face;
525 std::vector<unsigned int> dpo(dim + 1);
526 dpo[dim - 1] = dofs_per_face;
527 dpo[dim] = interior_dofs;
539 const unsigned int face_index)
const
560 return (face_index !=
582 std::vector<double> &nodal_values)
const
584 Assert(support_point_values.size() == this->generalized_support_points.size(),
586 this->generalized_support_points.size()));
587 Assert(support_point_values[0].
size() == this->n_components(),
589 this->n_components()));
590 Assert(nodal_values.size() == this->n_dofs_per_cell(),
593 std::fill(nodal_values.begin(), nodal_values.end(), 0.);
595 const unsigned int n_face_points = boundary_weights.size(0);
597 for (
unsigned int k = 0; k < n_face_points; ++k)
598 for (
unsigned int i = 0; i < boundary_weights.size(1); ++i)
600 nodal_values[i + face * this->n_dofs_per_face(face)] +=
601 boundary_weights(k, i) *
602 support_point_values[face * n_face_points + k][
GeometryInfo<
603 dim>::unit_normal_direction[face]];
609 const unsigned int face_no = 0;
611 const unsigned int start_cell_dofs =
613 const unsigned int start_cell_points =
616 for (
unsigned int k = 0; k < interior_weights.size(0); ++k)
617 for (
unsigned int i = 0; i < interior_weights.size(1); ++i)
618 for (
unsigned int d = 0; d < dim; ++d)
619 nodal_values[start_cell_dofs + i * dim + d] +=
620 interior_weights(k, i, d) *
621 support_point_values[k + start_cell_points][d];
623 const unsigned int start_abf_dofs =
624 start_cell_dofs + interior_weights.size(1) * dim;
627 for (
unsigned int k = 0; k < interior_weights_abf.size(0); ++k)
628 for (
unsigned int i = 0; i < interior_weights_abf.size(1); ++i)
629 for (
unsigned int d = 0; d < dim; ++d)
630 nodal_values[start_abf_dofs + i] +=
631 interior_weights_abf(k, i, d) *
632 support_point_values[k + start_cell_points][d];
638 for (
unsigned int fp = 0; fp < n_face_points; ++fp)
643 this->reference_cell(),
647 for (
unsigned int i = 0; i < boundary_weights_abf.size(1); ++i)
648 nodal_values[start_abf_dofs + i] +=
649 n_orient * boundary_weights_abf(k + fp, i) *
650 support_point_values[face * n_face_points + fp][
GeometryInfo<
651 dim>::unit_normal_direction[face]];
656 for (
unsigned int i = 0; i < boundary_weights_abf.size(1); ++i)
657 if (std::fabs(nodal_values[start_abf_dofs + i]) < 1.0e-16)
658 nodal_values[start_abf_dofs + i] = 0.0;
674#include "fe/fe_abf.inst"
***mech_lbc_system increment_interpolation_handlers push_back(scale_z_handler)
void initialize_quad_dof_index_permutation_and_sign_change()
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
virtual std::size_t memory_consumption() const override
void initialize_restriction()
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual std::string get_name() const override
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
void initialize_support_points(const unsigned int rt_degree)
FullMatrix< double > inverse_node_matrix
std::vector< MappingKind > mapping_kind
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_unique_faces() const
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
FullMatrix< double > interface_constraints
std::vector< std::vector< FullMatrix< double > > > prolongation
void invert(const FullMatrix< number2 > &M)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
static std::vector< Polynomial< number > > generate_complete_basis(const unsigned int degree)
static DataSetDescriptor face(const ReferenceCell< dim > &reference_cell, const unsigned int face_no, const types::geometric_orientation combined_orientation, 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 Quadrature< dim > project_to_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const types::geometric_orientation combined_orientation)
static Quadrature< dim > project_to_subface(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, const types::geometric_orientation combined_orientation, const RefinementCase< dim - 1 > &ref_case)
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 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 std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices()