libMesh::Parallel::TypeVectorOpFunction< V > Class Template Reference

#include <parallel_algebra.h>

Static Public Member Functions

static void vector_max (void *invec, void *inoutvec, int *len, MPI_Datatype *)
 
static void vector_min (void *invec, void *inoutvec, int *len, MPI_Datatype *)
 
static void vector_sum (void *invec, void *inoutvec, int *len, MPI_Datatype *)
 
static MPI_Op max ()
 
static MPI_Op min ()
 
static MPI_Op sum ()
 

Detailed Description

template<typename V>
class libMesh::Parallel::TypeVectorOpFunction< V >

Definition at line 255 of file parallel_algebra.h.

Member Function Documentation

◆ max()

template<typename V>
static MPI_Op libMesh::Parallel::TypeVectorOpFunction< V >::max ( )
inlinestatic

Definition at line 286 of file parallel_algebra.h.

287  {
288  // _static_op never gets freed, but it only gets committed once
289  // per T, so it's not a *huge* memory leak...
290  static MPI_Op _static_op;
291  static bool _is_initialized = false;
292  if (!_is_initialized)
293  {
294  libmesh_call_mpi
295  (MPI_Op_create (vector_max, /*commute=*/ true,
296  &_static_op));
297 
298  _is_initialized = true;
299  }
300 
301  return _static_op;
302  }
static void vector_max(void *invec, void *inoutvec, int *len, MPI_Datatype *)

◆ min()

template<typename V>
static MPI_Op libMesh::Parallel::TypeVectorOpFunction< V >::min ( )
inlinestatic

Definition at line 303 of file parallel_algebra.h.

304  {
305  // _static_op never gets freed, but it only gets committed once
306  // per T, so it's not a *huge* memory leak...
307  static MPI_Op _static_op;
308  static bool _is_initialized = false;
309  if (!_is_initialized)
310  {
311  libmesh_call_mpi
312  (MPI_Op_create (vector_min, /*commute=*/ true,
313  &_static_op));
314 
315  _is_initialized = true;
316  }
317 
318  return _static_op;
319  }
static void vector_min(void *invec, void *inoutvec, int *len, MPI_Datatype *)

◆ sum()

template<typename V>
static MPI_Op libMesh::Parallel::TypeVectorOpFunction< V >::sum ( )
inlinestatic

Definition at line 320 of file parallel_algebra.h.

321  {
322  // _static_op never gets freed, but it only gets committed once
323  // per T, so it's not a *huge* memory leak...
324  static MPI_Op _static_op;
325  static bool _is_initialized = false;
326  if (!_is_initialized)
327  {
328  libmesh_call_mpi
329  (MPI_Op_create (vector_sum, /*commute=*/ true,
330  &_static_op));
331 
332  _is_initialized = true;
333  }
334 
335  return _static_op;
336  }
static void vector_sum(void *invec, void *inoutvec, int *len, MPI_Datatype *)

◆ vector_max()

template<typename V>
static void libMesh::Parallel::TypeVectorOpFunction< V >::vector_max ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
inlinestatic

Definition at line 259 of file parallel_algebra.h.

Referenced by libMesh::Parallel::TypeVectorOpFunction< Point >::max().

260  {
261  V *in = static_cast<V *>(invec);
262  V *inout = static_cast<V *>(inoutvec);
263  for (int i=0; i != *len; ++i)
264  for (int d=0; d != LIBMESH_DIM; ++d)
265  inout[i](d) = std::max(in[i](d), inout[i](d));
266  }
long double max(long double a, double b)

◆ vector_min()

template<typename V>
static void libMesh::Parallel::TypeVectorOpFunction< V >::vector_min ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
inlinestatic

Definition at line 268 of file parallel_algebra.h.

Referenced by libMesh::Parallel::TypeVectorOpFunction< Point >::min().

269  {
270  V *in = static_cast<V *>(invec);
271  V *inout = static_cast<V *>(inoutvec);
272  for (int i=0; i != *len; ++i)
273  for (int d=0; d != LIBMESH_DIM; ++d)
274  inout[i](d) = std::min(in[i](d), inout[i](d));
275  }
long double min(long double a, double b)

◆ vector_sum()

template<typename V>
static void libMesh::Parallel::TypeVectorOpFunction< V >::vector_sum ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
inlinestatic

Definition at line 277 of file parallel_algebra.h.

Referenced by libMesh::Parallel::TypeVectorOpFunction< Point >::sum().

278  {
279  V *in = static_cast<V *>(invec);
280  V *inout = static_cast<V *>(inoutvec);
281  for (int i=0; i != *len; ++i)
282  for (int d=0; d != LIBMESH_DIM; ++d)
283  inout[i](d) += in[i](d);
284  }

The documentation for this class was generated from the following file: