89 Assert(prepared_for != pure_refinement, ExcAlreadyPrepForRef());
90 Assert(prepared_for != coarsening_and_refinement,
91 ExcAlreadyPrepForCoarseAndRef());
107 const unsigned int n_active_cells =
108 dof_handler->get_triangulation().n_active_cells();
109 n_dofs_old = dof_handler->n_dofs();
112 std::vector<std::vector<types::global_dof_index>>(n_active_cells)
113 .
swap(indices_on_cell);
115 for (
const auto &cell : dof_handler->active_cell_iterators())
117 const unsigned int i = cell->active_cell_index();
118 indices_on_cell[i].resize(cell->get_fe().n_dofs_per_cell());
125 cell->get_dof_indices(indices_on_cell[i]);
126 cell_map[std::make_pair(cell->level(), cell->index())] =
129 prepared_for = pure_refinement;
137 const VectorType &in,
138 VectorType & out)
const
140 Assert(prepared_for == pure_refinement, ExcNotPrepared());
142 Assert(out.size() == dof_handler->n_dofs(),
145 ExcMessage(
"Vectors cannot be used as input and output"
146 " at the same time!"));
162 typename std::map<std::pair<unsigned int, unsigned int>,
166 for (
const auto &cell : dof_handler->cell_iterators())
169 cell_map.find(std::make_pair(cell->level(), cell->index()));
181 const unsigned int dofs_per_cell =
182 cell->get_dof_handler().get_fe(
this_fe_index).n_dofs_per_cell();
190 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
223 if (dof.has_hp_capabilities() ==
false)
226 const ::hp::FECollection<dim, spacedim> &fe = dof.get_fe_collection();
227 matrices.
reinit(fe.size(), fe.size());
228 for (
unsigned int i = 0; i < fe.size(); ++i)
229 for (
unsigned int j = 0;
j < fe.
size(); ++
j)
232 matrices(i,
j).reinit(fe[i].n_dofs_per_cell(),
233 fe[
j].n_dofs_per_cell());
244 fe[i].get_interpolation_matrix(fe[
j], matrices(i,
j));
247 ExcInterpolationNotImplemented &)
249 matrices(i,
j).reinit(0, 0);
264 std::vector<std::vector<bool>> &restriction_is_additive)
266 restriction_is_additive.resize(fe.size());
267 for (
unsigned int f = 0; f < fe.size(); ++f)
269 restriction_is_additive[f].resize(fe[f].n_dofs_per_cell());
270 for (
unsigned int i = 0; i < fe[f].n_dofs_per_cell(); ++i)
271 restriction_is_additive[f][i] = fe[f].restriction_is_additive(i);
283 Assert(prepared_for != pure_refinement, ExcAlreadyPrepForRef());
284 Assert(prepared_for != coarsening_and_refinement,
285 ExcAlreadyPrepForCoarseAndRef());
288 n_dofs_old = dof_handler->n_dofs();
293 ExcMessage(
"The array of input vectors you pass to this "
294 "function has no elements. This is not useful."));
295 for (
unsigned int i = 0; i <
in_size; ++i)
319 for (
const auto &
act_cell : dof_handler->active_cell_iterators())
327 dof_handler->get_triangulation().n_active_cells(),
331 for (
const auto &cell : dof_handler->cell_iterators())
332 if (!cell->is_active() && cell->child(0)->coarsen_flag_set())
341 .
swap(indices_on_cell);
343 std::vector<std::vector<Vector<typename VectorType::value_type>>>(
345 std::vector<Vector<typename VectorType::value_type>>(
in_size))
346 .swap(dof_values_on_cell);
349 std::vector<std::vector<bool>> restriction_is_additive;
353 restriction_is_additive);
359 for (
const auto &cell : dof_handler->cell_iterators())
362 if (cell->is_active() && !cell->coarsen_flag_set())
364 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
365 indices_on_cell[
n_sr].resize(dofs_per_cell);
370 cell->get_dof_indices(indices_on_cell[
n_sr]);
371 cell_map[std::make_pair(cell->level(), cell->index())] =
377 else if (cell->has_children() && cell->child(0)->coarsen_flag_set())
386 for (
const auto &child : cell->child_iterators())
388 Assert(child->is_active() && child->coarsen_flag_set(),
389 typename ::Triangulation<
390 dim>::ExcInconsistentCoarseningFlags());
397 dof_handler->get_fe_collection().find_dominated_fe_extended(
402 ExcNoDominatedFiniteElementOnChildren());
404 const unsigned int dofs_per_cell =
407 std::vector<Vector<typename VectorType::value_type>>(
418 cell->get_interpolated_dof_values(
all_in[
j],
419 dof_values_on_cell[
n_cf][
j],
421 cell_map[std::make_pair(cell->level(), cell->index())] =
429 prepared_for = coarsening_and_refinement;
448 const std::vector<VectorType> &
all_in,
449 std::vector<VectorType> &
all_out)
const
453 Assert(prepared_for == coarsening_and_refinement, ExcNotPrepared());
455 for (
unsigned int i = 0; i <
size; ++i)
461 for (
unsigned int i = 0; i <
size; ++i)
462 for (
unsigned int j = 0;
j <
size; ++
j)
464 ExcMessage(
"Vectors cannot be used as input and output"
465 " at the same time!"));
481 std::vector<types::global_dof_index> dofs;
483 typename std::map<std::pair<unsigned int, unsigned int>,
491 for (
const auto &cell : dof_handler->cell_iterators())
494 cell_map.find(std::make_pair(cell->level(), cell->index()));
498 const std::vector<types::global_dof_index> *
const indexptr =
501 const std::vector<Vector<typename VectorType::value_type>>
515 for (
unsigned int j = 0;
j <
size; ++
j)
518 for (
unsigned int i = 0; i <
in_size; ++i)
523 cell->set_dof_values_by_interpolation(tmp,
535 const unsigned int dofs_per_cell =
536 cell->get_fe().n_dofs_per_cell();
537 dofs.resize(dofs_per_cell);
540 cell->get_dof_indices(dofs);
543 for (
unsigned int j = 0;
j <
size; ++
j)
550 const unsigned int active_fe_index = cell->active_fe_index();
551 if (active_fe_index !=
pointerstruct->second.active_fe_index)
560 tmp.
reinit(dofs_per_cell,
false);
563 tmp.
reinit(dofs_per_cell,
true);
572 data = &(*valuesptr)[
j];
575 for (
unsigned int i = 0; i < dofs_per_cell; ++i)