Panzer  Version of the Day
Panzer_Filtered_UniqueGlobalIndexer.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_Filtered_UniqueGlobalIndexer_hpp__
44 #define __Panzer_Filtered_UniqueGlobalIndexer_hpp__
45 
47 
48 namespace panzer {
49 
52 template <typename LocalOrdinalT,typename GlobalOrdinalT>
53 class Filtered_UniqueGlobalIndexer : public UniqueGlobalIndexer<LocalOrdinalT,GlobalOrdinalT> {
54 public:
55  // These functions are unique to this class (including constructors)
56 
60 
71  const std::vector<GlobalOrdinalT> & filteredIndices);
72 
81  void getOwnedAndGhostedNotFilteredIndicator(std::vector<int> & indicator) const;
82 
87  void getFilteredOwnedAndGhostedIndices(std::vector<GlobalOrdinalT> & indices) const ;
88 
89  // This functions are overriden, and the filtered indices removed
90 
91  virtual void getOwnedIndices(std::vector<GlobalOrdinalT> & indices) const;
92 
93  virtual void ownedIndices(const std::vector<GlobalOrdinalT> & indices,std::vector<bool> & isOwned) const;
94 
95  // The following functions are simply part of the decorator pattern and
96  // are simple pass throughs
97 
99 
101  { return base_->getComm(); }
102 
103  virtual int getNumFields() const
104  { return base_->getNumFields(); }
105 
106  virtual const std::string & getFieldString(int fieldNum) const
107  { return base_->getFieldString(fieldNum); }
108 
109  virtual int getFieldNum(const std::string & str) const
110  { return base_->getFieldNum(str); }
111 
112  virtual void getFieldOrder(std::vector<std::string> & fieldOrder) const
113  { base_->getFieldOrder(fieldOrder); }
114 
115  virtual void getElementBlockIds(std::vector<std::string> & elementBlockIds) const
116  { base_->getElementBlockIds(elementBlockIds); }
117 
118  virtual bool fieldInBlock(const std::string & field, const std::string & block) const
119  { return base_->fieldInBlock(field,block); }
120 
121  virtual const std::vector<int> & getBlockFieldNumbers(const std::string & blockId) const
122  { return base_->getBlockFieldNumbers(blockId); }
123 
124  virtual const std::vector<int> & getGIDFieldOffsets(const std::string & blockId,int fieldNum) const
125  { return base_->getGIDFieldOffsets(blockId,fieldNum); }
126 
127  virtual const std::pair<std::vector<int>,std::vector<int> > &
128  getGIDFieldOffsets_closure(const std::string & blockId, int fieldNum,
129  int subcellDim,int subcellId) const
130  { return base_->getGIDFieldOffsets_closure(blockId,fieldNum,subcellDim,subcellId); }
131 
132  virtual void getElementOrientation(LocalOrdinalT localElmtId,std::vector<double> & gidsOrientation) const
133  { base_->getElementOrientation(localElmtId,gidsOrientation); }
134 
135  virtual const std::vector<LocalOrdinalT> & getElementBlock(const std::string & blockId) const
136  { return base_->getElementBlock(blockId); }
137 
138  virtual void getElementGIDs(LocalOrdinalT localElmtId,std::vector<GlobalOrdinalT> & gids,const std::string & blockIdHint="") const
139  { base_->getElementGIDs(localElmtId,gids,blockIdHint); }
140 
141  virtual void getOwnedAndGhostedIndices(std::vector<GlobalOrdinalT> & indices) const
142  { base_->getOwnedAndGhostedIndices(indices); }
143 
144  virtual int getElementBlockGIDCount(const std::string & blockId) const
145  { return base_->getElementBlockGIDCount(blockId); }
146 
147  virtual int getElementBlockGIDCount(const std::size_t & blockIndex) const
148  { return base_->getElementBlockGIDCount(blockIndex); }
149 
151  { return base_->getConnManagerBase(); }
152 
153 private:
154 
156 
157  std::vector<GlobalOrdinalT> owned_;
158 };
159 
160 }
161 
162 #endif
virtual void getFieldOrder(std::vector< std::string > &fieldOrder) const
virtual void getElementOrientation(LocalOrdinalT localElmtId, std::vector< double > &gidsOrientation) const
Get a vector containg the orientation of the GIDs relative to the neighbors.
void initialize(const Teuchos::RCP< const UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > &ugi, const std::vector< GlobalOrdinalT > &filteredIndices)
virtual bool fieldInBlock(const std::string &field, const std::string &block) const
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 int getFieldNum(const std::string &str) const
Get the number used for access to this field.
virtual const std::vector< LocalOrdinalT > & getElementBlock(const std::string &blockId) const
void getOwnedAndGhostedNotFilteredIndicator(std::vector< int > &indicator) const
virtual void getOwnedAndGhostedIndices(std::vector< GlobalOrdinalT > &indices) const
Teuchos::RCP< const UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > base_
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const
How any GIDs are associate with a particular element block.
virtual int getElementBlockGIDCount(const std::string &blockId) const
How many GIDs are associate with a particular element block.
PHX::MDField< const ScalarT, Cell, IP > field
virtual void getElementGIDs(LocalOrdinalT localElmtId, std::vector< GlobalOrdinalT > &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< GlobalOrdinalT > &indices) const
virtual void ownedIndices(const std::vector< GlobalOrdinalT > &indices, std::vector< bool > &isOwned) const
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const
virtual const std::string & getFieldString(int fieldNum) const
Reverse lookup of the field string from a field number.
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) 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.
void getFilteredOwnedAndGhostedIndices(std::vector< GlobalOrdinalT > &indices) const
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const
virtual Teuchos::RCP< const ConnManagerBase< LocalOrdinalT > > getConnManagerBase() const
Returns the connection manager currently being used.