SolverControl control(1000, 1e-12 * std::sqrt(rhs.size()));
SolverCG<LinearAlgebra::distributed::Vector<double>> solver(control);
solver.solve(mf, sol, rhs, PreconditionIdentity());
+
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof.locally_owned_dofs_per_processor();
// gather all data at root
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
{
++i)
{
MPI_Recv(sol_gather_ptr,
- dof.locally_owned_dofs_per_processor()[i].n_elements(),
+ locally_owned_dofs_per_processor[i].n_elements(),
MPI_DOUBLE,
i,
i,
MPI_COMM_WORLD,
MPI_STATUS_IGNORE);
- sol_gather_ptr +=
- dof.locally_owned_dofs_per_processor()[i].n_elements();
+ sol_gather_ptr += locally_owned_dofs_per_processor[i].n_elements();
}
solution_gather0.print(deallog.get_file_stream());
}
++i)
AssertThrow(dof_handler.n_locally_owned_dofs_per_processor()[i] <= N,
ExcInternalError());
- AssertThrow(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
+ AssertThrow(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N), really_all(N);
// poor man's union operation
- for (unsigned int i = 0;
- i < dof_handler.n_locally_owned_dofs_per_processor().size();
+ for (unsigned int i = 0; i < n_locally_owned_dofs_per_processor.size();
++i)
for (unsigned int j = 0; j < N; ++j)
- if (dof_handler.locally_owned_dofs_per_processor()[i].is_element(j))
+ if (locally_owned_dofs_per_processor[i].is_element(j))
{
AssertThrow(all.is_element(j) == false, ExcInternalError());
all.add_index(j);
deallog << "Levels: " << tr.n_global_levels() << std::endl;
std::cout << "Levels: " << tr.n_global_levels() << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
deallog << "n_locally_owned_dofs_per_processor:" << std::endl;
- for (unsigned int i = 0;
- i < dofh.n_locally_owned_dofs_per_processor().size();
- ++i)
- deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
+ for (unsigned int i = 0; i < n_locally_owned_dofs_per_processor.size(); ++i)
+ deallog << n_locally_owned_dofs_per_processor[i] << std::endl;
deallog << "locally_owned_mg_dofs_per_processor:" << std::endl;
for (unsigned int lvl = 0; lvl < tr.n_global_levels(); ++lvl)
{
deallog << "level " << lvl << ":" << std::endl;
- const std::vector<IndexSet> &vec =
+ const std::vector<IndexSet> vec =
dofh.locally_owned_mg_dofs_per_processor(lvl);
for (unsigned int i = 0; i < vec.size(); ++i)
static const FE_Q<dim> fe(2);
dofh.distribute_dofs(fe);
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 0)
{
- deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor()
+ deallog << "dofh.n_dofs() " << n_locally_owned_dofs_per_processor
<< std::endl;
deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs()
<< std::endl;
static const FE_Q<dim> fe(2);
dofh.distribute_dofs(fe);
+ std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 0)
{
- deallog << "dofh.n_dofs() "
- << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+ deallog << "dofh.n_dofs() " << n_locally_owned_dofs_per_processor
+ << std::endl;
deallog << "dofh.n_locally_owned_dofs() "
<< dofh.n_locally_owned_dofs() << std::endl;
}
static const FE_Q<dim> fe(2);
dofh.distribute_dofs(fe);
+ std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 0)
{
- deallog << "dofh.n_dofs() "
- << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+ deallog << "dofh.n_dofs() " << n_locally_owned_dofs_per_processor
+ << std::endl;
deallog << "dofh.n_locally_owned_dofs() "
<< dofh.n_locally_owned_dofs() << std::endl;
}
static const FE_Q<dim> fe(2);
dofh.distribute_dofs(fe);
+ std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 0)
{
- deallog << "dofh.n_dofs() "
- << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+ deallog << "dofh.n_dofs() " << n_locally_owned_dofs_per_processor
+ << std::endl;
deallog << "dofh.n_locally_owned_dofs() "
<< dofh.n_locally_owned_dofs() << std::endl;
}
IndexSet dof_set;
DoFTools::extract_locally_active_dofs(dofh, dof_set);
+ const std::vector<IndexSet> owned_dofs =
+ dofh.locally_owned_dofs_per_processor();
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
{
dof_set.print(deallog);
++i)
{
deallog << "Dofs owned by processor " << i << ": ";
- dofh.locally_owned_dofs_per_processor()[i].print(deallog);
+ owned_dofs[i].print(deallog);
deallog << std::endl;
}
}
data_out.add_data_vector(x, "x");
data_out.build_patches();
+ std::vector<types::global_dof_index> n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 0)
{
- for (unsigned int i = 0;
- i < dofh.n_locally_owned_dofs_per_processor().size();
+ for (unsigned int i = 0; i < n_locally_owned_dofs_per_processor.size();
++i)
- deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
+ deallog << n_locally_owned_dofs_per_processor[i] << std::endl;
data_out.write_vtu(deallog.get_file_stream());
}
}
static const FE_Q<dim> fe(2);
dofh.distribute_dofs(fe);
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dofh.n_locally_owned_dofs_per_processor();
if (myid == 1)
{
- deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor()
+ deallog << "dofh.n_dofs() " << n_locally_owned_dofs_per_processor
<< std::endl;
deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs()
<< std::endl;
unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
constraints.print(deallog.get_file_stream());
- const std::vector<IndexSet> &locally_owned_dofs_vector =
+ const std::vector<IndexSet> locally_owned_dofs_vector =
dof_handler.locally_owned_dofs_per_processor();
IndexSet locally_active_dofs;
DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
IndexSet locally_active_dofs;
DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs);
- const std::vector<IndexSet> &locally_owned_dofs =
+ const std::vector<IndexSet> locally_owned_dofs =
dof_handler.locally_owned_dofs_per_processor();
std::map<types::global_dof_index, Point<dim>> supportPoints;
std::copy(renumbering.begin(),
renumbering.end(),
complete_renumbering.begin());
- unsigned int offset = renumbering.size();
+ unsigned int offset = renumbering.size();
+ const std::vector<IndexSet> dofs_per_proc =
+ dofh.locally_owned_dofs_per_processor();
for (unsigned int i = 1; i < nprocs; ++i)
{
if (myid == i)
MPI_COMM_WORLD);
else if (myid == 0)
MPI_Recv(&complete_renumbering[offset],
- dofh.locally_owned_dofs_per_processor()[i].n_elements(),
+ dofs_per_proc[i].n_elements(),
Utilities::MPI::internal::mpi_type_id(
&complete_renumbering[0]),
i,
i,
MPI_COMM_WORLD,
MPI_STATUSES_IGNORE);
- offset += dofh.locally_owned_dofs_per_processor()[i].n_elements();
+ offset += dofs_per_proc[i].n_elements();
}
if (myid == 0)
std::copy(renumbering.begin(),
renumbering.end(),
complete_renumbering.begin());
- unsigned int offset = renumbering.size();
+ unsigned int offset = renumbering.size();
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dofh.locally_owned_dofs_per_processor();
for (unsigned int i = 1; i < nprocs; ++i)
{
if (myid == i)
MPI_COMM_WORLD);
else if (myid == 0)
MPI_Recv(&complete_renumbering[offset],
- dofh.locally_owned_dofs_per_processor()[i].n_elements(),
+ locally_owned_dofs_per_processor[i].n_elements(),
Utilities::MPI::internal::mpi_type_id(
&complete_renumbering[0]),
i,
i,
MPI_COMM_WORLD,
MPI_STATUSES_IGNORE);
- offset += dofh.locally_owned_dofs_per_processor()[i].n_elements();
+ offset += locally_owned_dofs_per_processor[i].n_elements();
}
if (myid == 0)
pcout << " Number of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl
<< " ";
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
for (unsigned int i = 0;
i < Utilities::MPI::n_mpi_processes(mpi_communicator);
++i)
- pcout << dof_handler.n_locally_owned_dofs_per_processor()[i] << '+';
+ pcout << n_locally_owned_dofs_per_processor[i] << '+';
pcout << std::endl;
assemble_system();
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
}
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
}
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
// }
// deallog << " sum: " << sum << std::endl;
+ const std::vector<types::global_dof_index>
+ n_locally_owned_dofs_per_processor =
+ dof_handler.n_locally_owned_dofs_per_processor();
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ n_locally_owned_dofs_per_processor[triangulation
+ .locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(std::accumulate(
- dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
+ Assert(std::accumulate(n_locally_owned_dofs_per_processor.begin(),
+ n_locally_owned_dofs_per_processor.end(),
+ 0U) == N,
ExcInternalError());
+ const std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());
deallog << std::endl;
Assert(dof_handler.n_locally_owned_dofs() ==
- dof_handler.n_locally_owned_dofs_per_processor()
- [triangulation.locally_owned_subdomain()],
+ v[triangulation.locally_owned_subdomain()],
ExcInternalError());
Assert(dof_handler.n_locally_owned_dofs() ==
dof_handler.locally_owned_dofs().n_elements(),
const unsigned int N = dof_handler.n_dofs();
Assert(dof_handler.n_locally_owned_dofs() <= N, ExcInternalError());
- Assert(
- std::accumulate(dof_handler.n_locally_owned_dofs_per_processor().begin(),
- dof_handler.n_locally_owned_dofs_per_processor().end(),
- 0U) == N,
- ExcInternalError());
+ Assert(std::accumulate(v.begin(), v.end(), 0U) == N, ExcInternalError());
+ std::vector<IndexSet> locally_owned_dofs_per_processor =
+ dof_handler.locally_owned_dofs_per_processor();
IndexSet all(N);
- for (unsigned int i = 0;
- i < dof_handler.locally_owned_dofs_per_processor().size();
- ++i)
+ for (unsigned int i = 0; i < locally_owned_dofs_per_processor.size(); ++i)
{
- IndexSet intersect =
- all & dof_handler.locally_owned_dofs_per_processor()[i];
+ IndexSet intersect = all & locally_owned_dofs_per_processor[i];
Assert(intersect.n_elements() == 0, ExcInternalError());
- all.add_indices(dof_handler.locally_owned_dofs_per_processor()[i]);
+ all.add_indices(locally_owned_dofs_per_processor[i]);
}
Assert(all == complete_index_set(N), ExcInternalError());