Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ReadOnlyVector_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_ReadOnlyVector_GlobalEvaluationData_hpp__
12 #define __Panzer_ReadOnlyVector_GlobalEvaluationData_hpp__
13 
14 // Panzer
15 #include "PanzerDiscFE_config.hpp"
16 #ifdef PANZER_HAVE_EPETRA_STACK
18 #endif
19 
21 
22 // Teuchos
23 #include "Teuchos_RCP.hpp"
24 
25 // Thyra
26 #include "Thyra_VectorBase.hpp"
27 
28 namespace panzer {
29 
34 public:
35 
38 
40  virtual bool isInitialized() const = 0;
41 
45  virtual void globalToGhost(int mem) = 0;
46 
49  virtual void ghostToGlobal(int /* mem */) {}
50 
52  virtual void setOwnedVector(const Teuchos::RCP<const Thyra::VectorBase<double> > & ownedVector) = 0;
53 
56 
59 
60 #ifdef PANZER_HAVE_EPETRA_STACK
61 
73  const double&
74  operator[](
75  const int& lid) const
76  {
77  if (lid < static_cast<int>(ownedView_.extent(0)))
78  return ownedView_(lid);
79  else // if (lid >= static_cast<int>(ownedView_.extent(0)))
80  return ghostedView_(lid - ownedView_.extent(0));
81  } // end of operator[]()
82 
83 protected:
84 
89  ownedView_;
90 
95  ghostedView_;
96 #endif
97 
98 }; // end of class ReadOnlyVector_GlobalEvaluationData
99 
100 } // end of namespace panzer
101 
102 #endif // __Panzer_ReadOnlyVector_GlobalEvaluationData_hpp__
virtual bool isInitialized() const =0
Is this object initialized.
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const =0
Get the owned vector.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const =0
Get the ghosted vector.
virtual void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double > > &ownedVector)=0
Set the owned vector.