// Now we get the locally owned dofs, that is the dofs that our local
// to this processor. These dofs corresponding entries in the
// matrix and vectors that we will write to.
- IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
+ const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
// In additon to the locally owned dofs, we also need the the locally
// relevant dofs. These are the dofs that have read access to and we
// need in order to do computations on our processor, but, that
// we do not have the ability to write to.
- 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 std::vector<types::global_dof_index> dofs_per_component =
DoFTools::count_dofs_per_fe_component(dof_handler);
<< dof_handler.n_dofs()
<< std::endl;
- 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);
// we want to output solution, so here should have ghost cells
old_solution_T.reinit (locally_owned_dofs,locally_relevant_dofs,mpi_communicator);
TimerOutput::Scope t(time_table, "Refine mesh");
/*--- We first create a proper vector for computing estimator ---*/
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs(dof_handler_velocity, locally_relevant_dofs);
+ const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler_velocity);
LinearAlgebra::distributed::Vector<double> tmp_velocity;
tmp_velocity.reinit(dof_handler_velocity.locally_owned_dofs(), locally_relevant_dofs, MPI_COMM_WORLD);
tmp_velocity = u_n;
dof_handler.distribute_dofs(fe);
pcout << "Number of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl;
- 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);
constraints.clear();
constraints.reinit(locally_relevant_dofs);
<< dof_handler.n_dofs()
<< std::endl;
- locally_owned_dofs = dof_handler.locally_owned_dofs();
- locally_relevant_dofs.clear();
- 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);
}
/* setup hanging nodes and Dirichlet constraints */
owned_partitioning[0] = dof_handler.locally_owned_dofs().get_view(0, dof_u);
owned_partitioning[1] =
dof_handler.locally_owned_dofs().get_view(dof_u, dof_u + dof_p);
- DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
relevant_partitioning.resize(2);
relevant_partitioning[0] = locally_relevant_dofs.get_view(0, dof_u);
relevant_partitioning[1] =
////////////////////////////
// setup system LS
dof_handler_LS.distribute_dofs (fe_LS);
- locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_LS,locally_relevant_dofs_LS);
+ locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
+ locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
// setup system U
dof_handler_U.distribute_dofs (fe_U);
- locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_U,locally_relevant_dofs_U);
+ locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
+ locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
//////////////////////
// INIT CONSTRAINTS //
//////////////////////
{
// setup system LS
dof_handler_LS.distribute_dofs (fe_LS);
- locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
- locally_relevant_dofs_LS);
+ locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
+ locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
// setup system U
dof_handler_U.distribute_dofs (fe_U);
- locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_U,
- locally_relevant_dofs_U);
+ locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
+ locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
// setup system P //
dof_handler_P.distribute_dofs (fe_P);
- locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_P,
- locally_relevant_dofs_P);
+ locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
+ locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs (dof_handler_P);
// init vectors for phi
locally_relevant_solution_phi.reinit(locally_owned_dofs_LS,locally_relevant_dofs_LS,mpi_communicator);
locally_relevant_solution_phi = 0;
degree_MAX=std::max(degree_LS,degree_U);
// setup system LS
dof_handler_LS.distribute_dofs(fe_LS);
- locally_owned_dofs_LS=dof_handler_LS.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler_LS,locally_relevant_dofs_LS);
+ locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs();
+ locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs(dof_handler_LS);
// setup system U
dof_handler_U.distribute_dofs(fe_U);
- locally_owned_dofs_U=dof_handler_U.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler_U,locally_relevant_dofs_U);
- // setup system P //
+ locally_owned_dofs_U = dof_handler_U.locally_owned_dofs();
+ locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs(dof_handler_U);
+ // setup system P
dof_handler_P.distribute_dofs(fe_P);
- locally_owned_dofs_P=dof_handler_P.locally_owned_dofs();
- DoFTools::extract_locally_relevant_dofs(dof_handler_P,locally_relevant_dofs_P);
+ locally_owned_dofs_P = dof_handler_P.locally_owned_dofs();
+ locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs(dof_handler_P);
}
template<int dim>
degree = std::max(degree_LS,degree_U);
// setup system LS
dof_handler_LS.distribute_dofs (fe_LS);
- locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
- locally_relevant_dofs_LS);
+ locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
+ locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
// setup system U
dof_handler_U.distribute_dofs (fe_U);
- locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_U,
- locally_relevant_dofs_U);
+ locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
+ locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
// setup system U for disp field
dof_handler_U_disp_field.distribute_dofs (fe_U_disp_field);
- locally_owned_dofs_U_disp_field = dof_handler_U_disp_field.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_U_disp_field,
- locally_relevant_dofs_U_disp_field);
+ locally_owned_dofs_U_disp_field = dof_handler_U_disp_field.locally_owned_dofs ();
+ locally_relevant_dofs_U_disp_field = DoFTools::extract_locally_relevant_dofs (dof_handler_U_disp_field);
// init vectors for phi
locally_relevant_solution_phi.reinit(locally_owned_dofs_LS,
locally_relevant_dofs_LS,
{
// setup system LS
dof_handler_LS.distribute_dofs (fe_LS);
- locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
- locally_relevant_dofs_LS);
+ locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
+ locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
// setup system U
dof_handler_U.distribute_dofs (fe_U);
- locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_U,
- locally_relevant_dofs_U);
+ locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
+ locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
// setup system P //
dof_handler_P.distribute_dofs (fe_P);
- locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler_P,
- locally_relevant_dofs_P);
+ locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
+ locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs (dof_handler_P);
init_constraints();
// init vectors for rho
locally_relevant_solution_rho.reinit (locally_owned_dofs_LS,locally_relevant_dofs_LS,mpi_communicator);