Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_GlobalIndexer_Utilities.cpp
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 #include "PanzerDofMgr_config.hpp"
45 
46 namespace panzer {
47 
48 
49 std::vector<Teuchos::RCP<const GlobalIndexer>>
50 nc2c_vector(const std::vector<Teuchos::RCP<GlobalIndexer > > & ugis)
51 {
52  std::vector<Teuchos::RCP<const GlobalIndexer>> vec;
53 
54  for(std::size_t blk=0;blk<ugis.size();blk++)
55  vec.push_back(ugis[blk]);
56 
57  return vec;
58 }
59 
60 int getFieldBlock(const std::string & fieldName,
61  const std::vector<Teuchos::RCP<const GlobalIndexer>> & ugis)
62 {
63  int fieldNum = -1;
64  for(std::size_t blk=0;blk<ugis.size();blk++) {
65  fieldNum = ugis[blk]->getFieldNum(fieldName);
66  if(fieldNum>=0)
67  return blk;
68  }
69 
70  return fieldNum;
71 }
72 
73 int getFieldBlock(const std::string & fieldName,
74  const std::vector<Teuchos::RCP<GlobalIndexer>> & ugis)
75 {
76  int fieldNum = -1;
77  for(std::size_t blk=0;blk<ugis.size();blk++) {
78  fieldNum = ugis[blk]->getFieldNum(fieldName);
79  if(fieldNum>=0)
80  return fieldNum;
81  }
82 
83  return fieldNum;
84 }
85 
86 void computeBlockOffsets(const std::string & blockId,
87  const std::vector<Teuchos::RCP<GlobalIndexer>> & ugis,
88  std::vector<int> & blockOffsets)
89 {
90  blockOffsets.resize(ugis.size()+1); // number of fields, plus a sentinnel
91 
92  int offset = 0;
93  for(std::size_t blk=0;blk<ugis.size();blk++) {
94  blockOffsets[blk] = offset;
95  offset += ugis[blk]->getElementBlockGIDCount(blockId);
96  }
97  blockOffsets[ugis.size()] = offset;
98 }
99 
100 void computeBlockOffsets(const std::string & blockId,
101  const std::vector<Teuchos::RCP<const GlobalIndexer>> & ugis,
102  std::vector<int> & blockOffsets)
103 {
104  blockOffsets.resize(ugis.size()+1); // number of fields, plus a sentinnel
105 
106  int offset = 0;
107  for(std::size_t blk=0;blk<ugis.size();blk++) {
108  blockOffsets[blk] = offset;
109  offset += ugis[blk]->getElementBlockGIDCount(blockId);
110  }
111  blockOffsets[ugis.size()] = offset;
112 }
113 
114 std::string
116 {
117  std::size_t myOwnedCount = static_cast<std::size_t>(ugi.getNumOwned());
118  std::size_t sum=0,min=0,max=0;
119 
120  // get min,max and sum
121  Teuchos::reduceAll(*ugi.getComm(),Teuchos::REDUCE_SUM,1,&myOwnedCount,&sum);
122  Teuchos::reduceAll(*ugi.getComm(),Teuchos::REDUCE_MIN,1,&myOwnedCount,&min);
123  Teuchos::reduceAll(*ugi.getComm(),Teuchos::REDUCE_MAX,1,&myOwnedCount,&max);
124 
125  // compute mean and variance
126  double dev2 = (double(myOwnedCount)-double(sum)/double(ugi.getComm()->getSize()));
127  dev2 *= dev2;
128 
129  double variance = 0.0;
130  Teuchos::reduceAll(*ugi.getComm(),Teuchos::REDUCE_SUM,1,&dev2,&variance);
131 
132  double mean = sum / double(ugi.getComm()->getSize());
133  variance = variance / double(ugi.getComm()->getSize());
134 
135  // now print to a string stream
136  std::stringstream ss;
137  ss << "Max, Min, Mean, StdDev = " << max << ", " << min << ", " << mean << ", " << std::sqrt(variance);
138 
139  return ss.str();
140 }
141 
142 void
143 printMeshTopology(std::ostream & os,const panzer::GlobalIndexer & ugi)
144 {
145  std::vector<std::string> block_ids;
146 
147  ugi.getElementBlockIds(block_ids);
148  for(std::size_t b=0;b<block_ids.size();b++) {
149  // extract the elemnts in each element block
150  const std::vector<panzer::LocalOrdinal> & elements = ugi.getElementBlock(block_ids[b]);
151 
152  os << "Element Block: \"" << block_ids[b] << "\"" << std::endl;
153 
154  // loop over element in this element block, write out to
155  for(std::size_t e=0;e<elements.size();e++) {
156  // extract LIDs, this is returned by reference nominally for performance
157  Kokkos::View<const int*, PHX::Device> lids = ugi.getElementLIDs(elements[e]);
158 
159  // extract GIDs, this array is filled
160  std::vector<panzer::GlobalOrdinal> gids;
161  ugi.getElementGIDs(elements[e],gids);
162 
163  os << " local element id = " << elements[e] << ", ";
164 
165  os << " gids =";
166  for(std::size_t i=0;i<gids.size();i++)
167  os << " " << gids[i];
168 
169  os << ", lids =";
170  for(std::size_t i=0;i<gids.size();i++)
171  os << " " << lids[i];
172  os << std::endl;
173  }
174  }
175 }
176 
179 {
180  typedef Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> Map;
181  typedef Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> IntVector;
182 
183  std::vector<panzer::GlobalOrdinal> indices;
184  std::vector<std::string> blocks;
185 
186  ugi.getOwnedAndGhostedIndices(indices);
187  ugi.getElementBlockIds(blocks);
188 
189  std::vector<int> fieldNumbers(indices.size(),-1);
190 
191  Teuchos::RCP<Map> ghostedMap
192  = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
194 
195  // build a map from local ids to a field number
196  for(std::size_t blk=0;blk<blocks.size();blk++) {
197  std::string blockId = blocks[blk];
198 
199  const std::vector<panzer::LocalOrdinal> & elements = ugi.getElementBlock(blockId);
200  const std::vector<int> & fields = ugi.getBlockFieldNumbers(blockId);
201 
202  // loop over all elements, and set field number in output array
203  std::vector<panzer::GlobalOrdinal> gids(fields.size());
204  for(std::size_t e=0;e<elements.size();e++) {
205  ugi.getElementGIDs(elements[e],gids);
206 
207  for(std::size_t f=0;f<fields.size();f++) {
208  int fieldNum = fields[f];
209  panzer::GlobalOrdinal gid = gids[f];
210  std::size_t lid = ghostedMap->getLocalElement(gid); // hash table lookup
211 
212  fieldNumbers[lid] = fieldNum;
213  }
214  }
215  }
216 
217  // produce a reduced vector containing only fields known by this processor
218  std::vector<panzer::GlobalOrdinal> reducedIndices;
219  std::vector<int> reducedFieldNumbers;
220  for(std::size_t i=0;i<fieldNumbers.size();i++) {
221  if(fieldNumbers[i]>-1) {
222  reducedIndices.push_back(indices[i]);
223  reducedFieldNumbers.push_back(fieldNumbers[i]);
224  }
225  }
226 
227  Teuchos::RCP<Map> reducedMap
228  = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(reducedIndices),
230  return Teuchos::rcp(new IntVector(reducedMap,Teuchos::arrayViewFromVector(reducedFieldNumbers)));
231 }
232 
234  std::vector<int> & fieldNumbers,
235  const Teuchos::RCP<const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > & reducedVec)
236 {
237  typedef Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> IntVector;
238 
240 
241  fieldNumbers.resize(dest->getLocalLength());
242  dest->get1dCopy(Teuchos::arrayViewFromVector(fieldNumbers));
243 }
244 
247  const Teuchos::RCP<const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > & reducedVec)
248 {
249  typedef Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> Map;
250  typedef Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> IntVector;
251  typedef Tpetra::Import<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> Importer;
252 
253  // first step: get a reduced field number vector and build a map to
254  // contain the full field number vector
256 
257  Teuchos::RCP<Map> destMap;
258  {
259  std::vector<panzer::GlobalOrdinal> indices;
260  ugi.getOwnedAndGhostedIndices(indices);
261  destMap = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
263  }
264 
265  Teuchos::RCP<const IntVector> source = reducedVec;
266  if(source==Teuchos::null)
267  source = buildGhostedFieldReducedVector(ugi);
268  Teuchos::RCP<const Map> sourceMap = source->getMap();
269 
270  // second step: perform the global communciation required to fix the
271  // interface conditions (where this processor doesn't know what field
272  // some indices are)
274  Teuchos::RCP<IntVector> dest = Teuchos::rcp(new IntVector(destMap));
275  Importer importer(sourceMap,destMap);
276 
277  dest->doImport(*source,importer,Tpetra::INSERT);
278 
279  return dest;
280 }
281 
284 getFieldMap(int fieldNum,const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> & fieldTVector)
285 {
287  std::vector<int> fieldVector(fieldTVector.getLocalLength());
288  fieldTVector.get1dCopy(Teuchos::arrayViewFromVector(fieldVector));
289 
290  std::vector<panzer::GlobalOrdinal> mapVector;
291  for(std::size_t i=0;i<fieldVector.size();i++) {
292  if(fieldVector[i]==fieldNum)
293  mapVector.push_back(origMap->getGlobalElement(i));
294  }
295 
297  = Teuchos::rcp(new Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(
298  Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(mapVector),
300 
301  return finalMap;
302 }
303 
305  : ugi_(ugi)
306 {
309 }
310 
311 
312 void ArrayToFieldVector::buildFieldVector(const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> & source) const
313 {
314  // build (unghosted) vector and map
315  std::vector<panzer::GlobalOrdinal> indices;
316  ugi_->getOwnedIndices(indices);
317 
319  = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
321  Teuchos::RCP<IntVector> localFieldVector = Teuchos::rcp(new IntVector(destMap));
322 
323  Tpetra::Import<int,panzer::GlobalOrdinal> importer(source.getMap(),destMap);
324  localFieldVector->doImport(source,importer,Tpetra::INSERT);
325 
326  fieldVector_ = localFieldVector;
327 }
328 
330 ArrayToFieldVector::getFieldMap(const std::string & fieldName) const
331 {
332  return getFieldMap(ugi_->getFieldNum(fieldName));
333 }
334 
337 {
338  if(fieldMaps_[fieldNum]==Teuchos::null) {
339  // if neccessary build field vector
340  if(fieldVector_==Teuchos::null)
342 
343  fieldMaps_[fieldNum] = panzer::getFieldMap(fieldNum,*fieldVector_);
344  }
345 
346  return fieldMaps_[fieldNum];
347 }
348 
349 // *****************************************
350 // namespace orientation_helpers
351 // *****************************************
352 
353 namespace orientation_helpers {
354 
355 
356 void computeCellEdgeOrientations(const std::vector<std::pair<int,int> > & topEdgeIndices,
357  const std::vector<panzer::GlobalOrdinal> & topology,
358  const FieldPattern & fieldPattern,
359  std::vector<signed char> & orientation)
360 {
361  // LOCAL element orientations are always set so that they flow in the positive
362  // direction along an edge from node 0 to node 1. As a result if the GID of
363  // node 0 is larger then node 1 then the GLOBAL orientation is -1 (and positive
364  // otherwise). The local definition of the edge direction is defined by
365  // the shards cell topology.
366 
367  TEUCHOS_ASSERT(orientation.size()==std::size_t(fieldPattern.numberIds()));
368 
369  int edgeDim = 1;
370 
371  for(std::size_t e=0;e<topEdgeIndices.size();e++) {
372  // grab topological nodes
373  const std::pair<int,int> nodes = topEdgeIndices[e];
374 
375  // extract global values of topological nodes
376  panzer::GlobalOrdinal v0 = topology[nodes.first];
377  panzer::GlobalOrdinal v1 = topology[nodes.second];
378 
379  // using simple rule make a decision about orientation
380  signed char edgeOrientation = 1;
381  if(v1>v0)
382  edgeOrientation = 1;
383  else if(v0>v1)
384  edgeOrientation = -1;
385  else
386  { TEUCHOS_ASSERT(false); }
387 
388  // grab edgeIndices to be set to compute orientation
389  const std::vector<int> & edgeIndices = fieldPattern.getSubcellIndices(edgeDim,e);
390  for(std::size_t s=0;s<edgeIndices.size();s++)
391  orientation[edgeIndices[s]] = edgeOrientation;
392  }
393 }
394 
395 void computeCellFaceOrientations(const std::vector<std::vector<int> > & topFaceIndices,
396  const std::vector<panzer::GlobalOrdinal> & topology,
397  const FieldPattern & fieldPattern,
398  std::vector<signed char> & orientation)
399 {
400  // LOCAL element orientations are always set so that they flow in the positive
401  // direction away from the cell (counter clockwise rotation of the face). To determine
402  // the face orientation we use the fact that Shards (and thus the field pattern) always
403  // locally orders faces in a counter clockwise direction. A local rule for each element
404  // will take advantage of this ensuring both elements agree on the orientation. This rule
405  // is to first find the smallest node GID on the face. Then look at the GIDs of the nodes
406  // immediately preceding and following that one. If the node following has smaller GID than
407  // the preceding node then the face is oriented counter clockwise and thus the orientation
408  // is +1. If the node preceding is larger, then the orientation is clockwise and the set to
409  // a value of -1.
410 
411  // this only works for 3D field patterns
412  TEUCHOS_ASSERT(fieldPattern.getDimension()==3);
413 
414  TEUCHOS_ASSERT(orientation.size()==std::size_t(fieldPattern.numberIds()));
415 
416  int faceDim = 2;
417 
418  for(std::size_t f=0;f<topFaceIndices.size();f++) {
419  // grab topological nodes
420  const std::vector<int> & nodes = topFaceIndices[f];
421  std::vector<panzer::GlobalOrdinal> globals(nodes.size());
422  for(std::size_t n=0;n<nodes.size();n++)
423  globals[n] = topology[nodes[n]];
424 
425  typename std::vector<panzer::GlobalOrdinal>::const_iterator itr
426  = std::min_element(globals.begin(),globals.end());
427 
428  TEUCHOS_TEST_FOR_EXCEPTION(itr==globals.end(),std::out_of_range,
429  "panzer::orientation_helpers::computeCellFaceOrientations: A face index array "
430  "was empty.");
431 
432  // extract global values of topological nodes
433  // The face nodes go in counter clockwise order, let v_min be the
434  // value with the minimum element then
435  // vbefore => itr => vafter
436  // note that the nonsense with the beginning and end has to do with
437  // if this iterator was the first or last in the array
438  panzer::GlobalOrdinal vbefore = itr==globals.begin() ? *(globals.end()-1) : *(itr-1);
439  panzer::GlobalOrdinal vafter = (itr+1)==globals.end() ? *globals.begin() : *(itr+1);
440 
441 /*
442  // sanity check in debug mode (uncomment these lines)
443  TEUCHOS_ASSERT(std::find(globals.begin(),globals.end(),vbefore)!=globals.end());
444  TEUCHOS_ASSERT(std::find(globals.begin(),globals.end(),vafter)!=globals.end());
445 
446  // print out information about the found nodes and also what
447  // order they were in originally
448  std::cout << "\nFace Order = ";
449  for(std::size_t l=0;l<globals.size();l++)
450  std::cout << globals[l] << " ";
451  std::cout << std::endl;
452  std::cout << "(before,min,after) " << f << ": " << vbefore << " => " << *itr << " => " << vafter << std::endl;
453 */
454 
455  // note by assumption
456  // vbefore < *itr and *itr < vafter
457 
458  // Based on the next lowest global id starting from the minimum
459  signed char faceOrientation = 1;
460  if(vafter>vbefore) // means smaller in clockwise direction
461  faceOrientation = -1;
462  else if(vbefore>vafter) // means smaller in counter clockwise direction
463  faceOrientation = 1;
464  else
465  { TEUCHOS_ASSERT(false); } // we got an equality somehow!
466 
467  // grab faceIndices to be set to compute orientation
468  const std::vector<int> & faceIndices = fieldPattern.getSubcellIndices(faceDim,f);
469  for(std::size_t s=0;s<faceIndices.size();s++)
470  orientation[faceIndices[s]] = faceOrientation;
471  }
472 }
473 
474 void computePatternEdgeIndices(const FieldPattern & pattern,std::vector<std::pair<int,int> > & edgeIndices)
475 {
476  unsigned dim = 1;
477  shards::CellTopology cellTopo = pattern.getCellTopology();
478  for(unsigned e=0;e<cellTopo.getEdgeCount();e++) {
479  // get local vertex ids for a this edge
480  unsigned local_v0 = cellTopo.getNodeMap(dim,e,0);
481  unsigned local_v1 = cellTopo.getNodeMap(dim,e,1);
482 
483  // get sub cell indices for geometric pattern
484  const std::vector<int> & v0_indices = pattern.getSubcellIndices(0,local_v0);
485  const std::vector<int> & v1_indices = pattern.getSubcellIndices(0,local_v1);
486 
487  TEUCHOS_ASSERT(v0_indices.size()>0); // there must be a node
488  TEUCHOS_ASSERT(v1_indices.size()>0); // there must be a node
489 
490  // take the first index on each vertex and make a edge lookup
491  edgeIndices.push_back(std::make_pair(v0_indices[0],v1_indices[0]));
492  }
493 }
494 
495 void computePatternFaceIndices(const FieldPattern & pattern,std::vector<std::vector<int> > & faceIndices)
496 {
497  // this only works for 3D field patterns
498  // TEUCHOS_ASSERT(pattern.getDimension()==3);
499  //
500  unsigned node_dim = 0; // by assumption
501  unsigned subcell_dim = 2;
502 
503  if(pattern.getDimension()==3) {
504  shards::CellTopology cellTopo = pattern.getCellTopology();
505 
506  faceIndices.resize(cellTopo.getSubcellCount(subcell_dim));
507 
508  for(unsigned f=0;f<cellTopo.getSubcellCount(subcell_dim);f++) {
509  shards::CellTopology faceTopo(cellTopo.getBaseCellTopologyData(subcell_dim,f));
510 
511  for(unsigned v=0;v<faceTopo.getNodeCount();v++) {
512  // get local vertex ids for a this edge
513  unsigned local_v = cellTopo.getNodeMap(subcell_dim,f,v);
514 
515  // get sub cell indices for geometric pattern
516  const std::vector<int> & v_indices = pattern.getSubcellIndices(node_dim,local_v);
517 
518  TEUCHOS_ASSERT(v_indices.size()>0); // there must be a node
519 
520  // take the first index on each vertex and make a edge lookup
521  faceIndices[f].push_back(v_indices[0]);
522  }
523  }
524  }
525  else if(pattern.getDimension()==2) {
526  shards::CellTopology cellTopo = pattern.getCellTopology();
527 
528  faceIndices.resize(1);
529 
530  for(unsigned v=0;v<cellTopo.getNodeCount();v++)
531  faceIndices[0].push_back(v);
532  }
533 }
534 
535 } // end namespace orientation_helpers
536 } // end namespace panzer
std::map< int, Teuchos::RCP< const Map > > fieldMaps_
(unghosted) field vector (as needed)
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const =0
virtual int getDimension() const =0
const Kokkos::View< const panzer::LocalOrdinal *, Kokkos::LayoutRight, PHX::Device > getElementLIDs(panzer::LocalOrdinal localElmtId) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const IntVector > gh_reducedFieldVector_
virtual const std::vector< panzer::LocalOrdinal > & getElementBlock(const std::string &blockId) const =0
Teuchos::RCP< Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > buildGhostedFieldReducedVector(const GlobalIndexer &ugi)
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const =0
Teuchos::RCP< const IntVector > gh_fieldVector_
ghosted reduced field vector
Teuchos::RCP< const Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > getFieldMap(int fieldNum, const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > &fieldTVector)
void computeBlockOffsets(const std::string &blockId, const std::vector< Teuchos::RCP< GlobalIndexer >> &ugis, std::vector< int > &blockOffsets)
virtual int numberIds() const
Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > IntVector
Kokkos::View< const LO **, PHX::Device > lids
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const GlobalIndexer > ugi_
DOF mapping.
std::vector< Teuchos::RCP< const GlobalIndexer > > nc2c_vector(const std::vector< Teuchos::RCP< GlobalIndexer > > &ugis)
int getFieldBlock(const std::string &fieldName, const std::vector< Teuchos::RCP< const GlobalIndexer >> &ugis)
void computeCellEdgeOrientations(const std::vector< std::pair< int, int > > &topEdgeIndices, const std::vector< panzer::GlobalOrdinal > &topology, const FieldPattern &fieldPattern, std::vector< signed char > &orientation)
virtual void getOwnedAndGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const =0
Get the set of owned and ghosted indices for this processor.
void computePatternFaceIndices(const FieldPattern &pattern, std::vector< std::vector< int > > &faceIndices)
virtual int getNumOwned() const =0
Get the number of indices owned by this processor.
void computeCellFaceOrientations(const std::vector< std::vector< int > > &topFaceIndices, const std::vector< panzer::GlobalOrdinal > &topology, const FieldPattern &fieldPattern, std::vector< signed char > &orientation)
Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > Map
virtual shards::CellTopology getCellTopology() const =0
Teuchos::RCP< const Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > getFieldMap(const std::string &fieldName) const
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const =0
virtual void getElementGIDs(panzer::LocalOrdinal localElmtId, std::vector< panzer::GlobalOrdinal > &gids, const std::string &blockIdHint="") const =0
Get the global IDs for a particular element. This function overwrites the gids variable.
virtual const std::vector< int > & getSubcellIndices(int dim, int cellIndex) const =0
void buildFieldVector(const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > &source) const
build unghosted field vector from ghosted field vector
#define TEUCHOS_ASSERT(assertion_test)
Teuchos::RCP< const IntVector > fieldVector_
Maps for each field (as needed)
void printMeshTopology(std::ostream &os, const panzer::GlobalIndexer &ugi)
void computePatternEdgeIndices(const FieldPattern &pattern, std::vector< std::pair< int, int > > &edgeIndices)
void buildGhostedFieldVector(const GlobalIndexer &ugi, std::vector< int > &fieldNumbers, const Teuchos::RCP< const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > &reducedVec)
ArrayToFieldVector()
Maps for each field (as needed)
std::string printUGILoadBalancingInformation(const GlobalIndexer &ugi)