8#include <compile_time_options.h>
12#include <deal.II/base/mpi.h>
13#include <deal.II/base/utilities.h>
43 template <
typename... Args>
45 const std::string &subsection,
48 const auto &ensemble = mpi_ensemble.
ensemble();
49 const auto &n_ensembles = mpi_ensemble.
n_ensembles();
50 unsigned int digits = dealii::Utilities::needed_digits(n_ensembles);
52 payload_.resize(n_ensembles);
53 for (
int n = 0; n < n_ensembles; ++n) {
55 auto modified = subsection;
58 "/ensemble " + dealii::Utilities::int_to_string(n, digits);
60 std::make_unique<T>(std::forward<Args>(args)..., modified);
63 ensemble_payload_ = payload_[ensemble].get();
72 return *ensemble_payload_;
79 operator const T &()
const
81 return *ensemble_payload_;
85 std::vector<std::unique_ptr<T>> payload_;
MPIEnsembleContainer(const MPIEnsemble &mpi_ensemble, const std::string &subsection, Args &&...args)
auto & n_ensembles() const