LifeV
MapVector< MapType > Class Template Reference

This class is used to store maps that will be used for block defined problems. More...

#include <MapVector.hpp>

+ Collaboration diagram for MapVector< MapType >:

Private Attributes

std::vector< map_TypeM_vector
 

Public Types

typedef MapType map_Type
 Type of the map. More...
 

Constructors & Destructor

 MapVector ()
 Empty constructor. More...
 
 MapVector (const MapVector< map_Type > &otherMapVector)
 Copy constructor. More...
 
 MapVector (const map_Type &map)
 Constructor with one map. More...
 
 MapVector (const map_Type &map1, const map_Type &map2)
 Constructor with two maps. More...
 
 MapVector (const MapVector< map_Type > &vector, const map_Type &map)
 Concatenation constructor. More...
 
 ~MapVector ()
 Destructor. More...
 

Operators

MapVector< map_Typeoperator= (const MapVector< map_Type > &vector)
 Assignement operator. More...
 
const map_Typeoperator[] (UInt i) const
 Access to the ith map (read only) More...
 
map_Typeoperator[] (UInt i)
 Access to the ith map (read-write) More...
 
MapVector< map_Typeoperator| (const map_Type &map) const
 Juxtaposition operator for a vector of maps and a map. More...
 

Methods

UInt nbMap () const
 Returns the number of maps stored. More...
 
UInt mapSize (UInt i) const
 Returns the size of the ith map stored (global number of ids) More...
 
void showMe (std::ostream &output=std::cout) const
 Display internal state. More...
 
map_Type totalMap () const
 Return the map made by concatenating all the maps of the vector. More...
 
void addMap (const map_Type &newMap)
 Add a map into this vector (at the end of the vector) More...
 

Get Methods

const map_Typemap (const UInt &i) const
 Getter for the ith map stored. More...
 

Detailed Description

template<typename MapType>
class LifeV::MapVector< MapType >

This class is used to store maps that will be used for block defined problems.

This class consists in a collection of maps (e.g. LifeV::MapEpetra) to represent a problem made of several blocks.

When a system is made of several blocks (like a Stokes problem, with the velocity block and pressure block), one might want to use a block matrix and block vector. This class represents the "map" to construct block structures.

There are two operators to work with the maps: the "+" and the "|" operators. The "+" can be used to fusion two maps to create a bigger map (see the documentation of the related maps). The "|" is used to separate two maps for two different blocks. Starting from two maps (or a map and a vector of maps), it creates a vector of maps.

Between the operators "+" and "|", the "+" has a higher priority, meaning that all the "+" are evaluated before the "|" are. However, it is strongly recommanded to use brackets (some compilers might issue warnings if brackets are not used).

Example of valid template argument

LifeV::MapEpetra

Definition at line 61 of file MapVector.hpp.

Member Typedef Documentation

◆ map_Type

typedef MapType map_Type

Type of the map.

Definition at line 70 of file MapVector.hpp.

Constructor & Destructor Documentation

◆ MapVector() [1/5]

MapVector ( )

Empty constructor.

Definition at line 196 of file MapVector.hpp.

+ Here is the caller graph for this function:

◆ MapVector() [2/5]

MapVector ( const MapVector< map_Type > &  otherMapVector)

Copy constructor.

Parameters
otherMapVectorThe vector of maps to copy

Definition at line 202 of file MapVector.hpp.

+ Here is the caller graph for this function:

◆ MapVector() [3/5]

MapVector ( const map_Type map)
explicit

Constructor with one map.

This constructor builds a MapVector with only the map given in arguement.

Parameters
mapThe map to be put in the vector

Definition at line 208 of file MapVector.hpp.

+ Here is the caller graph for this function:

◆ MapVector() [4/5]

MapVector ( const map_Type map1,
const map_Type map2 
)

Constructor with two maps.

The MapVector is filled with the two maps given in argument.

Parameters
map1The first map of the vector
map2The second map of the vector

Definition at line 214 of file MapVector.hpp.

+ Here is the caller graph for this function:

◆ MapVector() [5/5]

MapVector ( const MapVector< map_Type > &  vector,
const map_Type map 
)

Concatenation constructor.

This constructor copies the maps in vector and adds the map to it.

Parameters
vectorThe vector to copy
mapThe map to add to vector

Definition at line 223 of file MapVector.hpp.

+ Here is the caller graph for this function:

◆ ~MapVector()

~MapVector ( )

Destructor.

Definition at line 231 of file MapVector.hpp.

Member Function Documentation

◆ operator=()

MapVector< MapType > operator= ( const MapVector< map_Type > &  vector)

Assignement operator.

Definition at line 241 of file MapVector.hpp.

◆ operator[]() [1/2]

const MapType & operator[] ( UInt  i) const

Access to the ith map (read only)

Definition at line 250 of file MapVector.hpp.

◆ operator[]() [2/2]

MapType & operator[] ( UInt  i)

Access to the ith map (read-write)

Definition at line 259 of file MapVector.hpp.

◆ operator|()

MapVector< MapType > operator| ( const map_Type map) const

Juxtaposition operator for a vector of maps and a map.

Definition at line 268 of file MapVector.hpp.

◆ nbMap()

UInt nbMap ( ) const

Returns the number of maps stored.

Definition at line 280 of file MapVector.hpp.

◆ mapSize()

UInt mapSize ( UInt  i) const

Returns the size of the ith map stored (global number of ids)

Definition at line 288 of file MapVector.hpp.

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const

Display internal state.

Definition at line 297 of file MapVector.hpp.

◆ totalMap()

MapType totalMap ( ) const

Return the map made by concatenating all the maps of the vector.

Definition at line 305 of file MapVector.hpp.

◆ addMap()

void addMap ( const map_Type newMap)

Add a map into this vector (at the end of the vector)

Definition at line 320 of file MapVector.hpp.

◆ map()

const MapType & map ( const UInt i) const

Getter for the ith map stored.

Definition at line 332 of file MapVector.hpp.

Field Documentation

◆ M_vector

std::vector<map_Type> M_vector
private

Definition at line 186 of file MapVector.hpp.


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