LifeV
|
VectorBlockMonolithicEpetra - class of block vector. More...
#include <VectorBlockMonolithicEpetra.hpp>
Private Attributes | |
std::vector< UInt > | M_blockSize |
std::vector< UInt > | M_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_Type > | mapVector_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_type > | block_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_type > | vectorPtr_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_type & | operator[] (const UInt row) |
Access operators. More... | |
const data_type & | operator[] (const UInt row) const |
Access operators. More... | |
data_type & | operator() (const UInt row) |
Access operators. More... | |
const data_type & | operator() (const UInt row) const |
Access operators. More... | |
VectorEpetra & | operator= (const VectorEpetra &vector) |
Affectation operator. More... | |
VectorEpetra & | operator= (const Epetra_MultiVector &vector) |
Affectation operator. More... | |
VectorEpetra & | operator= (data_type scalar) |
Affectation operator. More... | |
VectorEpetra & | operator+= (const VectorEpetra &vector) |
Addition operator. More... | |
VectorEpetra & | operator-= (const VectorEpetra &vector) |
Subtraction operator. More... | |
VectorEpetra & | operator*= (const VectorEpetra &vector) |
Multiplication operator. More... | |
VectorEpetra & | operator/= (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... | |
VectorEpetra & | operator+= (const data_type &scalar) |
Addition operator. More... | |
VectorEpetra & | operator-= (const data_type &scalar) |
Subtraction operator. More... | |
VectorEpetra & | operator*= (const data_type &scalar) |
Multiplication operator. More... | |
VectorEpetra & | operator/= (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... | |
VectorEpetra & | add (const VectorEpetra &vector, const Int offset=0) |
Add a vector to the current vector with an offset. More... | |
VectorEpetra & | replace (const VectorEpetra &vector, const Int &offset) |
Replace part of the vector with a given vector. More... | |
VectorEpetra & | subset (const VectorEpetra &vector, const UInt offset=0) |
Set the current vector to a subset of the given vector with an offset. More... | |
VectorEpetra & | subset (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... | |
VectorEpetra & | subset (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_type & | epetraVector () |
Return the VectorEpetra in the wrapper. More... | |
const vector_type & | epetraVector () const |
Return the VectorEpetra in the wrapper. More... | |
const vectorPtr_Type & | epetraVectorPtr () 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 MapEpetra & | map () const |
Return the MapEpetra of the vector. More... | |
const std::shared_ptr< MapEpetra > | mapPtr () 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... | |
VectorBlockMonolithicEpetra - class of block vector.
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:
Both ways are equivalent.
To access the blocks, one uses then the blockView or block methods.
Definition at line 71 of file VectorBlockMonolithicEpetra.hpp.
Type of data stored.
Definition at line 80 of file VectorBlockMonolithicEpetra.hpp.
Type of the map to be used.
Definition at line 83 of file VectorBlockMonolithicEpetra.hpp.
typedef MapVector<map_Type> mapVector_type |
Type of the MapVector to be used with this class.
Definition at line 86 of file VectorBlockMonolithicEpetra.hpp.
typedef MapEpetraType mapType_type |
Type of the map (Unique/Repeated)
Definition at line 89 of file VectorBlockMonolithicEpetra.hpp.
typedef Epetra_CombineMode combine_type |
Combine mode.
Definition at line 92 of file VectorBlockMonolithicEpetra.hpp.
Type of the view.
Definition at line 95 of file VectorBlockMonolithicEpetra.hpp.
typedef std::shared_ptr<block_type> block_ptrType |
Pointer on the view.
Definition at line 98 of file VectorBlockMonolithicEpetra.hpp.
VectorBlockMonolithicEpetra | ( | const map_Type & | map, |
const mapType_type & | mapType = Unique |
||
) |
Constructor with the monolithic map.
Definition at line 45 of file VectorBlockMonolithicEpetra.cpp.
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.
VectorBlockMonolithicEpetra | ( | const VectorBlockMonolithicEpetra & | vector | ) |
Copy constructor.
Definition at line 80 of file VectorBlockMonolithicEpetra.cpp.
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.
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.
|
inline |
Destructor.
Definition at line 127 of file VectorBlockMonolithicEpetra.hpp.
void setBlockStructure | ( | const std::vector< UInt > & | blockSizes | ) |
Set the size of the blocks of the vector
blockSizes | Sizes of the blocks |
Definition at line 106 of file VectorBlockMonolithicEpetra.cpp.
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.
Getter for the size of the block index.
index | Index of the block |
Definition at line 163 of file VectorBlockMonolithicEpetra.hpp.
void blockView | ( | const UInt & | index, |
block_type & | blockView | ||
) |
Getter for the block index.
index | Index of the block |
blockView | The blockView to be filled |
Definition at line 148 of file VectorBlockMonolithicEpetra.cpp.
VectorBlockMonolithicEpetra::block_ptrType block | ( | const UInt & | index | ) |
Getter for the block index.
index | Index of the block |
Definition at line 158 of file VectorBlockMonolithicEpetra.cpp.
|
private |
Definition at line 187 of file VectorBlockMonolithicEpetra.hpp.
|
private |
Definition at line 188 of file VectorBlockMonolithicEpetra.hpp.