Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_STK_SetupUtilities.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
44#include "Panzer_Workset_Builder.hpp"
45#include "Teuchos_Assert.hpp"
46
47#include <stk_mesh/base/Selector.hpp>
48#include <stk_mesh/base/GetEntities.hpp>
49
50namespace panzer_stk {
51
52Teuchos::RCP<std::vector<panzer::Workset> >
54 const std::string & eBlock,
55 const panzer::WorksetNeeds & needs)
56{
57 using namespace workset_utils;
58
59 std::vector<std::string> element_blocks;
60
61 std::vector<std::size_t> local_cell_ids;
62 Kokkos::DynRankView<double,PHX::Device> cell_vertex_coordinates;
63
64 getIdsAndVertices(mesh, eBlock, local_cell_ids, cell_vertex_coordinates);
65
66 // only build workset if there are elements to worry about
67 // this may be processor dependent, so an element block
68 // may not have elements and thus no contribution
69 // on this processor
70 return panzer::buildWorksets(needs, eBlock, local_cell_ids, cell_vertex_coordinates);
71}
72
73Teuchos::RCP<std::vector<panzer::Workset> >
75 const panzer::WorksetNeeds & needs,
76 const std::string & sideset,
77 const std::string & eBlock,
78 bool useCascade)
79{
80 using namespace workset_utils;
81 using Teuchos::RCP;
82
83 std::vector<stk::mesh::Entity> sideEntities;
84
85 try {
86 // grab local entities on this side
87 // ...catch any failure...primarily wrong side set and element block info
88 if(!useCascade)
89 mesh.getMySides(sideset,eBlock,sideEntities);
90 else
91 mesh.getAllSides(sideset,eBlock,sideEntities);
92 }
94 std::stringstream ss;
95 std::vector<std::string> sideSets;
96 mesh.getSidesetNames(sideSets);
97
98 // build an error message
99 ss << e.what() << "\nChoose one of:\n";
100 for(std::size_t i=0;i<sideSets.size();i++)
101 ss << "\"" << sideSets[i] << "\"\n";
102
103 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
104 }
106 std::stringstream ss;
107 std::vector<std::string> elementBlocks;
108 mesh.getElementBlockNames(elementBlocks);
109
110 // build an error message
111 ss << e.what() << "\nChoose one of:\n";
112 for(std::size_t i=0;i<elementBlocks.size();i++)
113 ss << "\"" << elementBlocks[i] << "\"\n";
114
115 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
116 }
117 catch(std::logic_error & e) {
118 std::stringstream ss;
119 ss << e.what() << "\nUnrecognized logic error.\n";
120
121 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
122 }
123
124 std::vector<stk::mesh::Entity> elements;
125 std::map<std::pair<unsigned,unsigned>,std::vector<std::size_t> > local_cell_ids;
126 if(!useCascade) {
127 unsigned subcell_dim = needs.cellData.baseCellDimension()-1;
128 std::vector<std::size_t> local_side_ids;
129 getSideElements(mesh, eBlock,
130 sideEntities,local_side_ids,elements);
131
132 // build local cell_ids, mapped by local side id
133 for(std::size_t elm=0;elm<elements.size();++elm) {
134 stk::mesh::Entity element = elements[elm];
135
136 local_cell_ids[std::make_pair(subcell_dim,local_side_ids[elm])].push_back(mesh.elementLocalId(element));
137 }
138 }
139 else {
140 std::vector<std::size_t> local_subcell_ids, subcell_dim;
141 getSideElementCascade(mesh, eBlock,
142 sideEntities,subcell_dim,local_subcell_ids,elements);
143
144 // build local cell_ids, mapped by local side id
145 for(std::size_t elm=0;elm<elements.size();++elm) {
146 stk::mesh::Entity element = elements[elm];
147
148 local_cell_ids[std::make_pair(subcell_dim[elm],local_subcell_ids[elm])].push_back(mesh.elementLocalId(element));
149 }
150 }
151
152 // only build workset if there are elements to worry about
153 // this may be processor dependent, so a defined boundary
154 // condition may have not elements and thus no contribution
155 // on this processor
156 if(elements.size()!=0) {
157 Teuchos::RCP<const shards::CellTopology> topo = mesh.getCellTopology(eBlock);
158
159 // worksets to be returned
160 Teuchos::RCP<std::vector<panzer::Workset> > worksets = Teuchos::rcp(new std::vector<panzer::Workset>);
161
162 // loop over each side
163 for(std::map<std::pair<unsigned,unsigned>,std::vector<std::size_t> >::const_iterator itr=local_cell_ids.begin();
164 itr!=local_cell_ids.end();++itr) {
165
166 if(itr->second.size()==0)
167 continue;
168
169 Kokkos::DynRankView<double,PHX::Device> vertices;
170 mesh.getElementVertices(itr->second,eBlock,vertices);
171
172 Teuchos::RCP<std::vector<panzer::Workset> > current
173 = panzer::buildWorksets(needs, eBlock, itr->second, vertices);
174
175 // correct worksets so the sides are correct
176 for(std::size_t w=0;w<current->size();w++) {
177 (*current)[w].subcell_dim = itr->first.first;
178 (*current)[w].subcell_index = itr->first.second;
179 }
180
181 // append new worksets
182 worksets->insert(worksets->end(),current->begin(),current->end());
183 }
184
185 return worksets;
186 }
187
188 // return Teuchos::null;
189 return Teuchos::rcp(new std::vector<panzer::Workset>());
190}
191
192Teuchos::RCP<std::map<unsigned,panzer::Workset> >
194 const panzer::WorksetNeeds & needs_a,
195 const std::string & blockid_a,
196 const panzer::WorksetNeeds & needs_b,
197 const std::string & blockid_b,
198 const std::string & sideset)
199{
200 using namespace workset_utils;
201 using Teuchos::RCP;
202
203 std::vector<stk::mesh::Entity> sideEntities; // we will reduce a_ and b_ to this vector
204
205 try {
206 // grab local entities on this side
207 // ...catch any failure...primarily wrong side set and element block info
208
209 // we can't use getMySides because it only returns locally owned sides
210 // this gurantees all the sides are extracted (element ownership is considered
211 // we we call getSideElements below)
212
213 stk::mesh::Part * sidePart = mesh.getSideset(sideset);
214 TEUCHOS_TEST_FOR_EXCEPTION(sidePart==0,std::logic_error,
215 "Unknown side set \"" << sideset << "\"");
216
217 stk::mesh::Selector side = *sidePart;
218 // stk::mesh::Selector ownedBlock = metaData_->locally_owned_part() & side;
219
220 // grab elements
221 stk::mesh::get_selected_entities(side,mesh.getBulkData()->buckets(mesh.getSideRank()),sideEntities);
222 }
224 std::stringstream ss;
225 std::vector<std::string> elementBlocks;
226 mesh.getElementBlockNames(elementBlocks);
227
228 // build an error message
229 ss << e.what() << "\nChoose one of:\n";
230 for(std::size_t i=0;i<elementBlocks.size();i++)
231 ss << "\"" << elementBlocks[i] << "\"\n";
232
233 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
234 }
235 catch(std::logic_error & e) {
236 std::stringstream ss;
237 ss << e.what() << "\nUnrecognized logic error.\n";
238
239 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
240 }
241
242 std::vector<stk::mesh::Entity> elements_a, elements_b;
243 std::vector<std::size_t> local_cell_ids_a, local_cell_ids_b;
244 std::vector<std::size_t> local_side_ids_a, local_side_ids_b;
245
246 // this enforces that "a" elements must be owned.
247 getSideElements(mesh, blockid_a,blockid_b, sideEntities,
248 local_side_ids_a,elements_a,
249 local_side_ids_b,elements_b);
250
251 TEUCHOS_TEST_FOR_EXCEPTION(elements_a.size()!=elements_b.size(),std::logic_error,
252 "For a DG type boundary, the number of elements on the \"left\" and \"right\" is not the same.");
253
254 // only build workset if there are elements to worry about
255 // this may be processor dependent, so a defined boundary
256 // condition may have not elements and thus no contribution
257 // on this processor
258 if(elements_a.size()==0)
259 return Teuchos::rcp(new std::map<unsigned,panzer::Workset>);
260
261 // loop over elements of this block (note the assures that element_a and element_b
262 // are the same size, the ordering is the same because the order of sideEntities is
263 // the same
264 for(std::size_t elm=0;elm<elements_a.size();++elm) {
265 stk::mesh::Entity element_a = elements_a[elm];
266 stk::mesh::Entity element_b = elements_b[elm];
267
268 local_cell_ids_a.push_back(mesh.elementLocalId(element_a));
269 local_cell_ids_b.push_back(mesh.elementLocalId(element_b));
270 }
271
272 Kokkos::DynRankView<double,PHX::Device> vertex_coordinates_a, vertex_coordinates_b;
273 mesh.getElementVertices(local_cell_ids_a,blockid_a,vertex_coordinates_a);
274 mesh.getElementVertices(local_cell_ids_b,blockid_b,vertex_coordinates_b);
275
276 // worksets to be returned
277 return buildBCWorkset(needs_a,blockid_a, local_cell_ids_a, local_side_ids_a, vertex_coordinates_a,
278 needs_b,blockid_b, local_cell_ids_b, local_side_ids_b, vertex_coordinates_b);
279}
280
281Teuchos::RCP<std::map<unsigned,panzer::Workset> >
283 const panzer::WorksetNeeds & needs,
284 const std::string & eblockID,
285 const std::string & sidesetID)
286{
287 using namespace workset_utils;
288 using Teuchos::RCP;
289
290 std::vector<stk::mesh::Entity> sideEntities;
291
292 try {
293 // grab local entities on this side
294 // ...catch any failure...primarily wrong side set and element block info
295 mesh.getMySides(sidesetID,eblockID,sideEntities);
296 }
298 std::stringstream ss;
299 std::vector<std::string> sideSets;
300 mesh.getSidesetNames(sideSets);
301
302 // build an error message
303 ss << e.what() << "\nChoose one of:\n";
304 for(std::size_t i=0;i<sideSets.size();i++)
305 ss << "\"" << sideSets[i] << "\"\n";
306
307 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
308 }
310 std::stringstream ss;
311 std::vector<std::string> elementBlocks;
312 mesh.getElementBlockNames(elementBlocks);
313
314 // build an error message
315 ss << e.what() << "\nChoose one of:\n";
316 for(std::size_t i=0;i<elementBlocks.size();i++)
317 ss << "\"" << elementBlocks[i] << "\"\n";
318
319 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
320 }
321 catch(std::logic_error & e) {
322 std::stringstream ss;
323 ss << e.what() << "\nUnrecognized logic error.\n";
324
325 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true,std::logic_error,ss.str());
326 }
327
328 std::vector<stk::mesh::Entity> elements;
329 std::vector<std::size_t> local_cell_ids;
330 std::vector<std::size_t> local_side_ids;
331 getSideElements(mesh, eblockID,
332 sideEntities,local_side_ids,elements);
333
334 // loop over elements of this block
335 for(std::size_t elm=0;elm<elements.size();++elm) {
336 stk::mesh::Entity element = elements[elm];
337
338 local_cell_ids.push_back(mesh.elementLocalId(element));
339 }
340
341 // only build workset if there are elements to worry about
342 // this may be processor dependent, so a defined boundary
343 // condition may have not elements and thus no contribution
344 // on this processor
345 if(elements.size()!=0) {
346 Teuchos::RCP<const shards::CellTopology> topo
347 = mesh.getCellTopology(eblockID);
348
349 Kokkos::DynRankView<double,PHX::Device> vertices;
350 mesh.getElementVertices(local_cell_ids,eblockID,vertices);
351
352 return panzer::buildBCWorkset(needs, eblockID, local_cell_ids, local_side_ids, vertices);
353 }
354
355 return Teuchos::null;
356}
357
358namespace workset_utils {
359
361 const std::string & blockId,
362 const std::vector<stk::mesh::Entity> & entities,
363 std::vector<std::size_t> & localEntityIds,
364 std::vector<stk::mesh::Entity> & elements)
365{
366 // for verifying that an element is in specified block
367 stk::mesh::Part * blockPart = mesh.getElementBlockPart(blockId);
368 stk::mesh::Part * ownedPart = mesh.getOwnedPart();
369 stk::mesh::BulkData& bulkData = *mesh.getBulkData();
370
371 // loop over each entitiy extracting elements and local entity ID that
372 // are containted in specified block.
373 std::vector<stk::mesh::Entity>::const_iterator entityItr;
374 for(entityItr=entities.begin();entityItr!=entities.end();++entityItr) {
375 stk::mesh::Entity entity = *entityItr;
376
377 const size_t num_rels = bulkData.num_elements(entity);
378 stk::mesh::Entity const* relations = bulkData.begin_elements(entity);
379 stk::mesh::ConnectivityOrdinal const* ordinals = bulkData.begin_element_ordinals(entity);
380 for(std::size_t e=0; e<num_rels; ++e) {
381 stk::mesh::Entity element = relations[e];
382 std::size_t entityId = ordinals[e];
383
384 // is this element in requested block
385 stk::mesh::Bucket const& bucket = bulkData.bucket(element);
386 bool inBlock = bucket.member(*blockPart);
387 bool onProc = bucket.member(*ownedPart);
388 if(inBlock && onProc) {
389 // add element and Side ID to output vectors
390 elements.push_back(element);
391 localEntityIds.push_back(entityId);
392 }
393 }
394 }
395}
396
398 const std::string & blockId,
399 const std::vector<stk::mesh::Entity> & entities,
400 std::vector<std::size_t> & localEntityIds,
401 std::vector<stk::mesh::Entity> & elements,
402 std::vector<std::size_t> & missingElementIndices)
403{
404 // for verifying that an element is in specified block
405 stk::mesh::Part * blockPart = mesh.getElementBlockPart(blockId);
406 stk::mesh::Part * universalPart = &mesh.getMetaData()->universal_part();
407 stk::mesh::BulkData& bulkData = *mesh.getBulkData();
408
409 // loop over each entitiy extracting elements and local entity ID that
410 // are containted in specified block.
411 std::size_t entityIndex =-1;
412 std::vector<stk::mesh::Entity>::const_iterator entityItr;
413 for(entityItr=entities.begin();entityItr!=entities.end();++entityItr) {
414 stk::mesh::Entity entity = *entityItr;
415 entityIndex += 1;
416
417 const size_t num_rels = bulkData.num_elements(entity);
418 stk::mesh::Entity const* element_rels = bulkData.begin_elements(entity);
419 stk::mesh::ConnectivityOrdinal const* ordinals = bulkData.begin_element_ordinals(entity);
420 for(std::size_t e=0; e<num_rels; ++e) {
421 stk::mesh::Entity element = element_rels[e];
422 std::size_t entityId = ordinals[e];
423
424 // is this element in requested block
425 stk::mesh::Bucket const& bucket = bulkData.bucket(element);
426 bool inBlock = bucket.member(*blockPart);
427 bool onProc = bucket.member(*universalPart);
428 if(inBlock && onProc) {
429 // add element and Side ID to output vectors
430 elements.push_back(element);
431 localEntityIds.push_back(entityId);
432 } else if(!inBlock && (num_rels == 1)) {
433 // add index of side whose neighbor element in blockPart does not belong
434 // to the current processor
435 missingElementIndices.push_back(entityIndex);
436 }
437 }
438 }
439}
440
442 const std::string & blockId,
443 const std::vector<stk::mesh::Entity> & sides,
444 std::vector<std::size_t> & localSubcellDim,
445 std::vector<std::size_t> & localSubcellIds,
446 std::vector<stk::mesh::Entity> & elements)
447{
448 // This is the alogrithm, for computing the side element
449 // cascade. The requirements are that for a particular set of sides
450 // we compute all elements and subcells where they touch the side. Note
451 // that elements can be and will be repeated within this list.
452
453 std::vector<std::vector<stk::mesh::Entity> > subcells;
454 getSubcellEntities(mesh,sides,subcells);
455 subcells.push_back(sides);
456
457 // subcells now contains a unique list of faces, edges and nodes that
458 // intersect with the sides
459
460 for(std::size_t d=0;d<subcells.size();d++) {
461 std::vector<std::size_t> subcellIds;
462 std::vector<stk::mesh::Entity> subcellElements;
463
464 // find elements connected to the subcells and their local subcell information
465 getSubcellElements(mesh,blockId,subcells[d],subcellIds,subcellElements);
466
467 // sanity check
468 TEUCHOS_ASSERT(subcellIds.size()==subcellElements.size());
469
470 // concatenate with found elements
471 localSubcellDim.insert(localSubcellDim.end(),subcellElements.size(),d);
472 localSubcellIds.insert(localSubcellIds.end(),subcellIds.begin(),subcellIds.end());
473 elements.insert(elements.end(),subcellElements.begin(),subcellElements.end());
474 }
475}
476
478 const std::string & blockId,
479 const std::vector<stk::mesh::Entity> & sides,
480 std::vector<std::size_t> & localSideIds,
481 std::vector<stk::mesh::Entity> & elements)
482{
483 getSubcellElements(mesh,blockId,sides,localSideIds,elements);
484}
485
487 const std::string & blockId_a,
488 const std::string & blockId_b,
489 const std::vector<stk::mesh::Entity> & sides,
490 std::vector<std::size_t> & localSideIds_a,
491 std::vector<stk::mesh::Entity> & elements_a,
492 std::vector<std::size_t> & localSideIds_b,
493 std::vector<stk::mesh::Entity> & elements_b)
494{
495 // for verifying that an element is in specified block
496 stk::mesh::Part * blockPart_a = mesh.getElementBlockPart(blockId_a);
497 stk::mesh::Part * blockPart_b = mesh.getElementBlockPart(blockId_b);
498 stk::mesh::Part * ownedPart = mesh.getOwnedPart();
499 stk::mesh::Part * universalPart = &mesh.getMetaData()->universal_part();
500 stk::mesh::BulkData& bulkData = *mesh.getBulkData();
501
502 // loop over each entitiy extracting elements and local entity ID that
503 // are containted in specified block.
504 std::vector<stk::mesh::Entity>::const_iterator sidesItr;
505 for(sidesItr=sides.begin();sidesItr!=sides.end();++sidesItr) {
506 stk::mesh::Entity side = *sidesItr;
507
508 // these are used below the loop to insert into the appropriate vectors
509 stk::mesh::Entity element_a = stk::mesh::Entity(), element_b = stk::mesh::Entity();
510 std::size_t entityId_a=0, entityId_b=0;
511
512 const size_t num_rels = bulkData.num_elements(side);
513 stk::mesh::Entity const* element_rels = bulkData.begin_elements(side);
514 stk::mesh::ConnectivityOrdinal const* ordinals = bulkData.begin_element_ordinals(side);
515 for(std::size_t e=0; e<num_rels; ++e) {
516 stk::mesh::Entity element = element_rels[e];
517 std::size_t entityId = ordinals[e];
518
519 // is this element in requested block
520 stk::mesh::Bucket const& bucket = bulkData.bucket(element);
521 bool inBlock_a = bucket.member(*blockPart_a);
522 bool inBlock_b = bucket.member(*blockPart_b);
523 bool onProc = bucket.member(*ownedPart);
524 bool unProc = bucket.member(*universalPart);
525
526 if(inBlock_a && onProc) {
527 TEUCHOS_ASSERT(element_a==stk::mesh::Entity()); // sanity check
528 element_a = element;
529 entityId_a = entityId;
530 }
531 if(inBlock_b && unProc) {
532 TEUCHOS_ASSERT(element_b==stk::mesh::Entity()); // sanity check
533 element_b = element;
534 entityId_b = entityId;
535 }
536 }
537
538 if(element_a!=stk::mesh::Entity() && element_b!=stk::mesh::Entity()) { // add element and Side ID to output vectors
539 elements_a.push_back(element_a);
540 localSideIds_a.push_back(entityId_a);
541
542 // add element and Side ID to output vectors
543 elements_b.push_back(element_b);
544 localSideIds_b.push_back(entityId_b);
545 }
546 }
547}
548
550 const std::string & blockId,
551 const std::vector<stk::mesh::Entity> & nodes,
552 std::vector<std::size_t> & localNodeIds,
553 std::vector<stk::mesh::Entity> & elements)
554{
555 getSubcellElements(mesh,blockId,nodes,localNodeIds,elements);
556}
557
559 const std::vector<stk::mesh::Entity> & entities,
560 std::vector<std::vector<stk::mesh::Entity> > & subcells)
561{
562 // exit if there is no work to do
563 if(entities.size()==0) {
564 subcells.clear();
565 return;
566 }
567
568 stk::mesh::BulkData& bulkData = *mesh.getBulkData();
569 stk::mesh::EntityRank master_rank = bulkData.entity_rank(entities[0]);
570
571 std::vector<std::set<stk::mesh::Entity> > subcells_set(master_rank);
572
573 // loop over each entitiy extracting elements and local entity ID that
574 // are containted in specified block.
575 std::vector<stk::mesh::Entity>::const_iterator entityItr;
576 for(entityItr=entities.begin();entityItr!=entities.end();++entityItr) {
577 stk::mesh::Entity entity = *entityItr;
578
579 // sanity check, enforcing that there is only one rank
580 TEUCHOS_ASSERT(bulkData.entity_rank(entity)==master_rank);
581
582 for(int i=0; i<static_cast<int>(master_rank); i++) {
583 stk::mesh::EntityRank const to_rank = static_cast<stk::mesh::EntityRank>(i);
584 const size_t num_rels = bulkData.num_connectivity(entity, to_rank);
585 stk::mesh::Entity const* relations = bulkData.begin(entity, to_rank);
586
587 // for each relation insert the appropriate entity (into the set
588 // which gurantees uniqueness
589 for(std::size_t e=0; e<num_rels; ++e) {
590 stk::mesh::Entity subcell = relations[e];
591
592 subcells_set[i].insert(subcell);
593 }
594 }
595 }
596
597 // copy unique entities into vector
598 subcells.clear();
599 subcells.resize(subcells_set.size());
600 for(std::size_t i=0;i<subcells_set.size();i++)
601 subcells[i].assign(subcells_set[i].begin(),subcells_set[i].end());
602}
603
604}
605
606}
int baseCellDimension() const
Dimension of the base cell. NOT the dimension of the local side, even if the side() method returns tr...
stk::mesh::Part * getElementBlockPart(const std::string &name) const
get the block part
void getElementVertices(const std::vector< std::size_t > &localIds, ArrayT &vertices) const
std::size_t elementLocalId(stk::mesh::Entity elmt) const
void getAllSides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
void getMySides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
void getElementBlockNames(std::vector< std::string > &names) const
void getSidesetNames(std::vector< std::string > &name) const
Teuchos::RCP< stk::mesh::MetaData > getMetaData() const
Teuchos::RCP< const shards::CellTopology > getCellTopology(const std::string &eBlock) const
stk::mesh::EntityRank getSideRank() const
stk::mesh::Part * getOwnedPart() const
Get a pointer to the locally owned part.
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
stk::mesh::Part * getSideset(const std::string &name) const
void getSideElements(const panzer_stk::STK_Interface &mesh, const std::string &blockId, const std::vector< stk::mesh::Entity > &sides, std::vector< std::size_t > &localSideIds, std::vector< stk::mesh::Entity > &elements)
void getUniversalSubcellElements(const panzer_stk::STK_Interface &mesh, const std::string &blockId, const std::vector< stk::mesh::Entity > &entities, std::vector< std::size_t > &localEntityIds, std::vector< stk::mesh::Entity > &elements, std::vector< std::size_t > &missingElementIndices)
void getSubcellEntities(const panzer_stk::STK_Interface &mesh, const std::vector< stk::mesh::Entity > &entities, std::vector< std::vector< stk::mesh::Entity > > &subcells)
void getNodeElements(const panzer_stk::STK_Interface &mesh, const std::string &blockId, const std::vector< stk::mesh::Entity > &nodes, std::vector< std::size_t > &localNodeIds, std::vector< stk::mesh::Entity > &elements)
void getSideElementCascade(const panzer_stk::STK_Interface &mesh, const std::string &blockId, const std::vector< stk::mesh::Entity > &sides, std::vector< std::size_t > &localSubcellDim, std::vector< std::size_t > &localSubcellIds, std::vector< stk::mesh::Entity > &elements)
void getSubcellElements(const panzer_stk::STK_Interface &mesh, const std::string &blockId, const std::vector< stk::mesh::Entity > &entities, std::vector< std::size_t > &localEntityIds, std::vector< stk::mesh::Entity > &elements)
Teuchos::RCP< std::map< unsigned, panzer::Workset > > buildBCWorksets(const panzer_stk::STK_Interface &mesh, const panzer::WorksetNeeds &needs_a, const std::string &blockid_a, const panzer::WorksetNeeds &needs_b, const std::string &blockid_b, const std::string &sideset)
Teuchos::RCP< std::vector< panzer::Workset > > buildWorksets(const panzer_stk::STK_Interface &mesh, const std::string &eBlock, const panzer::WorksetNeeds &needs)
Teuchos::RCP< std::vector< Workset > > buildWorksets(const WorksetNeeds &needs, const std::string &elementBlock, const std::vector< std::size_t > &local_cell_ids, const ArrayT &vertex_coordinates)
Teuchos::RCP< std::map< unsigned, Workset > > buildBCWorkset(const WorksetNeeds &needs, const std::string &elementBlock, const std::vector< std::size_t > &local_cell_ids, const std::vector< std::size_t > &local_side_ids, const ArrayT &vertex_coordinates, const bool populate_value_arrays=true)