Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_MultiVectorFactory_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Xpetra: A linear algebra interface package
4//
5// Copyright 2012 NTESS and the Xpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef XPETRA_MULTIVECTORFACTORY_DECL_HPP
11#define XPETRA_MULTIVECTORFACTORY_DECL_HPP
12
13#include "Xpetra_ConfigDefs.hpp"
15
16#ifdef HAVE_XPETRA_TPETRA
17#include "Xpetra_TpetraMultiVector.hpp"
18#endif
19
20#ifdef HAVE_XPETRA_EPETRA
23#endif
24
25// #include "Xpetra_BlockedMap.hpp"
26#include "Xpetra_Exceptions.hpp"
27
28namespace Xpetra {
29
46template <class Scalar,
47 class LocalOrdinal,
48 class GlobalOrdinal,
49 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
70
71// we need the Epetra specialization only if Epetra is enabled
72#if defined(HAVE_XPETRA_EPETRA)
73
74#if !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES)
75
76// Specialization for Scalar=double, LO=GO=int and Serial node
77// Used both for Epetra and Tpetra
78// For any other node definition the general default implementation is used which allows Tpetra only
79template <>
104
105template <>
106class MultiVectorFactory<int, int, int, EpetraNode> {
107 typedef int Scalar;
108 typedef int LocalOrdinal;
109 typedef int GlobalOrdinal;
111
112 private:
115
116 public:
118 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>> &map, size_t NumVectors, bool zeroOut = true);
119
124 size_t NumVectors);
125
128 Teuchos::DataAccess copyOrView);
129};
130
131// we need the Epetra specialization only if Epetra is enabled
132#if !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES)
133
134template <>
135class MultiVectorFactory<double, int, long long, EpetraNode> {
136 typedef double Scalar;
137 typedef int LocalOrdinal;
138 typedef long long GlobalOrdinal;
140
141 private:
144
145 public:
148 size_t NumVectors,
149 bool zeroOut = true);
150
155 size_t NumVectors);
156
159 Teuchos::DataAccess copyOrView);
160};
161
162template <>
189
190#endif // END !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES)
191
192#endif // END !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES)
193
194#endif // END HAVE_XPETRA_EPETRA
195
196} // namespace Xpetra
197
198#define XPETRA_MULTIVECTORFACTORY_SHORT
199#endif
static RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
Set multi-vector values from array of pointers using Teuchos memory management classes....
MultiVectorFactory()
Private constructor. This is a static class.
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &source, Teuchos::DataAccess copyOrView)
static RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &source, Teuchos::DataAccess copyOrView)
MultiVectorFactory()
Private constructor. This is a static class.
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
Set multi-vector values from array of pointers using Teuchos memory management classes....
Factory for any type of Xpetra::MultiVector and its derived classes.
MultiVectorFactory()
Private constructor. This is a static class.
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Constructor specifying the number of non-zeros for all rows.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode