template <class DH, class SparsityPattern>
void
make_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity_pattern,
- const ConstraintMatrix &constraints = ConstraintMatrix(),
- const bool keep_constrained_dofs = true,
- const types::subdomain_id subdomain_id = types::invalid_subdomain_id);
+ SparsityPattern &sparsity_pattern,
+ const ConstraintMatrix &constraints = ConstraintMatrix(),
+ const bool keep_constrained_dofs = true,
- const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id);
++ const types::subdomain_id subdomain_id = types::invalid_subdomain_id);
/**
* Locate non-zero entries for
template <class DH, class SparsityPattern>
void
make_sparsity_pattern (const DH &dof,
- const Table<2, Coupling> &coupling,
- SparsityPattern &sparsity_pattern,
- const ConstraintMatrix &constraints = ConstraintMatrix(),
- const bool keep_constrained_dofs = true,
- const types::subdomain_id subdomain_id = types::invalid_subdomain_id);
+ const Table<2, Coupling> &coupling,
+ SparsityPattern &sparsity_pattern,
+ const ConstraintMatrix &constraints = ConstraintMatrix(),
+ const bool keep_constrained_dofs = true,
- const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id);
++ const types::subdomain_id subdomain_id = types::invalid_subdomain_id);
/**
* @deprecated This is the old
template<class DH, class SparsityPattern>
void
make_flux_sparsity_pattern (const DH &dof_handler,
- SparsityPattern &sparsity_pattern,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs = true,
- const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int);
+ SparsityPattern &sparsity_pattern,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs = true,
- const types::subdomain_id_t subdomain_id = numbers::invalid_unsigned_int);
++ const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int);
/**
* This function does the same as
* extract_dofs() for one level
* of a multi-grid DoF numbering.
*/
- template <int dim, int spacedim>
+ template <class DH>
void
extract_level_dofs (const unsigned int level,
- const MGDoFHandler<dim,spacedim> &dof,
- const std::vector<bool> &select,
- std::vector<bool> &selected_dofs,
- const bool blocks = false);
+ const DH &dof,
+ const std::vector<bool> &select,
+ std::vector<bool> &selected_dofs,
+ const bool blocks = false);
-
+
/**
* Extract all degrees of freedom
* which are at the boundary and
extract_boundary_dofs (const DH &dof_handler,
const std::vector<bool> &component_mask,
std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
+ const std::set<types::boundary_id> &boundary_indicators = std::set<types::boundary_id>());
+ /**
+ * This function does the same as the previous one but it
+ * returns its result as an IndexSet rather than a std::vector@<bool@>.
+ * Thus, it can also be called for DoFHandler objects that are
+ * defined on parallel::distributed::Triangulation objects.
+ *
+ * @note If the DoFHandler object is indeed defined on a
+ * parallel::distributed::Triangulation, then the @p selected_dofs
+ * index set will contain only those degrees of freedom on the
+ * boundary that belong to the locally relevant set (see
+ * @ref GlossLocallyRelevantDof "locally relevant DoFs").
+ *
+ * @param dof_handler The object that describes which degrees of freedom
+ * live on which cell
+ * @param component_mask A mask denoting the vector components of the
+ * finite element that should be considered (see also
+ * @ref GlossComponentMask).
+ * @param selected_dofs The IndexSet object that is returned and that
+ * will contain the indices of degrees of freedom that are
+ * located on the boundary (and correspond to the selected
+ * vector components and boundary indicators, depending on
+ * the values of the @p component_mask and @p boundary_indicators
+ * arguments).
+ * @param boundary_indicators If empty, this function extracts the
+ * indices of the degrees of freedom for all parts of the boundary.
+ * If it is a non-empty list, then the function only considers
+ * boundary faces with the boundary indicators listed in this
+ * argument.
+ */
+ template <class DH>
+ void
+ extract_boundary_dofs (const DH &dof_handler,
+ const std::vector<bool> &component_mask,
+ IndexSet &selected_dofs,
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
+
/**
* This function does the same as the previous one but it
* returns its result as an IndexSet rather than a std::vector@<bool@>.
template <class DH>
void
extract_dofs_with_support_on_boundary (const DH &dof_handler,
- const std::vector<bool> &component_mask,
- std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id> &boundary_indicators = std::set<types::boundary_id>());
+ const std::vector<bool> &component_mask,
+ std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
++ const std::set<types::boundary_id> &boundary_indicators = std::set<types::boundary_id>());
/**
* @name Hanging Nodes
template <class DH>
void
extract_subdomain_dofs (const DH &dof_handler,
- const types::subdomain_id_t subdomain_id,
- const types::subdomain_id subdomain_id,
- std::vector<bool> &selected_dofs);
++ const types::subdomain_id subdomain_id,
+ std::vector<bool> &selected_dofs);
/**
template <class DH>
void
get_subdomain_association (const DH &dof_handler,
- std::vector<types::subdomain_id_t> &subdomain);
- std::vector<types::subdomain_id> &subdomain);
++ std::vector<types::subdomain_id> &subdomain);
/**
* Count how many degrees of freedom are
template <class DH>
unsigned int
count_dofs_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain);
- const types::subdomain_id subdomain);
++ const types::subdomain_id subdomain);
/**
* Count how many degrees of freedom are
template <class DH>
void
count_dofs_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain,
- const types::subdomain_id subdomain,
- std::vector<unsigned int> &n_dofs_on_subdomain);
++ const types::subdomain_id subdomain,
+ std::vector<unsigned int> &n_dofs_on_subdomain);
/**
* Return a set of indices that denotes
template <class DH>
IndexSet
dof_indices_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain);
- const types::subdomain_id subdomain);
-
++ const types::subdomain_id subdomain);
// @}
/**
* @name Dof indices for patches
template <class DH>
void
map_dof_to_boundary_indices (const DH &dof_handler,
- const std::set<types::boundary_id_t> &boundary_indicators,
- const std::set<types::boundary_id> &boundary_indicators,
- std::vector<unsigned int> &mapping);
++ const std::set<types::boundary_id> &boundary_indicators,
+ std::vector<unsigned int> &mapping);
/**
* Return a list of support
{
std::size_t result = sizeof(*this);
result += sizeof(unsigned int) * sizes.size();
- #ifdef DEAL_PREFER_MATRIX_EZ
- std::vector<std_cxx1x::shared_ptr<SparseMatrixEZ<double> > >::const_iterator m;
- const std::vector<std_cxx1x::shared_ptr<SparseMatrixEZ<double> > >::const_iterator end = prolongation_matrices.end();
- for (m = prolongation_matrices.begin(); m != end ; ++m)
- result += *m->memory_consumption();
- #else
+
for (unsigned int i=0;i<prolongation_matrices.size();++i)
result += prolongation_matrices[i]->memory_consumption()
- + prolongation_sparsities[i]->memory_consumption();
+ + prolongation_sparsities[i]->memory_consumption();
- #endif
+
return result;
}
// check that only boundary
// indicators 0 and 1 are allowed
// in 1d
- for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
+ for (std::set<types::boundary_id>::const_iterator i=boundary_indicators.begin();
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
return boundary_indicators.size()*get_fe().dofs_per_vertex;
}
// check that only boundary
// indicators 0 and 1 are allowed
// in 1d
- for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
+ for (std::set<types::boundary_id>::const_iterator i=boundary_indicators.begin();
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
return boundary_indicators.size()*get_fe().dofs_per_vertex;
}
template<int dim, int spacedim>
unsigned int
- DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
+ DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
{
Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
std::set<int> boundary_dofs;
template <class DH, class SparsityPattern>
void
make_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
- const types::subdomain_id subdomain_id)
+ SparsityPattern &sparsity,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs,
- const types::subdomain_id_t subdomain_id)
++ const types::subdomain_id subdomain_id)
{
const unsigned int n_dofs = dof.n_dofs();
template <class DH, class SparsityPattern>
void
make_sparsity_pattern (const DH &dof,
- const Table<2,Coupling> &couplings,
- SparsityPattern &sparsity,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
- const types::subdomain_id subdomain_id)
+ const Table<2,Coupling> &couplings,
+ SparsityPattern &sparsity,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs,
- const types::subdomain_id_t subdomain_id)
++ const types::subdomain_id subdomain_id)
{
const unsigned int n_dofs = dof.n_dofs();
template <class DH, class SparsityPattern>
void
make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
+ SparsityPattern &sparsity,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs,
- const types::subdomain_id_t subdomain_id)
+ const types::subdomain_id subdomain_id)
{
const unsigned int n_dofs = dof.n_dofs();
template <class DH>
void
extract_dofs_with_support_on_boundary (const DH &dof_handler,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id> &boundary_indicators)
+ const std::vector<bool> &component_select,
+ std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id_t> &boundary_indicators)
++ const std::set<types::boundary_id> &boundary_indicators)
{
AssertDimension (component_select.size(), n_components(dof_handler));
Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
template <class DH>
void
extract_subdomain_dofs (const DH &dof_handler,
- const types::subdomain_id_t subdomain_id,
- const types::subdomain_id subdomain_id,
- std::vector<bool> &selected_dofs)
++ const types::subdomain_id subdomain_id,
+ std::vector<bool> &selected_dofs)
{
Assert(selected_dofs.size() == dof_handler.n_dofs(),
- ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs()));
+ ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs()));
// preset all values by false
std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false);
template <class DH>
void
get_subdomain_association (const DH &dof_handler,
- std::vector<types::subdomain_id_t> &subdomain_association)
- std::vector<types::subdomain_id> &subdomain_association)
++ std::vector<types::subdomain_id> &subdomain_association)
{
// if the Triangulation is distributed, the
// only thing we can usefully ask is for
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- Assert (cell->is_artificial() == false,
- ExcMessage ("You can't call this function for meshes that "
- "have artificial cells."));
+ Assert (cell->is_artificial() == false,
+ ExcMessage ("You can't call this function for meshes that "
+ "have artificial cells."));
- const types::subdomain_id_t subdomain_id = cell->subdomain_id();
- const types::subdomain_id subdomain_id = cell->subdomain_id();
- const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
- local_dof_indices.resize (dofs_per_cell);
- cell->get_dof_indices (local_dof_indices);
++ const types::subdomain_id subdomain_id = cell->subdomain_id();
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
+ local_dof_indices.resize (dofs_per_cell);
+ cell->get_dof_indices (local_dof_indices);
// set subdomain ids. if dofs
// already have their values
template <class DH>
unsigned int
count_dofs_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain)
- const types::subdomain_id subdomain)
++ const types::subdomain_id subdomain)
{
- std::vector<types::subdomain_id_t> subdomain_association (dof_handler.n_dofs());
+ std::vector<types::subdomain_id> subdomain_association (dof_handler.n_dofs());
get_subdomain_association (dof_handler, subdomain_association);
return std::count (subdomain_association.begin(),
template <class DH>
IndexSet
dof_indices_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain)
- const types::subdomain_id subdomain)
++ const types::subdomain_id subdomain)
{
// If we have a distributed::Triangulation only
template <class DH>
void
count_dofs_with_subdomain_association (const DH &dof_handler,
- const types::subdomain_id_t subdomain,
- const types::subdomain_id subdomain,
- std::vector<unsigned int> &n_dofs_on_subdomain)
++ const types::subdomain_id subdomain,
+ std::vector<unsigned int> &n_dofs_on_subdomain)
{
Assert (n_dofs_on_subdomain.size() == dof_handler.get_fe().n_components(),
- ExcDimensionMismatch (n_dofs_on_subdomain.size(),
- dof_handler.get_fe().n_components()));
+ ExcDimensionMismatch (n_dofs_on_subdomain.size(),
+ dof_handler.get_fe().n_components()));
std::fill (n_dofs_on_subdomain.begin(), n_dofs_on_subdomain.end(), 0);
// in debug mode, make sure that there are
#if defined(DEAL_II_USE_P4EST) && defined(DEAL_II_COMPILER_SUPPORTS_MPI)
const unsigned int dim = DH::dimension;
const unsigned int spacedim = DH::space_dimension;
-
+
if (const parallel::distributed::Triangulation<dim,spacedim> * tria
- = (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
- (&dof_handler.get_tria())))
+ = (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
+ (&dof_handler.get_tria())))
{
- std::vector<unsigned int> local_dof_count = dofs_per_component;
+ std::vector<unsigned int> local_dof_count = dofs_per_component;
- MPI_Allreduce ( &local_dof_count[0], &dofs_per_component[0], n_target_components,
- MPI_UNSIGNED, MPI_SUM, tria->get_communicator());
+ MPI_Allreduce ( &local_dof_count[0], &dofs_per_component[0], n_target_components,
+ MPI_UNSIGNED, MPI_SUM, tria->get_communicator());
}
#endif
}
#endif
- return n_parameters_on_fine_grid;
+ return n_parameters_on_fine_grid;
}
-
-
+
+
}
}
local_dof_indices.resize(cell->get_fe().dofs_per_cell);
cell->get_dof_indices(local_dof_indices);
-
+
const std::vector<Point<spacedim> > & points =
- fe_values.get_quadrature_points();
+ fe_values.get_quadrature_points();
for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; ++i)
// insert the values into the map
support_points[local_dof_indices[i]] = points[i];
unsigned int
DoFTools::count_dofs_with_subdomain_association<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const types::subdomain_id_t);
+ const types::subdomain_id);
-
+
template
IndexSet
DoFTools::dof_indices_with_subdomain_association<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const types::subdomain_id_t);
+ const types::subdomain_id);
-
+
template
void
DoFTools::get_subdomain_association<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
{
const FiniteElement<dim>& fe = dof.get_fe();
const unsigned int n_comp = fe.n_components();
-
+
Assert ((level>=1) && (level<dof.get_tria().n_levels()),
- ExcIndexRange(level, 1, dof.get_tria().n_levels()));
+ ExcIndexRange(level, 1, dof.get_tria().n_levels()));
const unsigned int fine_dofs = dof.n_dofs(level);
const unsigned int coarse_dofs = dof.n_dofs(level-1);
if (component_mask.size() == 0)
{
typename MGDoFHandler<dim,spacedim>::cell_iterator
- cell = dof.begin(),
- endc = dof.end();
+ cell = dof.begin(),
+ endc = dof.end();
for (; cell!=endc; ++cell)
- {
- const FiniteElement<dim> &fe = cell->get_fe();
- const unsigned int level = cell->level();
- local_dofs.resize(fe.dofs_per_face);
-
- for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
- ++face_no)
- if (cell->at_boundary(face_no) == true)
- {
- const typename MGDoFHandler<dim,spacedim>::face_iterator
- face = cell->face(face_no);
- const types::boundary_id bi = face->boundary_indicator();
+ {
+ const FiniteElement<dim> &fe = cell->get_fe();
+ const unsigned int level = cell->level();
+ local_dofs.resize(fe.dofs_per_face);
+
+ for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
+ ++face_no)
+ if (cell->at_boundary(face_no) == true)
+ {
+ const typename MGDoFHandler<dim,spacedim>::face_iterator
+ face = cell->face(face_no);
- const types::boundary_id_t bi = face->boundary_indicator();
++ const types::boundary_id bi = face->boundary_indicator();
// Face is listed in
// boundary map
- if (function_map.find(bi) != function_map.end())
- {
- face->get_mg_dof_indices(level, local_dofs);
- for (unsigned int i=0;i<fe.dofs_per_face;++i)
- boundary_indices[level].insert(local_dofs[i]);
- }
- }
- }
+ if (function_map.find(bi) != function_map.end())
+ {
+ face->get_mg_dof_indices(level, local_dofs);
+ for (unsigned int i=0;i<fe.dofs_per_face;++i)
+ boundary_indices[level].insert(local_dofs[i]);
+ }
+ }
+ }
}
else
{
// that are non-zero for the
// components we are interested in,
// are in fact primitive
- for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
- {
- const std::vector<bool> &nonzero_component_array
- = cell->get_fe().get_nonzero_components (i);
- for (unsigned int c=0; c<n_components; ++c)
- if ((nonzero_component_array[c] == true)
- &&
- (component_mask[c] == true))
- Assert (cell->get_fe().is_primitive (i),
- ExcMessage ("This function can only deal with requested boundary "
- "values that correspond to primitive (scalar) base "
- "elements"));
- }
-
- typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
- const types::boundary_id boundary_component = face->boundary_indicator();
- if (function_map.find(boundary_component) != function_map.end())
+ for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+ {
+ const std::vector<bool> &nonzero_component_array
+ = cell->get_fe().get_nonzero_components (i);
+ for (unsigned int c=0; c<n_components; ++c)
+ if ((nonzero_component_array[c] == true)
+ &&
+ (component_mask[c] == true))
+ Assert (cell->get_fe().is_primitive (i),
+ ExcMessage ("This function can only deal with requested boundary "
+ "values that correspond to primitive (scalar) base "
+ "elements"));
+ }
+
+ typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
- const types::boundary_id_t boundary_component = face->boundary_indicator();
++ const types::boundary_id boundary_component = face->boundary_indicator();
+ if (function_map.find(boundary_component) != function_map.end())
// face is of the right component
- {
+ {
// get indices, physical location and
// boundary values of dofs on this
// face
std::fill (cell_dofs.begin(), cell_dofs.end(), false);
for (unsigned int face_nr=0; face_nr<GeometryInfo<dim>::faces_per_cell; ++face_nr)
- {
- const typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_nr);
- if (!face->at_boundary())
- {
+ {
+ const typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_nr);
+ if (!face->at_boundary())
+ {
//interior face
- const typename MGDoFHandler<dim>::cell_iterator
- neighbor = cell->neighbor(face_nr);
+ const typename MGDoFHandler<dim>::cell_iterator
+ neighbor = cell->neighbor(face_nr);
- if (neighbor->level() < cell->level())
- {
- for (unsigned int j=0; j<dofs_per_face; ++j)
- cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
+ if (neighbor->level() < cell->level())
+ {
+ for (unsigned int j=0; j<dofs_per_face; ++j)
+ cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
- }
- }
- }
+ }
+ }
+ }
-
+
const unsigned int level = cell->level();
cell->get_mg_dof_indices (local_dof_indices);
}
-template <int dim, int spacedim>
-void
-extract_non_interface_dofs (const MGDoFHandler<dim,spacedim> &mg_dof_handler,
- std::vector<std::set<unsigned int> > &non_interface_dofs)
-{
- Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
- ExcDimensionMismatch (non_interface_dofs.size(),
- mg_dof_handler.get_tria().n_levels()));
+ template <int dim, int spacedim>
+ void
+ extract_non_interface_dofs (const MGDoFHandler<dim,spacedim> &mg_dof_handler,
+ std::vector<std::set<unsigned int> > &non_interface_dofs)
+ {
+ Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
+ ExcDimensionMismatch (non_interface_dofs.size(),
+ mg_dof_handler.get_tria().n_levels()));
- const FiniteElement<dim,spacedim> &fe = mg_dof_handler.get_fe();
+ const FiniteElement<dim,spacedim> &fe = mg_dof_handler.get_fe();
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int dofs_per_face = fe.dofs_per_face;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int dofs_per_face = fe.dofs_per_face;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
- std::vector<bool> cell_dofs(dofs_per_cell, false);
- std::vector<bool> cell_dofs_interface(dofs_per_cell, false);
+ std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ std::vector<bool> cell_dofs(dofs_per_cell, false);
+ std::vector<bool> cell_dofs_interface(dofs_per_cell, false);
- typename MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
- endc = mg_dof_handler.end();
+ typename MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
+ endc = mg_dof_handler.end();
- for (; cell!=endc; ++cell)
- {
- std::fill (cell_dofs.begin(), cell_dofs.end(), false);
- std::fill (cell_dofs_interface.begin(), cell_dofs_interface.end(), false);
+ for (; cell!=endc; ++cell)
+ {
+ std::fill (cell_dofs.begin(), cell_dofs.end(), false);
+ std::fill (cell_dofs_interface.begin(), cell_dofs_interface.end(), false);
-
+
- for (unsigned int face_nr=0; face_nr<GeometryInfo<dim>::faces_per_cell; ++face_nr)
- {
- const typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_nr);
- if (!face->at_boundary())
- {
+ for (unsigned int face_nr=0; face_nr<GeometryInfo<dim>::faces_per_cell; ++face_nr)
+ {
+ const typename DoFHandler<dim,spacedim>::face_iterator face = cell->face(face_nr);
+ if (!face->at_boundary())
+ {
//interior face
- const typename MGDoFHandler<dim>::cell_iterator
- neighbor = cell->neighbor(face_nr);
-
- if ((neighbor->level() < cell->level()))
+ const typename MGDoFHandler<dim>::cell_iterator
+ neighbor = cell->neighbor(face_nr);
+
+ if ((neighbor->level() < cell->level()))
+ {
+ for (unsigned int j=0; j<dofs_per_face; ++j)
+ cell_dofs_interface[fe.face_to_cell_index(j,face_nr)] = true;
+ }
+ else
{
for (unsigned int j=0; j<dofs_per_face; ++j)
- cell_dofs_interface[fe.face_to_cell_index(j,face_nr)] = true;
+ cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
}
- else
+ }
+ else
{
- for (unsigned int j=0; j<dofs_per_face; ++j)
- cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
- }
- }
- else
- {
//boundary face
for (unsigned int j=0; j<dofs_per_face; ++j)
- cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
- }
- }
+ cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
+ }
+ }
- const unsigned int level = cell->level();
- cell->get_mg_dof_indices (local_dof_indices);
+ const unsigned int level = cell->level();
+ cell->get_mg_dof_indices (local_dof_indices);
- for(unsigned int i=0; i<dofs_per_cell; ++i)
- if (cell_dofs[i] && !cell_dofs_interface[i])
- non_interface_dofs[level].insert(local_dof_indices[i]);
- }
-}
+ for(unsigned int i=0; i<dofs_per_cell; ++i)
+ if (cell_dofs[i] && !cell_dofs_interface[i])
+ non_interface_dofs[level].insert(local_dof_indices[i]);
+ }
+ }
template <int dim, int spacedim>