Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Xpetra utility class for common map-related routines. More...

#include <Xpetra_MapUtils_fwd.hpp>

Static Public Member Functions

static Teuchos::RCP< const
Xpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
concatenateMaps (const std::vector< Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > > &subMaps)
 Helper function to concatenate several maps. More...
 
static Teuchos::RCP
< Xpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
shrinkMapGIDs (const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &input, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &nonOvlInput)
 Helper function to shrink the GIDs and generate a standard map whith GIDs starting at 0. More...
 
static Teuchos::RCP
< Xpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
transformThyra2XpetraGIDs (const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &input, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &nonOvlInput, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &nonOvlReferenceInput)
 replace set of global ids by new global ids More...
 
static Teuchos::RCP< const
Xpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
transformThyra2XpetraGIDs (const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &input, GlobalOrdinal offset)
 replace set of global ids by new global ids More...
 

Detailed Description

template<class LocalOrdinal, class GlobalOrdinal, class Node>
class Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node >

Xpetra utility class for common map-related routines.

The routines should be independent from Epetra/Tpetra and be purely implemented in Xpetra.

Definition at line 51 of file Xpetra_MapUtils_fwd.hpp.

Member Function Documentation

template<class LocalOrdinal , class GlobalOrdinal , class Node >
static Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node >::concatenateMaps ( const std::vector< Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > > &  subMaps)
inlinestatic

Helper function to concatenate several maps.

Parameters
subMapsvector of maps which are concatenated
Returns
concatenated map

The routine builds a global map by concatenating all provided maps in the ordering defined by the vector. The GIDs are just appended in the same ordering as in the subMaps. No reordering or sorting is performed. This routine is supposed to generate the full map in an Xpetra::MapExtractor for a block operator. Note, it should not be used for strided maps since the GIDs are not reordered.

Example: subMap[0] = { 0, 1, 3, 4 }; subMap[1] = { 2, 5 }; concatenated map = { 0, 1, 3, 4, 2 ,5 };

Definition at line 93 of file Xpetra_MapUtils.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
static Teuchos::RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node >::shrinkMapGIDs ( const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  input,
const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  nonOvlInput 
)
inlinestatic

Helper function to shrink the GIDs and generate a standard map whith GIDs starting at 0.

Parameters
inputInput map (may be overlapping) containing all GIDs. Think of it as a column map.
nonOvlInputNon-overlapping version of "input" map. Think of it is the corresponding domain map associated with the column map "input"
Returns
New map with unique continuous global ids starting with GID 0

This helper routine may be useful for the transformation of MapExtractors in Xpetra-style GID ordering to the Thyra-style ordering.

Example: input = { 10, 15, 26, 37, 48 }; on proc 0 input = { 37, 48, 59, 60, 70 }; on proc 1 nonOvlInput = { 10, 15, 26, 37 }; on proc 0 nonOvlInput = { 48, 59, 60, 70 }: on proc 1 result = { 0, 1, 2, 3, 4 }; on proc 0 result = { 3, 4, 5, 6, 7 }; on proc 1

Definition at line 128 of file Xpetra_MapUtils.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
static Teuchos::RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node >::transformThyra2XpetraGIDs ( const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  input,
const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  nonOvlInput,
const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  nonOvlReferenceInput 
)
inlinestatic

replace set of global ids by new global ids

Parameters
inputOverlapping input map.
nonOvlInputNon-overlapping map containing GIDs corresponding to "input". Think of it is the corresponding domain map associated with the column map "input"
nonOvlReferenceInputNon-overlapping reference map containing new GIDs.
Returns
Overlapping map compatible to "input" using the GIDs as defined by "nonOvlReferenceInput"

Example: input = { 0, 1, 2, 3 }; on proc 0 input = { 2, 3, 4, 5 }; on proc 1 nonOvlInput = { 0, 1, 2 }; on proc 0 nonOvlInput = { 3, 4, 5 }: on proc 1 nonOvlReferenceInput = { 33, 44, 55 }; on proc 0 nonOvlReferenceInput = { 101, 102, 103 }; on proc 1 result = { 33, 44, 55, 101 }; on proc 0 result = { 55, 101, 102, 103}; on proc 1

Definition at line 228 of file Xpetra_MapUtils.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
static Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Xpetra::MapUtils< LocalOrdinal, GlobalOrdinal, Node >::transformThyra2XpetraGIDs ( const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  input,
GlobalOrdinal  offset 
)
inlinestatic

replace set of global ids by new global ids

Parameters
inputmap (either Map or BlockedMap) containing Thyra GIDs
offsetGID offset for resulting Xpetra GIDs
Returns
Map (or BlockedMap) containing Xpetra GIDs

Definition at line 309 of file Xpetra_MapUtils.hpp.


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