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

#include <parallel_algebra.h>

Inheritance diagram for libMesh::Parallel::OpFunction< Point >:
[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<>
class libMesh::Parallel::OpFunction< Point >

Definition at line 348 of file parallel_algebra.h.

Member Function Documentation

◆ max()

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

Definition at line 286 of file parallel_algebra.h.

References libMesh::Parallel::TypeVectorOpFunction< V >::vector_max().

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()

static MPI_Op libMesh::Parallel::TypeVectorOpFunction< Point >::min ( )
staticinherited

Definition at line 303 of file parallel_algebra.h.

References libMesh::Parallel::TypeVectorOpFunction< V >::vector_min().

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()

static MPI_Op libMesh::Parallel::TypeVectorOpFunction< Point >::sum ( )
staticinherited

Definition at line 320 of file parallel_algebra.h.

References libMesh::Parallel::TypeVectorOpFunction< V >::vector_sum().

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()

static void libMesh::Parallel::TypeVectorOpFunction< Point >::vector_max ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
staticinherited

Definition at line 259 of file parallel_algebra.h.

References std::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()

static void libMesh::Parallel::TypeVectorOpFunction< Point >::vector_min ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
staticinherited

Definition at line 268 of file parallel_algebra.h.

References std::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()

static void libMesh::Parallel::TypeVectorOpFunction< Point >::vector_sum ( void *  invec,
void *  inoutvec,
int *  len,
MPI_Datatype *   
)
staticinherited

Definition at line 277 of file parallel_algebra.h.

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: