Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
61 namespace Thyra
62 {
63  template<typename> class DefaultProductVectorSpace;
64 }
65 
66 namespace 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,
106  gedBlocks);
107 
112  {
113  } // end of Destructor
114 
130  void
131  initialize(
132  const Teuchos::RCP<const Thyra::VectorSpaceBase<double>>& ghostedSpace,
133  const Teuchos::RCP<const Thyra::VectorSpaceBase<double>>& ownedSpace,
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
166  initializeData();
167 
174  virtual void
176  const Teuchos::RCP<const Thyra::VectorBase<double>>& ownedVector);
177 
184  getOwnedVector() const;
185 
192  getGhostedVector() const;
193 
199  size_t
201  {
202  return gedBlocks_.size();
203  } // end of getBlockCount()
204 
212  int i)
213  {
214  return gedBlocks_[i];
215  } // end of getGEDBlock()
216 
224  int i) const
225  {
226  return gedBlocks_[i];
227  } // end of getGEDBlock()
228 
236  bool
238  {
239  return false;
240  } // end of requiresDirichletAdjustment()
241 
242  private:
243 
249 
253  std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>
255 
260 
266 
267  }; // end of class BlockedVector_ReadOnly_GlobalEvaluationData
268 
269 } // end of namespace panzer
270 
271 #endif // __Panzer_BlockedVector_ReadOnly_GlobalEvaluationData_hpp__
Teuchos::RCP< const Thyra::VectorBase< double > > ownedVector_
The owned vector.
Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > getGEDBlock(int i)
Get the i-th block (non const version).
Teuchos::RCP< const ReadOnlyVector_GlobalEvaluationData > getGEDBlock(int i) const
Get the i-th block (const version).
bool requiresDirichletAdjustment() const
Determine if a Dirichlet adjustment is necessary.
std::vector< Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > > gedBlocks_
A vector of the GlobalEvaluationData blocks.
virtual void initializeData()
Initialize internal data for communication.
This class encapsulates the needs of a gather operation to do a halo exchange for blocked vectors...
virtual void globalToGhost(int mem)
Communicate the owned data to the ghosted vector.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector.
Teuchos::RCP< const Thyra::DefaultProductVectorSpace< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector.
virtual void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double >> &ownedVector)
Set the owned vector.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
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.