libMesh
Static Public Member Functions | List of all members
libMesh::Parallel::OpFunction< VectorValue< T > > Class Template Reference

#include <parallel_algebra.h>

Inheritance diagram for libMesh::Parallel::OpFunction< VectorValue< T > >:
[legend]

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 T>
class libMesh::Parallel::OpFunction< VectorValue< T > >

Definition at line 414 of file parallel_algebra.h.

Member Function Documentation

static MPI_Op libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::max ( )
staticinherited

Definition at line 355 of file parallel_algebra.h.

356  {
357  // _static_op never gets freed, but it only gets committed once
358  // per T, so it's not a *huge* memory leak...
359  static MPI_Op _static_op;
360  static bool _is_initialized = false;
361  if (!_is_initialized)
362  {
363  libmesh_call_mpi
364  (MPI_Op_create (vector_max, /*commute=*/ true,
365  &_static_op));
366 
367  _is_initialized = true;
368  }
369 
370  return _static_op;
371  }
static void vector_max(void *invec, void *inoutvec, int *len, MPI_Datatype *)
bool _is_initialized
Flag that tells if init() has been called.
Definition: libmesh.C:255
static MPI_Op libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::min ( )
staticinherited

Definition at line 372 of file parallel_algebra.h.

373  {
374  // _static_op never gets freed, but it only gets committed once
375  // per T, so it's not a *huge* memory leak...
376  static MPI_Op _static_op;
377  static bool _is_initialized = false;
378  if (!_is_initialized)
379  {
380  libmesh_call_mpi
381  (MPI_Op_create (vector_min, /*commute=*/ true,
382  &_static_op));
383 
384  _is_initialized = true;
385  }
386 
387  return _static_op;
388  }
static void vector_min(void *invec, void *inoutvec, int *len, MPI_Datatype *)
bool _is_initialized
Flag that tells if init() has been called.
Definition: libmesh.C:255
static MPI_Op libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::sum ( )
staticinherited

Definition at line 389 of file parallel_algebra.h.

390  {
391  // _static_op never gets freed, but it only gets committed once
392  // per T, so it's not a *huge* memory leak...
393  static MPI_Op _static_op;
394  static bool _is_initialized = false;
395  if (!_is_initialized)
396  {
397  libmesh_call_mpi
398  (MPI_Op_create (vector_sum, /*commute=*/ true,
399  &_static_op));
400 
401  _is_initialized = true;
402  }
403 
404  return _static_op;
405  }
bool _is_initialized
Flag that tells if init() has been called.
Definition: libmesh.C:255
static void vector_sum(void *invec, void *inoutvec, int *len, MPI_Datatype *)
static void libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::vector_max ( void *  invec,
void *  inoutvec,
int len,
MPI_Datatype *   
)
staticinherited

Definition at line 328 of file parallel_algebra.h.

329  {
330  V *in = static_cast<V *>(invec);
331  V *inout = static_cast<V *>(inoutvec);
332  for (int i=0; i != *len; ++i)
333  for (int d=0; d != LIBMESH_DIM; ++d)
334  inout[i](d) = std::max(in[i](d), inout[i](d));
335  }
long double max(long double a, double b)
static void libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::vector_min ( void *  invec,
void *  inoutvec,
int len,
MPI_Datatype *   
)
staticinherited

Definition at line 337 of file parallel_algebra.h.

338  {
339  V *in = static_cast<V *>(invec);
340  V *inout = static_cast<V *>(inoutvec);
341  for (int i=0; i != *len; ++i)
342  for (int d=0; d != LIBMESH_DIM; ++d)
343  inout[i](d) = std::min(in[i](d), inout[i](d));
344  }
long double min(long double a, double b)
static void libMesh::Parallel::TypeVectorOpFunction< VectorValue< T > >::vector_sum ( void *  invec,
void *  inoutvec,
int len,
MPI_Datatype *   
)
staticinherited

Definition at line 346 of file parallel_algebra.h.

347  {
348  V *in = static_cast<V *>(invec);
349  V *inout = static_cast<V *>(inoutvec);
350  for (int i=0; i != *len; ++i)
351  for (int d=0; d != LIBMESH_DIM; ++d)
352  inout[i](d) += in[i](d);
353  }

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