LifeV
|
MapEpetra - Wrapper for Epetra_Map. More...
#include <MapEpetra.hpp>
Private Attributes | |
mapPtr_Type | M_repeatedMapEpetra |
mapPtr_Type | M_uniqueMapEpetra |
exporterPtr_Type | M_exporter |
importerPtr_Type | M_importer |
commPtr_Type | M_commPtr |
Public Types | |
typedef Epetra_Map | map_Type |
typedef std::shared_ptr< map_Type > | mapPtr_Type |
typedef MapEpetraData | mapData_Type |
typedef std::shared_ptr< std::shared_ptr< Epetra_Export > > | exporterPtr_Type |
typedef std::shared_ptr< std::shared_ptr< Epetra_Import > > | importerPtr_Type |
typedef Epetra_Comm | comm_Type |
typedef std::shared_ptr< comm_Type > | commPtr_Type |
Constructors & Destructor | |
MapEpetra () | |
Empty Constructor. More... | |
MapEpetra (Int numGlobalElements, Int numMyElements, Int *myGlobalElements, const commPtr_Type &commPtr) | |
Constructor. More... | |
MapEpetra (mapData_Type const &mapData, commPtr_Type const &commPtr) | |
Constructor. More... | |
MapEpetra (const Int numGlobalElements, const Int notUsed, const commPtr_Type &commPtr) | |
Constructor. More... | |
MapEpetra (const Int size, const commPtr_Type &commPtr) | |
Constructor. More... | |
MapEpetra (const MapEpetra &epetraMap) | |
Copy constructor. More... | |
MapEpetra (const Epetra_BlockMap &blockMap, const Int offset, const Int maxId) | |
Constructor. More... | |
~MapEpetra () | |
Destructor. More... | |
MapEpetra (const map_Type map) | |
Constructor from raw Epetra_Map. More... | |
Operators | |
MapEpetra & | operator= (const MapEpetra &epetraMap) |
Assignment operator. More... | |
MapEpetra & | operator+= (const MapEpetra &epetraMap) |
Addition operator. More... | |
MapEpetra & | operator+= (Int const size) |
Addition operator. More... | |
Methods | |
std::shared_ptr< MapEpetra > | createRootMap (Int const root) const |
This method creates a pointer to a MapEpetra that has points only on processor root. More... | |
bool | mapsAreSimilar (MapEpetra const &epetraMap) const |
This method return true if both the unique map and the repeated map are identical. More... | |
void | exportToHDF5 (std::string const &fileName, std::string const &mapName="map", bool const truncate=true) |
Save the matrix into a HDF5 (.h5) file. More... | |
void | importFromHDF5 (std::string const &fileName, std::string const &mapName="map") |
Read a matrix from a HDF5 (.h5) file. More... | |
void | showMe (std::ostream &output=std::cout) const |
Show informations about the map. More... | |
UInt | mapSize () const |
Getter for the global number of entries. More... | |
bool | isOwned (const UInt globalId) const |
check if a global id is owned by the current partition More... | |
Get Methods | |
comm_Type const & | comm () const |
Return the communicator. More... | |
commPtr_Type const & | commPtr () const |
Return a shared pointer on the communicator. More... | |
commPtr_Type & | commPtr () |
mapPtr_Type const & | map (MapEpetraType mapType) const |
Return a shared pointer on the internal Epetra_Map. More... | |
Epetra_Export const & | exporter () |
Getter for the Epetra_Export. More... | |
Epetra_Import const & | importer () |
Getter for the Epetra_Import. More... | |
Set Methods | |
void | setComm (commPtr_Type const &commPtr) |
Set the communicator. More... | |
void | setMap (mapPtr_Type map, MapEpetraType mapType) |
set the internal Epetra_Maps More... | |
Private Methods | |
void | createMap (Int numGlobalElements, Int numMyElements, Int *myGlobalElements, const comm_Type &comm) |
Create a map. More... | |
mapPtr_Type const & | getRepeatedMap () const |
Getter for the repeated map. More... | |
mapPtr_Type const & | getUniqueMap () const |
Getter for the unique map. More... | |
void | uniqueMap () |
Reset the internal unique map and recompute it using the repeated map. More... | |
void | createImportExport () |
Reset and rebuild the importer and exporter for the map. More... | |
void | bubbleSort (Epetra_IntSerialDenseVector &elements) |
Sort the element given using a bubble sort algorithm. More... | |
MapEpetra - Wrapper for Epetra_Map.
The MapEpetra class provides a general interface for the Epetra_Map class of Trilinos.
Visit http://trilinos.sandia.gov for more informations about Epetra_Map.
Definition at line 72 of file MapEpetra.hpp.
typedef Epetra_Map map_Type |
Definition at line 79 of file MapEpetra.hpp.
typedef std::shared_ptr<map_Type> mapPtr_Type |
Definition at line 80 of file MapEpetra.hpp.
typedef MapEpetraData mapData_Type |
Definition at line 82 of file MapEpetra.hpp.
typedef std::shared_ptr< std::shared_ptr<Epetra_Export> > exporterPtr_Type |
Definition at line 89 of file MapEpetra.hpp.
typedef std::shared_ptr< std::shared_ptr<Epetra_Import> > importerPtr_Type |
Definition at line 90 of file MapEpetra.hpp.
typedef Epetra_Comm comm_Type |
Definition at line 93 of file MapEpetra.hpp.
typedef std::shared_ptr<comm_Type> commPtr_Type |
Definition at line 94 of file MapEpetra.hpp.
MapEpetra | ( | ) |
Empty Constructor.
Definition at line 53 of file MapEpetra.cpp.
MapEpetra | ( | Int | numGlobalElements, |
Int | numMyElements, | ||
Int * | myGlobalElements, | ||
const commPtr_Type & | commPtr | ||
) |
Constructor.
To define a linear map, set MyGlobalElements = 0
numGlobalElements | Number of global elements |
numMyElements | Number of local elements |
myGlobalElements | Array of Id of the local element |
commPtr | Pointer to the communicator |
Definition at line 60 of file MapEpetra.cpp.
MapEpetra | ( | mapData_Type const & | mapData, |
commPtr_Type const & | commPtr | ||
) |
Constructor.
To define a linear map, set MyGlobalElements = 0
mapData | Structure containing Ids for the local Unique and Repeated map |
commPtr | Pointer to the communicator |
Definition at line 74 of file MapEpetra.cpp.
MapEpetra | ( | const Int | numGlobalElements, |
const Int | notUsed, | ||
const commPtr_Type & | commPtr | ||
) |
Constructor.
Definition at line 93 of file MapEpetra.cpp.
MapEpetra | ( | const Int | size, |
const commPtr_Type & | commPtr | ||
) |
Constructor.
size | Size of the map |
commPtr | Pointer to the communicator |
Definition at line 113 of file MapEpetra.cpp.
Copy constructor.
epetraMap | An MapEpetra object |
Definition at line 429 of file MapEpetra.cpp.
Constructor.
Builds a submap of map _epetraMap with a given positive offset and the maximum id to consider
e.g:
blockMap | Epetra_BlockMap |
offset | Offset to be used to build the map |
maxId | Maximum Id |
Definition at line 154 of file MapEpetra.cpp.
Constructor from raw Epetra_Map.
This constructor should be used only inside this class, therefore it is private
map | underlying Epetra_Map |
Definition at line 147 of file MapEpetra.cpp.
|
inline |
Destructor.
Definition at line 183 of file MapEpetra.hpp.
Assignment operator.
The assignment operator will copy the pointers of the maps, exporter and importer
epetraMap | MapEpetra to be assigned to the current matrix |
Definition at line 184 of file MapEpetra.cpp.
Addition operator.
The addition operator combines two map together
epetraMap | MapEpetra to be combined with the current map |
Definition at line 198 of file MapEpetra.cpp.
Addition operator.
The addition operator create a map of size "size" and add it to the current map to create a new map
size | Size of the map to be added to the current map |
Definition at line 258 of file MapEpetra.cpp.
This method creates a pointer to a MapEpetra that has points only on processor root.
root | processor on which to export all the points |
Definition at line 272 of file MapEpetra.cpp.
bool mapsAreSimilar | ( | MapEpetra const & | epetraMap | ) | const |
This method return true if both the unique map and the repeated map are identical.
Definition at line 278 of file MapEpetra.cpp.
void exportToHDF5 | ( | std::string const & | fileName, |
std::string const & | mapName = "map" , |
||
bool const | truncate = true |
||
) |
Save the matrix into a HDF5 (.h5) file.
fileName | Name of the file where the map will be saved, without extension (.h5) |
mapName | Name of the map in the HDF5 file |
truncate | True if the file has to be truncated; False if the file already exist and should not be truncated |
Definition at line 291 of file MapEpetra.cpp.
void importFromHDF5 | ( | std::string const & | fileName, |
std::string const & | mapName = "map" |
||
) |
Read a matrix from a HDF5 (.h5) file.
fileName | Name of the file where the map will be saved, without extension (.h5) |
matrixName | Name of the map in the HDF5 file |
Definition at line 325 of file MapEpetra.cpp.
void showMe | ( | std::ostream & | output = std::cout | ) | const |
Show informations about the map.
Definition at line 361 of file MapEpetra.cpp.
|
inline |
Getter for the global number of entries.
Definition at line 247 of file MapEpetra.hpp.
|
inline |
check if a global id is owned by the current partition
Definition at line 253 of file MapEpetra.hpp.
|
inline |
Return the communicator.
Definition at line 264 of file MapEpetra.hpp.
|
inline |
Return a shared pointer on the communicator.
Definition at line 270 of file MapEpetra.hpp.
|
inline |
const MapEpetra::mapPtr_Type & map | ( | MapEpetraType | mapType | ) | const |
Return a shared pointer on the internal Epetra_Map.
Definition at line 373 of file MapEpetra.cpp.
const Epetra_Export & exporter | ( | ) |
Getter for the Epetra_Export.
Definition at line 385 of file MapEpetra.cpp.
const Epetra_Import & importer | ( | ) |
Getter for the Epetra_Import.
Definition at line 394 of file MapEpetra.cpp.
void setComm | ( | commPtr_Type const & | commPtr | ) |
Set the communicator.
Definition at line 407 of file MapEpetra.cpp.
void setMap | ( | mapPtr_Type | map, |
MapEpetraType | mapType | ||
) |
set the internal Epetra_Maps
Definition at line 414 of file MapEpetra.cpp.
|
private |
Create a map.
Note: createMap does not call createImportExport
numGlobalElements | Number of global elements of the map |
numMyElements | number of local element |
myGlobalElements | Array of Id of the global elements of the map |
comm | Communicator |
Definition at line 434 of file MapEpetra.cpp.
|
inlineprivate |
Getter for the repeated map.
Definition at line 319 of file MapEpetra.hpp.
|
inlineprivate |
Getter for the unique map.
Definition at line 325 of file MapEpetra.hpp.
|
private |
Reset the internal unique map and recompute it using the repeated map.
Definition at line 454 of file MapEpetra.cpp.
|
private |
Reset and rebuild the importer and exporter for the map.
Definition at line 462 of file MapEpetra.cpp.
|
private |
Sort the element given using a bubble sort algorithm.
elements | Epetra_IntSerialDenseVector vector to be sorted |
Definition at line 481 of file MapEpetra.cpp.
|
private |
Definition at line 344 of file MapEpetra.hpp.
|
private |
Definition at line 345 of file MapEpetra.hpp.
|
private |
Definition at line 346 of file MapEpetra.hpp.
|
private |
Definition at line 347 of file MapEpetra.hpp.
|
private |
Definition at line 348 of file MapEpetra.hpp.