102 nptiso->inv_piston = 1. / nptiso->piston;
104 std::pow(box_geo->length()[nptiso->non_const_dim], nptiso->dimension);
111 auto const particle_number = cell_structure->local_particles().
size();
112 nptiso->particle_number =
113 boost::mpi::all_reduce(
::comm_cart, particle_number, std::plus<>());
115 auto const dt = get_time_step();
116 nptiso->half_dt_inv_piston = 0.5 * dt * nptiso->inv_piston;
117 nptiso->half_dt_inv_piston_and_Nf = -nptiso->half_dt_inv_piston;
118 if (particle_number > 1) {
119 nptiso->half_dt_inv_piston_and_Nf *=
120 (1. + 1. /
static_cast<double>(particle_number - 1));
123 auto &mass_list = nptiso->mass_list;
125 for (
auto &p : cell_structure->local_particles()) {
126 mass_list.emplace_back(p.mass());
128 mass_list.erase(std::ranges::unique(mass_list).begin(), mass_list.end());
131 mass_list.erase(std::ranges::unique(mass_list).begin(), mass_list.end());
132 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.