libMesh
Public Member Functions | Protected Attributes | List of all members
libMesh::ParallelObject Class Reference

This class forms the base class for all other classes that are expected to be implemented in parallel. More...

#include <parallel_object.h>

Inheritance diagram for libMesh::ParallelObject:
[legend]

Public Member Functions

 ParallelObject (const Parallel::Communicator &comm_in)
 Constructor. More...
 
 ParallelObject (const ParallelObject &other)
 Copy Constructor. More...
 
ParallelObjectoperator= (const ParallelObject &libmesh_dbg_var(other))
 "Assignment" operator. More...
 
virtual ~ParallelObject ()
 Destructor. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Attributes

const Parallel::Communicator_communicator
 

Detailed Description

This class forms the base class for all other classes that are expected to be implemented in parallel.

Each ParallelObject requires a Parallel::Communicator object for construction.

Author
Benjamin S. Kirk
Date
2013

Definition at line 48 of file parallel_object.h.

Constructor & Destructor Documentation

◆ ParallelObject() [1/2]

libMesh::ParallelObject::ParallelObject ( const Parallel::Communicator comm_in)

Constructor.

Requires a reference to the communicator that defines the object's parallel decomposition.

Definition at line 56 of file parallel_object.h.

56  :
57  _communicator(comm_in)
58  {}
const Parallel::Communicator & _communicator

◆ ParallelObject() [2/2]

libMesh::ParallelObject::ParallelObject ( const ParallelObject other)

Copy Constructor.

Definition at line 63 of file parallel_object.h.

63  :
64  _communicator(other._communicator)
65  {}
const Parallel::Communicator & _communicator

◆ ~ParallelObject()

virtual libMesh::ParallelObject::~ParallelObject ( )
virtual

Destructor.

Virtual because we are a base class.

Definition at line 81 of file parallel_object.h.

81 {}

Member Function Documentation

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References _communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ operator=()

ParallelObject& libMesh::ParallelObject::operator= ( const ParallelObject libmesh_dbg_varother)

"Assignment" operator.

Simply asserts our references are identical because this is the only thing that makes sense

Definition at line 72 of file parallel_object.h.

References _communicator, and libMesh::Parallel::Communicator::_communicator.

73  {
74  libmesh_assert_equal_to (&_communicator, &other._communicator);
75  return *this;
76  }
const Parallel::Communicator & _communicator

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protected

Definition at line 105 of file parallel_object.h.

Referenced by comm(), n_processors(), operator=(), and processor_id().


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