Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_TpetraVector_ReadOnly_GlobalEvaluationData.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
11#ifndef __Panzer_TpetraVector_ReadOnly_GlobalEvaluationData_hpp__
12#define __Panzer_TpetraVector_ReadOnly_GlobalEvaluationData_hpp__
13
14#include "Tpetra_Import.hpp"
15#include "Tpetra_Vector.hpp"
16#include "Tpetra_Map.hpp"
17
18#include "Teuchos_RCP.hpp"
19
20#include "Thyra_VectorSpaceBase.hpp"
21#include "Thyra_VectorBase.hpp"
22
23#include "Panzer_NodeType.hpp"
25
26namespace panzer {
27
31template <typename ScalarT,typename LocalOrdinalT,typename GlobalOrdinalT,
32 typename NodeT=panzer::TpetraNodeType>
34public:
35 typedef Tpetra::Vector<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT> VectorType;
36 typedef Tpetra::Map<LocalOrdinalT,GlobalOrdinalT,NodeT> MapType;
37 typedef Tpetra::Import<LocalOrdinalT,GlobalOrdinalT,NodeT> ImportType;
38
42
45
54 TpetraVector_ReadOnly_GlobalEvaluationData(const Teuchos::RCP<const ImportType>& importer,
55 const Teuchos::RCP<const MapType>& ghostedMap,
56 const Teuchos::RCP<const MapType>& ownedMap)
57 : isInitialized_(false) { initialize(importer, ghostedMap, ownedMap); }
58
66 void useConstantValues(const std::vector<GlobalOrdinalT> & indices,double value);
67
76 void initialize(const Teuchos::RCP<const ImportType>& importer,
77 const Teuchos::RCP<const MapType>& ghostedMap,
78 const Teuchos::RCP<const MapType>& ownedMap);
79
83 virtual void globalToGhost(int mem);
84
86 virtual void initializeData();
87
89 virtual void ghostToGlobal(int /* mem */) {}
90
92 virtual bool requiresDirichletAdjustment() const { return false; }
93
95 void setOwnedVector_Tpetra(const Teuchos::RCP<const VectorType>& ownedVector);
96
98 Teuchos::RCP<const VectorType> getOwnedVector_Tpetra() const;
99
101 Teuchos::RCP<VectorType> getGhostedVector_Tpetra() const;
102
104 void setOwnedVector(const Teuchos::RCP<const Thyra::VectorBase<double> >& ownedVector);
105
107 Teuchos::RCP<const Thyra::VectorBase<double> > getOwnedVector() const;
108
110 Teuchos::RCP<Thyra::VectorBase<double> > getGhostedVector() const;
111
113 bool isInitialized() const { return isInitialized_; }
114
116 void print(std::ostream & os) const;
117
118private:
120
121 Teuchos::RCP<const MapType> ghostedMap_;
122 Teuchos::RCP<const MapType> ownedMap_;
123
124 Teuchos::RCP<const Thyra::VectorSpaceBase<double> > ghostedSpace_;
125 Teuchos::RCP<const Thyra::VectorSpaceBase<double> > ownedSpace_;
126
127 Teuchos::RCP<const ImportType> importer_;
128 Teuchos::RCP<VectorType> ghostedVector_;
129 Teuchos::RCP<const VectorType> ownedVector_;
130
131 typedef std::pair<std::vector<GlobalOrdinalT>,double> FilteredGlobalPair;
132 typedef std::pair<std::vector<LocalOrdinalT>,double> FilteredLocalPair;
133 std::vector<FilteredGlobalPair> globalFilteredPairs_;
134 std::vector<FilteredLocalPair> filteredPairs_;
135};
136
137}
138
139#endif
TpetraVector_ReadOnly_GlobalEvaluationData(const TpetraVector_ReadOnly_GlobalEvaluationData &src)
Teuchos::RCP< const VectorType > getOwnedVector_Tpetra() const
Get the owned vector (Tpetra version)
void useConstantValues(const std::vector< GlobalOrdinalT > &indices, double value)
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version)
Teuchos::RCP< VectorType > getGhostedVector_Tpetra() const
Get the ghosted vector (Tpetra version)
void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double > > &ownedVector)
Set the owned vector (Thyra version)
void setOwnedVector_Tpetra(const Teuchos::RCP< const VectorType > &ownedVector)
Set the owned vector (Tpetra version)
virtual void ghostToGlobal(int)
For this class this method does nothing.
Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > VectorType
TpetraVector_ReadOnly_GlobalEvaluationData(const Teuchos::RCP< const ImportType > &importer, const Teuchos::RCP< const MapType > &ghostedMap, const Teuchos::RCP< const MapType > &ownedMap)
void initialize(const Teuchos::RCP< const ImportType > &importer, const Teuchos::RCP< const MapType > &ghostedMap, const Teuchos::RCP< const MapType > &ownedMap)
Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version)
Tpetra::KokkosCompat::KokkosDeviceWrapperNode< PHX::Device > TpetraNodeType