Utilities::MPI::ConsensusAlgorithms::Selector<
std::vector<std::pair<types::global_dof_index, types::global_dof_index>>,
- std::vector<unsigned int>>(constrained_indices_process, mpi_communicator)
- .run();
+ std::vector<unsigned int>>
+ consensus_algorithm;
+ consensus_algorithm.run(constrained_indices_process, mpi_communicator);
// step 2: collect all locally owned constraints
const auto constrained_indices_by_ranks =
Utilities::MPI::ConsensusAlgorithms::Selector<
std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>,
- std::vector<unsigned int>>(locally_relevant_dofs_process,
- mpi_communicator)
- .run();
+ std::vector<unsigned int>>
+ consensus_algorithm;
+ consensus_algorithm.run(locally_relevant_dofs_process, mpi_communicator);
const auto locally_relevant_dofs_by_ranks =
locally_relevant_dofs_process.get_requesters();
out.precision(precision);
- const unsigned int n_elements = this->n_elements();
+ const unsigned int n_elements = this->locally_owned_size();
for (unsigned int i = 0; i < n_elements; ++i)
out << this->values[i] << ' ';
out << '\n' << std::flush;
inline typename ReadWriteVector<Number>::iterator
ReadWriteVector<Number>::end()
{
- return values.get() + this->n_elements();
+ return values.get() + this->locally_owned_size();
}
inline typename ReadWriteVector<Number>::const_iterator
ReadWriteVector<Number>::end() const
{
- return values.get() + this->n_elements();
+ return values.get() + this->locally_owned_size();
}
inline Number
ReadWriteVector<Number>::local_element(const size_type local_index) const
{
- AssertIndexRange(local_index, this->n_elements());
+ AssertIndexRange(local_index, this->locally_owned_size());
return values[local_index];
}
inline Number &
ReadWriteVector<Number>::local_element(const size_type local_index)
{
- AssertIndexRange(local_index, this->n_elements());
+ AssertIndexRange(local_index, this->locally_owned_size());
return values[local_index];
}
ReadWriteVector<Number>::reinit(const ReadWriteVector<Number2> &v,
const bool omit_zeroing_entries)
{
- resize_val(v.n_elements());
+ resize_val(v.locally_owned_size());
stored_elements = v.get_stored_elements();
FunctorTemplate<Functor> functor(*this, func);
dealii::internal::VectorOperations::parallel_for(functor,
0,
- n_elements(),
+ locally_owned_size(),
thread_loop_partitioner);
}
return *this;
thread_loop_partitioner = in_vector.thread_loop_partitioner;
- if (n_elements() != in_vector.n_elements())
+ if (locally_owned_size() != in_vector.locally_owned_size())
reinit(in_vector, true);
- if (n_elements() > 0)
+ if (locally_owned_size() > 0)
{
dealii::internal::VectorOperations::Vector_copy<Number, Number> copier(
in_vector.values.get(), values.get());
dealii::internal::VectorOperations::parallel_for(
- copier, 0, n_elements(), thread_loop_partitioner);
+ copier, 0, locally_owned_size(), thread_loop_partitioner);
}
return *this;
ReadWriteVector<Number>::operator=(const ReadWriteVector<Number2> &in_vector)
{
thread_loop_partitioner = in_vector.thread_loop_partitioner;
- if (n_elements() != in_vector.n_elements())
+ if (locally_owned_size() != in_vector.locally_owned_size())
reinit(in_vector, true);
- if (n_elements() > 0)
+ if (locally_owned_size() > 0)
{
dealii::internal::VectorOperations::Vector_copy<Number, Number2> copier(
in_vector.values.get(), values.get());
dealii::internal::VectorOperations::parallel_for(
- copier, 0, n_elements(), thread_loop_partitioner);
+ copier, 0, locally_owned_size(), thread_loop_partitioner);
}
return *this;
ExcMessage("Only 0 can be assigned to a vector."));
(void)s;
- const size_type this_size = n_elements();
+ const size_type this_size = locally_owned_size();
if (this_size > 0)
{
dealii::internal::VectorOperations::Vector_set<Number> setter(
ReadWriteVector<Number>::memory_consumption() const
{
std::size_t memory = sizeof(*this);
- memory += sizeof(Number) * static_cast<std::size_t>(this->n_elements());
+ memory +=
+ sizeof(Number) * static_cast<std::size_t>(this->locally_owned_size());
memory += stored_elements.memory_consumption();
std::vector<
std::pair<types::global_cell_index, types::global_cell_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
}
for (unsigned i = 0;
std::vector<
std::pair<types::global_cell_index, types::global_cell_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
this->is_dst_locally_owned = is_dst_locally_owned;
this->is_dst_remote = is_dst_remote;
touch_count_.copy_locally_owned_data_from(touch_count);
- for (unsigned int i = 0; i < touch_count_.local_size(); ++i)
+ for (unsigned int i = 0; i < touch_count_.locally_owned_size(); ++i)
touch_count_.local_element(i) =
constraints_fine.is_constrained(
touch_count_.get_partitioner()->local_to_global(i)) ?
std::vector<
std::pair<types::global_cell_index, types::global_cell_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
bool all_cells_found = true;
std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, comm);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, comm);
return owning_ranks;
}
std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
// setup map of processes from where this rank will receive values
{
std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
{
ghost_targets_data = {};
std::vector<
std::pair<types::global_cell_index, types::global_cell_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, communicator);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, communicator);
}
const auto tria =
const auto partitioner =
tria->global_active_cell_index_partitioner().lock();
- std::vector<unsigned int> weights(partitioner->local_size());
+ std::vector<unsigned int> weights(partitioner->locally_owned_size());
const auto mpi_communicator = tria_in.get_communicator();
const auto n_subdomains = Utilities::MPI::n_mpi_processes(mpi_communicator);
{
#ifdef DEAL_II_WITH_MPI
if (tria.get_communicator() == MPI_COMM_NULL)
- AssertDimension(partition.local_size(), 0);
+ AssertDimension(partition.locally_owned_size(), 0);
#endif
if (partition.size() == 0)
const std::vector<unsigned int> relevant_processes = [&]() {
std::set<unsigned int> relevant_processes;
- for (unsigned int i = 0; i < partition.local_size(); ++i)
+ for (unsigned int i = 0; i < partition.locally_owned_size(); ++i)
relevant_processes.insert(
static_cast<unsigned int>(partition.local_element(i)));
for (const auto &partition : partitions_mg)
- for (unsigned int i = 0; i < partition.local_size(); ++i)
+ for (unsigned int i = 0; i < partition.locally_owned_size(); ++i)
relevant_processes.insert(
static_cast<unsigned int>(partition.local_element(i)));
for (unsigned int i = row_starts[cell * n_components].first;
i < row_starts[(cell + 1) * n_components].first;
++i)
- if (dof_indices[i] >= part.local_size())
+ if (dof_indices[i] >= part.locally_owned_size())
ghost_indices.push_back(part.local_to_global(dof_indices[i]));
const unsigned int fe_index =
for (unsigned int i = row_starts_plain_indices[cell];
i < row_starts_plain_indices[cell] + dofs_this_cell;
++i)
- if (plain_dof_indices[i] >= part.local_size())
+ if (plain_dof_indices[i] >= part.locally_owned_size())
ghost_indices.push_back(
part.local_to_global(plain_dof_indices[i]));
}
const unsigned int index =
dof_indices_contiguous[dof_access_cell][cell_no];
if (flag || (index != numbers::invalid_unsigned_int &&
- index >= part.local_size()))
+ index >= part.locally_owned_size()))
{
const unsigned int stride =
dof_indices_interleave_strides[dof_access_cell][cell_no];
const unsigned int index =
dof_indices_contiguous[dof_access_cell][cell_no];
if (flag || (index != numbers::invalid_unsigned_int &&
- index >= part.local_size()))
+ index >= part.locally_owned_size()))
{
const unsigned int stride =
dof_indices_interleave_strides[dof_access_cell][cell_no];
std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>,
std::vector<unsigned int>>
- consensus_algorithm(process, comm);
- consensus_algorithm.run();
+ consensus_algorithm;
+ consensus_algorithm.run(process, comm);
// decompress ghost_indices_within_larger_ghost_set for simpler
// data access during setup