// get cell weights for a weighted repartitioning.
const std::vector<unsigned int> cell_weights = get_cell_weights();
-# ifdef DEBUG
// verify that the global sum of weights is larger than 0
- const auto local_weights_sum =
- std::accumulate(cell_weights.begin(),
- cell_weights.end(),
- std::uint64_t(0));
- const auto global_weights_sum =
- Utilities::MPI::sum(local_weights_sum, this->mpi_communicator);
- Assert(global_weights_sum > 0,
+ Assert(Utilities::MPI::sum(std::accumulate(cell_weights.begin(),
+ cell_weights.end(),
+ std::uint64_t(0)),
+ this->mpi_communicator) > 0,
ExcMessage(
"The global sum of weights over all active cells "
"is zero. Please verify how you generate weights."));
-# endif
PartitionWeights<dim, spacedim> partition_weights(cell_weights);
// get cell weights for a weighted repartitioning.
const std::vector<unsigned int> cell_weights = get_cell_weights();
-# ifdef DEBUG
// verify that the global sum of weights is larger than 0
- const auto local_weights_sum = std::accumulate(cell_weights.begin(),
- cell_weights.end(),
- std::uint64_t(0));
- const auto global_weights_sum =
- Utilities::MPI::sum(local_weights_sum, this->mpi_communicator);
- Assert(global_weights_sum > 0,
+ Assert(Utilities::MPI::sum(std::accumulate(cell_weights.begin(),
+ cell_weights.end(),
+ std::uint64_t(0)),
+ this->mpi_communicator) > 0,
ExcMessage(
"The global sum of weights over all active cells "
"is zero. Please verify how you generate weights."));
-# endif
PartitionWeights<dim, spacedim> partition_weights(cell_weights);
shared_tria->get_communicator(),
cell_weights);
-#ifdef DEBUG
// verify that the global sum of weights is larger than 0
- const auto global_cell_sum = std::accumulate(cell_weights.begin(),
- cell_weights.end(),
- std::uint64_t(0));
- Assert(global_cell_sum > 0,
+ Assert(std::accumulate(cell_weights.begin(),
+ cell_weights.end(),
+ std::uint64_t(0)) > 0,
ExcMessage("The global sum of weights over all active cells "
"is zero. Please verify how you generate weights."));
-#endif
}
// Call the other more general function
shared_tria->get_communicator(),
cell_weights);
-#ifdef DEBUG
// verify that the global sum of weights is larger than 0
- const auto global_cell_sum = std::accumulate(cell_weights.begin(),
- cell_weights.end(),
- std::uint64_t(0));
- Assert(global_cell_sum > 0,
+ Assert(std::accumulate(cell_weights.begin(),
+ cell_weights.end(),
+ std::uint64_t(0)) > 0,
ExcMessage("The global sum of weights over all active cells "
"is zero. Please verify how you generate weights."));
-#endif
}
// Call the other more general function