Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_EpetraMultiVector.cpp
Go to the documentation of this file.
1// @HEADER
2//
3// ***********************************************************************
4//
5// Xpetra: A linear algebra interface package
6// Copyright 2012 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact
39// Jonathan Hu (jhu@sandia.gov)
40// Andrey Prokopenko (aprokop@sandia.gov)
41// Ray Tuminaro (rstumin@sandia.gov)
42//
43// ***********************************************************************
44//
45// @HEADER
47
50#include "Xpetra_Exceptions.hpp"
51
53
54#include "Epetra_SerialComm.h"
55
56
57namespace Xpetra {
58
59// specialization for GO=int and NO=EpetraNode
60#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
61Teuchos::RCP< const Vector< double, int, int, EpetraNode > > EpetraMultiVectorT<int, EpetraNode>::getVector(size_t j) const {
62 XPETRA_MONITOR("EpetraMultiVectorT::getVector");
63 return rcp(new Xpetra::EpetraVectorT<int,EpetraNode>(vec_, j)); // See constructor EpetraVectorT(const RCP<EpetraMultiVectorT> &mv, size_t j) for more info
64}
65
67Teuchos::RCP< Vector< double, int, int, EpetraNode > > EpetraMultiVectorT<int,EpetraNode>::getVectorNonConst(size_t j) {
68 XPETRA_MONITOR("EpetraMultiVectorT::getVector");
69 return rcp(new EpetraVectorT<int,EpetraNode>(vec_, j)); // See constructor EpetraVectorT(const RCP<EpetraMultiVectorT> &mv, size_t j) for more info
70}
71#endif
72
73// specialization for GO=long long and NO=EpetraNode
74#ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
75Teuchos::RCP< const Vector< double, int, long long, EpetraNode > > EpetraMultiVectorT<long long, EpetraNode>::getVector(size_t j) const {
76 XPETRA_MONITOR("EpetraMultiVectorT::getVector");
77 return rcp(new Xpetra::EpetraVectorT<long long,EpetraNode>(vec_, j)); // See constructor EpetraVectorT(const RCP<EpetraMultiVectorT> &mv, size_t j) for more info
78}
79
81Teuchos::RCP< Vector< double, int, long long, EpetraNode > > EpetraMultiVectorT<long long,EpetraNode>::getVectorNonConst(size_t j) {
82 XPETRA_MONITOR("EpetraMultiVectorT::getVector");
83 return rcp(new EpetraVectorT<long long,EpetraNode>(vec_, j)); // See constructor EpetraVectorT(const RCP<EpetraMultiVectorT> &mv, size_t j) for more info
84}
85#endif
86
87// TODO: move that elsewhere
88template<class GlobalOrdinal,class Node>
91 return *tX.getEpetra_MultiVector();
92}
93
94template<class GlobalOrdinal,class Node>
99//
100
101template<class GlobalOrdinal,class Node>
103 if (!vec.is_null())
105
106 return Teuchos::null;
107}
108
109
110
111#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
112#ifdef HAVE_XPETRA_TPETRA
113#include "TpetraCore_config.h"
114#if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
115 (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
116template class EpetraMultiVectorT<int, Xpetra::EpetraNode >;
120#endif
121
122#ifdef HAVE_TPETRA_INST_SERIAL
127#endif
128#ifdef HAVE_TPETRA_INST_PTHREAD
133#endif
134#ifdef HAVE_TPETRA_INST_OPENMP
139#endif
140#ifdef HAVE_TPETRA_INST_CUDA
145#endif
146#ifdef HAVE_TPETRA_INST_HIP
151#endif
152#else // Tpetra is disabled
153typedef Xpetra::EpetraNode default_node_type;
158#endif
159#endif
160
161#ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
162#ifdef HAVE_XPETRA_TPETRA
163#include "TpetraCore_config.h"
164#if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
165 (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
170#endif
171
172#ifdef HAVE_TPETRA_INST_SERIAL
177#endif
178#ifdef HAVE_TPETRA_INST_PTHREAD
183#endif
184#ifdef HAVE_TPETRA_INST_OPENMP
189#endif
190#ifdef HAVE_TPETRA_INST_CUDA
195#endif
196#ifdef HAVE_TPETRA_INST_HIP
201#endif
202#else // Tpetra is disabled
203typedef Xpetra::EpetraNode default_node_type;
208#endif
209#endif
210
211} // namespace Xpetra
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
bool is_null() const
Teuchos::RCP< Vector< double, int, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
Teuchos::RCP< const Vector< double, int, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
Xpetra namespace
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
template const Epetra_CrsGraph & toEpetra< long long, Xpetra::EpetraNode >(const RCP< const CrsGraph< int, long long, Xpetra::EpetraNode > > &graph)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
template RCP< const CrsGraph< int, long long, Xpetra::EpetraNode > > toXpetra< long long, Xpetra::EpetraNode >(const Epetra_CrsGraph &g)
Kokkos::Compat::KokkosSerialWrapperNode EpetraNode
template const Epetra_CrsGraph & toEpetra< int, Xpetra::EpetraNode >(const RCP< const CrsGraph< int, int, Xpetra::EpetraNode > > &graph)
template RCP< const CrsGraph< int, int, Xpetra::EpetraNode > > toXpetra< int, Xpetra::EpetraNode >(const Epetra_CrsGraph &g)