Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_Filtered_GlobalIndexer.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_Filtered_GlobalIndexer_hpp__
12 #define __Panzer_Filtered_GlobalIndexer_hpp__
13 
14 #include "Panzer_GlobalIndexer.hpp"
15 
16 namespace panzer {
17 
23 public:
24  // These functions are unique to this class (including constructors)
25 
28 
39  const std::vector<panzer::GlobalOrdinal> & filteredIndices);
40 
49  void getOwnedAndGhostedNotFilteredIndicator(std::vector<int> & indicator) const;
50 
55  void getFilteredOwnedAndGhostedIndices(std::vector<panzer::GlobalOrdinal> & indices) const ;
56 
57  // This functions are overriden, and the filtered indices removed
58 
68  virtual void getOwnedIndices(std::vector<panzer::GlobalOrdinal>& indices) const
69  {
70  indices = owned_;
71  }
72 
83  virtual void getGhostedIndices(std::vector<panzer::GlobalOrdinal>& indices) const
84  {
85  indices = ghosted_;
86  }
87 
97  virtual void
98  getOwnedAndGhostedIndices(std::vector<panzer::GlobalOrdinal>& indices) const
99  {
100  using std::size_t;
101  indices.resize(owned_.size() + ghosted_.size());
102  for (size_t i(0); i < owned_.size(); ++i)
103  indices[i] = owned_[i];
104  for (size_t i(0); i < ghosted_.size(); ++i)
105  indices[owned_.size() + i] = ghosted_[i];
106  }
107 
108  // For backwards compatibility with Epetra. Will be deprecated.
109  virtual void getElementGIDsAsInt(panzer::LocalOrdinal localElmtId,std::vector<int> & gids,const std::string & blockIdHint="") const
110  { base_->getElementGIDsAsInt(localElmtId,gids,blockIdHint); }
111 
112  // For backwards compatibility with Epetra. Will be deprecated.
113  virtual void getOwnedIndicesAsInt(std::vector<int>& indices) const
114  {
115  indices.resize(owned_.size());
116  for (std::size_t i=0; i < owned_.size(); ++i)
117  indices[i] = owned_[i];
118  }
119 
120  // For backwards compatibility with Epetra. Will be deprecated.
121  virtual void getGhostedIndicesAsInt(std::vector<int>& indices) const
122  {
123  indices.resize(ghosted_.size());
124  for (std::size_t i=0; i < ghosted_.size(); ++i)
125  indices[i] = ghosted_[i];
126  }
127 
128  // For backwards compatibility with Epetra. Will be deprecated.
129  virtual void
130  getOwnedAndGhostedIndicesAsInt(std::vector<int>& indices) const
131  {
132  indices.resize(owned_.size() + ghosted_.size());
133  for (std::size_t i=0; i < owned_.size(); ++i)
134  indices[i] = owned_[i];
135  for (std::size_t i=0; i < ghosted_.size(); ++i)
136  indices[owned_.size() + i] = ghosted_[i];
137  }
138 
139 
148  virtual int getNumOwned() const
149  { return owned_.size(); }
150 
160  virtual int getNumGhosted() const
161  { return ghosted_.size(); }
162 
171  virtual int getNumOwnedAndGhosted() const
172  { return owned_.size() + ghosted_.size(); }
173 
174  virtual void ownedIndices(const std::vector<panzer::GlobalOrdinal> & indices,std::vector<bool> & isOwned) const;
175 
176  // The following functions are simply part of the decorator pattern and
177  // are simple pass throughs
178 
180 
182  { return base_->getComm(); }
183 
184  virtual int getNumFields() const
185  { return base_->getNumFields(); }
186 
187  virtual const std::string & getFieldString(int fieldNum) const
188  { return base_->getFieldString(fieldNum); }
189 
190  virtual int getFieldNum(const std::string & str) const
191  { return base_->getFieldNum(str); }
192 
193  virtual void getFieldOrder(std::vector<std::string> & fieldOrder) const
194  { base_->getFieldOrder(fieldOrder); }
195 
196  virtual void getElementBlockIds(std::vector<std::string> & elementBlockIds) const
197  { base_->getElementBlockIds(elementBlockIds); }
198 
199  virtual bool fieldInBlock(const std::string & field, const std::string & block) const
200  { return base_->fieldInBlock(field,block); }
201 
202  virtual const std::vector<int> & getBlockFieldNumbers(const std::string & blockId) const
203  { return base_->getBlockFieldNumbers(blockId); }
204 
205  virtual const std::vector<int> & getGIDFieldOffsets(const std::string & blockId,int fieldNum) const
206  { return base_->getGIDFieldOffsets(blockId,fieldNum); }
207 
208  virtual const std::pair<std::vector<int>,std::vector<int> > &
209  getGIDFieldOffsets_closure(const std::string & blockId, int fieldNum,
210  int subcellDim,int subcellId) const
211  { return base_->getGIDFieldOffsets_closure(blockId,fieldNum,subcellDim,subcellId); }
212 
213  virtual void getElementOrientation(panzer::LocalOrdinal localElmtId,std::vector<double> & gidsOrientation) const
214  { base_->getElementOrientation(localElmtId,gidsOrientation); }
215 
216  virtual const std::vector<panzer::LocalOrdinal> & getElementBlock(const std::string & blockId) const
217  { return base_->getElementBlock(blockId); }
218 
219  virtual void getElementGIDs(panzer::LocalOrdinal localElmtId,std::vector<panzer::GlobalOrdinal> & gids,const std::string & blockIdHint="") const
220  { base_->getElementGIDs(localElmtId,gids,blockIdHint); }
221 
222  virtual int getElementBlockGIDCount(const std::string & blockId) const
223  { return base_->getElementBlockGIDCount(blockId); }
224 
225  virtual int getElementBlockGIDCount(const std::size_t & blockIndex) const
226  { return base_->getElementBlockGIDCount(blockIndex); }
227 
229  { return base_->getConnManager(); }
230 
231 private:
232 
234 
241  std::vector<panzer::GlobalOrdinal> owned_;
242 
250  std::vector<panzer::GlobalOrdinal> ghosted_;
251 };
252 
253 }
254 
255 #endif
void getOwnedAndGhostedNotFilteredIndicator(std::vector< int > &indicator) const
virtual void getElementGIDs(panzer::LocalOrdinal localElmtId, std::vector< panzer::GlobalOrdinal > &gids, const std::string &blockIdHint="") const
Get the global IDs for a particular element. This function overwrites the gids variable.
virtual void getOwnedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of indices owned by this processor.
virtual int getNumOwned() const
Get the number of indices owned by this processor.
virtual int getFieldNum(const std::string &str) const
Get the number used for access to this field.
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
std::vector< panzer::GlobalOrdinal > ghosted_
The list of ghosted indices.
std::vector< panzer::GlobalOrdinal > owned_
The list of owned indices.
virtual void getOwnedIndicesAsInt(std::vector< int > &indices) const
Get the set of indices owned by this processor.
virtual void getOwnedAndGhostedIndicesAsInt(std::vector< int > &indices) const
Get the set of owned and ghosted indices for this processor.
void getFilteredOwnedAndGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
virtual void getElementOrientation(panzer::LocalOrdinal localElmtId, std::vector< double > &gidsOrientation) const
Get a vector containg the orientation of the GIDs relative to the neighbors.
virtual void ownedIndices(const std::vector< panzer::GlobalOrdinal > &indices, std::vector< bool > &isOwned) const
virtual const std::vector< panzer::LocalOrdinal > & getElementBlock(const std::string &blockId) const
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const
virtual void getOwnedAndGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of owned and ghosted indices for this processor.
virtual const std::string & getFieldString(int fieldNum) const
Reverse lookup of the field string from a field number.
virtual int getNumOwnedAndGhosted() const
Get the number of owned and ghosted indices for this processor.
virtual void getElementGIDsAsInt(panzer::LocalOrdinal localElmtId, std::vector< int > &gids, const std::string &blockIdHint="") const
Get the global IDs for a particular element. This function overwrites the gids variable.
virtual void getGhostedIndicesAsInt(std::vector< int > &indices) const
Get the set of indices ghosted for this processor.
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const
How any GIDs are associate with each element in a particular element block.
virtual Teuchos::RCP< const ConnManager > getConnManager() const
Returns the connection manager currently being used.
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we&#39;ll contribute, or in which we&#39;ll store, the result of computing this integral...
virtual const std::pair< std::vector< int >, std::vector< int > > & getGIDFieldOffsets_closure(const std::string &blockId, int fieldNum, int subcellDim, int subcellId) const
Use the field pattern so that you can find a particular field in the GIDs array. This version lets yo...
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const
virtual const std::vector< int > & getGIDFieldOffsets(const std::string &blockId, int fieldNum) const
Use the field pattern so that you can find a particular field in the GIDs array.
virtual int getElementBlockGIDCount(const std::string &blockId) const
How many GIDs are associated with each element in a particular element block.
virtual bool fieldInBlock(const std::string &field, const std::string &block) const
Teuchos::RCP< const GlobalIndexer > base_
virtual int getNumGhosted() const
Get the number of indices ghosted for this processor.
void initialize(const Teuchos::RCP< const GlobalIndexer > &ugi, const std::vector< panzer::GlobalOrdinal > &filteredIndices)
virtual void getFieldOrder(std::vector< std::string > &fieldOrder) const
virtual void getGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of indices ghosted for this processor.