Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_BlockedVector_ReadOnly_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_BlockedVector_ReadOnly_GlobalEvaluationData_hpp__
44#define __Panzer_BlockedVector_ReadOnly_GlobalEvaluationData_hpp__
45
47//
48// Include Files
49//
51
52// Panzer
54
56//
57// Forward Declarations
58//
60
61namespace Thyra
62{
63 template<typename> class DefaultProductVectorSpace;
64}
65
66namespace panzer
67{
73 :
75 {
76 public:
77
82
90
103 const Teuchos::RCP<const Thyra::VectorSpaceBase<double>> ghostedSpace,
104 const Teuchos::RCP<const Thyra::VectorSpaceBase<double>> ownedSpace,
105 const std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>&
106 gedBlocks);
107
112 {
113 } // end of Destructor
114
130 void
132 const Teuchos::RCP<const Thyra::VectorSpaceBase<double>>& ghostedSpace,
133 const Teuchos::RCP<const Thyra::VectorSpaceBase<double>>& ownedSpace,
134 const std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>&
135 gedBlocks);
136
142 virtual bool
144 {
145 return isInitialized_;
146 } // end of isInitialized()
147
156 virtual void
158 int mem);
159
165 virtual void
167
174 virtual void
176 const Teuchos::RCP<const Thyra::VectorBase<double>>& ownedVector);
177
183 virtual Teuchos::RCP<const Thyra::VectorBase<double>>
184 getOwnedVector() const;
185
191 virtual Teuchos::RCP<Thyra::VectorBase<double>>
192 getGhostedVector() const;
193
199 size_t
201 {
202 return gedBlocks_.size();
203 } // end of getBlockCount()
204
205
206#ifdef PANZER_HAVE_EPETRA_STACK
212 Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>
213 getGEDBlock(
214 int i)
215 {
216 return gedBlocks_[i];
217 } // end of getGEDBlock()
218
224 Teuchos::RCP<const ReadOnlyVector_GlobalEvaluationData>
225 getGEDBlock(
226 int i) const
227 {
228 return gedBlocks_[i];
229 } // end of getGEDBlock()
230#endif // PANZER_HAVE_EPETRA_STACK
231
239 bool
241 {
242 return false;
243 } // end of requiresDirichletAdjustment()
244
245 private:
246
252
256 std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>
258
262 Teuchos::RCP<const Thyra::VectorBase<double>> ownedVector_;
263
267 Teuchos::RCP<const Thyra::DefaultProductVectorSpace<double>>
269
270 }; // end of class BlockedVector_ReadOnly_GlobalEvaluationData
271
272} // end of namespace panzer
273
274#endif // __Panzer_BlockedVector_ReadOnly_GlobalEvaluationData_hpp__
This class encapsulates the needs of a gather operation to do a halo exchange for blocked vectors.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
bool requiresDirichletAdjustment() const
Determine if a Dirichlet adjustment is necessary.
void initialize(const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &ghostedSpace, const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &ownedSpace, const std::vector< Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > > &gedBlocks)
Initialize this object using the sub-GlobalEvaluationData objects.
Teuchos::RCP< const Thyra::VectorBase< double > > ownedVector_
The owned vector.
Teuchos::RCP< const Thyra::DefaultProductVectorSpace< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
std::vector< Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > > gedBlocks_
A vector of the GlobalEvaluationData blocks.
virtual void globalToGhost(int mem)
Communicate the owned data to the ghosted vector.
virtual void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double > > &ownedVector)
Set the owned vector.
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector.