Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_EpetraVector_Write_GlobalEvaluationData.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Panzer: A partial differential equation assembly
5// engine for strongly coupled complex multiphysics systems
6// Copyright (2011) Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39// Eric C. Cyr (eccyr@sandia.gov)
40// ***********************************************************************
41// @HEADER
42
43#ifndef __Panzer_EpetraVector_Write_GlobalEvaluationData_hpp__
44#define __Panzer_EpetraVector_Write_GlobalEvaluationData_hpp__
45
47//
48// Include Files
49//
51
52// Epetra
53#include "Epetra_Export.h"
54#include "Epetra_Map.h"
55#include "Epetra_Vector.h"
56
57// Panzer
59
60// Teuchos
61#include "Teuchos_RCP.hpp"
62
63// Thyra
64#include "Thyra_VectorSpaceBase.hpp"
65#include "Thyra_VectorBase.hpp"
66
67namespace panzer
68{
69
77 :
79 {
80 public:
81
86 :
87 isInitialized_(false)
88 {
89 } // end of Default Constructor
90
98 :
99 isInitialized_(false)
100 {
102 } // end of Copy Constructor
103
116 const Teuchos::RCP<const Epetra_Export>& exporter,
117 const Teuchos::RCP<const Epetra_Map>& ghostedMap,
118 const Teuchos::RCP<const Epetra_Map>& ownedMap)
119 :
120 isInitialized_(false)
121 {
122 initialize(exporter, ghostedMap, ownedMap);
123 } // end of Initializing Constructor
124
136 void
138 const Teuchos::RCP<const Epetra_Export>& exporter,
139 const Teuchos::RCP<const Epetra_Map>& ghostedMap,
140 const Teuchos::RCP<const Epetra_Map>& ownedMap);
141
150 virtual void
152 int mem);
153
157 virtual void
159
165 virtual bool
167 {
168 return false;
169 } // end of requiresDirichletAdjustment()
170
177 void
179 const Teuchos::RCP<Epetra_Vector>& ownedVector);
180
186 Teuchos::RCP<Epetra_Vector>
188
195 void
197 const Teuchos::RCP<Thyra::VectorBase<double>>& ownedVector);
198
204 Teuchos::RCP<Thyra::VectorBase<double>>
205 getOwnedVector() const;
206
212 Teuchos::RCP<Thyra::VectorBase<double>>
213 getGhostedVector() const;
214
220 virtual bool
222 {
223 return isInitialized_;
224 } // end of isInitialized()
225
234 void
235 print(
236 std::ostream& os) const;
237
238 private:
239
245
249 Teuchos::RCP<const Epetra_Map> ghostedMap_;
250
254 Teuchos::RCP<const Epetra_Map> ownedMap_;
255
259 Teuchos::RCP<const Thyra::VectorSpaceBase<double>> ghostedSpace_;
260
264 Teuchos::RCP<const Thyra::VectorSpaceBase<double>> ownedSpace_;
265
270 Teuchos::RCP<const Epetra_Export> exporter_;
271
275 Teuchos::RCP<Epetra_Vector> ghostedVector_;
276
280 Teuchos::RCP<Thyra::VectorBase<double>> ownedVector_;
281
282 }; // end of class EpetraVector_Write_GlobalEvaluationData
283
284} // end of namespace panzer
285
286#endif // __Panzer_EpetraVector_Write_GlobalEvaluationData_hpp__
This class provides a boundary exchange communication mechanism for vectors.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
The vector space corresponding to the owned vector.
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ghostedMap_
The map corresponding to the ghosted vector.
void initialize(const Teuchos::RCP< const Epetra_Export > &exporter, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initialize this object with some Epetra communication objects.
Teuchos::RCP< const Epetra_Export > exporter_
The exporter used to communicate between the owned and ghosted vectors.
virtual void ghostToGlobal(int mem)
Communicate the ghosted data to the owned vector.
void setOwnedVector(const Teuchos::RCP< Thyra::VectorBase< double > > &ownedVector)
Set the owned vector (Thyra version).
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
virtual bool requiresDirichletAdjustment() const
Determine if a Dirichlet adjustment is necessary.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
Teuchos::RCP< const Epetra_Map > ownedMap_
The map corresponding to the owned vector.
virtual void initializeData()
Clear out the ghosted vector. // JMG: Is this right?
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
Teuchos::RCP< Thyra::VectorBase< double > > ownedVector_
The owned vector.
EpetraVector_Write_GlobalEvaluationData(const Teuchos::RCP< const Epetra_Export > &exporter, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initializing Constructor.
EpetraVector_Write_GlobalEvaluationData(const EpetraVector_Write_GlobalEvaluationData &src)
Copy Constructor.
Teuchos::RCP< Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version).
void setOwnedVector_Epetra(const Teuchos::RCP< Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).