joint_solution.compress(VectorOperation::insert);
- IndexSet locally_relevant_joint_dofs(joint_dof_handler.n_dofs());
- DoFTools::extract_locally_relevant_dofs(joint_dof_handler,
- locally_relevant_joint_dofs);
+ const IndexSet locally_relevant_joint_dofs =
+ DoFTools::extract_locally_relevant_dofs(joint_dof_handler);
TrilinosWrappers::MPI::Vector locally_relevant_joint_solution;
locally_relevant_joint_solution.reinit(locally_relevant_joint_dofs,
MPI_COMM_WORLD);
* process):
* @code
* // Create initial indexsets pertaining to the grid before refinement
- * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- * const IndexSet locally_relevant_dofs =
- * DoFTools::extract_locally_relevant_dofs(dof_handler);
+ * 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;
* required for the interpolation process):
* @code
* // Create initial indexsets pertaining to the grid before refinement
- * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- * const IndexSet locally_relevant_dofs =
- * DoFTools::extract_locally_relevant_dofs(dof_handler);
+ * 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;
std::vector<dealii::IndexSet> locally_owned_dofs_per_processor =
locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
DoFRenumbering::subdomain_wise(dof_handler);
std::vector<IndexSet> locally_owned_dofs_per_processor =
locally_owned_dofs_per_subdomain(dof_handler);
- locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
std::vector<dealii::IndexSet> locally_owned_dofs_per_processor =
locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
dof_handler.distribute_dofs(fe);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
dof_handler.distribute_dofs(fe);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
dof_handler.distribute_dofs(fe);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
DoFRenumbering::subdomain_wise(dof_handler);
std::vector<IndexSet> locally_owned_dofs_per_processor =
locally_owned_dofs_per_subdomain(dof_handler);
- locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
LaplaceProblem<dim>::setup_system()
{
dof_handler.distribute_dofs(fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = dof_handler.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
}
template <int dim>
LaplaceProblem<dim>::setup_system()
{
dof_handler.distribute_dofs(fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = dof_handler.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
}
template <int dim>
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
// Make FE vector
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
VectorType global_dof_vector;
{
const types::global_dof_index n_dofs = dof_handler.n_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
const IndexSet is_hanging_node_constrained =
DoFTools::extract_hanging_node_dofs(dof_handler);
coupling[1][1] = DoFTools::always;
flux_coupling[1][1] = DoFTools::always;
- IndexSet relevant_partitioning(dh.n_dofs());
- DoFTools::extract_locally_relevant_dofs(dh, relevant_partitioning);
+ const IndexSet relevant_partitioning =
+ DoFTools::extract_locally_relevant_dofs(dh);
// Generate hanging node constraints
AffineConstraints<double> constraints;
FE_Q<dim> fe(2);
dh.distribute_dofs(fe);
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> cm;
cm.reinit(locally_relevant_set);
dh.distribute_dofs(fe);
const IndexSet &locally_owned_set = dh.locally_owned_dofs();
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> cm;
cm.reinit(locally_relevant_set);
dof_handler_0.distribute_dofs(fe_0);
dof_handler_1.distribute_dofs(fe_1);
- IndexSet locally_relevant_dofs_0;
- IndexSet locally_relevant_dofs_1;
- DoFTools::extract_locally_relevant_dofs(dof_handler_0,
- locally_relevant_dofs_0);
- DoFTools::extract_locally_relevant_dofs(dof_handler_1,
- locally_relevant_dofs_1);
+ const IndexSet locally_relevant_dofs_0 =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_0);
+ const IndexSet locally_relevant_dofs_1 =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_1);
deallog << "locally owned dofs 0: ";
dof_handler_0.locally_owned_dofs().print(deallog);
deallog << std::endl;
dof_handler_0.distribute_dofs(fe_0);
dof_handler_1.distribute_dofs(fe_1);
- IndexSet locally_relevant_dofs_0;
- IndexSet locally_relevant_dofs_1;
- DoFTools::extract_locally_relevant_dofs(dof_handler_0,
- locally_relevant_dofs_0);
- DoFTools::extract_locally_relevant_dofs(dof_handler_1,
- locally_relevant_dofs_1);
+ const IndexSet locally_relevant_dofs_0 =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_0);
+ const IndexSet locally_relevant_dofs_1 =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_1);
deallog << "locally owned dofs 0: ";
dof_handler_0.locally_owned_dofs().print(deallog);
deallog << std::endl;
DoFRenumbering::subdomain_wise(dof_handler);
std::vector<IndexSet> locally_owned_dofs_per_proc =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
- locally_owned_dofs = locally_owned_dofs_per_proc[this_mpi_process];
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = locally_owned_dofs_per_proc[this_mpi_process];
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
std::vector<IndexSet> locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
std::vector<IndexSet> locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(FE_Q<dim>(2));
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
stokes_partitioning.push_back(stokes_index_set.get_view(0, n_u));
stokes_partitioning.push_back(stokes_index_set.get_view(n_u, n_u + n_p));
- IndexSet stokes_relevant_set;
- DoFTools::extract_locally_relevant_dofs(stokes_dof_handler,
- stokes_relevant_set);
+ const IndexSet stokes_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(stokes_dof_handler);
stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(0, n_u));
stokes_relevant_partitioning.push_back(
stokes_relevant_set.get_view(n_u, n_u + n_p));
stokes_partitioning.push_back(stokes_index_set.get_view(0, n_u));
stokes_partitioning.push_back(stokes_index_set.get_view(n_u, n_u + n_p));
- IndexSet stokes_relevant_set;
- DoFTools::extract_locally_relevant_dofs(stokes_dof_handler,
- stokes_relevant_set);
+ const IndexSet stokes_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(stokes_dof_handler);
stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(0, n_u));
stokes_relevant_partitioning.push_back(
stokes_relevant_set.get_view(n_u, n_u + n_p));
std::vector<IndexSet> locally_relevant_partitioning;
std::vector<IndexSet> locally_owned_partitioning;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_partitioning.push_back(
locally_relevant_dofs.get_view(0, dofs_per_block[0]));
locally_relevant_partitioning.push_back(
std::vector<IndexSet> locally_relevant_partitioning;
std::vector<IndexSet> locally_owned_partitioning;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_partitioning.push_back(
locally_relevant_dofs.get_view(0, dofs_per_block[0]));
locally_relevant_partitioning.push_back(
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(temperature_fe);
- IndexSet owned = dof_handler.locally_owned_dofs();
- IndexSet relevant;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant);
+ const IndexSet &owned = dof_handler.locally_owned_dofs();
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// this causes a crash in PETSc, but is ignored in Trilinos:
// DynamicSparsityPattern sp (owned);
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(temperature_fe);
- IndexSet owned = dof_handler.locally_owned_dofs();
- IndexSet relevant;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant);
+ const IndexSet &owned = dof_handler.locally_owned_dofs();
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
DynamicSparsityPattern sp(relevant);
typename LA::MPI::SparseMatrix matrix;
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
background_dof_handler.reinit(triangulation);
background_dof_handler.distribute_dofs(fe);
- VectorType ls_vector;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(background_dof_handler,
- locally_relevant_dofs);
+ VectorType ls_vector;
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(background_dof_handler);
ls_vector.reinit(background_dof_handler.locally_owned_dofs(),
AffineConstraints<double> affine_constraints;
const double new_value = 2.;
- locally_relevant_dofs.clear();
locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
LinearAlgebra::distributed::Vector<double> new_solution(
dof_handler.locally_owned_dofs(), locally_relevant_dofs, MPI_COMM_WORLD);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
AssertThrow(locally_relevant_dofs.n_elements() == dof_handler.n_dofs(),
ExcInternalError());
if (cell->center()[0] > 0.5 && cell->center()[1] > 0.5)
cell->set_material_id(1);
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
test(dof_handler, locally_active_dofs);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
test(dof_handler, locally_relevant_dofs);
}
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
constraints);
constraints.close();
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
DynamicSparsityPattern dsp(dof_handler.n_dofs());
DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
constraints);
constraints.close();
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
DynamicSparsityPattern dsp(dof_handler.n_dofs());
DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
locally_owned_partitioning.push_back(
locally_owned_dofs.get_view(dofs_per_block[0],
dofs_per_block[0] + dofs_per_block[1]));
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_partitioning.push_back(
locally_relevant_dofs.get_view(0, dofs_per_block[0]));
locally_relevant_partitioning.push_back(
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
// Create a Mapping
LinearAlgebra::distributed::Vector<double> map_vector;
- IndexSet locally_relevant_euler;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_euler);
+ const IndexSet locally_relevant_euler =
+ DoFTools::extract_locally_relevant_dofs(dh);
map_vector.reinit(dh.locally_owned_dofs(),
locally_relevant_euler,
MPI_COMM_WORLD);
update_quadrature_points);
for (unsigned int level = 0; level < tria.n_global_levels(); ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dh, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dh, level);
level_vectors[level].reinit(dh.locally_owned_mg_dofs(level),
relevant_dofs,
tria.get_communicator());
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
LinearAlgebra::distributed::Vector<double> vector(
dof_handler.locally_owned_dofs(),
locally_relevant_dofs,
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD);
PETScWrappers::MPI::Vector x_relevant(locally_owned_dofs,
const IndexSet &locally_owned_dofs_euler =
dof_handler_euler.locally_owned_dofs();
- IndexSet locally_relevant_dofs_euler;
- DoFTools::extract_locally_relevant_dofs(dof_handler_euler,
- locally_relevant_dofs_euler);
+ const IndexSet locally_relevant_dofs_euler =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_euler);
const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// constraints:
AffineConstraints<double> constraints_euler;
// all relevant ghost indices is required to certain meshes.
for (unsigned int level = min_level; level <= max_level; ++level)
{
- IndexSet relevant_mg_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler_euler,
- level,
- relevant_mg_dofs);
+ const IndexSet relevant_mg_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler_euler, level);
displacement_level[level].reinit(dof_handler_euler.locally_owned_mg_dofs(
level),
relevant_mg_dofs,
update_quadrature_points;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
// IndexSets and constraints
const IndexSet &locally_owned_dofs_euler =
dof_handler_euler.locally_owned_dofs();
- IndexSet locally_relevant_dofs_euler;
- DoFTools::extract_locally_relevant_dofs(dof_handler_euler,
- locally_relevant_dofs_euler);
+ const IndexSet locally_relevant_dofs_euler =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_euler);
const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// constraints:
AffineConstraints<double> constraints_euler;
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
TrilinosWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD);
TrilinosWrappers::MPI::Vector x_relevant(locally_owned_dofs,
// IndexSets and constraints
const IndexSet &locally_owned_dofs_euler =
dof_handler_euler.locally_owned_dofs();
- IndexSet locally_relevant_dofs_euler;
- DoFTools::extract_locally_relevant_dofs(dof_handler_euler,
- locally_relevant_dofs_euler);
+ const IndexSet locally_relevant_dofs_euler =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_euler);
const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// constraints:
AffineConstraints<double> constraints_euler;
// the bug observed.
for (unsigned int level = min_level; level <= max_level; ++level)
{
- IndexSet relevant_mg_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler_euler,
- level,
- relevant_mg_dofs);
+ const IndexSet relevant_mg_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler_euler, level);
displacement_level[level].reinit(dof_handler_euler.locally_owned_mg_dofs(
level),
relevant_mg_dofs,
update_quadrature_points;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
for (unsigned int level = 0; level <= max_level; ++level)
{
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
dof_handler.distribute_dofs(fe);
AffineConstraints<Number> constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(locally_relevant_dofs);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- 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);
+
+
// constraints:
AffineConstraints<double> constraints;
level_projection(min_level, max_level);
for (unsigned int level = min_level; level <= max_level; ++level)
{
- IndexSet set;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler, level, set);
+ const IndexSet set =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
level_projection[level].reinit(dof_handler.locally_owned_mg_dofs(level),
set,
mpi_communicator);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints_0(relevant_set),
constraints_1(relevant_set);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
deallog << "locally owned dofs :" << std::endl;
owned_set.print(deallog.get_file_stream());
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
}
dof.distribute_dofs(fe_collection);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
deallog << "locally owned dofs :" << std::endl;
owned_set.print(deallog.get_file_stream());
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
std::vector<IndexSet> locally_relevant_dofs(dof.size());
for (unsigned int i = 0; i < dof.size(); ++i)
- DoFTools::extract_locally_relevant_dofs(*dof[i], locally_relevant_dofs[i]);
+ locally_relevant_dofs[i] = DoFTools::extract_locally_relevant_dofs(*dof[i]);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
dof.size());
for (unsigned int i = 0; i < dof.size(); ++i)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(*dof[i],
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(*dof[i], level);
level_constraints[i].reinit(relevant_dofs);
level_constraints[i].add_lines(
mg_constrained_dofs[i].get_boundary_indices(level));
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
dirichlet_boundary[0] = &zero_function;
// fine-level constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(dof,
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
AffineConstraints<double> constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_dofs);
+ const IndexSet relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof);
constraints.reinit(relevant_dofs);
VectorTools::interpolate_boundary_values(dof,
0,
MatrixFree<dim, number>::AdditionalData::none;
{
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
constraints.close();
DoFRenumbering::matrix_free_data_locality(dof, constraints, addit_data);
}
constraints.clear();
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
constraints.close();
const QGauss<1> quadrature(dof.get_fe().degree + 1);
pcout << "Number of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
for (unsigned int level = 0; level < nlevels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
<< std::endl;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
<< std::endl;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.close();
QGaussLobatto<1> quadrature(fe_degree + 1);
<< std::endl;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
dof_handler_p.clear();
dof_handler_p.distribute_dofs(fe_p);
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u, constraints_u);
dof_handler_u, 0, ExactSolution_BoundaryValues_u<dim>(), constraints_u);
constraints_u.close();
- IndexSet locally_relevant_dofs_p;
- DoFTools::extract_locally_relevant_dofs(dof_handler_p,
- locally_relevant_dofs_p);
+ const IndexSet locally_relevant_dofs_p =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_p);
constraints_p.reinit(locally_relevant_dofs_p);
DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
constraints_p.close();
for (unsigned int level = 0; level < n_levels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler_u,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler_u, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
// Create constraints with no Dirchlet info
AffineConstraints<double> constraints_u_no_dirchlet;
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u_no_dirchlet.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u,
constraints_u_no_dirchlet);
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, LinearFunction<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
dofh.distribute_dofs(fe_collection);
}
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, dofh.get_communicator());
{
TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
constraints.close();
- 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);
PETScWrappers::MPI::Vector vec(locally_owned_dofs, MPI_COMM_WORLD);
PETScWrappers::MPI::Vector vec_ghosted(locally_owned_dofs,
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs;
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
PETScWrappers::MPI::Vector force;
force.reinit(locally_owned_dofs, mpi_communicator);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
+ const IndexSet &owned_set = dofh.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x;
x.reinit(owned_set, MPI_COMM_WORLD);
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_active_dofs;
-
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
-
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
AffineConstraints<double> constraints;
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
deallog << "relevant set:" << std::endl;
relevant_set.print(deallog.get_file_stream());
deallog << "constraints:" << std::endl;
// Initialize the solution
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs, mpi_communicator);
locally_relevant_solution = 0;
IndexSet locally_relevant_dofs;
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_sol.reinit(locally_owned_dofs,
locally_relevant_dofs,
mpi_communicator);
DoFHandler<dim> dofh(tr);
dofh.distribute_dofs(fe);
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector vec(dofh.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int i = vec.local_range().first; i < vec.local_range().second;
DoFHandler<dim> dofh(tr);
dofh.distribute_dofs(fe);
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dofh);
// create a vector representing a function that is independent of the number
// of processors involved
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
DynamicSparsityPattern dynamic_sparsity_pattern(locally_relevant_dofs);
Table<2, DoFTools::Coupling> cell_integral_mask(fe.n_components(),
// the result of extract_boundary_dofs is supposed to be a subset of the
// locally relevant dofs, so test this
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
boundary_dofs.subtract_set(relevant_set);
AssertThrow(boundary_dofs.n_elements() == 0, ExcInternalError());
}
DoFHandler<dim> dofh(tr);
dofh.distribute_dofs(fe);
- IndexSet locally_active;
- DoFTools::extract_locally_active_dofs(dofh, locally_active);
+ const IndexSet locally_active = DoFTools::extract_locally_active_dofs(dofh);
Assert(locally_active == DoFTools::dof_indices_with_subdomain_association(
dofh, tr.locally_owned_subdomain()),
dofh.distribute_dofs(fe);
dofh.distribute_mg_dofs();
- IndexSet locally_level_active;
for (unsigned int level = 0; level < tr.n_levels(); ++level)
{
- DoFTools::extract_locally_active_level_dofs(dofh,
- locally_level_active,
- level);
+ const IndexSet locally_level_active =
+ DoFTools::extract_locally_active_level_dofs(dofh, level);
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
{
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, LinearFunction<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, LinearFunction<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, LinearFunction<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
DoFTools::make_hanging_node_constraints(*dof2, cm2);
cm2.close();
- IndexSet locally_owned_dofs1 = dof1->locally_owned_dofs();
- IndexSet locally_relevant_dofs1;
- DoFTools::extract_locally_relevant_dofs(*dof1, locally_relevant_dofs1);
- IndexSet locally_owned_dofs2 = dof2->locally_owned_dofs();
- IndexSet locally_relevant_dofs2;
- DoFTools::extract_locally_relevant_dofs(*dof2, locally_relevant_dofs2);
+ const IndexSet &locally_owned_dofs1 = dof1->locally_owned_dofs();
+ const IndexSet locally_relevant_dofs1 =
+ DoFTools::extract_locally_relevant_dofs(*dof1);
+ const IndexSet &locally_owned_dofs2 = dof2->locally_owned_dofs();
+ const IndexSet locally_relevant_dofs2 =
+ DoFTools::extract_locally_relevant_dofs(*dof2);
VectorType in_ghosted =
build_ghosted<VectorType>(locally_owned_dofs1, locally_relevant_dofs1);
DoFTools::make_hanging_node_constraints(*dof2, cm2);
cm2.close();
- IndexSet locally_owned_dofs1 = dof1->locally_owned_dofs();
- IndexSet locally_relevant_dofs1;
- DoFTools::extract_locally_relevant_dofs(*dof1, locally_relevant_dofs1);
- IndexSet locally_owned_dofs2 = dof2->locally_owned_dofs();
- IndexSet locally_relevant_dofs2;
- DoFTools::extract_locally_relevant_dofs(*dof2, locally_relevant_dofs2);
+ const IndexSet &locally_owned_dofs1 = dof1->locally_owned_dofs();
+ const IndexSet locally_relevant_dofs1 =
+ DoFTools::extract_locally_relevant_dofs(*dof1);
+ const IndexSet &locally_owned_dofs2 = dof2->locally_owned_dofs();
+ const IndexSet locally_relevant_dofs2 =
+ DoFTools::extract_locally_relevant_dofs(*dof2);
VectorType in_ghosted =
build_ghosted<VectorType>(locally_owned_dofs1, locally_relevant_dofs1);
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_set);
+ locally_relevant_set = DoFTools::extract_locally_relevant_dofs(dof_handler);
DynamicSparsityPattern c_sparsity(dof_handler.n_dofs(),
dof_handler.n_dofs());
dh.distribute_dofs(fe_collection);
// ---- constrain ----
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> constraints;
constraints.clear();
std::vector<IndexSet> locally_owned_dofs_per_processor =
Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dh, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dh);
if (print_constraints)
{
dh.distribute_dofs(fe_collection);
// ---- constrain ----
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> constraints;
constraints.clear();
std::vector<IndexSet> locally_owned_dofs_per_processor =
Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dh, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dh);
if (print_constraints)
{
dh.distribute_dofs(fe_collection);
// ---- constrain ----
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> constraints;
constraints.clear();
std::vector<IndexSet> locally_owned_dofs_per_processor =
Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dh, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dh);
if (print_constraints)
{
dh.distribute_dofs(fes);
// make constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
dof_handler.distribute_dofs(fe_collection);
// make constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> hanging_node_constraints;
hanging_node_constraints.reinit(locally_relevant_dofs);
hanging_node_constraints.distribute(interpolated);
// extract a vector that has ghost elements
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- locally_relevant_dofs.clear();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_dofs.compress();
constraints.clear();
Utilities::MPI::all_gather(communicator,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(
constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, LinearFunction<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = interpolated;
AffineConstraints<PetscScalar> cm2;
cm2.close();
- IndexSet dof1_locally_owned_dofs = dofh1.locally_owned_dofs();
- IndexSet dof2_locally_owned_dofs = dofh2.locally_owned_dofs();
- IndexSet dof1_locally_relevant_dofs;
- IndexSet dof2_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dofh2, dof2_locally_relevant_dofs);
- DoFTools::extract_locally_relevant_dofs(dofh1, dof1_locally_relevant_dofs);
+ const IndexSet &dof1_locally_owned_dofs = dofh1.locally_owned_dofs();
+ const IndexSet &dof2_locally_owned_dofs = dofh2.locally_owned_dofs();
+ const IndexSet dof1_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dofh1);
+ const IndexSet dof2_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dofh2);
+
PETScWrappers::MPI::Vector u1(dof1_locally_owned_dofs,
dof1_locally_relevant_dofs,
// Integrate the difference in the first component, if everything went
// well, this should be zero.
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
x_rel = x;
Vector<double> error(tr.n_active_cells());
{
dh.distribute_dofs(fe);
vec.reinit(dh.locally_owned_dofs(), MPI_COMM_WORLD);
- IndexSet locally_relevant;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant);
+ const IndexSet locally_relevant = DoFTools::extract_locally_relevant_dofs(dh);
lr_vec.reinit(locally_relevant, MPI_COMM_WORLD);
}
SeventhProblem<dim>::setup_system()
{
dof_handler.distribute_dofs(fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = dof_handler.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
mpi_communicator);
{
second_dof_handler.distribute_dofs(fe);
second_locally_owned_dofs = second_dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(second_dof_handler,
- second_locally_relevant_dofs);
+ second_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(second_dof_handler);
second_locally_relevant_solution.reinit(second_locally_owned_dofs,
second_locally_relevant_dofs,
mpi_communicator);
// the result of extract_boundary_dofs is supposed to be a subset of the
// locally relevant dofs, so do the test again with that
{
- IndexSet relevant_set(dofh.n_dofs());
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> boundary_values(relevant_set);
DoFTools::make_zero_boundary_constraints(dofh, boundary_values);
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
// supposed to be a map that
// contains exactly the locally
// relevant dofs, so test this
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
for (unsigned int i = 0; i < dofh.n_dofs(); ++i)
{
owned_partitioning.push_back(locally_owned_dofs.get_view(n_u, n_u + n_p));
relevant_partitioning.clear();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(
locally_relevant_dofs.get_view(n_u, n_u + n_p));
Vector<float> estimated_error_per_cell(triangulation.n_active_cells());
TrilinosWrappers::MPI::Vector temp_solution;
- IndexSet idx;
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler, idx);
+ const IndexSet idx =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
temp_solution.reinit(idx, MPI_COMM_WORLD);
temp_solution = solution;
if (myid == 0)
deallog << "#dofs = " << dofh.locally_owned_dofs().size() << std::endl;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> constraints;
constraints.reinit(relevant_set);
if (myid == 0)
deallog << "#dofs = " << dofh.locally_owned_dofs().size() << std::endl;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> constraints;
constraints.reinit(relevant_set);
if (myid == 0)
deallog << "#dofs = " << dofh.locally_owned_dofs().size() << std::endl;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> constraints;
constraints.reinit(relevant_set);
if (myid == 0)
deallog << "#dofs = " << dofh.locally_owned_dofs().size() << std::endl;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> constraints;
constraints.reinit(relevant_set);
static const FE_Q<dim> fe(1);
dofh.distribute_dofs(fe);
- IndexSet dof_set;
- DoFTools::extract_locally_relevant_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> cm;
DoFTools::make_hanging_node_constraints(dofh, cm);
static const FE_Q<dim> fe(1);
dofh.distribute_dofs(fe);
- IndexSet dof_set;
- DoFTools::extract_locally_relevant_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> cm;
DoFTools::make_hanging_node_constraints(dofh, cm);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
-
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet &owned_set = dofh.locally_owned_dofs();
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x;
x.reinit(owned_set, MPI_COMM_WORLD);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
-
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ IndexSet owned_set = dofh.locally_owned_dofs();
+ IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x;
x.reinit(owned_set, MPI_COMM_WORLD);
dofh.distribute_dofs(fe);
- owned_set = dofh.locally_owned_dofs();
-
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ owned_set = dofh.locally_owned_dofs();
+ dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
x.reinit(owned_set, MPI_COMM_WORLD);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet &owned_set = dofh.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x_ref;
x_ref.reinit(owned_set, MPI_COMM_WORLD);
<< dofh.n_locally_owned_dofs() << std::endl;
}
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs<>(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs<>(dofh);
std::set<unsigned int> control_dof_set;
typename DoFHandler<dim>::active_cell_iterator cell = dofh.begin_active();
dofh.distribute_dofs(fe);
{
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
if (myid == 0)
dof_set.print(deallog);
}
// correct. This was a bug at some point.
Assert(n_dofs == dofh.n_dofs(), ExcInternalError());
{
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
if (myid == 0)
dof_set.print(deallog);
deallog << "Total dofs=" << dofh.n_dofs() << std::endl;
{
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
dof_set.print(deallog);
}
DoFRenumbering::component_wise(dofh);
{
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
const std::vector<IndexSet> owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD, dofh.locally_owned_dofs());
static const FE_Q<dim> fe(1);
dofh.distribute_dofs(fe);
- IndexSet dof_set;
- DoFTools::extract_locally_relevant_dofs(dofh, dof_set);
+ const IndexSet dof_set = DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> cm;
DoFTools::make_hanging_node_constraints(dofh, cm);
static const FE_Q<dim> fe(1);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
-
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet &owned_set = dofh.locally_owned_dofs();
+ const IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x;
x.reinit(owned_set, MPI_COMM_WORLD);
dofh.distribute_dofs(fe);
- IndexSet owned_set = dofh.locally_owned_dofs();
-
- IndexSet dof_set;
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ IndexSet owned_set = dofh.locally_owned_dofs();
+ IndexSet dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector x;
x.reinit(owned_set, MPI_COMM_WORLD);
dofh.distribute_dofs(fe);
- owned_set = dofh.locally_owned_dofs();
-
- DoFTools::extract_locally_active_dofs(dofh, dof_set);
-
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ owned_set = dofh.locally_owned_dofs();
+ dof_set = DoFTools::extract_locally_active_dofs(dofh);
+ relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
x.reinit(owned_set, MPI_COMM_WORLD);
dof.distribute_dofs(fe);
// build constraint matrix
- IndexSet locally_relevant(dof.n_dofs());
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant);
+ const IndexSet locally_relevant =
+ DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(locally_relevant);
DoFTools::make_hanging_node_constraints(dof, constraints);
constraints.close();
const unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
const unsigned int numproc = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
- IndexSet locally_active(dof.n_dofs());
- DoFTools::extract_locally_active_dofs(dof, locally_active);
- std::ofstream file(
+ const IndexSet locally_active = DoFTools::extract_locally_active_dofs(dof);
+ std::ofstream file(
(std::string("dat.") + Utilities::int_to_string(myid)).c_str());
file << "**** proc " << myid << ": \n\n";
file << "Constraints:\n";
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD);
PETScWrappers::MPI::Vector solution(locally_owned_dofs,
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector solution(locally_owned_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector>
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD);
PETScWrappers::MPI::Vector x2(locally_owned_dofs, MPI_COMM_WORLD);
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector solution(locally_owned_dofs, MPI_COMM_WORLD);
PETScWrappers::MPI::Vector solution2(locally_owned_dofs, MPI_COMM_WORLD);
DoFHandler<dim> dh(tr);
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector x(locally_owned_dofs, com_small);
PETScWrappers::MPI::Vector rel_x(locally_owned_dofs,
DoFHandler<dim> dh(tr);
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector solution(locally_owned_dofs, com_all);
solution = PetscScalar();
dh.distribute_dofs(fe_collection);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector x(locally_owned_dofs, com_small);
PETScWrappers::MPI::Vector rel_x(locally_owned_dofs,
dh.deserialize_active_fe_indices();
dh.distribute_dofs(fe_collection);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector solution(locally_owned_dofs, com_all);
solution = PetscScalar();
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
- IndexSet owned_set = dof.locally_owned_dofs();
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof, relevant_set);
+ const IndexSet &owned_set = dof.locally_owned_dofs();
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints(relevant_set);
DoFTools::make_hanging_node_constraints(dof, constraints);
DoFTools::make_hanging_node_constraints(dof2, c2);
c2.close();
- IndexSet locally_relevant_dofs2;
- DoFTools::extract_locally_relevant_dofs(dof2, locally_relevant_dofs2);
+ const IndexSet locally_relevant_dofs2 =
+ DoFTools::extract_locally_relevant_dofs(dof2);
LinearAlgebra::distributed::Vector<double> v2(dof2.locally_owned_dofs(),
locally_relevant_dofs2,
DoFRenumbering::component_wise(dof1);
DoFRenumbering::component_wise(dof2);
- IndexSet locally_owned_dofs1 = dof1.locally_owned_dofs();
- IndexSet locally_relevant_dofs1;
- DoFTools::extract_locally_relevant_dofs(dof1, locally_relevant_dofs1);
+ const IndexSet locally_owned_dofs1 = dof1.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs1 =
+ DoFTools::extract_locally_relevant_dofs(dof1);
std::vector<IndexSet> owned_partitioning1;
std::vector<IndexSet> relevant_partitioning1;
dof1.distribute_dofs(fe1);
dof2.distribute_dofs(fe2);
- IndexSet locally_relevant_dofs1, locally_relevant_dofs2;
- DoFTools::extract_locally_relevant_dofs(dof1, locally_relevant_dofs1);
- DoFTools::extract_locally_relevant_dofs(dof2, locally_relevant_dofs2);
+ const IndexSet locally_relevant_dofs1 =
+ DoFTools::extract_locally_relevant_dofs(dof1);
+ const IndexSet locally_relevant_dofs2 =
+ DoFTools::extract_locally_relevant_dofs(dof2);
LinearAlgebra::distributed::Vector<double> v1(dof1.locally_owned_dofs(),
locally_relevant_dofs1,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
mpi_communicator);
const std::vector<IndexSet> &locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(constraints.is_consistent_in_parallel(locally_owned_dofs,
locally_active_dofs,
mpi_communicator,
owned_partitioning.push_back(locally_owned_dofs.get_view(n_u, n_u + n_p));
relevant_partitioning.clear();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(
locally_relevant_dofs.get_view(n_u, n_u + n_p));
const std::vector<IndexSet> &locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(constraints.is_consistent_in_parallel(locally_owned_dofs,
locally_active_dofs,
mpi_communicator,
owned_partitioning.push_back(locally_owned_dofs.get_view(n_u, n_u + n_p));
relevant_partitioning.clear();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(
locally_relevant_dofs.get_view(n_u, n_u + n_p));
const std::vector<IndexSet> &locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(constraints.is_consistent_in_parallel(locally_owned_dofs,
locally_active_dofs,
mpi_communicator,
AffineConstraints<double> constraints;
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
constraints.reinit(locally_relevant_dofs);
{
const std::vector<IndexSet> locally_owned_dofs_vector =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(constraints.is_consistent_in_parallel(locally_owned_dofs_vector,
locally_active_dofs,
MPI_COMM_WORLD,
data_out.write_vtu_in_parallel(std::string("mesh.vtu").c_str(),
mpi_communicator);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
std::map<types::global_dof_index, Point<dim>> supportPoints;
DoFTools::map_dofs_to_support_points(MappingQ1<dim>(),
const std::vector<IndexSet> &locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(constraints.is_consistent_in_parallel(locally_owned_dofs,
locally_active_dofs,
mpi_communicator,
data_out.write_vtu_in_parallel(std::string("mesh.vtu").c_str(),
mpi_communicator);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
-
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
const std::vector<IndexSet> locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
data_out.write_vtu_in_parallel(std::string("mesh.vtu").c_str(),
mpi_communicator);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
-
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
const std::vector<IndexSet> locally_owned_dofs =
Utilities::MPI::all_gather(MPI_COMM_WORLD,
DoFHandler<2> handler(fluid_triangulation);
handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = handler.locally_owned_dofs();
- IndexSet locally_relevant_dofs = handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(handler, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = handler.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(handler);
PETScWrappers::MPI::Vector vector;
dof_handler.distribute_dofs(fe_collection);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
Utilities::MPI::all_gather(dof_handler.get_communicator(),
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(
constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
<< owned_partitioning[1].n_elements() << ')' << std::endl
<< std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.resize(2);
relevant_partitioning[0] = locally_relevant_dofs.get_view(0, n_u);
relevant_partitioning[1] = locally_relevant_dofs.get_view(n_u, n_u + n_p);
dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ IndexSet locally_owned_dofs = dh.locally_owned_dofs();
+ IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector solution(locally_owned_dofs,
locally_relevant_dofs,
tria.execute_coarsening_and_refinement();
dh.distribute_dofs(fe);
- locally_owned_dofs = dh.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ locally_owned_dofs = dh.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dh);
PETScWrappers::MPI::Vector tmp(locally_owned_dofs, MPI_COMM_WORLD);
// ----- prepare solution -----
dh.distribute_dofs(fe_collection);
- IndexSet locally_owned_dofs = dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ IndexSet locally_owned_dofs = dh.locally_owned_dofs();
+ IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dh);
TrilinosWrappers::MPI::Vector solution;
solution.reinit(locally_owned_dofs, MPI_COMM_WORLD);
tria.execute_coarsening_and_refinement();
dh.distribute_dofs(fe_collection);
- locally_owned_dofs = dh.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+ locally_owned_dofs = dh.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dh);
TrilinosWrappers::MPI::Vector new_solution;
new_solution.reinit(locally_owned_dofs, MPI_COMM_WORLD);
// prepare index sets
IndexSet dgq_locally_owned_dofs = dgq_dof_handler.locally_owned_dofs();
- IndexSet dgq_locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dgq_dof_handler,
- dgq_locally_relevant_dofs);
+ IndexSet dgq_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dgq_dof_handler);
IndexSet dgq_ghost_dofs = dgq_locally_relevant_dofs;
dgq_ghost_dofs.subtract_set(dgq_locally_owned_dofs);
// prepare index sets
dgq_locally_owned_dofs = dgq_dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dgq_dof_handler,
- dgq_locally_relevant_dofs);
+ dgq_locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dgq_dof_handler);
dgq_ghost_dofs = dgq_locally_relevant_dofs;
dgq_ghost_dofs.subtract_set(dgq_locally_owned_dofs);
DoFHandler<dim> dof_handler(tria);
dof_handler.begin(0)->child(0)->set_active_fe_index(1);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
LinearAlgebra::distributed::Vector<double> solution(
dof_handler.locally_owned_dofs(), locally_relevant_dofs, comm);
dof_euler.distribute_dofs(fe_system);
{
- IndexSet locally_relevant_euler;
- DoFTools::extract_locally_relevant_dofs(dof_euler,
- locally_relevant_euler);
+ const IndexSet locally_relevant_euler =
+ DoFTools::extract_locally_relevant_dofs(dof_euler);
euler_positions.reinit(dof_euler.locally_owned_dofs(),
locally_relevant_euler,
MPI_COMM_WORLD);
pcout << "Number of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
for (unsigned int level = 0; level < nlevels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_set);
+ locally_relevant_set = DoFTools::extract_locally_relevant_dofs(dof_handler);
solution.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
right_hand_side.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
smoother_data[l].relaxation = 0.7;
smoother_data[l].inversion = PreconditionBlockBase<double>::svd;
TrilinosWrappers::MPI::Vector *ghost = &(temp_vectors[l]);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- l,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, l);
ghost->reinit(dof_handler.locally_owned_mg_dofs(l),
relevant_dofs,
MPI_COMM_WORLD);
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_set);
+ locally_relevant_set = DoFTools::extract_locally_relevant_dofs(dof_handler);
solution.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
right_hand_side.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
{
std::vector<types::global_dof_index> starting_indices;
DoFRenumbering::Cuthill_McKee(dof_handler, false, true, starting_indices);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
}
locally_relevant_solution.reinit(locally_owned_dofs,
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
{
std::vector<types::global_dof_index> starting_indices;
DoFRenumbering::Cuthill_McKee(dof_handler, false, true, starting_indices);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
}
locally_relevant_solution.reinit(locally_owned_dofs,
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
DoFHandler<dim> dofh(tr);
dofh.distribute_dofs(fe);
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dofh);
AffineConstraints<double> cm;
cm.reinit(locally_relevant_set);
dof_handler.distribute_dofs(fe_collection);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
Utilities::MPI::all_gather(dof_handler.get_communicator(),
dof_handler.locally_owned_dofs());
- IndexSet locally_active_dofs;
- DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
AssertThrow(
constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- 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);
// constraints:
AffineConstraints<double> constraints;
level_projection(min_level, max_level);
for (unsigned int level = min_level; level <= max_level; ++level)
{
- IndexSet set;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler, level, set);
+ const IndexSet set =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
level_projection[level].reinit(dof_handler.locally_owned_mg_dofs(level),
set,
mpi_communicator);
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
dof_handler.distribute_mg_dofs();
// Make FE vector
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
VectorType global_dof_vector;
dof_handler.distribute_mg_dofs();
// Make FE vector
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
VectorType global_dof_vector;
{
IndexSet locally_relevant_dofs;
if (level == numbers::invalid_unsigned_int)
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
else
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
const parallel::TriangulationBase<MeshType::dimension> *dist_tria =
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
*mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
auto &op = operators[l];
// set up constraints
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- l,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, l);
constraint.reinit(relevant_dofs);
constraint.add_lines(mg_constrained_dofs.get_boundary_indices(l));
constraint.close();
auto &op = operators[l];
// set up constraints
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- l,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, l);
constraint.reinit(relevant_dofs);
constraint.add_lines(mg_constrained_dofs.get_boundary_indices(l));
constraint.close();
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
*mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- 0 /*level*/,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, 0 /*level*/);
constraint.reinit(relevant_dofs);
constraint.add_lines(
mg_constrained_dofs.get_boundary_indices(0 /*level*/));
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraint.reinit(relevant_dofs);
constraint.add_lines(mg_constrained_dofs.get_boundary_indices(level));
constraint.close();
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
*mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
*_mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
dof_handler.distribute_dofs(*fe);
// set up constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraint.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(
*mapping, dof_handler, 0, Functions::ZeroFunction<dim>(), constraint);
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
}
else
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
constraints.reinit(relevant_dofs);
constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level));
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
hanging_node_constraints.reinit(locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof, hanging_node_constraints);
hanging_node_constraints.close();
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
std::vector<IndexSet> locally_relevant_dofs(dof.size());
for (unsigned int i = 0; i < dof.size(); ++i)
- DoFTools::extract_locally_relevant_dofs(*dof[i], locally_relevant_dofs[i]);
+ locally_relevant_dofs[i] = DoFTools::extract_locally_relevant_dofs(*dof[i]);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
dof.size());
for (unsigned int i = 0; i < dof.size(); ++i)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(*dof[i],
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(*dof[i], level);
level_constraints[i].reinit(relevant_dofs);
level_constraints[i].add_lines(
mg_constrained_dofs[i].get_boundary_indices(level));
deallog << std::endl;
deallog << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
// Dirichlet BC
Functions::ZeroFunction<dim> zero_function;
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
dirichlet_boundary[0] = &zero_function;
// fine-level constraints
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
VectorTools::interpolate_boundary_values(dof,
mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof, level, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof, level);
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
mg_constrained_dofs.get_boundary_indices(level));
pcout << "Number of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
for (unsigned int level = 0; level < nlevels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
dof_handler_p.clear();
dof_handler_p.distribute_dofs(fe_p);
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u, constraints_u);
dof_handler_u, 0, ExactSolution_BoundaryValues_u<dim>(), constraints_u);
constraints_u.close();
- IndexSet locally_relevant_dofs_p;
- DoFTools::extract_locally_relevant_dofs(dof_handler_p,
- locally_relevant_dofs_p);
+ const IndexSet locally_relevant_dofs_p =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_p);
constraints_p.reinit(locally_relevant_dofs_p);
DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
constraints_p.close();
for (unsigned int level = 0; level < n_levels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler_u,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler_u, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
// Create constraints with no Dirchlet info
AffineConstraints<double> constraints_u_no_dirchlet;
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u_no_dirchlet.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u,
constraints_u_no_dirchlet);
LinearAlgebra::distributed::Vector<Number> v1, v2;
LinearAlgebra::distributed::Vector<double> v1_cpy, v2_cpy, v3;
v1.reinit(mgdof.locally_owned_mg_dofs(level - 1), MPI_COMM_WORLD);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_level_dofs(mgdof,
- level,
- relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_level_dofs(mgdof, level);
v2.reinit(mgdof.locally_owned_mg_dofs(level),
relevant_set,
MPI_COMM_WORLD);
deallog << "get_boundary_indices:" << std::endl;
bi.print(deallog);
- IndexSet relevant;
- DoFTools::extract_locally_relevant_level_dofs(dofh, level, relevant);
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_level_dofs(dofh, level);
deallog << "relevant:" << std::endl;
relevant.print(deallog);
{
deallog << "Level " << level << ':' << std::endl;
- IndexSet relevant;
- DoFTools::extract_locally_relevant_level_dofs(dofh, level, relevant);
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_level_dofs(dofh, level);
mg_boundary_constraints[level].reinit(relevant);
mg_boundary_constraints[level].add_lines(boundary_indices[level]);
level_boundary_indices);
const auto &bi = mg_constrained_dofs_1.get_boundary_indices(level);
- IndexSet relevant;
- DoFTools::extract_locally_relevant_level_dofs(dofh, level, relevant);
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_level_dofs(dofh, level);
deallog << ((bi ==
(relevant &
deallog << "get_boundary_indices:" << std::endl;
bi.print(deallog);
- IndexSet relevant;
- DoFTools::extract_locally_relevant_level_dofs(dofh, level, relevant);
+ const IndexSet relevant =
+ DoFTools::extract_locally_relevant_level_dofs(dofh, level);
deallog << "relevant:" << std::endl;
relevant.print(deallog);
for (unsigned int level = 0; level < tr.n_levels(); ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(mgdof,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(mgdof, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
FE_Q<dim> fe(2);
DoFHandler<dim> mg_dof_handler(tria);
- IndexSet locally_relevant_set;
AffineConstraints<double> constraints;
MGConstrainedDoFs mg_constrained_dofs;
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
constraints.reinit(locally_relevant_set);
DoFTools::make_hanging_node_constraints(mg_dof_handler, constraints);
dof_handler.distribute_dofs(fe);
dof_handler.distribute_mg_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
dof_handler.distribute_mg_dofs();
// Make FE vector
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
VectorType global_dof_vector;
dof_handler.distribute_mg_dofs();
// Make FE vector
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
using VectorType = LinearAlgebra::distributed::Vector<double>;
VectorType global_dof_vector;
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
mg_dof_handler.distribute_dofs(fe);
mg_dof_handler.distribute_mg_dofs();
- DoFTools::extract_locally_relevant_dofs(mg_dof_handler,
- locally_relevant_set);
+ locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(mg_dof_handler);
solution.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
system_rhs.reinit(mg_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
for (unsigned int level = 0; level < triangulation.n_global_levels();
++level)
{
- IndexSet dofset;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler,
- level,
- dofset);
+ const IndexSet dofset =
+ DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, level);
boundary_constraints[level].reinit(dofset);
boundary_constraints[level].add_lines(
mg_constrained_dofs.get_refinement_edge_indices(level));
mg_constrained_dofs.initialize(dofh);
AffineConstraints<double> hanging_node_constraints;
- IndexSet locally_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, locally_relevant_set);
+ const IndexSet locally_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dofh);
hanging_node_constraints.reinit(locally_relevant_set);
DoFTools::make_hanging_node_constraints(dofh, hanging_node_constraints);
hanging_node_constraints.close();
LinearAlgebra::distributed::Vector<Number> v1, v2;
LinearAlgebra::distributed::Vector<double> v1_cpy, v2_cpy, v3;
v1.reinit(mgdof.locally_owned_mg_dofs(level - 1), MPI_COMM_WORLD);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_level_dofs(mgdof,
- level,
- relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_level_dofs(mgdof, level);
v2.reinit(mgdof.locally_owned_mg_dofs(level),
relevant_set,
MPI_COMM_WORLD);
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(mgdof);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(mgdof, 0, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(mgdof, 0);
AffineConstraints<double> user_constraints;
user_constraints.reinit(relevant_dofs);
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(mgdof);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(mgdof, 0, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(mgdof, 0);
AffineConstraints<double> user_constraints;
user_constraints.reinit(relevant_dofs);
const auto mpi_comm = dof_handler.get_communicator();
const IndexSet &owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<typename MatrixType::value_type> constraints;
dof_handler_p.clear();
dof_handler_p.distribute_dofs(fe_p);
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u, constraints_u);
constraints_u);
constraints_u.close();
- IndexSet locally_relevant_dofs_p;
- DoFTools::extract_locally_relevant_dofs(dof_handler_p,
- locally_relevant_dofs_p);
+ const IndexSet locally_relevant_dofs_p =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_p);
constraints_p.reinit(locally_relevant_dofs_p);
DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
constraints_p.close();
for (unsigned int level = 0; level < n_levels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler_u,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler_u, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
// level_constraints.add_lines(
// Create constraints with no Dirchlet info
AffineConstraints<double> constraints_u_no_dirchlet;
- IndexSet locally_relevant_dofs_u;
- DoFTools::extract_locally_relevant_dofs(dof_handler_u,
- locally_relevant_dofs_u);
+ const IndexSet locally_relevant_dofs_u =
+ DoFTools::extract_locally_relevant_dofs(dof_handler_u);
constraints_u_no_dirchlet.reinit(locally_relevant_dofs_u);
DoFTools::make_hanging_node_constraints(dof_handler_u,
constraints_u_no_dirchlet);
deallog << "n_cells=" << triangulation.n_global_active_cells() << std::endl;
deallog << "n_dofs=" << dof_handler.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
AffineConstraints<double> constraints;
constraints.reinit(locally_relevant_dofs);
dof_handlers[i]->distribute_dofs(*fes[i]);
deallog << "n_dofs=" << dof_handlers[i]->n_dofs() << std::endl;
- DoFTools::extract_locally_relevant_dofs(*dof_handlers[i],
- locally_relevant_dofs[i]);
+ locally_relevant_dofs[i] =
+ DoFTools::extract_locally_relevant_dofs(*dof_handlers[i]);
constraints[i].reinit(locally_relevant_dofs[i]);
DoFTools::make_hanging_node_constraints(*dof_handlers[i], constraints[i]);
DoFHandler<dim, spacedim> space_dh(tria);
space_dh.distribute_dofs(fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
DoFHandler<dim, spacedim> space_dh(space_tria);
space_dh.distribute_dofs(space_fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
DoFHandler<dim, spacedim> space_dh(space_tria);
space_dh.distribute_dofs(space_fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
DoFHandler<dim, spacedim> space_dh(space_tria);
space_dh.distribute_dofs(space_fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
DoFHandler<dim, spacedim> space_dh(space_tria);
space_dh.distribute_dofs(space_fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
DoFHandler<dim, spacedim> space_dh(space_tria);
space_dh.distribute_dofs(space_fe);
- IndexSet locally_owned_dofs = space_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(space_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = space_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(space_dh);
if (my_mpi_id == 0)
deallog << "dim: " << dim << ", spacedim: " << spacedim << std::endl
ParticleTracking<dim>::setup_background_dofs()
{
fluid_dh.distribute_dofs(fluid_fe);
- const IndexSet locally_owned_dofs = fluid_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(fluid_dh, locally_relevant_dofs);
+ const IndexSet &locally_owned_dofs = fluid_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(fluid_dh);
velocity_field.reinit(locally_owned_dofs,
locally_relevant_dofs,
else
dof_h.distribute_dofs(*fes[level + 1 - coarse_triangulations.size()]);
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_h, relevant_dofs);
+ IndexSet relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_h);
AffineConstraints<float> &constraints = level_constraints[level];
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_h, constraints);
additional_data);
// now create the final constraints object
- DoFTools::extract_locally_relevant_dofs(dof_h, relevant_dofs);
+ relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_h);
constraints.clear();
constraints.reinit(relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_h, constraints);
debug_output << "Number of DoFs: " << dof_handler.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
for (unsigned int level = 0; level < triangulation.n_global_levels(); ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
for (unsigned int level = 0; level < nlevels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
debug_output << "Number of DoFs: " << dof_handler.n_dofs() << std::endl;
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
for (unsigned int level = 0; level < triangulation.n_global_levels(); ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
for (unsigned int level = 0; level < nlevels; ++level)
{
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(dof_handler,
- level,
- relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
AffineConstraints<double> level_constraints;
level_constraints.reinit(relevant_dofs);
level_constraints.add_lines(
ParticleTracking<dim>::setup_background_dofs()
{
fluid_dh.distribute_dofs(fluid_fe);
- const IndexSet locally_owned_dofs = fluid_dh.locally_owned_dofs();
- const IndexSet locally_relevant_dofs =
+ const IndexSet &locally_owned_dofs = fluid_dh.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
DoFTools::extract_locally_relevant_dofs(fluid_dh);
velocity_field.reinit(locally_owned_dofs,
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(3);
-
- IndexSet locally_owned_dofs;
- IndexSet locally_relevant_dofs;
- IndexSet locally_active_dofs;
-
dof_handler.distribute_dofs(fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
- locally_active_dofs = DoFTools::extract_locally_active_dofs(dof_handler);
+ const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
+ const IndexSet locally_active_dofs =
+ DoFTools::extract_locally_active_dofs(dof_handler);
DynamicSparsityPattern dsp(locally_relevant_dofs);
dof_handler.distribute_dofs(fe);
}
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet 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);
// Specifically, we need two types of AffineConstraints.
DoFHandler<dim> dof_handler(tria);
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
PETScWrappers::MPI::Vector vector, vector_locally_relevant;
LinearAlgebra::distributed::Vector<double> vector_Re,
DoFHandler<dim> dof_handler(tria);
dof_handler.distribute_dofs(fe);
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
PETScWrappers::MPI::Vector vector;
PETScWrappers::MPI::SparseMatrix mass_matrix;
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
hanging_node_constraints.clear();
DoFTools::make_hanging_node_constraints(dof_handler,
hanging_node_constraints);
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
hanging_node_constraints.clear();
DoFTools::make_hanging_node_constraints(dof_handler,
hanging_node_constraints);
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
std::shared_ptr<const Utilities::MPI::Partitioner>
create_partitioner(const DoFHandler<dim, spacedim> &dof_handler)
{
- IndexSet locally_relevant_dofs;
-
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
return std::make_shared<const Utilities::MPI::Partitioner>(
dof_handler.locally_owned_dofs(),
DoFHandler<dim> dof_handler(tria);
dof_handler.distribute_dofs(fe);
- IndexSet owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet &owned_dofs = dof_handler.locally_owned_dofs();
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
LinearAlgebra::distributed::Vector<double> solution;
// the result of extract_boundary_dofs is supposed to be a subset of the
// locally relevant dofs, so test this
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
boundary_dofs.subtract_set(relevant_set);
AssertThrow(boundary_dofs.n_elements() == 0, ExcInternalError());
}
const MPI_Comm comm = get_communicator(dof_handler.get_triangulation());
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
#ifdef DEAL_II_WITH_TRILINOS
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// The next step is to set up constraints due to hanging nodes. This has
// been handled many times before:
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
owned_partitioning[1] =
dof_handler.locally_owned_dofs().get_view(n_u, n_u + n_p);
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.resize(2);
relevant_partitioning[0] = locally_relevant_dofs.get_view(0, n_u);
relevant_partitioning[1] = locally_relevant_dofs.get_view(n_u, n_u + n_p);
{
fluid_dh.distribute_dofs(fluid_fe);
const IndexSet locally_owned_dofs = fluid_dh.locally_owned_dofs();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(fluid_dh, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(fluid_dh);
velocity_field.reinit(locally_owned_dofs,
locally_relevant_dofs,
std::vector<dealii::IndexSet> locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
std::vector<dealii::IndexSet> locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
std::vector<dealii::IndexSet> locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain(dof_handler);
locally_owned_dofs = locally_owned_dofs_per_processor[this_mpi_process];
- locally_relevant_dofs.clear();
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ locally_relevant_dofs =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
}
{
TrilinosWrappers::SparsityPattern csp;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
csp.reinit(locally_owned, locally_owned, relevant_set, MPI_COMM_WORLD);
DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
csp.compress();
}
{
TrilinosWrappers::SparsityPattern csp;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
csp.reinit(locally_owned, locally_owned, relevant_set, MPI_COMM_WORLD);
DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
csp.compress();
std::placeholders::_1)));
TrilinosWrappers::BlockSparsityPattern csp(2, 2);
- std::vector<IndexSet> locally_owned(2), relevant_set(2);
- IndexSet locally_owned_total = dof_handler.locally_owned_dofs(),
- relevant_total;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total);
+ const IndexSet &locally_owned_total = dof_handler.locally_owned_dofs();
+ const IndexSet relevant_total =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
const std::vector<types::global_dof_index> dofs_per_block =
DoFTools::count_dofs_per_fe_block(dof_handler, blocks);
+
+ std::vector<IndexSet> locally_owned(2), relevant_set(2);
locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]);
locally_owned[1] =
locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs());
reference_rhs.reinit(locally_owned, MPI_COMM_WORLD);
}
{
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
DynamicSparsityPattern csp(dof_handler.n_dofs(),
dof_handler.n_dofs(),
relevant_set);
std::placeholders::_1)));
TrilinosWrappers::BlockSparsityPattern csp(2, 2);
- std::vector<IndexSet> locally_owned(2), relevant_set(2);
- IndexSet locally_owned_total = dof_handler.locally_owned_dofs(),
- relevant_total;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total);
+ const IndexSet &locally_owned_total = dof_handler.locally_owned_dofs();
+ const IndexSet relevant_total =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
const std::vector<types::global_dof_index> dofs_per_block =
DoFTools::count_dofs_per_fe_block(dof_handler, blocks);
+
+ std::vector<IndexSet> locally_owned(2), relevant_set(2);
locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]);
locally_owned[1] =
locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs());
}
{
TrilinosWrappers::SparsityPattern csp;
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set);
+ const IndexSet relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// TODO: currently no Trilinos version is capable of doing this...
// #if DEAL_II_TRILINOS_VERSION_GTE(11,14,0)
// Cannot pre-build sparsity pattern, Trilinos must provide it...
constraints);
constraints.close();
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
DynamicSparsityPattern dsp(dof_handler.n_dofs());
constraints);
constraints.close();
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
- IndexSet locally_relevant_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);
DynamicSparsityPattern dsp(dof_handler.n_dofs());
{
dof_handler.distribute_dofs(fe);
locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
DynamicSparsityPattern dynamic_sparsity_pattern(locally_relevant_dofs);
Table<2, DoFTools::Coupling> cell_integral_mask(1, 1);
Table<2, DoFTools::Coupling> coupling(1, 1);
coupling.fill(DoFTools::none);
- const IndexSet system_partitioning = dof_handler.locally_owned_dofs();
- IndexSet system_relevant_set;
- DoFTools::extract_locally_relevant_dofs(dof_handler, system_relevant_set);
+ const IndexSet &system_partitioning = dof_handler.locally_owned_dofs();
+ const IndexSet system_relevant_set =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
// create an empty sparsity pattern
{
locally_owned_dofs = dof_handler.locally_owned_dofs();
locally_owned_dofs.print(deallog);
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_dofs.print(deallog);
DynamicSparsityPattern sparsity_pattern(locally_relevant_dofs);
TimerOutput::Scope t(timer, "setup");
dof_handler.distribute_dofs(fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_owned_dofs = dof_handler.locally_owned_dofs();
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
locally_relevant_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
owned_partitioning.push_back(locally_owned_dofs.get_view(n_u, n_u + n_p));
relevant_partitioning.clear();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler,
- locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(
locally_relevant_dofs.get_view(n_u, n_u + n_p));
DoFHandler<dim> dh(triangulation);
dh.distribute_dofs(fe_system);
- IndexSet relevant_partitioning(dh.n_dofs());
- DoFTools::extract_locally_relevant_dofs(dh, relevant_partitioning);
+ const IndexSet relevant_partitioning =
+ DoFTools::extract_locally_relevant_dofs(dh);
// generate empty constraints
AffineConstraints<double> constraints;
QIterated<dim> quadrature(QTrapezoid<1>(), 5);
const dealii::Function<dim, double> *w = nullptr;
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dofhandler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dofhandler);
VectorType ghosted(dofhandler.locally_owned_dofs(),
relevant_dofs,
MPI_COMM_WORLD);
const dealii::Function<dim, double> *w = nullptr;
MappingFE<dim> mapping(FE_SimplexP<dim>(1));
- IndexSet relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dofhandler, relevant_dofs);
+ const IndexSet relevant_dofs =
+ DoFTools::extract_locally_relevant_dofs(dofhandler);
VectorType ghosted(dofhandler.locally_owned_dofs(),
relevant_dofs,
MPI_COMM_WORLD);
VectorTools::interpolate(dofh, Ref<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector solution(relevant_set, MPI_COMM_WORLD);
solution = interpolated;
VectorTools::interpolate(dofh, Ref<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector solution(relevant_set, MPI_COMM_WORLD);
solution = interpolated;
VectorTools::interpolate(dofh, Ref<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector solution(relevant_set, MPI_COMM_WORLD);
solution = interpolated;
VectorTools::interpolate(dofh, Ref<dim>(), interpolated);
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs(dofh, relevant_set);
+ const IndexSet relevant_set = DoFTools::extract_locally_relevant_dofs(dofh);
TrilinosWrappers::MPI::Vector solution(relevant_set, MPI_COMM_WORLD);
solution = interpolated;
const dealii::FESystem<dim> fe_system_coarse(fe_q_coarse, dim);
dof_handler_coarse.distribute_dofs(fe_system_coarse);
- Vector solution_coarse;
- dealii::IndexSet locally_owned_dofs_coarse =
+ Vector solution_coarse;
+ const dealii::IndexSet locally_owned_dofs_coarse =
dof_handler_coarse.locally_owned_dofs();
- dealii::IndexSet ghost_dofs_coarse;
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler_coarse,
- ghost_dofs_coarse);
+ dealii::IndexSet ghost_dofs_coarse =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler_coarse);
dealii::IndexSet locally_relevant_dofs_coarse = ghost_dofs_coarse;
ghost_dofs_coarse.subtract_set(locally_owned_dofs_coarse);
const dealii::FESystem<dim> fe_system_fine(fe_q_fine, dim);
dof_handler_fine.distribute_dofs(fe_system_fine);
- Vector solution_fine;
- dealii::IndexSet locally_owned_dofs_fine =
+ Vector solution_fine;
+ const dealii::IndexSet locally_owned_dofs_fine =
dof_handler_fine.locally_owned_dofs();
- dealii::IndexSet ghost_dofs_fine;
- dealii::DoFTools::extract_locally_relevant_dofs(dof_handler_fine,
- ghost_dofs_fine);
+ dealii::IndexSet ghost_dofs_fine =
+ dealii::DoFTools::extract_locally_relevant_dofs(dof_handler_fine);
dealii::IndexSet locally_relevant_dofs_fine = ghost_dofs_fine;
ghost_dofs_fine.subtract_set(locally_owned_dofs_fine);