From: John P. <jwp...@gm...> - 2018-06-28 16:04:12
|
On Thu, Jun 28, 2018 at 9:49 AM, Renato Poli <re...@gm...> wrote: > Should I copy-paste code from NumericVector to build mine? > Any suggestion? > I definitely suggest _not_ copy/pasting code! Another alternative is to sync the solution vector to all processors so > that everybody can do the same calculation. > Seems a little inefficient, but is simple-and-easy. > If you are not using NumericVector, then there is a Communicator::max() overload that takes a std::vector<T> of values, but I believe this only works if there is a valid StandardType<T> specialization for the type T. Most libMesh objects (LibMeshInit, Mesh, EquationSystems, etc.) provide a Communicator object via the comm() method, e.g. mesh.comm().max(vec). -- John |