// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// see if we need to fill this
// entry, or whether it already
// exists
- if (identities == 0)
+ if (identities.get() == 0)
{
switch (structdim)
{
(new DoFIdentities(fe1.hp_vertex_dof_identities(fe2)));
break;
}
-
+
case 1:
{
identities =
(new DoFIdentities(fe1.hp_line_dof_identities(fe2)));
break;
}
-
+
case 2:
{
identities =
(new DoFIdentities(fe1.hp_quad_dof_identities(fe2)));
break;
}
-
+
default:
Assert (false, ExcNotImplemented());
}
{
const FiniteElement<dim, spacedim> &this_fe
= object->get_fe (object->nth_active_fe_index(dominating_fe_index));
-
+
FiniteElementDomination::Domination
domination = FiniteElementDomination::either_element_can_dominate;
for (unsigned int other_fe_index=0;
const FiniteElement<dim, spacedim>
&that_fe
= object->get_fe (object->nth_active_fe_index(other_fe_index));
-
+
domination = domination &
this_fe.compare_for_face_domination(that_fe);
}
-
+
// see if this element is
// able to dominate all the
// other ones, and if so
}
}
-
+
namespace internal
{
static
void
reserve_space_vertices (DoFHandler<dim,spacedim> &dof_handler)
- {
+ {
// The final step is allocating
// memory is to set up vertex dof
// information. since vertices
std::vector<std::vector<bool> >
vertex_fe_association (dof_handler.finite_elements->size(),
std::vector<bool> (dof_handler.tria->n_vertices(), false));
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
vertex_fe_association[cell->active_fe_index()][cell->vertex_index(v)]
= true;
-
+
// in debug mode, make sure
// that each vertex is
// associated with at least one
// vertex_dofs_offsets field
dof_handler.vertex_dofs_offsets.resize (dof_handler.tria->n_vertices(),
numbers::invalid_unsigned_int);
-
+
unsigned int vertex_slots_needed = 0;
for (unsigned int v=0; v<dof_handler.tria->n_vertices(); ++v)
if (dof_handler.tria->vertex_used(v) == true)
{
dof_handler.vertex_dofs_offsets[v] = vertex_slots_needed;
-
+
for (unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
if (vertex_fe_association[fe][v] == true)
vertex_slots_needed += (*dof_handler.finite_elements)[fe].dofs_per_vertex + 1;
}
}
-
-
+
+
/**
* Distribute dofs on the given cell,
* with new dofs starting with index
unsigned int next_free_dof)
{
const unsigned int dim = 1;
-
+
const FiniteElement<dim,spacedim> &fe = cell->get_fe();
const unsigned int fe_index = cell->active_fe_index ();
-
+
// number dofs on vertices. to do
// so, check whether dofs for
// this vertex have been
DoFHandler<dim,spacedim>::invalid_dof_index)
for (unsigned int d=0; d<fe.dofs_per_vertex; ++d, ++next_free_dof)
cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
-
+
// finally for the line. this one
// shouldn't be numbered yet
if (fe.dofs_per_line > 0)
Assert ((cell->dof_index(0, fe_index) ==
DoFHandler<dim,spacedim>::invalid_dof_index),
ExcInternalError());
-
+
for (unsigned int d=0; d<fe.dofs_per_line; ++d, ++next_free_dof)
cell->set_dof_index (d, next_free_dof, fe_index);
}
// note that this cell has been processed
cell->set_user_flag ();
-
+
return next_free_dof;
}
const FiniteElement<dim,spacedim> &fe = cell->get_fe();
const unsigned int fe_index = cell->active_fe_index ();
-
+
// number dofs on vertices. to do
// so, check whether dofs for
// this vertex have been
DoFHandler<dim,spacedim>::invalid_dof_index)
for (unsigned int d=0; d<fe.dofs_per_vertex; ++d, ++next_free_dof)
cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
-
+
// next the sides. do the
// same as above: check whether
// the line is already numbered
Assert ((cell->dof_index(0, fe_index) ==
DoFHandler<dim,spacedim>::invalid_dof_index),
ExcInternalError());
-
+
for (unsigned int d=0; d<fe.dofs_per_quad; ++d, ++next_free_dof)
cell->set_dof_index (d, next_free_dof, fe_index);
}
// note that this cell has been processed
cell->set_user_flag ();
-
+
return next_free_dof;
}
const FiniteElement<dim,spacedim> &fe = cell->get_fe();
const unsigned int fe_index = cell->active_fe_index ();
-
+
// number dofs on vertices. to do
// so, check whether dofs for
// this vertex have been
DoFHandler<dim,spacedim>::invalid_dof_index)
for (unsigned int d=0; d<fe.dofs_per_vertex; ++d, ++next_free_dof)
cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
-
+
// next the four lines. do the
// same as above: check whether
// the line is already numbered
Assert ((cell->dof_index(0, fe_index) ==
DoFHandler<dim,spacedim>::invalid_dof_index),
ExcInternalError());
-
+
for (unsigned int d=0; d<fe.dofs_per_hex; ++d, ++next_free_dof)
cell->set_dof_index (d, next_free_dof, fe_index);
}
// note that this cell has been processed
cell->set_user_flag ();
-
+
return next_free_dof;
}
-
-
+
+
/**
- * Reserve enough space in the
+ * Reserve enough space in the
* <tt>levels[]</tt> objects to store the
* numbers of the degrees of freedom
* needed for the given element. The
const unsigned int dim = 1;
typedef DoFHandler<dim,spacedim> BaseClass;
-
+
Assert (dof_handler.finite_elements != 0,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
// troublesome if you want to change
// their size
dof_handler.clear_space ();
-
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels.push_back (new internal::hp::DoFLevel<dim>);
std::swap (active_fe_backup[level],
}
// LINE (CELL) DOFs
-
+
// count how much space we need
// on each level for the cell
// dofs and set the
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->lines.dof_offsets
= std::vector<unsigned int> (dof_handler.tria->n_raw_lines(level),
cell!=dof_handler.end_active(level); ++cell)
if (!cell->has_children())
counter += cell->get_fe().dofs_per_line;
-
+
Assert (dof_handler.levels[level]->lines.dofs.size() == counter,
ExcInternalError());
Assert (static_cast<unsigned int>
ExcInternalError());
}
#endif
-
-
+
+
// VERTEX DOFS
reserve_space_vertices (dof_handler);
}
-
+
template <int spacedim>
static
const unsigned int dim = 2;
typedef DoFHandler<dim,spacedim> BaseClass;
-
+
Assert (dof_handler.finite_elements != 0,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
// troublesome if you want to change
// their size
dof_handler.clear_space ();
-
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels.push_back (new internal::hp::DoFLevel<dim>);
std::swap (active_fe_backup[level],
dof_handler.faces = new internal::hp::DoFFaces<2>;
}
-
+
// QUAD (CELL) DOFs
-
+
// count how much space we need
// on each level for the cell
// dofs and set the
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->quads.dof_offsets
= std::vector<unsigned int> (dof_handler.tria->n_raw_quads(level),
cell!=dof_handler.end_active(level); ++cell)
if (!cell->has_children())
counter += cell->get_fe().dofs_per_quad;
-
+
Assert (dof_handler.levels[level]->quads.dofs.size() == counter,
ExcInternalError());
Assert (static_cast<unsigned int>
ExcInternalError());
}
#endif
-
-
+
+
// LINE DOFS
//
// same here: count line dofs,
// class) we will have to store
// on each level
unsigned int n_line_slots = 0;
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
.dofs_per_line
+
3);
-
+
// mark this face as
// visited
cell->face(face)->set_user_flag ();
dof_handler.faces->lines.dofs
= std::vector<unsigned int> (n_line_slots,
DoFHandler<dim,spacedim>::invalid_dof_index);
-
+
// with the memory now
// allocated, loop over the
// dof_handler.cells again and prime the
.clear_user_flags_line ();
unsigned int next_free_line_slot = 0;
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
// does not have to
// be explicitly
// set
-
+
// finally, mark
// those slots as
// used
// unset for the
// moment (i.e. at
// invalid_dof_index).
- //
+ //
// then comes the
// fe_index for the
// neighboring
// of dofs that we
// need not set
// right now
- //
+ //
// following this
// comes the stop
// index, which
// does not have to
// be explicitly
// set
-
+
// finally, mark
// those slots as
// used
+
3);
}
-
+
// mark this face as
// visited
cell->face(face)->set_user_flag ();
}
-
+
// we should have moved the
// cursor for each level to the
// total number of dofs on that
// level. check that
Assert (next_free_line_slot == n_line_slots,
ExcInternalError());
-
+
// at the end, restore the user
// flags for the lines
const_cast<dealii::Triangulation<dim,spacedim>&>(*dof_handler.tria)
.load_user_flags_line (saved_line_user_flags);
}
-
+
// VERTEX DOFS
reserve_space_vertices (dof_handler);
}
-
+
template <int spacedim>
static
const unsigned int dim = 3;
typedef DoFHandler<dim,spacedim> BaseClass;
-
+
Assert (dof_handler.finite_elements != 0,
typename BaseClass::ExcNoFESelected());
Assert (dof_handler.finite_elements->size() > 0,
// troublesome if you want to change
// their size
dof_handler.clear_space ();
-
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels.push_back (new internal::hp::DoFLevel<dim>);
std::swap (active_fe_backup[level],
dof_handler.faces = new internal::hp::DoFFaces<3>;
}
-
+
// HEX (CELL) DOFs
-
+
// count how much space we need
// on each level for the cell
// dofs and set the
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->hexes.dof_offsets
= std::vector<unsigned int> (dof_handler.tria->n_raw_hexs(level),
cell!=dof_handler.end_active(level); ++cell)
if (!cell->has_children())
counter += cell->get_fe().dofs_per_hex;
-
+
Assert (dof_handler.levels[level]->hexes.dofs.size() == counter,
ExcInternalError());
Assert (static_cast<unsigned int>
ExcInternalError());
}
#endif
-
-
+
+
// QUAD DOFS
//
// same here: count quad dofs,
// slots (see the hp::DoFLevel
// class) we will have to store
unsigned int n_quad_slots = 0;
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
.dofs_per_quad
+
3);
-
+
// mark this face as
// visited
cell->face(face)->set_user_flag ();
// quads, though only the
// active ones will have a
// non-invalid value later on
- if (true)
+ if (true)
{
dof_handler.faces->quads.dof_offsets
= std::vector<unsigned int> (dof_handler.tria->n_raw_quads(),
DoFHandler<dim,spacedim>::invalid_dof_index);
dof_handler.faces->quads.dofs
= std::vector<unsigned int> (n_quad_slots,
- DoFHandler<dim,spacedim>::invalid_dof_index);
+ DoFHandler<dim,spacedim>::invalid_dof_index);
}
// with the memory now
.clear_user_flags_quad ();
unsigned int next_free_quad_slot = 0;
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
// does not have to
// be explicitly
// set
-
+
// finally, mark
// those slots as
// used
// unset for the
// moment (i.e. at
// invalid_dof_index).
- //
+ //
// then comes the
// fe_index for the
// neighboring
// of dofs that we
// need not set
// right now
- //
+ //
// following this
// comes the stop
// index, which
// does not have to
// be explicitly
// set
-
+
// finally, mark
// those slots as
// used
+
3);
}
-
+
// mark this face as
// visited
cell->face(face)->set_user_flag ();
// of dofs. check that
Assert (next_free_quad_slot == n_quad_slots,
ExcInternalError());
-
+
// at the end, restore the user
// flags for the quads
const_cast<dealii::Triangulation<dim,spacedim>&>(*dof_handler.tria)
// much like with vertices: there
// can be an arbitrary number of
// finite elements associated
- // with each line.
+ // with each line.
//
// the algorithm we use is
// somewhat similar to what we do
line_fe_association (dof_handler.finite_elements->size(),
std::vector<bool> (dof_handler.tria->n_raw_lines(),
false));
-
+
for (typename DoFHandler<dim,spacedim>::active_cell_iterator
cell=dof_handler.begin_active();
cell!=dof_handler.end(); ++cell)
line_is_used[line] = true;
break;
}
-
+
// next count how much memory
// we actually need. for each
// line, we need one slot per
dof_handler.faces->lines.dof_offsets
.resize (dof_handler.tria->n_raw_lines(),
numbers::invalid_unsigned_int);
-
+
unsigned int line_slots_needed = 0;
for (unsigned int line=0; line<dof_handler.tria->n_raw_lines(); ++line)
if (line_is_used[line] == true)
{
dof_handler.faces->lines.dof_offsets[line] = line_slots_needed;
-
+
for (unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
if (line_fe_association[fe][line] == true)
line_slots_needed += (*dof_handler.finite_elements)[fe].dofs_per_line + 1;
}
}
-
+
// VERTEX DOFS
reserve_space_vertices (dof_handler);
unsigned int
max_couplings_between_dofs (const DoFHandler<3,spacedim> &dof_handler)
{
-//TODO:[?] Invent significantly better estimates than the ones in this function
+//TODO:[?] Invent significantly better estimates than the ones in this function
// doing the same thing here is a rather
// complicated thing, compared to the 2d
// case, since it is hard to draw pictures
Assert (false, ExcNotImplemented());
max_couplings=0;
}
-
+
return std::min(max_couplings,dof_handler.n_dofs());
}
};
template<int dim, int spacedim>
const unsigned int DoFHandler<dim,spacedim>::default_fe_index;
-
+
template<int dim, int spacedim>
// unsubscribe as a listener to refinement
// of the underlying triangulation
tria->remove_refinement_listener (*this);
-
+
// ...and release allocated memory
clear ();
}
if (tria->n_raw_quads(level) == 0)
return end_quad();
-
+
return raw_quad_iterator (tria,
level,
0,
0,
this);
}
-
-
+
+
default:
Assert (false, ExcNotImplemented());
- return raw_hex_iterator();
+ return raw_hex_iterator();
}
}
quad_iterator(end_quad()) :
begin_quad (level+1));
else
- return quad_iterator(end_quad());
+ return quad_iterator(end_quad());
}
default:
Assert (false, ExcNotImplemented());
return raw_quad_iterator();
- }
+ }
}
if (tria->n_raw_hexs(level) == 0)
return end_hex();
-
+
return raw_hex_iterator (tria,
level,
0,
this);
}
-
+
default:
Assert (false, ExcNotImplemented());
- return raw_hex_iterator();
+ return raw_hex_iterator();
}
}
}
-
+
template <int dim, int spacedim>
typename DoFHandler<dim, spacedim>::active_hex_iterator
DoFHandler<dim, spacedim>::last_active_hex (const unsigned int level) const
DoFHandler<1>::cell_iterator cell;
unsigned int n = 0;
-
+
// search left-most cell
cell = this->begin_active();
while (!cell->at_boundary(0))
cell = cell->neighbor(0);
n += cell->get_fe().dofs_per_vertex;
-
+
// same with right-most cell
cell = this->begin_active();
while (!cell->at_boundary(1))
i!=boundary_indicators.end(); ++i)
Assert ((i->first == 0) || (i->first == 1),
ExcInvalidBoundaryIndicator());
-
+
DoFHandler<1>::active_cell_iterator cell;
unsigned int n = 0;
-
+
// search left-most cell
if (boundary_indicators.find (0) != boundary_indicators.end())
{
cell = cell->neighbor(0);
n += cell->get_fe().dofs_per_vertex;
}
-
+
// same with right-most cell
if (boundary_indicators.find (1) != boundary_indicators.end())
{
cell = cell->neighbor(1);
n += cell->get_fe().dofs_per_vertex;
}
-
+
return n;
}
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
ExcInvalidBoundaryIndicator());
-
+
DoFHandler<1>::active_cell_iterator cell;
unsigned int n = 0;
-
+
// search left-most cell
if (boundary_indicators.find (0) != boundary_indicators.end())
{
cell = cell->neighbor(0);
n += cell->get_fe().dofs_per_vertex;
}
-
+
// same with right-most cell
if (boundary_indicators.find (1) != boundary_indicators.end())
{
cell = cell->neighbor(1);
n += cell->get_fe().dofs_per_vertex;
}
-
+
return n;
}
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
dofs_on_face.resize (dofs_per_face);
-
+
cell->face(f)->get_dof_indices (dofs_on_face,
cell->active_fe_index());
for (unsigned int i=0; i<dofs_per_face; ++i)
boundary_dofs.insert(dofs_on_face[i]);
};
- return boundary_dofs.size();
+ return boundary_dofs.size();
}
Assert (finite_elements != 0, ExcNoFESelected());
Assert (boundary_indicators.find(255) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
-
+
// same as above, but with
// additional checks for set of
// boundary indicators
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
dofs_on_face.resize (dofs_per_face);
-
+
cell->face(f)->get_dof_indices (dofs_on_face,
cell->active_fe_index());
for (unsigned int i=0; i<dofs_per_face; ++i)
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
dofs_on_face.resize (dofs_per_face);
-
+
cell->face(f)->get_dof_indices (dofs_on_face);
for (unsigned int i=0; i<dofs_per_face; ++i)
boundary_dofs.insert(dofs_on_face[i]);
}
-#if deal_II_dimension == 2
-
+#if deal_II_dimension == 2
+
template <>
unsigned int DoFHandler<2,3>::n_boundary_dofs () const
{
for (unsigned int i=0; i<levels.size(); ++i)
mem += MemoryConsumption::memory_consumption (*levels[i]);
mem += MemoryConsumption::memory_consumption (*faces);
-
+
return mem;
}
(new_dof_indices[higher_dof_index] ==
lower_dof_index),
ExcInternalError());
-
+
new_dof_indices[higher_dof_index] = lower_dof_index;
}
}
Table<2,std_cxx1x::shared_ptr<internal::hp::DoFIdentities> >
line_dof_identities (finite_elements->size(),
finite_elements->size());
-
+
for (line_iterator line=begin_line(); line!=end_line(); ++line)
{
unsigned int unique_sets_of_dofs
{
const unsigned int fe_index_1 = line->nth_active_fe_index (f),
fe_index_2 = line->nth_active_fe_index (g);
-
+
if (((*finite_elements)[fe_index_1].dofs_per_line
==
(*finite_elements)[fe_index_2].dofs_per_line)
// indeed there are n
// identities
if (line_dof_identities[fe_index_1][fe_index_2]->size()
- ==
+ ==
(*finite_elements)[fe_index_1].dofs_per_line)
{
unsigned int i=0;
==
FiniteElementDomination::either_element_can_dominate,
ExcInternalError());
-
+
--unique_sets_of_dofs;
for (unsigned int j=0; j<(*finite_elements)[fe_index_1].dofs_per_line; ++j)
Assert (new_dof_indices[new_dof_indices[master_dof_index]] ==
numbers::invalid_unsigned_int,
ExcInternalError());
-
+
new_dof_indices[slave_dof_index]
= new_dof_indices[master_dof_index];
}
(new_dof_indices[slave_dof_index] ==
master_dof_index),
ExcInternalError());
-
+
new_dof_indices[slave_dof_index] = master_dof_index;
}
- }
+ }
}
}
}
}
-
+
// if at this point, there is only
// one unique set of dofs left, then
// we have taken care of everything
(new_dof_indices[slave_dof_index] ==
master_dof_index),
ExcInternalError());
-
+
new_dof_indices[slave_dof_index] = master_dof_index;
}
}
#endif
-
+
template<int dim, int spacedim>
void
DoFHandler<dim,spacedim>::
Table<2,std_cxx1x::shared_ptr<internal::hp::DoFIdentities> >
quad_dof_identities (finite_elements->size(),
finite_elements->size());
-
+
for (quad_iterator quad=begin_quad(); quad!=end_quad(); ++quad)
if (quad->n_active_fe_indices() == 2)
{
(new_dof_indices[slave_dof_index] ==
master_dof_index),
ExcInternalError());
-
+
new_dof_indices[slave_dof_index] = master_dof_index;
}
}
}
}
-
-
+
+
template <int dim, int spacedim>
void DoFHandler<dim,spacedim>::set_active_fe_indices (const std::vector<unsigned int>& active_fe_indices)
{
cell->set_active_fe_index(active_fe_indices[i]);
}
-
+
template <int dim, int spacedim>
void DoFHandler<dim,spacedim>::get_active_fe_indices (std::vector<unsigned int>& active_fe_indices) const
for (unsigned int i=0; cell!=endc; ++cell, ++i)
active_fe_indices[i]=cell->active_fe_index();
}
-
-
+
+
template<int dim, int spacedim>
void DoFHandler<dim,spacedim>::distribute_dofs (const hp::FECollection<dim,spacedim> &ff)
{
// collection is large enough to
// cover all fe indices presently
// in use on the mesh
- for (active_cell_iterator cell = begin_active(); cell != end(); ++cell)
+ for (active_cell_iterator cell = begin_active(); cell != end(); ++cell)
Assert (cell->active_fe_index() < finite_elements->size(),
ExcInvalidFEIndex (cell->active_fe_index(),
finite_elements->size()));
active_cell_iterator cell = begin_active(),
endc = end();
- for (; cell != endc; ++cell)
+ for (; cell != endc; ++cell)
next_free_dof
= internal::hp::DoFHandler::Implementation::template distribute_dofs_on_cell<spacedim> (cell,
next_free_dof);
used_dofs = next_free_dof;
}
-
+
/////////////////////////////////
-
+
// Step 2: identify certain dofs
// if the finite element tells us
// that they should have the same
new_dof_indices[i] = next_free_dof;
++next_free_dof;
}
-
+
// then loop over all those that
// are constrained and record the
// new dof number for those:
Assert (new_dof_indices[constrained_indices[i]] !=
numbers::invalid_unsigned_int,
ExcInternalError());
-
+
new_dof_indices[i] = new_dof_indices[constrained_indices[i]];
}
Assert (new_dof_indices[i] < next_free_dof,
ExcInternalError());
}
-
+
// finally, do the renumbering
// and set the number of actually
// used dof indices
renumber_dofs_internal (new_dof_indices, internal::int2type<dim>());
used_dofs = next_free_dof;
-
-
+
+
// finally restore the user flags
const_cast<Triangulation<dim,spacedim> &>(*tria).load_user_flags(user_flags);
}
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
renumber_dofs_internal (new_numbers, internal::int2type<0>());
-
+
for (line_iterator line=begin_line(); line!=end_line(); ++line)
{
const unsigned int n_active_fe_indices
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
renumber_dofs_internal (new_numbers, internal::int2type<1>());
-
+
for (quad_iterator quad=begin_quad(); quad!=end_quad(); ++quad)
{
const unsigned int n_active_fe_indices
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
renumber_dofs_internal (new_numbers, internal::int2type<2>());
-
+
for (hex_iterator hex=begin_hex(); hex!=end_hex(); ++hex)
{
const unsigned int n_active_fe_indices
}
-
+
template<int dim, int spacedim>
void DoFHandler<dim,spacedim>::create_active_fe_table ()
{
// Coarsening can lead to the loss
// of levels. Hence remove them.
while (levels.size () > tria.n_levels ())
- {
+ {
delete levels[levels.size ()-1];
levels.pop_back ();
}
}
}
}
-
+
// Free buffer objects
std::vector<std::vector<bool> *>::iterator children_level;
for (children_level = has_children.begin ();
template<int dim, int spacedim>
void DoFHandler<dim,spacedim>::clear_space ()
- {
+ {
for (unsigned int i=0; i<levels.size(); ++i)
delete levels[i];
levels.resize (0);
std::vector<unsigned int> tmp;
std::swap (vertex_dofs, tmp);
}
-
+
{
std::vector<unsigned int> tmp;
std::swap (vertex_dofs_offsets, tmp);