46 #ifndef XPETRA_MAPFACTORY_HPP
47 #define XPETRA_MAPFACTORY_HPP
53 #ifdef HAVE_XPETRA_TPETRA
56 #ifdef HAVE_XPETRA_EPETRA
66 template <
class LocalOrdinal,
class GlobalOrdinal = LocalOrdinal,
class Node = Kokkos::DefaultNode::DefaultNodeType>
79 #ifdef HAVE_XPETRA_TPETRA
92 #ifdef HAVE_XPETRA_TPETRA
105 #ifdef HAVE_XPETRA_TPETRA
118 #ifdef HAVE_XPETRA_TPETRA
119 LocalOrdinal N = map->getNodeNumElements();
122 for (LocalOrdinal i = 0; i < N; i++)
123 for (LocalOrdinal j = 0; j < numDofPerNode; j++)
124 newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
138 #ifdef HAVE_XPETRA_TPETRA
152 #ifdef HAVE_XPETRA_TPETRA
167 #ifdef HAVE_XPETRA_TPETRA
181 #ifdef HAVE_XPETRA_TPETRA
195 #ifdef HAVE_XPETRA_TPETRA
210 #ifdef HAVE_XPETRA_TPETRA
237 #ifdef HAVE_XPETRA_TPETRA
242 #ifdef HAVE_XPETRA_EPETRA
244 return rcp(
new EpetraMap(numGlobalElements, indexBase, comm, lg, node) );
253 #ifdef HAVE_XPETRA_TPETRA
258 #ifdef HAVE_XPETRA_EPETRA
260 return rcp(
new EpetraMap(numGlobalElements, numLocalElements, indexBase, comm, node) );
269 #ifdef HAVE_XPETRA_TPETRA
274 #ifdef HAVE_XPETRA_EPETRA
276 return rcp(
new EpetraMap(numGlobalElements, elementList, indexBase, comm, node) );
291 newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
293 #ifdef HAVE_XPETRA_TPETRA
298 #ifdef HAVE_XPETRA_EPETRA
300 return rcp(
new EpetraMap(map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm(), map->getNode()) );
310 #ifdef HAVE_XPETRA_TPETRA
315 #ifdef HAVE_XPETRA_EPETRA
327 #ifdef HAVE_XPETRA_TPETRA
332 #ifdef HAVE_XPETRA_EPETRA
352 #ifdef HAVE_XPETRA_TPETRA
357 #ifdef HAVE_XPETRA_EPETRA
376 #ifdef HAVE_XPETRA_TPETRA
381 #ifdef HAVE_XPETRA_EPETRA
393 #ifdef HAVE_XPETRA_TPETRA
398 #ifdef HAVE_XPETRA_EPETRA
411 #ifdef HAVE_XPETRA_TPETRA
416 #ifdef HAVE_XPETRA_EPETRA
435 #define XPETRA_MAPFACTORY_SHORT
RCP< const T > getConst() const
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
Create a (potentially) non-uniform, contiguous Map with a user-specified node.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a uniform, contiguous Map with the default node.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
Create a uniform, contiguous Map with a user-specified node.
MapFactory()
Private constructor. This is a static class.
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
Map constructor transforming degrees of freedom.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=Xpetra::GloballyDistributed, const Teuchos::RCP< Node > &node=Kokkos::Details::getNode< Node >())
Map constructor with Xpetra-defined contiguous uniform distribution.
static Teuchos::RCP< DefaultNodeType > getDefaultNode()
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node)
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::Details::getNode< Node >())
Map constructor with a user-defined contiguous distribution.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a locally replicated Map with the default node.
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node=Kokkos::Details::getNode< Node >())
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a (potentially) non-uniform, contiguous Map with the default node.
MapFactory()
Private constructor. This is a static class.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
#define XPETRA_FACTORY_END
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::Details::getNode< Node >())
Map constructor with user-defined non-contiguous (arbitrary) distribution.
size_t global_size_t
Global size_t object.
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, size_t numLocalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node=Kokkos::Details::getNode< Node >())
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
Create a locally replicated Map with a specified node.
Kokkos::DefaultNode::DefaultNodeType Node
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
#define XPETRA_MONITOR(funcName)
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView< const int > &elementList, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node=Kokkos::Details::getNode< Node >())
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
Map constructor transforming degrees of freedom.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Kokkos::DefaultNode::DefaultNodeType > &node)