Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_EpetraVector_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_EpetraVector_ReadOnly_GlobalEvaluationData_hpp__
12 #define __Panzer_EpetraVector_ReadOnly_GlobalEvaluationData_hpp__
13 
15 //
16 // Include Files
17 //
19 
20 // Epetra
21 #include "Epetra_Import.h"
22 #include "Epetra_Map.h"
23 #include "Epetra_Vector.h"
24 
25 // Panzer
27 
28 // Teuchos
29 #include "Teuchos_RCP.hpp"
30 
32 //
33 // Forward Declarations
34 //
36 
37 namespace panzer
38 {
47  :
49  {
50  public:
51 
56  :
57  isInitialized_(false)
58  {
59  } // end of Default Constructor
60 
68  :
69  isInitialized_(false)
70  {
72  } // end of Copy Constructor
73 
86  const Teuchos::RCP<const Epetra_Import>& importer,
87  const Teuchos::RCP<const Epetra_Map>& ghostedMap,
88  const Teuchos::RCP<const Epetra_Map>& ownedMap)
89  :
90  isInitialized_(false)
91  {
92  initialize(importer, ghostedMap, ownedMap);
93  } // end of Initializing Constructor
94 
108  void
110  const std::vector<int>& indices,
111  double value);
112 
124  void
125  initialize(
126  const Teuchos::RCP<const Epetra_Import>& importer,
127  const Teuchos::RCP<const Epetra_Map>& ghostedMap,
128  const Teuchos::RCP<const Epetra_Map>& ownedMap);
129 
138  virtual void
140  int mem = 0);
141 
145  virtual void
146  initializeData();
147 
156  virtual void
158  int mem = 0);
159 
167  virtual bool
169  {
170  return false;
171  } // end of requiresDirichletAdjustment()
172 
179  void
181  const Teuchos::RCP<const Epetra_Vector>& ownedVector);
182 
189  getGhostedVector_Epetra() const;
190 
197  void
199  const Teuchos::RCP<const Thyra::VectorBase<double>>& ownedVector);
200 
207  getOwnedVector() const;
208 
215  getGhostedVector() const;
216 
222  bool
224  {
225  return isInitialized_;
226  } // end of isInitialized()
227 
236  void
237  print(
238  std::ostream& os) const;
239 
240  private:
241 
247 
252 
257 
262 
267 
273 
278 
283 
288  typedef std::pair<std::vector<int>, double> FilteredPair;
289 
294  std::vector<FilteredPair> filteredPairs_;
295 
296  }; // end of class EpetraVector_ReadOnly_GlobalEvaluationData
297 
298 } // end of namespace panzer
299 
300 #endif // __Panzer_EpetraVector_ReadOnly_GlobalEvaluationData_hpp__
virtual void globalToGhost(int mem=0)
Communicate the owned data to the ghosted vector.
EpetraVector_ReadOnly_GlobalEvaluationData(const EpetraVector_ReadOnly_GlobalEvaluationData &src)
Copy Constructor.
Teuchos::RCP< const Epetra_Import > importer_
The importer used to communicate between the owned and ghosted vectors.
void setOwnedVector_Epetra(const Teuchos::RCP< const Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).
void useConstantValues(const std::vector< int > &indices, double value)
Choose a few GIDs and, instead of zeroing them out in the ghosted vector, set them to a specified val...
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
This class provides a boundary exchange communication mechanism for vectors.
virtual void ghostToGlobal(int mem=0)
Communicate the ghosted data to the owned vector.
Teuchos::RCP< const Thyra::VectorBase< double > > ownedVector_
The owned vector.
void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double >> &ownedVector)
Set the owned vector (Thyra version).
std::vector< FilteredPair > filteredPairs_
The list of filtered pairs, used to initialize values on the ghostedVector_.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
The vector space corresponding to the owned vector.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
std::pair< std::vector< int >, double > FilteredPair
A list of global IDs (which will be translated to local IDs), paired with a value to be assigned in t...
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ownedMap_
The map corresponding to the owned vector.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
virtual bool requiresDirichletAdjustment() const
Determine if a Dirichlet adjustment is necessary.
Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ghostedMap_
The map corresponding to the ghosted vector.
EpetraVector_ReadOnly_GlobalEvaluationData(const Teuchos::RCP< const Epetra_Import > &importer, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initializing Constructor.
void initialize(const Teuchos::RCP< const Epetra_Import > &importer, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initialize this object with some Epetra communication objects.