// @HEADER
// *****************************************************************************
// Thyra: Interfaces and Support for Abstract Numerical Algorithms
//
// Copyright 2004 NTESS and the Thyra contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @HEADER
#ifndef THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP
#define THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP
#include "Thyra_OperatorVectorTypes.hpp"
#include "Thyra_TpetraVectorSpace_decl.hpp"
#include "Thyra_TpetraVector_decl.hpp"
#include "Thyra_TpetraMultiVector_decl.hpp"
#include "Thyra_TpetraLinearOp_decl.hpp"
namespace Thyra {
/** \brief Given an Tpetra Teuchos::Comm object, return an
* equivalent Teuchos::Comm object.
*
* Will throw if conversion is not successful.
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
RCP >
convertTpetraToThyraComm( const RCP > &tpetraComm );
/** \brief Create a Thyra::VectorSpaceBase object given a Tpetra::Map.
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createVectorSpace(const RCP > &tpetraMap);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createVector(
const RCP > &tpetraVector,
const RCP > space = Teuchos::null
);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createConstVector(
const RCP > &tpetraVector,
const RCP > space = Teuchos::null
);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createMultiVector(
const RCP > &tpetraMultiVector,
const RCP > rangeSpace = Teuchos::null,
const RCP > domainSpace = Teuchos::null
);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createConstMultiVector(
const RCP > &tpetraMultiVector,
const RCP > rangeSpace = Teuchos::null,
const RCP > domainSpace = Teuchos::null
);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createLinearOp(
const RCP > &tpetraOperator,
const RCP > rangeSpace = Teuchos::null,
const RCP > domainSpace = Teuchos::null
);
/** \brief .
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template
RCP >
createConstLinearOp(
const RCP > &tpetraOperator,
const RCP > rangeSpace = Teuchos::null,
const RCP > domainSpace = Teuchos::null
);
/** \brief Traits class that enables the extraction of Tpetra operator/vector
* objects wrapped in Thyra operator/vector objects.
*
* Example usage:
\code
typedef Thyra::TpetraObjectExtraction TOE;
typedef Tpetra::MultiVector TpetraMultiVector_t;
RCP tpetraMv = TOE::getTpetraMultiVector(thyraMv);
RCP tpetraV = TOE::getTpetraVector(thyraV);
\endcode
*
* \todo Finish documentation
*
* \ingroup Tpetra_Thyra_Op_Vec_adapters_grp
*/
template ::scalar_type,
class LocalOrdinal = Tpetra::Vector<>::local_ordinal_type,
class GlobalOrdinal = Tpetra::Vector<>::global_ordinal_type,
class Node = Tpetra::Vector<>::node_type>
class TpetraOperatorVectorExtraction {
public:
/** \brief Get a const Tpetra::Map from a const Thyra::VectorSpaceBase object.
*/
static RCP >
getTpetraMap(const RCP > &vs);
/** \brief Get a non-const Tpetra::Vector from a non-const
* Thyra::VectorBase object.
*/
static RCP >
getTpetraVector(const RCP > &v);
/** \brief Get a const Tpetra::Vector from a const
* Thyra::VectorBase object.
*/
static RCP >
getConstTpetraVector(const RCP > &v);
/** \brief Get a non-const Tpetra::MultiVector from a non-const
* Thyra::MultiVectorBase object.
*/
static RCP >
getTpetraMultiVector(const RCP > &mv);
/** \brief Get a const Tpetra::MultiVector from a const
* Thyra::MultiVectorBase object.
*/
static RCP >
getConstTpetraMultiVector(const RCP > &mv);
/** \brief Get a non-const Tpetra::Operator from a non-const
* Thyra::LinearOpBase object.
*/
static RCP >
getTpetraOperator(const RCP > &op);
/** \brief Get a const Tpetra::Operator from a const
* Thyra::LinearOpBase object.
*/
static RCP >
getConstTpetraOperator(const RCP > &op);
};
} // namespace Thyra
#endif // THYRA_TPETRA_THYRA_WRAPPERS_DECL_HPP