101 nptiso->inv_piston = 1. / nptiso->piston;
103 std::pow(box_geo->length()[nptiso->non_const_dim], nptiso->dimension);
110 auto const particle_number = cell_structure->local_particles().
size();
111 nptiso->particle_number =
112 boost::mpi::all_reduce(
::comm_cart, particle_number, std::plus<>());
114 auto const dt = get_time_step();
115 nptiso->half_dt_inv_piston = 0.5 * dt * nptiso->inv_piston;
116 nptiso->half_dt_inv_piston_and_Nf = -nptiso->half_dt_inv_piston;
117 if (particle_number > 1) {
118 nptiso->half_dt_inv_piston_and_Nf *=
119 (1. + 1. /
static_cast<double>(particle_number - 1));
122 auto &mass_list = nptiso->mass_list;
124 for (
auto &p : cell_structure->local_particles()) {
125 mass_list.emplace_back(p.mass());
127 mass_list.erase(std::ranges::unique(mass_list).begin(), mass_list.end());
130 mass_list.erase(std::ranges::unique(mass_list).begin(), mass_list.end());
131 std::ranges::sort(mass_list);
void gather_buffer(std::vector< T, Allocator > &buffer, boost::mpi::communicator const &comm, int root=0)
Gather buffer with different size on each node.