22#ifndef INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_DOF_TOOLS_EXTENSION_H_
23#define INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_DOF_TOOLS_EXTENSION_H_
26#include <deal.II/dofs/dof_handler.h>
27#include <deal.II/dofs/dof_tools.h>
29#include <deal.II/fe/fe.h>
30#include <deal.II/fe/mapping_q_generic.h>
40template<
int dim,
int spacedim>
42map_boundary_dofs_to_support_points(
43 Mapping<dim, spacedim>
const & mapping,
44 DoFHandler<dim, spacedim>
const & dof_handler,
45 std::map<types::global_dof_index, Point<spacedim>> & support_points,
46 ComponentMask
const & in_mask,
47 types::boundary_id
const boundary_id)
49 FiniteElement<dim, spacedim>
const & fe = dof_handler.get_fe();
51 Assert(fe.has_support_points(),
typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
53 Quadrature<dim - 1>
const quad(fe.get_unit_face_support_points());
56 ComponentMask
const mask =
57 (in_mask.size() == 0 ? ComponentMask(fe.n_components(),
true) : in_mask);
66 FEFaceValues<dim, spacedim> fe_values(mapping, fe, quad, update_quadrature_points);
68 std::vector<types::global_dof_index> local_dof_indices;
69 for(
auto const & cell : dof_handler.active_cell_iterators())
70 if(cell->is_locally_owned())
71 for(
auto const & face : cell->face_iterators())
72 if(face->at_boundary() ==
true and face->boundary_id() == boundary_id)
75 fe_values.reinit(cell, face);
77 local_dof_indices.resize(fe.dofs_per_face);
78 face->get_dof_indices(local_dof_indices);
80 std::vector<Point<spacedim>>
const & points = fe_values.get_quadrature_points();
82 for(
unsigned int i = 0; i < fe.n_dofs_per_face(); ++i)
84 unsigned int const dof_comp = fe.face_system_to_component_index(i).first;
88 support_points[local_dof_indices[i]] = points[i];
94DEAL_II_NAMESPACE_CLOSE