* process):
* @code
* // Create initial indexsets pertaining to the grid before refinement
- * IndexSet locally_owned_dofs, locally_relevant_dofs;
- * locally_owned_dofs = dof_handler.locally_owned_dofs();
- * DoFTools::extract_locally_relevant_dofs(dof_handler,
- * locally_relevant_dofs);
+ * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
+ * const IndexSet locally_relevant_dofs =
+ * DoFTools::extract_locally_relevant_dofs(dof_handler);
*
* // The solution vector only knows about locally owned DoFs
* TrilinosWrappers::MPI::Vector solution;
&dh.get_triangulation());
Assert(parallel_tria != nullptr, ExcNotImplemented());
const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
vector.reinit(locally_owned_dofs,
locally_relevant_dofs,
parallel_tria->get_communicator());
&dh.get_triangulation());
Assert(parallel_tria != nullptr, ExcNotImplemented());
const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
vector.reinit(locally_owned_dofs,
locally_relevant_dofs,
parallel_tria->get_communicator());
&dh.get_triangulation());
Assert(parallel_tria != nullptr, ExcNotImplemented());
const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
vector.reinit(locally_owned_dofs,
locally_relevant_dofs,
parallel_tria->get_communicator());
// vector u2 with based on the sets of locally owned and relevant
// dofs of dof2
const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
- IndexSet dof2_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+ const IndexSet dof2_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof2);
PETScWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
u1.get_mpi_communicator());
// vector u2 with based on the sets of locally owned and relevant
// dofs of dof2
const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
- IndexSet dof2_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+ const IndexSet dof2_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof2);
TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
u1.get_mpi_communicator());
return;
const MPI_Comm mpi_communicator = u1.block(0).get_mpi_communicator();
const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
- IndexSet dof2_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+ const IndexSet dof2_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof2);
TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
mpi_communicator);
LinearAlgebra::distributed::Vector<Number> &u1_interpolated)
{
const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
- IndexSet dof2_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+ const IndexSet dof2_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof2);
LinearAlgebra::distributed::Vector<Number> u2(dof2_locally_owned_dofs,
dof2_locally_relevant_dofs,
* required for the interpolation process):
* @code
* // Create initial indexsets pertaining to the grid before refinement
- * IndexSet locally_owned_dofs, locally_relevant_dofs;
- * locally_owned_dofs = dof_handler.locally_owned_dofs();
- * DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
+ * const IndexSet locally_relevant_dofs =
+ * DoFTools::extract_locally_relevant_dofs(dof_handler);
*
* // The solution vector only knows about locally owned DoFs
* TrilinosWrappers::MPI::Vector solution;
const IndexSet &locally_owned_dofs = [&]() -> const IndexSet & {
if (reorder_level_dofs == false)
{
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return dof_handler.locally_owned_dofs();
}
else
{
Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
ExcDoFHandlerNotInitialized());
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
return dof_handler.locally_owned_mg_dofs(level);
}
}();
IndexSet locally_active_dofs;
if (reorder_level_dofs == false)
{
- DoFTools::extract_locally_active_dofs(dof_handler,
- locally_active_dofs);
+ locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
}
else
{
- DoFTools::extract_locally_active_level_dofs(dof_handler,
- locally_active_dofs,
- level);
+ locally_active_dofs =
+ DoFTools::extract_locally_active_level_dofs(dof_handler, level);
}
bool needs_locally_active = false;
}
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(
- coarse_to_fine_grid_map.get_destination_grid(),
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(
+ coarse_to_fine_grid_map.get_destination_grid());
copy_data.global_parameter_representation[i].reinit(
coarse_to_fine_grid_map.get_destination_grid()
// Step 1: copy global vector so that the ghost values are such that the
// cache can be set up for all ghost cells
LinearAlgebra::distributed::Vector<typename VectorType::value_type>
- vector_ghosted;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ vector_ghosted;
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
vector_ghosted.reinit(dof_handler.locally_owned_dofs(),
locally_relevant_dofs,
dof_handler.get_communicator());
for (unsigned int l = vectors.min_level(); l <= vectors.max_level(); ++l)
{
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- l,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, l);
vectors_ghosted[l].reinit(dof_handler.locally_owned_mg_dofs(l),
locally_relevant_dofs,
dof_handler.get_communicator());
//
// increment dofs_per_cell since a useless diagonal element will be
// stored
- IndexSet level_p1_relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level + 1,
- level_p1_relevant_dofs);
+ const IndexSet level_p1_relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level + 1);
DynamicSparsityPattern dsp(this->sizes[level + 1],
this->sizes[level],
level_p1_relevant_dofs);
std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
- IndexSet active_dofs;
- DoFTools::extract_locally_active_dofs(patch_dof_handler, active_dofs);
+ const IndexSet active_dofs =
+ DoFTools::extract_locally_active_dofs(patch_dof_handler);
partitioner = std::make_shared<Utilities::MPI::Partitioner>(
patch_dof_handler.locally_owned_dofs(), active_dofs, MPI_COMM_WORLD);