File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ namespace MC
9393 /* *
9494 * @brief Main constructor
9595 */
96- ReactorDomain (std::span<double > volumes, std::span<const size_t > neighbors);
96+ explicit ReactorDomain (std::span<double > volumes);
97+
98+ ReactorDomain (double total_volume, std::size_t size);
99+
97100 /* *
98101 * @brief Default destructor
99102 *
Original file line number Diff line number Diff line change @@ -43,10 +43,11 @@ namespace MC
4343 uint64_t n_particles,
4444 std::size_t n_samples,
4545 std::span<double > volumes,
46- std::span<const size_t > neighbors ,
46+ std::span<const size_t > _neighbors ,
4747 bool uniform_mc_init,
4848 double & total_mass)
4949 {
50+ (void )_neighbors; // TODO remove
5051 if constexpr (ConstWeightModelType<Model>)
5152 {
5253 if (_logger)
@@ -58,7 +59,7 @@ namespace MC
5859 }
5960
6061 auto unit = std::make_unique<MonteCarloUnit>();
61- unit->domain = ReactorDomain (volumes, neighbors );
62+ unit->domain = ReactorDomain (volumes);
6263
6364 // bool flag_virtual = unit->domain.getNumberCompartments() == 1;
6465 auto container = ParticlesContainer<Model>(
Original file line number Diff line number Diff line change @@ -22,19 +22,26 @@ namespace MC
2222 Kokkos::deep_copy (this ->inner .liquid_volume , tmp_host_volume);
2323 }
2424
25- ReactorDomain::ReactorDomain () = default ;
25+ ReactorDomain::ReactorDomain (double total_volume, std::size_t size)
26+ : _total_volume(total_volume), size(size)
27+ {
28+ }
2629
27- ReactorDomain::ReactorDomain (std::span<double > volumes,
28- std::span<const size_t > neighbors)
29- : _total_volume(std::reduce(volumes.begin(), volumes.end(), 0 .)),
30- size (volumes.size())
30+ ReactorDomain::ReactorDomain () : ReactorDomain(0 , 0 )
3131
3232 {
3333 // const auto n_rows = this->getNumberCompartments();
3434 // const auto n_cols = neighbors.size() / n_rows;
3535 // setLiquidNeighbors(n_rows, n_cols, neighbors);
3636 }
3737
38+ ReactorDomain::ReactorDomain (std::span<double > volumes)
39+ : ReactorDomain(std::reduce(volumes.begin(), volumes.end(), 0 .),
40+ volumes.size())
41+
42+ {
43+ }
44+
3845 void ReactorDomain::update (std::span<const double > newliquid_volume,
3946 std::span<const std::size_t > neighors_flat,
4047 std::span<const double > out_flows,
You can’t perform that action at this time.
0 commit comments