27template <
int dim,
int spacedim>
32 const bool initialize_periodicity_constraints)
40 const unsigned int min_level = level_relevant_dofs.
min_level();
41 const unsigned int max_level = (level_relevant_dofs.
max_level() == 0) ?
44 const bool use_provided_level_relevant_dofs =
51 for (
unsigned int l = min_level; l <= max_level; ++l)
53 if (use_provided_level_relevant_dofs)
56 level_relevant_dofs[l]);
67 if (initialize_periodicity_constraints)
72 const double periodicity_factor = 1.0;
74 for (
const auto &[first_cell, second_cell] :
78 if (first_cell.first->is_artificial_on_level())
80 if (second_cell.first.first->is_artificial_on_level())
84 if (first_cell.first->level() != second_cell.first.first->level())
88 first_cell.first->as_dof_handler_level_iterator(dof)->face(
90 second_cell.first.first->as_dof_handler_level_iterator(dof)->face(
91 second_cell.first.second),
97 first_cell.first->level());
101 for (
unsigned int l = min_level; l <= max_level; ++l)
114template <
int dim,
int spacedim>
118 const std::set<types::boundary_id> &boundary_ids,
136template <
int dim,
int spacedim>
139 const unsigned int level,
140 const IndexSet &level_boundary_indices)
146 for (
unsigned int i = 0; i < n_levels; ++i)
155template <
int dim,
int spacedim>
160 const unsigned int first_vector_component)
173 for (; face != endf; ++face)
174 if (face->at_boundary() && face->boundary_id() == bid)
175 for (
unsigned int d = 0; d < dim; ++d)
181 face->get_manifold().normal_vector(face, face->center());
184 comp_mask.
set(d + first_vector_component,
true);
187 std::abs(unit_vec * normal_vec) < 1e-10,
189 "We can currently only support no normal flux conditions "
190 "for a specific boundary id if all faces are normal to the "
191 "x, y, or z axis."));
196 "We can currently only support no normal flux conditions "
197 "for a specific boundary id if all faces are facing in the "
198 "same direction, i.e., a boundary normal to the x-axis must "
199 "have a different boundary id than a boundary normal to the "
200 "y- or z-axis and so on. If the mesh here was produced using "
201 "GridGenerator::..., setting colorize=true during mesh generation "
202 "and calling make_no_normal_flux_constraints() for each no normal "
203 "flux boundary will fulfill the condition."));
212 const unsigned int level,
225 constraints_on_level,
251template <
typename Number>
254 const unsigned int level,
255 const bool add_boundary_indices,
256 const bool add_refinement_edge_indices,
257 const bool add_level_constraints,
258 const bool add_user_constraints)
const
268 if (add_refinement_edge_indices)
271 if (add_level_constraints)
286 if (add_refinement_edge_indices)
290 if (add_level_constraints)
304#include "multigrid/mg_constrained_dofs.inst"
void merge(const AffineConstraints< other_number > &other_constraints, const MergeConflictBehavior merge_conflict_behavior=no_conflicts_allowed, const bool allow_different_local_lines=false)
void constrain_dof_to_zero(const size_type constrained_dof)
void set(const unsigned int index, const bool value)
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
const hp::FECollection< dim, spacedim > & get_fe_collection() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
const Triangulation< dim, spacedim > & get_triangulation() const
types::global_dof_index n_dofs() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
void add_indices(const ForwardIterator &begin, const ForwardIterator &end)
std::vector< IndexSet > refinement_edge_indices
std::vector< AffineConstraints< double > > user_constraints
void make_no_normal_flux_constraints(const DoFHandler< dim, spacedim > &dof, const types::boundary_id bid, const unsigned int first_vector_component)
void make_zero_boundary_constraints(const DoFHandler< dim, spacedim > &dof, const std::set< types::boundary_id > &boundary_ids, const ComponentMask &component_mask={})
std::vector< IndexSet > boundary_indices
void add_boundary_indices(const DoFHandler< dim, spacedim > &dof, const unsigned int level, const IndexSet &boundary_indices)
void merge_constraints(AffineConstraints< Number > &constraints, const unsigned int level, const bool add_boundary_indices, const bool add_refinement_edge_indices, const bool add_level_constraints, const bool add_user_constraints) const
void clear_user_constraints()
std::vector< AffineConstraints< double > > level_constraints
bool have_boundary_indices() const
void add_user_constraints(const unsigned int level, const AffineConstraints< double > &constraints_on_level)
const IndexSet & get_refinement_edge_indices(unsigned int level) const
const AffineConstraints< double > & get_user_constraint_matrix(const unsigned int level) const
const AffineConstraints< double > & get_level_constraints(const unsigned int level) const
const IndexSet & get_boundary_indices(const unsigned int level) const
void initialize(const DoFHandler< dim, spacedim > &dof, const MGLevelObject< IndexSet > &level_relevant_dofs=MGLevelObject< IndexSet >(), const bool initialize_periodicity_constraints=true)
unsigned int max_level() const
unsigned int min_level() const
face_iterator end_face() const
virtual unsigned int n_global_levels() const
face_iterator begin_face() const
const std::map< std::pair< cell_iterator, unsigned int >, std::pair< std::pair< cell_iterator, unsigned int >, types::geometric_orientation > > & get_periodic_face_map() const
unsigned int n_components() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)