for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<types::global_dof_index> (
+ = std::vector<std::vector<types::global_dof_index>::size_type> (
dof_handler.tria->n_raw_lines(level),
DoFHandler<dim,spacedim>::invalid_dof_index);
for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<types::global_dof_index> (
+ = std::vector<std::vector<types::global_dof_index>::size_type> (
dof_handler.tria->n_raw_quads(level),
DoFHandler<dim,spacedim>::invalid_dof_index);
// active ones will have a
// non-invalid value later on
dof_handler.faces->lines.dof_offsets
- = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_lines(),
+ = std::vector<std::vector<types::global_dof_index>::size_type>
+ (dof_handler.tria->n_raw_lines(),
DoFHandler<dim,spacedim>::invalid_dof_index);
dof_handler.faces->lines.dofs
= std::vector<types::global_dof_index> (n_line_slots,
for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
{
dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_hexs(level),
+ = std::vector<std::vector<types::global_dof_index>::size_type>
+ (dof_handler.tria->n_raw_hexs(level),
DoFHandler<dim,spacedim>::invalid_dof_index);
types::global_dof_index next_free_dof = 0;
if (true)
{
dof_handler.faces->quads.dof_offsets
- = std::vector<types::global_dof_index> (dof_handler.tria->n_raw_quads(),
+ = std::vector<std::vector<types::global_dof_index>::size_type>
+ (dof_handler.tria->n_raw_quads(),
DoFHandler<dim,spacedim>::invalid_dof_index);
dof_handler.faces->quads.dofs
= std::vector<types::global_dof_index> (n_quad_slots,
std::vector<bool> *has_children_level =
new std::vector<bool> (cells_on_level);
- // Check for each cell, if it has children.
- std::transform (tria->levels[i]->cells.refinement_cases.begin (),
- tria->levels[i]->cells.refinement_cases.end (),
- has_children_level->begin (),
- std::bind2nd (std::not_equal_to<unsigned char>(),
- static_cast<unsigned char>(RefinementCase<dim>::no_refinement)));
-
- has_children.push_back (has_children_level);
- }
- }
-
-
-
- template <>
- void DoFHandler<1>::pre_refinement_action ()
- {
- create_active_fe_table ();
-
- // Remember if the cells already have
- // children. That will make the transfer
- // of the active_fe_index to the finer
- // levels easier.
- Assert (has_children.size () == 0, ExcInternalError ());
- for (unsigned int i=0; i<levels.size(); ++i)
- {
- const unsigned int cells_on_level = tria->n_raw_cells (i);
- std::vector<bool> *has_children_level =
- new std::vector<bool> (cells_on_level);
-
- // Check for each cell, if it has
- // children. here we cannot use
- // refinement_cases, since it is unused in
- // 1d (as there is only one choice
- // anyway). use the 'children' vector
- // instead
- std::transform (tria->levels[i]->cells.children.begin (),
- tria->levels[i]->cells.children.end (),
- has_children_level->begin (),
- std::bind2nd (std::not_equal_to<int>(), -1));
-
- has_children.push_back (has_children_level);
- }
- }
-
-
-
- template <>
- void DoFHandler<1,2>::pre_refinement_action ()
- {
- create_active_fe_table ();
-
- // Remember if the cells have already
- // children. That will make the transfer
- // of the active_fe_index to the finer
- // levels easier.
- Assert (has_children.size () == 0, ExcInternalError ());
- for (unsigned int i=0; i<levels.size(); ++i)
- {
- const unsigned int lines_on_level = tria->n_raw_lines(i);
- std::vector<bool> *has_children_level =
- new std::vector<bool> (lines_on_level);
-
- // Check for each cell, if it has children.
- std::transform (tria->levels[i]->cells.children.begin (),
- tria->levels[i]->cells.children.end (),
- has_children_level->begin (),
- std::bind2nd (std::not_equal_to<int>(), -1));
-
- has_children.push_back (has_children_level);
- }
- }
-
-
-
- template <>
- void DoFHandler<1,3>::pre_refinement_action ()
- {
- create_active_fe_table ();
-
- // Remember if the cells have already
- // children. That will make the transfer
- // of the active_fe_index to the finer
- // levels easier.
- Assert (has_children.size () == 0, ExcInternalError ());
- for (unsigned int i=0; i<levels.size(); ++i)
- {
- const unsigned int lines_on_level = tria->n_raw_lines(i);
- std::vector<bool> *has_children_level =
- new std::vector<bool> (lines_on_level);
-
- // Check for each cell, if it has children.
- std::transform (tria->levels[i]->cells.children.begin (),
- tria->levels[i]->cells.children.end (),
- has_children_level->begin (),
- std::bind2nd (std::not_equal_to<int>(), -1));
+ // Check for each cell, if it has children. in 1d,
+ // we don't store refinement cases, so use the 'children'
+ // vector instead
+ if (dim == 1)
+ std::transform (tria->levels[i]->cells.children.begin (),
+ tria->levels[i]->cells.children.end (),
+ has_children_level->begin (),
+ std::bind2nd (std::not_equal_to<int>(), -1));
+ else
+ std::transform (tria->levels[i]->cells.refinement_cases.begin (),
+ tria->levels[i]->cells.refinement_cases.end (),
+ has_children_level->begin (),
+ std::bind2nd (std::not_equal_to<unsigned char>(),
+ static_cast<unsigned char>(RefinementCase<dim>::no_refinement)));
has_children.push_back (has_children_level);
}