Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_WriteVector_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_WriteVector_GlobalEvaluationData_hpp__
12 #define __Panzer_WriteVector_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 
37  typedef enum { CM_Sum, CM_Max, CM_Min, CM_Insert } CombineMode;
38 
41 
44 
47 
50 
52  virtual bool isInitialized() const = 0;
53 
54 
57  virtual void globalToGhost(int /* mem */) { }
58 
62  virtual void ghostToGlobal(int mem) = 0;
63 
65  virtual void setOwnedVector(const Teuchos::RCP<Thyra::VectorBase<double> > & ownedVector) = 0;
66 
69 
72 
73 #ifdef PANZER_HAVE_EPETRA_STACK
74 
86  double&
87  operator[](
88  const int& lid)
89  {
90  if (lid < static_cast<int>(ownedView_.extent(0)))
91  return ownedView_(lid);
92  else // if (lid >= static_cast<int>(ownedView_.extent(0)))
93  return ghostedView_(lid - ownedView_.extent(0));
94  } // end of operator[]()
95 
96 protected:
97 
102  ownedView_;
103 
108  ghostedView_;
109 #endif // PANZER_HAVE_EPETRA_STACK
110 
111 private:
112 
114 }; // end of class WriteVector_GlobalEvaluationData
115 
116 } // end of namespace panzer
117 
118 #endif // __Panzer_WriteVector_GlobalEvaluationData_hpp__
virtual Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const =0
Get the ghosted vector.
virtual void ghostToGlobal(int mem)=0
CombineMode
when you gho from ghost to global, combine with a particular mode
WriteVector_GlobalEvaluationData()
Default constructor, set combine mode to sum right away.
void setCombineMode(CombineMode cm)
Allow the user to set the combine mode (at any time)
virtual void setOwnedVector(const Teuchos::RCP< Thyra::VectorBase< double > > &ownedVector)=0
Set the owned vector.
virtual bool isInitialized() const =0
Is this object initialized.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getOwnedVector() const =0
Get the owned vector.
CombineMode getCombineMode() const
Get the combine mode, to be used by sub classes.