51 #ifdef HAVE_XPETRA_EPETRA
59 #define sumAll(rcpComm, in, out) \
60 Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_SUM, in, Teuchos::outArg(out));
61 #define minAll(rcpComm, in, out) \
62 Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_MIN, in, Teuchos::outArg(out));
63 #define maxAll(rcpComm, in, out) \
64 Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_MAX, in, Teuchos::outArg(out));
72 :
EpetraMap(numGlobalElements, indexBase, comm, lg, node),
StridedMap<int, int>(numGlobalElements, indexBase, stridingInfo, comm, stridedBlockId, offset)
84 int nStridedOffset = 0;
86 if(stridedBlockId > -1) {
88 for(
int j=0; j<stridedBlockId; j++) {
89 nStridedOffset += stridingInfo[j];
91 nDofsPerNode = stridingInfo[stridedBlockId];
93 numGlobalElements = nodeMap->NumGlobalElements()*nDofsPerNode;
95 std::vector<int> dofgids;
96 for(
int i = 0; i<nodeMap->NumMyElements(); i++) {
97 int gid = nodeMap->GID(i);
98 for(
int dof = 0; dof < nDofsPerNode; ++dof) {
112 if(stridedBlockId == -1) {
117 int nDofsInStridedBlock = stridingInfo[stridedBlockId];
127 :
EpetraMap(numGlobalElements, numLocalElements, indexBase, comm, node),
StridedMap<int, int>(numGlobalElements, numLocalElements, indexBase, stridingInfo, comm, stridedBlockId, offset)
138 size_t numLocalNodes = numLocalElements / blockSize;
145 int nStridedOffset = 0;
147 if(stridedBlockId > -1) {
149 for(
int j=0; j<stridedBlockId; j++) {
150 nStridedOffset += stridingInfo[j];
152 nDofsPerNode = stridingInfo[stridedBlockId];
154 numGlobalElements = nodeMap->NumGlobalElements()*nDofsPerNode;
156 std::vector<int> dofgids;
157 for(
int i = 0; i<nodeMap->NumMyElements(); i++) {
158 int gid = nodeMap->GID(i);
159 for(
int dof = 0; dof < nDofsPerNode; ++dof) {
173 if(stridedBlockId == -1) {
178 int nDofsInStridedBlock = stridingInfo[stridedBlockId];
189 :
EpetraMap(numGlobalElements, elementList, indexBase, comm, node), Xpetra::
StridedMap<int,int>(numGlobalElements, elementList, indexBase, stridingInfo, comm, stridedBlockId)
192 if(stridedBlockId != -1) {
194 nDofsPerNode = Teuchos::as<int>(stridingInfo[stridedBlockId]);
207 std::ostringstream oss;
233 int myImageID = comm_->getRank();
234 int numImages = comm_->getSize();
243 width = std::max<size_t>(width,12) + 2;
254 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
255 if (myImageID == imageCtr) {
256 if (myImageID == 0) {
265 out <<
"Number of Local Elements = " << nME << endl
271 out << std::setw(width) <<
"Node ID"
272 << std::setw(width) <<
"Local Index"
273 << std::setw(width) <<
"Global Index"
275 for (
size_t i=0; i < nME; i++) {
276 out << std::setw(width) << myImageID
277 << std::setw(width) << i
278 << std::setw(width) << myEntries[i]
std::string description() const
Return a simple one-line description of this object.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Exception throws to report errors in the internal logical of the program.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
RCP< const Epetra_BlockMap > map_
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, int > > &graph)
size_t getNodeNumElements() const
Returns the number of elements belonging to the calling node.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
global_size_t getGlobalNumElements() const
Returns the number of elements in this Map.
std::string description() const
Return a simple one-line description of this object.
size_t getFixedBlockSize() const
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to a FancyOStream object.
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
int offset_
offset for gids in map (default = 0)
size_t global_size_t
Global size_t object.
const Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
StridedEpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, std::vector< size_t > &stridingInfo, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalOrdinal stridedBlockId=-1, GlobalOrdinal offset=0, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Kokkos::DefaultNode::getDefaultNode())
Map constructor with Tpetra-defined contiguous uniform distribution. The elements are distributed amo...
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
GlobalOrdinal getIndexBase() const
The index base for this Map.
Class that stores a strided map.