155 {
162 int saw_pp_g = 0, saw_wall_g = 0;
163 double min_pp_g = 0., min_y_g = 0., rc_g = 0.;
164 MPI_Allreduce(&saw_pp, &saw_pp_g, 1, MPI_INT, MPI_MAX,
166 MPI_Allreduce(&saw_wall, &saw_wall_g, 1, MPI_INT, MPI_MAX,
168 MPI_Allreduce(&min_pp, &min_pp_g, 1, MPI_DOUBLE, MPI_MIN,
170 MPI_Allreduce(&min_y, &min_y_g, 1, MPI_DOUBLE, MPI_MIN,
172 MPI_Allreduce(&rc, &rc_g, 1, MPI_DOUBLE, MPI_MAX,
174 saw_pp = saw_pp_g;
175 saw_wall = saw_wall_g;
176 min_pp = min_pp_g;
177 min_y = min_y_g;
178 rc = rc_g;
179 }
180 if (!saw_pp)
181 throw std::runtime_error(std::format(
182 "particle-particle contact missing: min_gap={:.6e} Rc={:.6e}", min_pp,
183 rc));
184 if (!saw_wall)
185 throw std::runtime_error(std::format(
186 "particle-wall contact missing: min_grain_y={:.6e} Rc={:.6e}", min_y,
187 rc));
190 "contacts OK: min_pp_gap={:.6e} min_grain_y={:.6e} Rc={:.6e}\n",
191 min_pp, min_y, rc));
192 }
void print(const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
Prints formatted information.
int mpiSize()
Get size (number) of processors.
int mpiRank()
get rank (id) of this processor
MPI_Comm mpiComm()
Get MPI comm.