ML Version of the Day
Loading...
Searching...
No Matches
MLAPI::Space Class Reference

Specifies the number and distribution among processes of elements. More...

#include <MLAPI_Space.h>

Inheritance diagram for MLAPI::Space:
Collaboration diagram for MLAPI::Space:

Public Member Functions

 Space ()
 Default constructor, defines an empty space.
 Space (const int NumGlobalElements, const int NumMyElements=-1)
 Constructor with specified number of global and local elements.
 Space (const Epetra_Map &Map)
 Constructor with specified Epetra_Map.
 Space (const int NumGlobalElements, const int NumMyElements, const int *MyGlobalElements)
 Constructor for non-linear distributions.
 Space (const Space &RHS)
 Copy constructor.
 ~Space ()
 Destructor.
void Reshape ()
 Resets this object.
void Reshape (const int NumGlobalElements, const int NumMyElements=-1)
 Resets the dimension of the space by specifying the local number of elements.
void Reshape (const int NumGlobalElements, const int NumMyElements, const int *MyGlobalElements)
 Reset the dimension of the space by specifying the local number of elements and their global numbering (starting from 0).
Spaceoperator= (const Space &RHS)
 Operator =.
bool operator== (const Space &RHS) const
 Returns true if this Space is equivalent to RHS.
bool operator!= (const Space &RHS) const
 Returns true if this Space is not equivalent to RHS.
Spaceoperator= (const std::string &Label)
 Sets the Label of this object.
int operator() (int i) const
 Returns the global ID of local element i.
int GetNumMyElements () const
 Returns the local number of elements on the calling process.
int GetNumGlobalElements () const
 Returns the global number of elements.
int GetOffset () const
 Returns the global ID of the first element on the calling process (for linear distributions only).
bool IsLinear () const
 Returns true if the decomposition among processors is linear.
const Teuchos::RefCountPtr< Epetra_IntSerialDenseVectorGetRCPMyGlobalElements () const
 Returns a pointer to the list of global nodes.
std::ostream & Print (std::ostream &os, const bool verbose=true) const
 Prints on std::ostream basic information about this object.
Public Member Functions inherited from MLAPI::BaseObject
 BaseObject ()
 Constructor with empty label.
 BaseObject (const std::string &Label)
 Constructor with given Label.
virtual ~BaseObject ()
 Destructor.
void SetLabel (const std::string &Label)
 Sets the Label of this object to Label.
const std::string & GetLabel () const
 Returns the Label of this object.

Detailed Description

Specifies the number and distribution among processes of elements.

Author
Marzio Sala, SNL 9214
Date
Last updated on Feb-05.

Constructor & Destructor Documentation

◆ Space() [1/5]

MLAPI::Space::Space ( )
inline

Default constructor, defines an empty space.

Referenced by operator!=(), operator=(), operator=(), operator==(), and Space().

◆ Space() [2/5]

MLAPI::Space::Space ( const int NumGlobalElements,
const int NumMyElements = -1 )
inline

Constructor with specified number of global and local elements.

Constructs a space with linear distribution.

Parameters
NumGlobalElements- (In) number of global elements.
NumMyElements- (In) number of local elements. If different from -1, then eithere NumGlobalElements == -1, or the sum across of processors of NumMyElements equals NumGlobalElements

References Reshape().

◆ Space() [3/5]

MLAPI::Space::Space ( const Epetra_Map & Map)
inline

◆ Space() [4/5]

MLAPI::Space::Space ( const int NumGlobalElements,
const int NumMyElements,
const int * MyGlobalElements )
inline

Constructor for non-linear distributions.

Parameters
NumGlobalElements- (In) number of global elements. Set to -1 to compute it automatically.
NumMyElements- (In) number of local elements. Cannot be set to -1.
MyGlobalElements- (In) contains the global ID of each local node.
Note
Global ID always starts from 0.

References Reshape().

◆ Space() [5/5]

MLAPI::Space::Space ( const Space & RHS)
inline

Member Function Documentation

◆ GetNumGlobalElements()

◆ GetNumMyElements()

int MLAPI::Space::GetNumMyElements ( ) const
inline

Returns the local number of elements on the calling process.

Referenced by MLAPI::MATLABStream::operator<<(), MLAPI::MATLABStream::operator<<(), operator=(), operator==(), Print(), and Space().

◆ GetOffset()

int MLAPI::Space::GetOffset ( ) const
inline

Returns the global ID of the first element on the calling process (for linear distributions only).

Referenced by operator()(), operator=(), Print(), and Space().

◆ GetRCPMyGlobalElements()

const Teuchos::RefCountPtr< Epetra_IntSerialDenseVector > MLAPI::Space::GetRCPMyGlobalElements ( ) const
inline

Returns a pointer to the list of global nodes.

Referenced by operator=(), and Space().

◆ IsLinear()

bool MLAPI::Space::IsLinear ( ) const
inline

Returns true if the decomposition among processors is linear.

Referenced by operator()(), operator=(), operator==(), Print(), and Space().

◆ operator!=()

bool MLAPI::Space::operator!= ( const Space & RHS) const
inline

Returns true if this Space is not equivalent to RHS.

References Space().

◆ operator()()

int MLAPI::Space::operator() ( int i) const
inline

Returns the global ID of local element i.

References GetOffset(), and IsLinear().

◆ operator=() [1/2]

Space & MLAPI::Space::operator= ( const Space & RHS)
inline

◆ operator=() [2/2]

Space & MLAPI::Space::operator= ( const std::string & Label)
inline

Sets the Label of this object.

References MLAPI::BaseObject::SetLabel(), and Space().

◆ operator==()

bool MLAPI::Space::operator== ( const Space & RHS) const
inline

Returns true if this Space is equivalent to RHS.

References GetNumGlobalElements(), GetNumMyElements(), IsLinear(), and Space().

◆ Print()

std::ostream & MLAPI::Space::Print ( std::ostream & os,
const bool verbose = true ) const
inlinevirtual

◆ Reshape() [1/3]

void MLAPI::Space::Reshape ( )
inline

Resets this object.

Referenced by MLAPI::MultiVector::Reshape(), Space(), Space(), and Space().

◆ Reshape() [2/3]

void MLAPI::Space::Reshape ( const int NumGlobalElements,
const int NumMyElements,
const int * MyGlobalElements )
inline

Reset the dimension of the space by specifying the local number of elements and their global numbering (starting from 0).

References MLAPI::GetML_Comm(), MLAPI::GetMyPID(), and MLAPI::GetNumProcs().

◆ Reshape() [3/3]

void MLAPI::Space::Reshape ( const int NumGlobalElements,
const int NumMyElements = -1 )
inline

Resets the dimension of the space by specifying the local number of elements.

References MLAPI::GetML_Comm(), MLAPI::GetMyPID(), and MLAPI::GetNumProcs().


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