LifeV
VectorBlockMonolithicEpetra Class Reference

VectorBlockMonolithicEpetra - class of block vector. More...

#include <VectorBlockMonolithicEpetra.hpp>

+ Inheritance diagram for VectorBlockMonolithicEpetra:
+ Collaboration diagram for VectorBlockMonolithicEpetra:

Private Attributes

std::vector< UIntM_blockSize
 
std::vector< UIntM_blockFirstIndex
 

Public Types

typedef Real data_type
 Type of data stored. More...
 
typedef MapEpetra map_Type
 Type of the map to be used. More...
 
typedef MapVector< map_TypemapVector_type
 Type of the MapVector to be used with this class. More...
 
typedef MapEpetraType mapType_type
 Type of the map (Unique/Repeated) More...
 
typedef Epetra_CombineMode combine_type
 Combine mode. More...
 
typedef VectorBlockMonolithicEpetraView block_type
 Type of the view. More...
 
typedef std::shared_ptr< block_typeblock_ptrType
 Pointer on the view. More...
 

Constructor & Destructor

 VectorBlockMonolithicEpetra (const map_Type &map, const mapType_type &mapType=Unique)
 Constructor with the monolithic map. More...
 
 VectorBlockMonolithicEpetra (const mapVector_type &mapVector, const mapType_type &mapType=Unique)
 Construction with a vector of map. More...
 
 VectorBlockMonolithicEpetra (const VectorBlockMonolithicEpetra &vector)
 Copy constructor. More...
 
 VectorBlockMonolithicEpetra (const VectorBlockMonolithicEpetra &vector, const mapType_type &mapType)
 Copy constructor with a specified map type (Repeated/Unique) More...
 
 VectorBlockMonolithicEpetra (const VectorBlockMonolithicEpetra &vector, const mapType_type &mapType, const combine_type &combineMode)
 Copy constructor with specified map type and combine mode. More...
 
 ~VectorBlockMonolithicEpetra ()
 Destructor. More...
 

Set Methods

void setBlockStructure (const std::vector< UInt > &blockSizes)
 
void setBlockStructure (const mapVector_type &mapVector)
 Reset the block structure using the blocks of a vector of map. More...
 

Get Methods

UInt blockSize (const UInt &index) const
 Getter for the size of the block index. More...
 
void blockView (const UInt &index, block_type &blockView)
 Getter for the block index. More...
 
block_ptrType block (const UInt &index)
 Getter for the block index. More...
 

Additional Inherited Members

- Public Types inherited from VectorEpetra
typedef Epetra_FEVector vector_type
 
typedef std::shared_ptr< vector_typevectorPtr_Type
 
typedef Real data_type
 
typedef Epetra_CombineMode combineMode_Type
 
- Public Member Functions inherited from VectorEpetra
 VectorEpetra (const MapEpetraType &mapType=Unique, const combineMode_Type combineMode=Add)
 Empty Constructor. More...
 
 VectorEpetra (const MapEpetra &map, const MapEpetraType &mapType=Unique, const combineMode_Type combineMode=Add)
 Constructor - Using Maps. More...
 
 VectorEpetra (const std::shared_ptr< MapEpetra > &mapPtr, const MapEpetraType &mapType=Unique, const combineMode_Type combineMode=Add)
 Constructor - Using Maps. More...
 
 VectorEpetra (const VectorEpetra &vector)
 Copy constructor. More...
 
 VectorEpetra (const VectorEpetra &vector, const MapEpetraType &mapType)
 Copy constructor. More...
 
 VectorEpetra (const VectorEpetra &vector, const MapEpetraType &mapType, const combineMode_Type &combineMode)
 Copy constructor. More...
 
 VectorEpetra (const Epetra_MultiVector &vector, const std::shared_ptr< MapEpetra > map, const MapEpetraType &mapType, const combineMode_Type combineMode=Add)
 Copy constructor. More...
 
 VectorEpetra (const VectorEpetra &vector, const Int &reduceToProc)
 Copy constructor. More...
 
virtual ~VectorEpetra ()
 Destructor. More...
 
data_typeoperator[] (const UInt row)
 Access operators. More...
 
const data_typeoperator[] (const UInt row) const
 Access operators. More...
 
data_typeoperator() (const UInt row)
 Access operators. More...
 
const data_typeoperator() (const UInt row) const
 Access operators. More...
 
VectorEpetraoperator= (const VectorEpetra &vector)
 Affectation operator. More...
 
VectorEpetraoperator= (const Epetra_MultiVector &vector)
 Affectation operator. More...
 
VectorEpetraoperator= (data_type scalar)
 Affectation operator. More...
 
VectorEpetraoperator+= (const VectorEpetra &vector)
 Addition operator. More...
 
VectorEpetraoperator-= (const VectorEpetra &vector)
 Subtraction operator. More...
 
VectorEpetraoperator*= (const VectorEpetra &vector)
 Multiplication operator. More...
 
VectorEpetraoperator/= (const VectorEpetra &vector)
 Division operator. More...
 
const VectorEpetra operator+ (const VectorEpetra &vector) const
 Addition operator. More...
 
const VectorEpetra operator- (const VectorEpetra &vector) const
 Subtraction operator. More...
 
const VectorEpetra operator* (const VectorEpetra &vector) const
 Multiplication operator. More...
 
const VectorEpetra operator/ (const VectorEpetra &vector) const
 Division operator. More...
 
VectorEpetraoperator+= (const data_type &scalar)
 Addition operator. More...
 
VectorEpetraoperator-= (const data_type &scalar)
 Subtraction operator. More...
 
VectorEpetraoperator*= (const data_type &scalar)
 Multiplication operator. More...
 
VectorEpetraoperator/= (const data_type &scalar)
 Division operator. More...
 
const VectorEpetra operator+ (const data_type &scalar) const
 Operations with scalar values (do not modify the vector of the class) More...
 
const VectorEpetra operator- (const data_type &scalar) const
 Subtraction operator. More...
 
const VectorEpetra operator* (const data_type &scalar) const
 Multiplication operator. More...
 
const VectorEpetra operator/ (const data_type &scalar) const
 Division operator. More...
 
VectorEpetra operator== (const Real &scalar) const
 Equality operator. More...
 
VectorEpetra operator!= (const Real &scalar) const
 Inequality operator. More...
 
VectorEpetra operator< (const Real &scalar) const
 Less than operator. More...
 
VectorEpetra operator> (const Real &scalar) const
 Greater than operator. More...
 
VectorEpetra operator<= (const Real &scalar) const
 Less than or equal to operator. More...
 
VectorEpetra operator>= (const Real &scalar) const
 Greater than or equal to operator. More...
 
VectorEpetra operator && (const VectorEpetra &vector) const
 Logical AND operator. More...
 
VectorEpetra operator|| (const VectorEpetra &vector) const
 Logical OR operator. More...
 
VectorEpetra operator! (void) const
 Logical NOT operator. More...
 
bool isGlobalIDPresent (const UInt row) const
 Access operators. More...
 
Int globalAssemble (combineMode_Type mode)
 Assemble the vector. More...
 
Int globalAssemble ()
 Assemble the vector. More...
 
Int globalToLocalRowId (const UInt row) const
 Return the local Id of a global row. More...
 
void zero ()
 set zero in all the vector entries More...
 
bool setCoefficient (const UInt row, const data_type &value, UInt offset=0)
 Look for the given global row and set its value. More...
 
Int setCoefficients (std::vector< Int > &rowsVector, std::vector< Real > &valuesVector)
 Set the row of the vector to the given value. More...
 
Int sumIntoGlobalValues (const Int GID, const Real value)
 insert a global value More...
 
VectorEpetraadd (const VectorEpetra &vector, const Int offset=0)
 Add a vector to the current vector with an offset. More...
 
VectorEpetrareplace (const VectorEpetra &vector, const Int &offset)
 Replace part of the vector with a given vector. More...
 
VectorEpetrasubset (const VectorEpetra &vector, const UInt offset=0)
 Set the current vector to a subset of the given vector with an offset. More...
 
VectorEpetrasubset (const VectorEpetra &vector, const MapEpetra &map, const UInt offset1, const UInt offset2)
 Set the current vector to a subset of vector with an offset. More...
 
VectorEpetrasubset (const Epetra_MultiVector &vector, const MapEpetra &map, const UInt offset1, const UInt offset2, const UInt column=0)
 Set the current vector to a subset of vector with an offset. More...
 
void meanValue (Real *result) const
 Compute the mean value of the vector components and store it in the given variable. More...
 
Real norm1 () const
 Compute and return the norm 1. More...
 
void norm1 (Real *result) const
 Compute and store the norm 1 in the given pointed variable. More...
 
void norm1 (Real &result) const
 Compute and store the norm 1 in the given variable. More...
 
Real norm2 () const
 Compute and return the norm 2. More...
 
void norm2 (Real *result) const
 Compute and store the norm 2 in the given pointed variable. More...
 
void norm2 (Real &result) const
 Compute and store the norm 2 in the given variable. More...
 
Real normInf () const
 Compute and return the norm inf. More...
 
void normInf (Real *result) const
 Compute and store the norm inf in the given pointed variable. More...
 
void normInf (Real &result) const
 Compute and store the norm inf in the given variable. More...
 
Real minValue () const
 Compute and return the minimum value in the vector. More...
 
void minValue (Real *result) const
 Compute and store the minimum value of the vector in the given pointed variable. More...
 
void minValue (Real &result) const
 Compute and store the minimum value of the vector in the given variable. More...
 
Real maxValue () const
 Compute and return the maximum value in the vector. More...
 
void maxValue (Real *result) const
 Compute and store the maximum value of the vector in the given pointed variable. More...
 
void maxValue (Real &result) const
 Compute and store the maximum value of the vector in the given variable. More...
 
void abs (void)
 Replace the vector with his absolute value. More...
 
void abs (VectorEpetra &vector)
 Compute the absolute value of a vector and store it in an other vector. More...
 
void sqrt ()
 Apply the square root to of each element in the vector. More...
 
data_type dot (const VectorEpetra &vector) const
 Compute the scalar product of two vectors. More...
 
void dot (const VectorEpetra &vector, data_type &scalarProduct)
 Compute the scalar product of two vectors and store the result in a given variable. More...
 
void matrixMarket (std::string const &fileName, const bool headers=true) const
 Save the values of the matrix into a file. More...
 
void spy (std::string const &fileName) const
 Save the values of the matrix into a file. More...
 
void showMe (std::ostream &output=std::cout) const
 Print the contents of the vector. More...
 
void apply (const std::function< Real(Real)> &f)
 
void setCombineMode (combineMode_Type combineMode)
 Sets the combine mode for the import/export operations. More...
 
void setDefaultCombineMode ()
 Sets the combine mode for the import/export operations to default. More...
 
void setMap (const MapEpetra &map)
 Sets the map to use for the epetra vector. More...
 
const Epetra_Comm & comm () const
 Return the communicator of the vector. More...
 
vector_typeepetraVector ()
 Return the VectorEpetra in the wrapper. More...
 
const vector_typeepetraVector () const
 Return the VectorEpetra in the wrapper. More...
 
const vectorPtr_TypeepetraVectorPtr () const
 Return the shared pointer on the raw VectorEpetra. More...
 
const Epetra_BlockMap & blockMap () const
 Return the Epetra_BlockMap of the vector. More...
 
MapEpetraType mapType () const
 Return the map type of the vector (Unique or Repeated) More...
 
const MapEpetramap () const
 Return the MapEpetra of the vector. More...
 
const std::shared_ptr< MapEpetramapPtr () const
 Return a shared pointer on the MapEpetra. More...
 
const Epetra_Map & epetraMap () const
 Return the MapEpetra of the vector. More...
 
void setMapType (MapEpetraType type)
 
Int size () const
 Return the size of the vector. More...
 

Detailed Description

VectorBlockMonolithicEpetra - class of block vector.

Author
Samuel Quinodoz samue.nosp@m.l.qu.nosp@m.inodo.nosp@m.z@ep.nosp@m.fl.ch

The VectorBlockMonolithicEpetra class contains data related to block vector. It is an extension to VectorEpetra where data about blocks have been set. For an introduction to the block structures in LifeV, see this page.

There are mainly two ways to define a VectorBlockMonolithicEpetra:

  • Construct it using the same syntax as for LifeV::VectorEpetra and the use a setter for the structure.
  • Construct it directly with the maps of the blocks.

Both ways are equivalent.

To access the blocks, one uses then the blockView or block methods.

Definition at line 71 of file VectorBlockMonolithicEpetra.hpp.

Member Typedef Documentation

◆ data_type

typedef Real data_type

Type of data stored.

Definition at line 80 of file VectorBlockMonolithicEpetra.hpp.

◆ map_Type

Type of the map to be used.

Definition at line 83 of file VectorBlockMonolithicEpetra.hpp.

◆ mapVector_type

Type of the MapVector to be used with this class.

Definition at line 86 of file VectorBlockMonolithicEpetra.hpp.

◆ mapType_type

Type of the map (Unique/Repeated)

Definition at line 89 of file VectorBlockMonolithicEpetra.hpp.

◆ combine_type

typedef Epetra_CombineMode combine_type

Combine mode.

Definition at line 92 of file VectorBlockMonolithicEpetra.hpp.

◆ block_type

Type of the view.

Definition at line 95 of file VectorBlockMonolithicEpetra.hpp.

◆ block_ptrType

typedef std::shared_ptr<block_type> block_ptrType

Pointer on the view.

Definition at line 98 of file VectorBlockMonolithicEpetra.hpp.

Constructor & Destructor Documentation

◆ VectorBlockMonolithicEpetra() [1/5]

VectorBlockMonolithicEpetra ( const map_Type map,
const mapType_type mapType = Unique 
)

Constructor with the monolithic map.

Definition at line 45 of file VectorBlockMonolithicEpetra.cpp.

+ Here is the caller graph for this function:

◆ VectorBlockMonolithicEpetra() [2/5]

VectorBlockMonolithicEpetra ( const mapVector_type mapVector,
const mapType_type mapType = Unique 
)

Construction with a vector of map.

With this constructor, the block structure is automatically deduced from the maps in the vector. The monolithic map and vectors are also built by concanating the different maps in the vector.

Definition at line 52 of file VectorBlockMonolithicEpetra.cpp.

+ Here is the caller graph for this function:

◆ VectorBlockMonolithicEpetra() [3/5]

Copy constructor.

Definition at line 80 of file VectorBlockMonolithicEpetra.cpp.

+ Here is the caller graph for this function:

◆ VectorBlockMonolithicEpetra() [4/5]

VectorBlockMonolithicEpetra ( const VectorBlockMonolithicEpetra vector,
const mapType_type mapType 
)

Copy constructor with a specified map type (Repeated/Unique)

Definition at line 87 of file VectorBlockMonolithicEpetra.cpp.

+ Here is the caller graph for this function:

◆ VectorBlockMonolithicEpetra() [5/5]

VectorBlockMonolithicEpetra ( const VectorBlockMonolithicEpetra vector,
const mapType_type mapType,
const combine_type combineMode 
)

Copy constructor with specified map type and combine mode.

Definition at line 94 of file VectorBlockMonolithicEpetra.cpp.

+ Here is the caller graph for this function:

◆ ~VectorBlockMonolithicEpetra()

Destructor.

Definition at line 127 of file VectorBlockMonolithicEpetra.hpp.

Member Function Documentation

◆ setBlockStructure() [1/2]

void setBlockStructure ( const std::vector< UInt > &  blockSizes)

Set the size of the blocks of the vector

Parameters
blockSizesSizes of the blocks

Definition at line 106 of file VectorBlockMonolithicEpetra.cpp.

◆ setBlockStructure() [2/2]

void setBlockStructure ( const mapVector_type mapVector)

Reset the block structure using the blocks of a vector of map.

Definition at line 122 of file VectorBlockMonolithicEpetra.cpp.

◆ blockSize()

UInt blockSize ( const UInt index) const
inline

Getter for the size of the block index.

Parameters
indexIndex of the block
Returns
size of the index-th block

Definition at line 163 of file VectorBlockMonolithicEpetra.hpp.

◆ blockView()

void blockView ( const UInt index,
block_type blockView 
)

Getter for the block index.

Parameters
indexIndex of the block
blockViewThe blockView to be filled

Definition at line 148 of file VectorBlockMonolithicEpetra.cpp.

◆ block()

Getter for the block index.

Parameters
indexIndex of the block
Returns
The index-th block

Definition at line 158 of file VectorBlockMonolithicEpetra.cpp.

Field Documentation

◆ M_blockSize

std::vector<UInt> M_blockSize
private

Definition at line 187 of file VectorBlockMonolithicEpetra.hpp.

◆ M_blockFirstIndex

std::vector<UInt> M_blockFirstIndex
private

Definition at line 188 of file VectorBlockMonolithicEpetra.hpp.


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