22#ifndef EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_DOF_TOOLS_EXTENSION_H_
23#define 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>
28#include <deal.II/fe/fe.h>
29#include <deal.II/fe/mapping_q_generic.h>
39template<
int dim,
int spacedim>
41map_boundary_dofs_to_support_points(
42 Mapping<dim, spacedim>
const & mapping,
43 DoFHandler<dim, spacedim>
const & dof_handler,
44 std::map<types::global_dof_index, Point<spacedim>> & support_points,
45 ComponentMask
const & in_mask,
46 types::boundary_id
const boundary_id)
48 FiniteElement<dim, spacedim>
const & fe = dof_handler.get_fe();
50 Assert(fe.has_support_points(),
typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
52 Quadrature<dim - 1>
const quad(fe.get_unit_face_support_points());
55 ComponentMask
const mask =
56 (in_mask.size() == 0 ? ComponentMask(fe.n_components(),
true) : in_mask);
65 FEFaceValues<dim, spacedim> fe_values(mapping, fe, quad, update_quadrature_points);
67 std::vector<types::global_dof_index> local_dof_indices;
68 for(
auto const & cell : dof_handler.active_cell_iterators())
69 if(cell->is_locally_owned())
70 for(
auto const & face : cell->face_iterators())
71 if(face->at_boundary() ==
true and face->boundary_id() == boundary_id)
74 fe_values.reinit(cell, face);
76 local_dof_indices.resize(fe.dofs_per_face);
77 face->get_dof_indices(local_dof_indices);
79 std::vector<Point<spacedim>>
const & points = fe_values.get_quadrature_points();
81 for(
unsigned int i = 0; i < fe.n_dofs_per_face(); ++i)
83 unsigned int const dof_comp = fe.face_system_to_component_index(i).first;
87 support_points[local_dof_indices[i]] = points[i];
93DEAL_II_NAMESPACE_CLOSE