Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_TpetraThyraWrappers_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP
43 #define THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP
44 
45 
46 #include "Thyra_OperatorVectorTypes.hpp"
47 #include "Thyra_TpetraVectorSpace_decl.hpp"
48 #include "Thyra_TpetraVector_decl.hpp"
49 #include "Thyra_TpetraMultiVector_decl.hpp"
50 #include "Thyra_TpetraLinearOp_decl.hpp"
51 
52 
53 namespace Thyra {
54 
55 
63 RCP<const Teuchos::Comm<Ordinal> >
64 convertTpetraToThyraComm( const RCP<const Teuchos::Comm<int> > &tpetraComm );
65 
66 
71 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
72 RCP<const VectorSpaceBase<Scalar> >
73 createVectorSpace(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &tpetraMap);
74 
75 
80 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
81 RCP<VectorBase<Scalar> >
83  const RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraVector,
84  const RCP<const VectorSpaceBase<Scalar> > space = Teuchos::null
85  );
86 
87 
92 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
93 RCP<const VectorBase<Scalar> >
95  const RCP<const Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraVector,
96  const RCP<const VectorSpaceBase<Scalar> > space = Teuchos::null
97  );
98 
99 
104 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
105 RCP<MultiVectorBase<Scalar> >
107  const RCP<Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraMultiVector,
108  const RCP<const VectorSpaceBase<Scalar> > rangeSpace = Teuchos::null,
109  const RCP<const VectorSpaceBase<Scalar> > domainSpace = Teuchos::null
110  );
111 
112 
117 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
118 RCP<const MultiVectorBase<Scalar> >
120  const RCP<const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraMultiVector,
121  const RCP<const VectorSpaceBase<Scalar> > rangeSpace = Teuchos::null,
122  const RCP<const VectorSpaceBase<Scalar> > domainSpace = Teuchos::null
123  );
124 
125 
130 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
131 RCP<LinearOpBase<Scalar> >
133  const RCP<Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator,
134  const RCP<const VectorSpaceBase<Scalar> > rangeSpace = Teuchos::null,
135  const RCP<const VectorSpaceBase<Scalar> > domainSpace = Teuchos::null
136  );
137 
138 
143 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
144 RCP<const LinearOpBase<Scalar> >
146  const RCP<const Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator,
147  const RCP<const VectorSpaceBase<Scalar> > rangeSpace = Teuchos::null,
148  const RCP<const VectorSpaceBase<Scalar> > domainSpace = Teuchos::null
149  );
150 
151 
172 template <class Scalar = Tpetra::Vector<>::scalar_type,
173  class LocalOrdinal = Tpetra::Vector<>::local_ordinal_type,
174  class GlobalOrdinal = Tpetra::Vector<>::global_ordinal_type,
175  class Node = Tpetra::Vector<>::node_type>
177 public:
178 
182  getTpetraMap(const RCP<const VectorSpaceBase<Scalar> > &vs);
183 
189 
194  getConstTpetraVector(const RCP<const VectorBase<Scalar> > &v);
195 
201 
207 
213 
219 
220 };
221 
222 
223 } // namespace Thyra
224 
225 
226 #endif // THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP
RCP< MultiVectorBase< Scalar > > createMultiVector(const RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraMultiVector, const RCP< const VectorSpaceBase< Scalar > > rangeSpace=Teuchos::null, const RCP< const VectorSpaceBase< Scalar > > domainSpace=Teuchos::null)
static RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetraMap(const RCP< const VectorSpaceBase< Scalar > > &vs)
Get a const Tpetra::Map from a const Thyra::VectorSpaceBase object.
RCP< const MultiVectorBase< Scalar > > createConstMultiVector(const RCP< const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraMultiVector, const RCP< const VectorSpaceBase< Scalar > > rangeSpace=Teuchos::null, const RCP< const VectorSpaceBase< Scalar > > domainSpace=Teuchos::null)
RCP< const VectorBase< Scalar > > createConstVector(const RCP< const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraVector, const RCP< const VectorSpaceBase< Scalar > > space=Teuchos::null)
Abstract interface for objects that represent a space for vectors.
Traits class that enables the extraction of Tpetra operator/vector objects wrapped in Thyra operator/...
static RCP< const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getConstTpetraVector(const RCP< const VectorBase< Scalar > > &v)
Get a const Tpetra::Vector from a const Thyra::VectorBase object.
static RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetraMultiVector(const RCP< MultiVectorBase< Scalar > > &mv)
Get a non-const Tpetra::MultiVector from a non-const Thyra::MultiVectorBase object.
RCP< const LinearOpBase< Scalar > > createConstLinearOp(const RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator, const RCP< const VectorSpaceBase< Scalar > > rangeSpace=Teuchos::null, const RCP< const VectorSpaceBase< Scalar > > domainSpace=Teuchos::null)
Interface for a collection of column vectors called a multi-vector.
RCP< VectorBase< Scalar > > createVector(const RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraVector, const RCP< const VectorSpaceBase< Scalar > > space=Teuchos::null)
Abstract interface for finite-dimensional dense vectors.
static RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetraVector(const RCP< VectorBase< Scalar > > &v)
Get a non-const Tpetra::Vector from a non-const Thyra::VectorBase object.
RCP< const VectorSpaceBase< Scalar > > createVectorSpace(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &tpetraMap)
Create a Thyra::VectorSpaceBase object given a Tpetra::Map.
RCP< const Teuchos::Comm< Ordinal > > convertTpetraToThyraComm(const RCP< const Teuchos::Comm< int > > &tpetraComm)
Given an Tpetra Teuchos::Comm&lt;int&gt; object, return an equivalent Teuchos::Comm&lt;Ordinal&gt; object...
Base class for all linear operators.
static RCP< const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getConstTpetraMultiVector(const RCP< const MultiVectorBase< Scalar > > &mv)
Get a const Tpetra::MultiVector from a const Thyra::MultiVectorBase object.
static RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getConstTpetraOperator(const RCP< const LinearOpBase< Scalar > > &op)
Get a const Tpetra::Operator from a const Thyra::LinearOpBase object.
static RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetraOperator(const RCP< LinearOpBase< Scalar > > &op)
Get a non-const Tpetra::Operator from a non-const Thyra::LinearOpBase object.
RCP< LinearOpBase< Scalar > > createLinearOp(const RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator, const RCP< const VectorSpaceBase< Scalar > > rangeSpace=Teuchos::null, const RCP< const VectorSpaceBase< Scalar > > domainSpace=Teuchos::null)