Panzer Version of the Day
Loading...
Searching...
No Matches
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
46namespace panzer {
47
48
49std::vector<Teuchos::RCP<const GlobalIndexer>>
50nc2c_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
60int 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
73int 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
86void 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
100void 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
114std::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
142void
143printMeshTopology(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 terribly inefficient for certain
157 // devices but only used for debugging
158 PHX::View<const int*> lids = ugi.getElementLIDs(elements[e]);
159 auto lids_host = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(),lids);
160
161 // extract GIDs, this array is filled
162 std::vector<panzer::GlobalOrdinal> gids;
163 ugi.getElementGIDs(elements[e],gids);
164
165 os << " local element id = " << elements[e] << ", ";
166
167 os << " gids =";
168 for(std::size_t i=0;i<gids.size();i++)
169 os << " " << gids[i];
170
171 os << ", lids =";
172 for(std::size_t i=0;i<gids.size();i++)
173 os << " " << lids_host(i);
174 os << std::endl;
175 }
176 }
177}
178
179Teuchos::RCP<Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
181{
182 using Map = Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
183 using IntVector = Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
184
185 std::vector<panzer::GlobalOrdinal> indices;
186 std::vector<std::string> blocks;
187
188 ugi.getOwnedAndGhostedIndices(indices);
189 ugi.getElementBlockIds(blocks);
190
191 std::vector<int> fieldNumbers(indices.size(),-1);
192
193 Teuchos::RCP<Map> ghostedMap
194 = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
195 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::zero(), ugi.getComm()));
196
197 // build a map from local ids to a field number
198 for(std::size_t blk=0;blk<blocks.size();blk++) {
199 std::string blockId = blocks[blk];
200
201 const std::vector<panzer::LocalOrdinal> & elements = ugi.getElementBlock(blockId);
202 const std::vector<int> & fields = ugi.getBlockFieldNumbers(blockId);
203
204 // loop over all elements, and set field number in output array
205 std::vector<panzer::GlobalOrdinal> gids(fields.size());
206 for(std::size_t e=0;e<elements.size();e++) {
207 ugi.getElementGIDs(elements[e],gids);
208
209 for(std::size_t f=0;f<fields.size();f++) {
210 int fieldNum = fields[f];
211 panzer::GlobalOrdinal gid = gids[f];
212 std::size_t lid = ghostedMap->getLocalElement(gid); // hash table lookup
213
214 fieldNumbers[lid] = fieldNum;
215 }
216 }
217 }
218
219 // produce a reduced vector containing only fields known by this processor
220 std::vector<panzer::GlobalOrdinal> reducedIndices;
221 std::vector<int> reducedFieldNumbers;
222 for(std::size_t i=0;i<fieldNumbers.size();i++) {
223 if(fieldNumbers[i]>-1) {
224 reducedIndices.push_back(indices[i]);
225 reducedFieldNumbers.push_back(fieldNumbers[i]);
226 }
227 }
228
229 Teuchos::RCP<Map> reducedMap
230 = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(reducedIndices),
231 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::zero(), ugi.getComm()));
232 return Teuchos::rcp(new IntVector(reducedMap,Teuchos::arrayViewFromVector(reducedFieldNumbers)));
233}
234
236 std::vector<int> & fieldNumbers,
237 const Teuchos::RCP<const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > & reducedVec)
238{
239 using IntVector = Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
240 Teuchos::RCP<const IntVector> dest = buildGhostedFieldVector(ugi,reducedVec);
241
242 auto host_values = dest->getLocalViewHost(Tpetra::Access::ReadOnly);
243
244 fieldNumbers.resize(dest->getLocalLength());
245 for (size_t i=0; i < fieldNumbers.size(); ++i)
246 fieldNumbers[i] = host_values(i,0);
247}
248
249Teuchos::RCP<const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
251 const Teuchos::RCP<const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > & reducedVec)
252{
253 using Map = Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
254 using IntVector = Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
255 using Importer = Tpetra::Import<int,panzer::GlobalOrdinal,panzer::TpetraNodeType>;
256
257 // first step: get a reduced field number vector and build a map to
258 // contain the full field number vector
260
261 Teuchos::RCP<Map> destMap;
262 {
263 std::vector<panzer::GlobalOrdinal> indices;
264 ugi.getOwnedAndGhostedIndices(indices);
265 destMap = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
266 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::zero(), ugi.getComm()));
267 }
268
269 Teuchos::RCP<const IntVector> source = reducedVec;
270 if(source==Teuchos::null)
271 source = buildGhostedFieldReducedVector(ugi);
272 Teuchos::RCP<const Map> sourceMap = source->getMap();
273
274 // second step: perform the global communciation required to fix the
275 // interface conditions (where this processor doesn't know what field
276 // some indices are)
278 Teuchos::RCP<IntVector> dest = Teuchos::rcp(new IntVector(destMap));
279 Importer importer(sourceMap,destMap);
280
281 dest->doImport(*source,importer,Tpetra::INSERT);
282 PHX::Device::execution_space().fence();
283
284 return dest;
285}
286
288Teuchos::RCP<const Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
289getFieldMap(int fieldNum,const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> & fieldTVector)
290{
291 Teuchos::RCP<const Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > origMap = fieldTVector.getMap();
292 std::vector<int> fieldVector(fieldTVector.getLocalLength());
293 fieldTVector.get1dCopy(Teuchos::arrayViewFromVector(fieldVector));
294
295 std::vector<panzer::GlobalOrdinal> mapVector;
296 for(std::size_t i=0;i<fieldVector.size();i++) {
297 if(fieldVector[i]==fieldNum)
298 mapVector.push_back(origMap->getGlobalElement(i));
299 }
300
301 Teuchos::RCP<Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> > finalMap
302 = Teuchos::rcp(new Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(
303 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(mapVector),
304 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::zero(), origMap->getComm()));
305
306 return finalMap;
307}
308
309ArrayToFieldVector::ArrayToFieldVector(const Teuchos::RCP<const GlobalIndexer> & ugi)
310 : ugi_(ugi)
311{
314}
315
316
317void ArrayToFieldVector::buildFieldVector(const Tpetra::Vector<int,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> & source) const
318{
319 // build (unghosted) vector and map
320 std::vector<panzer::GlobalOrdinal> indices;
321 ugi_->getOwnedIndices(indices);
322
323 Teuchos::RCP<const Map> destMap
324 = Teuchos::rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(), Teuchos::arrayViewFromVector(indices),
325 Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::zero(), ugi_->getComm()));
326 Teuchos::RCP<IntVector> localFieldVector = Teuchos::rcp(new IntVector(destMap));
327
328 Tpetra::Import<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> importer(source.getMap(),destMap);
329 localFieldVector->doImport(source,importer,Tpetra::INSERT);
330
331 fieldVector_ = localFieldVector;
332}
333
334Teuchos::RCP<const Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
335ArrayToFieldVector::getFieldMap(const std::string & fieldName) const
336{
337 return getFieldMap(ugi_->getFieldNum(fieldName));
338}
339
340Teuchos::RCP<const Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
342{
343 if(fieldMaps_[fieldNum]==Teuchos::null) {
344 // if neccessary build field vector
345 if(fieldVector_==Teuchos::null)
347
348 fieldMaps_[fieldNum] = panzer::getFieldMap(fieldNum,*fieldVector_);
349 }
350
351 return fieldMaps_[fieldNum];
352}
353
354// *****************************************
355// namespace orientation_helpers
356// *****************************************
357
358namespace orientation_helpers {
359
360
361void computeCellEdgeOrientations(const std::vector<std::pair<int,int> > & topEdgeIndices,
362 const std::vector<panzer::GlobalOrdinal> & topology,
363 const FieldPattern & fieldPattern,
364 std::vector<signed char> & orientation)
365{
366 // LOCAL element orientations are always set so that they flow in the positive
367 // direction along an edge from node 0 to node 1. As a result if the GID of
368 // node 0 is larger then node 1 then the GLOBAL orientation is -1 (and positive
369 // otherwise). The local definition of the edge direction is defined by
370 // the shards cell topology.
371
372 TEUCHOS_ASSERT(orientation.size()==std::size_t(fieldPattern.numberIds()));
373
374 int edgeDim = 1;
375
376 for(std::size_t e=0;e<topEdgeIndices.size();e++) {
377 // grab topological nodes
378 const std::pair<int,int> nodes = topEdgeIndices[e];
379
380 // extract global values of topological nodes
381 panzer::GlobalOrdinal v0 = topology[nodes.first];
382 panzer::GlobalOrdinal v1 = topology[nodes.second];
383
384 // using simple rule make a decision about orientation
385 signed char edgeOrientation = 1;
386 if(v1>v0)
387 edgeOrientation = 1;
388 else if(v0>v1)
389 edgeOrientation = -1;
390 else
391 { TEUCHOS_ASSERT(false); }
392
393 // grab edgeIndices to be set to compute orientation
394 const std::vector<int> & edgeIndices = fieldPattern.getSubcellIndices(edgeDim,e);
395 for(std::size_t s=0;s<edgeIndices.size();s++)
396 orientation[edgeIndices[s]] = edgeOrientation;
397 }
398}
399
400void computeCellFaceOrientations(const std::vector<std::vector<int> > & topFaceIndices,
401 const std::vector<panzer::GlobalOrdinal> & topology,
402 const FieldPattern & fieldPattern,
403 std::vector<signed char> & orientation)
404{
405 // LOCAL element orientations are always set so that they flow in the positive
406 // direction away from the cell (counter clockwise rotation of the face). To determine
407 // the face orientation we use the fact that Shards (and thus the field pattern) always
408 // locally orders faces in a counter clockwise direction. A local rule for each element
409 // will take advantage of this ensuring both elements agree on the orientation. This rule
410 // is to first find the smallest node GID on the face. Then look at the GIDs of the nodes
411 // immediately preceding and following that one. If the node following has smaller GID than
412 // the preceding node then the face is oriented counter clockwise and thus the orientation
413 // is +1. If the node preceding is larger, then the orientation is clockwise and the set to
414 // a value of -1.
415
416 // this only works for 3D field patterns
417 TEUCHOS_ASSERT(fieldPattern.getDimension()==3);
418
419 TEUCHOS_ASSERT(orientation.size()==std::size_t(fieldPattern.numberIds()));
420
421 int faceDim = 2;
422
423 for(std::size_t f=0;f<topFaceIndices.size();f++) {
424 // grab topological nodes
425 const std::vector<int> & nodes = topFaceIndices[f];
426 std::vector<panzer::GlobalOrdinal> globals(nodes.size());
427 for(std::size_t n=0;n<nodes.size();n++)
428 globals[n] = topology[nodes[n]];
429
430 typename std::vector<panzer::GlobalOrdinal>::const_iterator itr
431 = std::min_element(globals.begin(),globals.end());
432
433 TEUCHOS_TEST_FOR_EXCEPTION(itr==globals.end(),std::out_of_range,
434 "panzer::orientation_helpers::computeCellFaceOrientations: A face index array "
435 "was empty.");
436
437 // extract global values of topological nodes
438 // The face nodes go in counter clockwise order, let v_min be the
439 // value with the minimum element then
440 // vbefore => itr => vafter
441 // note that the nonsense with the beginning and end has to do with
442 // if this iterator was the first or last in the array
443 panzer::GlobalOrdinal vbefore = itr==globals.begin() ? *(globals.end()-1) : *(itr-1);
444 panzer::GlobalOrdinal vafter = (itr+1)==globals.end() ? *globals.begin() : *(itr+1);
445
446/*
447 // sanity check in debug mode (uncomment these lines)
448 TEUCHOS_ASSERT(std::find(globals.begin(),globals.end(),vbefore)!=globals.end());
449 TEUCHOS_ASSERT(std::find(globals.begin(),globals.end(),vafter)!=globals.end());
450
451 // print out information about the found nodes and also what
452 // order they were in originally
453 std::cout << "\nFace Order = ";
454 for(std::size_t l=0;l<globals.size();l++)
455 std::cout << globals[l] << " ";
456 std::cout << std::endl;
457 std::cout << "(before,min,after) " << f << ": " << vbefore << " => " << *itr << " => " << vafter << std::endl;
458*/
459
460 // note by assumption
461 // vbefore < *itr and *itr < vafter
462
463 // Based on the next lowest global id starting from the minimum
464 signed char faceOrientation = 1;
465 if(vafter>vbefore) // means smaller in clockwise direction
466 faceOrientation = -1;
467 else if(vbefore>vafter) // means smaller in counter clockwise direction
468 faceOrientation = 1;
469 else
470 { TEUCHOS_ASSERT(false); } // we got an equality somehow!
471
472 // grab faceIndices to be set to compute orientation
473 const std::vector<int> & faceIndices = fieldPattern.getSubcellIndices(faceDim,f);
474 for(std::size_t s=0;s<faceIndices.size();s++)
475 orientation[faceIndices[s]] = faceOrientation;
476 }
477}
478
479void computePatternEdgeIndices(const FieldPattern & pattern,std::vector<std::pair<int,int> > & edgeIndices)
480{
481 unsigned dim = 1;
482 shards::CellTopology cellTopo = pattern.getCellTopology();
483 for(unsigned e=0;e<cellTopo.getEdgeCount();e++) {
484 // get local vertex ids for a this edge
485 unsigned local_v0 = cellTopo.getNodeMap(dim,e,0);
486 unsigned local_v1 = cellTopo.getNodeMap(dim,e,1);
487
488 // get sub cell indices for geometric pattern
489 const std::vector<int> & v0_indices = pattern.getSubcellIndices(0,local_v0);
490 const std::vector<int> & v1_indices = pattern.getSubcellIndices(0,local_v1);
491
492 TEUCHOS_ASSERT(v0_indices.size()>0); // there must be a node
493 TEUCHOS_ASSERT(v1_indices.size()>0); // there must be a node
494
495 // take the first index on each vertex and make a edge lookup
496 edgeIndices.push_back(std::make_pair(v0_indices[0],v1_indices[0]));
497 }
498}
499
500void computePatternFaceIndices(const FieldPattern & pattern,std::vector<std::vector<int> > & faceIndices)
501{
502 // this only works for 3D field patterns
503 // TEUCHOS_ASSERT(pattern.getDimension()==3);
504 //
505 unsigned node_dim = 0; // by assumption
506 unsigned subcell_dim = 2;
507
508 if(pattern.getDimension()==3) {
509 shards::CellTopology cellTopo = pattern.getCellTopology();
510
511 faceIndices.resize(cellTopo.getSubcellCount(subcell_dim));
512
513 for(unsigned f=0;f<cellTopo.getSubcellCount(subcell_dim);f++) {
514 shards::CellTopology faceTopo(cellTopo.getBaseCellTopologyData(subcell_dim,f));
515
516 for(unsigned v=0;v<faceTopo.getNodeCount();v++) {
517 // get local vertex ids for a this edge
518 unsigned local_v = cellTopo.getNodeMap(subcell_dim,f,v);
519
520 // get sub cell indices for geometric pattern
521 const std::vector<int> & v_indices = pattern.getSubcellIndices(node_dim,local_v);
522
523 TEUCHOS_ASSERT(v_indices.size()>0); // there must be a node
524
525 // take the first index on each vertex and make a edge lookup
526 faceIndices[f].push_back(v_indices[0]);
527 }
528 }
529 }
530 else if(pattern.getDimension()==2) {
531 shards::CellTopology cellTopo = pattern.getCellTopology();
532
533 faceIndices.resize(1);
534
535 for(unsigned v=0;v<cellTopo.getNodeCount();v++)
536 faceIndices[0].push_back(v);
537 }
538}
539
540} // end namespace orientation_helpers
541} // end namespace panzer
Kokkos::View< const LO **, Kokkos::LayoutRight, PHX::Device > lids
Teuchos::RCP< const GlobalIndexer > ugi_
DOF mapping.
std::map< int, Teuchos::RCP< const Map > > fieldMaps_
(unghosted) field vector (as needed)
Teuchos::RCP< const IntVector > gh_reducedFieldVector_
Teuchos::RCP< const IntVector > gh_fieldVector_
ghosted reduced field vector
Teuchos::RCP< const IntVector > fieldVector_
Maps for each field (as needed)
Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > Map
Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > IntVector
ArrayToFieldVector()
Maps for each field (as needed)
void buildFieldVector(const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > &source) const
build unghosted field vector from ghosted field vector
Teuchos::RCP< const Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > getFieldMap(const std::string &fieldName) const
virtual int getDimension() const =0
virtual shards::CellTopology getCellTopology() const =0
virtual int numberIds() const
virtual const std::vector< int > & getSubcellIndices(int dim, int cellIndex) const =0
virtual const std::vector< panzer::LocalOrdinal > & getElementBlock(const std::string &blockId) const =0
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 int getNumOwned() const =0
Get the number of indices owned by this processor.
virtual void getOwnedAndGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const =0
Get the set of owned and ghosted indices for this processor.
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const =0
const Kokkos::View< const panzer::LocalOrdinal *, Kokkos::LayoutRight, PHX::Device > getElementLIDs(panzer::LocalOrdinal localElmtId) const
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const =0
void computeCellEdgeOrientations(const std::vector< std::pair< int, int > > &topEdgeIndices, const std::vector< panzer::GlobalOrdinal > &topology, const FieldPattern &fieldPattern, std::vector< signed char > &orientation)
void computePatternEdgeIndices(const FieldPattern &pattern, std::vector< std::pair< int, int > > &edgeIndices)
void computeCellFaceOrientations(const std::vector< std::vector< int > > &topFaceIndices, const std::vector< panzer::GlobalOrdinal > &topology, const FieldPattern &fieldPattern, std::vector< signed char > &orientation)
void computePatternFaceIndices(const FieldPattern &pattern, std::vector< std::vector< int > > &faceIndices)
Teuchos::RCP< const Tpetra::Map< int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > getFieldMap(int fieldNum, const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > &fieldTVector)
std::vector< Teuchos::RCP< const GlobalIndexer > > nc2c_vector(const std::vector< Teuchos::RCP< GlobalIndexer > > &ugis)
void printMeshTopology(std::ostream &os, const panzer::GlobalIndexer &ugi)
void computeBlockOffsets(const std::string &blockId, const std::vector< Teuchos::RCP< GlobalIndexer > > &ugis, std::vector< int > &blockOffsets)
void buildGhostedFieldVector(const GlobalIndexer &ugi, std::vector< int > &fieldNumbers, const Teuchos::RCP< const Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > &reducedVec)
std::string printUGILoadBalancingInformation(const GlobalIndexer &ugi)
int getFieldBlock(const std::string &fieldName, const std::vector< Teuchos::RCP< const GlobalIndexer > > &ugis)
Teuchos::RCP< Tpetra::Vector< int, int, panzer::GlobalOrdinal, panzer::TpetraNodeType > > buildGhostedFieldReducedVector(const GlobalIndexer &ugi)