Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
26 namespace panzer {
27 
31 template <typename ScalarT,typename LocalOrdinalT,typename GlobalOrdinalT,
32  typename NodeT=panzer::TpetraNodeType>
34 public:
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 
41  : isInitialized_(false) { }
42 
44  : isInitialized_(false) { initialize(src.importer_, src.ghostedMap_, src.ownedMap_); }
45 
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 
96 
99 
102 
104  void setOwnedVector(const Teuchos::RCP<const Thyra::VectorBase<double> >& ownedVector);
105 
108 
111 
113  bool isInitialized() const { return isInitialized_; }
114 
116  void print(std::ostream & os) const;
117 
118 private:
120 
123 
126 
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
virtual void ghostToGlobal(int)
For this class this method does nothing.
Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > VectorType
void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double > > &ownedVector)
Set the owned vector (Thyra version)
virtual bool requiresDirichletAdjustment() const
Nothing to do (its read only)
TpetraVector_ReadOnly_GlobalEvaluationData(const TpetraVector_ReadOnly_GlobalEvaluationData &src)
void useConstantValues(const std::vector< GlobalOrdinalT > &indices, double value)
Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version)
TpetraVector_ReadOnly_GlobalEvaluationData(const Teuchos::RCP< const ImportType > &importer, const Teuchos::RCP< const MapType > &ghostedMap, const Teuchos::RCP< const MapType > &ownedMap)
void setOwnedVector_Tpetra(const Teuchos::RCP< const VectorType > &ownedVector)
Set the owned vector (Tpetra version)
Teuchos::RCP< const VectorType > getOwnedVector_Tpetra() const
Get the owned vector (Tpetra version)
Teuchos::RCP< VectorType > getGhostedVector_Tpetra() const
Get the ghosted vector (Tpetra version)
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version)
Tpetra::KokkosCompat::KokkosDeviceWrapperNode< PHX::Device > TpetraNodeType
void initialize(const Teuchos::RCP< const ImportType > &importer, const Teuchos::RCP< const MapType > &ghostedMap, const Teuchos::RCP< const MapType > &ownedMap)