Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
50 namespace panzer_stk {
51 
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 
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) {
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 
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 
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 
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) {
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 
358 namespace 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 {
403  // for verifying that an element is in specified block
404  stk::mesh::Part * blockPart = mesh.getElementBlockPart(blockId);
405  stk::mesh::Part * universalPart = &mesh.getMetaData()->universal_part();
406  stk::mesh::BulkData& bulkData = *mesh.getBulkData();
407 
408  // loop over each entitiy extracting elements and local entity ID that
409  // are containted in specified block.
410  std::vector<stk::mesh::Entity>::const_iterator entityItr;
411  for(entityItr=entities.begin();entityItr!=entities.end();++entityItr) {
412  stk::mesh::Entity entity = *entityItr;
413 
414  const size_t num_rels = bulkData.num_elements(entity);
415  stk::mesh::Entity const* element_rels = bulkData.begin_elements(entity);
416  stk::mesh::ConnectivityOrdinal const* ordinals = bulkData.begin_element_ordinals(entity);
417  for(std::size_t e=0; e<num_rels; ++e) {
418  stk::mesh::Entity element = element_rels[e];
419  std::size_t entityId = ordinals[e];
420 
421  // is this element in requested block
422  stk::mesh::Bucket const& bucket = bulkData.bucket(element);
423  bool inBlock = bucket.member(*blockPart);
424  bool onProc = bucket.member(*universalPart);
425  if(inBlock && onProc) {
426  // add element and Side ID to output vectors
427  elements.push_back(element);
428  localEntityIds.push_back(entityId);
429  }
430  }
431  }
432 }
433 
435  const std::string & blockId,
436  const std::vector<stk::mesh::Entity> & sides,
437  std::vector<std::size_t> & localSubcellDim,
438  std::vector<std::size_t> & localSubcellIds,
439  std::vector<stk::mesh::Entity> & elements)
440 {
441  // This is the alogrithm, for computing the side element
442  // cascade. The requirements are that for a particular set of sides
443  // we compute all elements and subcells where they touch the side. Note
444  // that elements can be and will be repeated within this list.
445 
446  std::vector<std::vector<stk::mesh::Entity> > subcells;
447  getSubcellEntities(mesh,sides,subcells);
448  subcells.push_back(sides);
449 
450  // subcells now contains a unique list of faces, edges and nodes that
451  // intersect with the sides
452 
453  for(std::size_t d=0;d<subcells.size();d++) {
454  std::vector<std::size_t> subcellIds;
455  std::vector<stk::mesh::Entity> subcellElements;
456 
457  // find elements connected to the subcells and their local subcell information
458  getSubcellElements(mesh,blockId,subcells[d],subcellIds,subcellElements);
459 
460  // sanity check
461  TEUCHOS_ASSERT(subcellIds.size()==subcellElements.size());
462 
463  // concatenate with found elements
464  localSubcellDim.insert(localSubcellDim.end(),subcellElements.size(),d);
465  localSubcellIds.insert(localSubcellIds.end(),subcellIds.begin(),subcellIds.end());
466  elements.insert(elements.end(),subcellElements.begin(),subcellElements.end());
467  }
468 }
469 
471  const std::string & blockId,
472  const std::vector<stk::mesh::Entity> & sides,
473  std::vector<std::size_t> & localSideIds,
474  std::vector<stk::mesh::Entity> & elements)
475 {
476  getSubcellElements(mesh,blockId,sides,localSideIds,elements);
477 }
478 
480  const std::string & blockId_a,
481  const std::string & blockId_b,
482  const std::vector<stk::mesh::Entity> & sides,
483  std::vector<std::size_t> & localSideIds_a,
484  std::vector<stk::mesh::Entity> & elements_a,
485  std::vector<std::size_t> & localSideIds_b,
486  std::vector<stk::mesh::Entity> & elements_b)
487 {
488  // for verifying that an element is in specified block
489  stk::mesh::Part * blockPart_a = mesh.getElementBlockPart(blockId_a);
490  stk::mesh::Part * blockPart_b = mesh.getElementBlockPart(blockId_b);
491  stk::mesh::Part * ownedPart = mesh.getOwnedPart();
492  stk::mesh::Part * universalPart = &mesh.getMetaData()->universal_part();
493  stk::mesh::BulkData& bulkData = *mesh.getBulkData();
494 
495  // loop over each entitiy extracting elements and local entity ID that
496  // are containted in specified block.
497  std::vector<stk::mesh::Entity>::const_iterator sidesItr;
498  for(sidesItr=sides.begin();sidesItr!=sides.end();++sidesItr) {
499  stk::mesh::Entity side = *sidesItr;
500 
501  // these are used below the loop to insert into the appropriate vectors
502  stk::mesh::Entity element_a = stk::mesh::Entity(), element_b = stk::mesh::Entity();
503  std::size_t entityId_a=0, entityId_b=0;
504 
505  const size_t num_rels = bulkData.num_elements(side);
506  stk::mesh::Entity const* element_rels = bulkData.begin_elements(side);
507  stk::mesh::ConnectivityOrdinal const* ordinals = bulkData.begin_element_ordinals(side);
508  for(std::size_t e=0; e<num_rels; ++e) {
509  stk::mesh::Entity element = element_rels[e];
510  std::size_t entityId = ordinals[e];
511 
512  // is this element in requested block
513  stk::mesh::Bucket const& bucket = bulkData.bucket(element);
514  bool inBlock_a = bucket.member(*blockPart_a);
515  bool inBlock_b = bucket.member(*blockPart_b);
516  bool onProc = bucket.member(*ownedPart);
517  bool unProc = bucket.member(*universalPart);
518 
519  if(inBlock_a && onProc) {
520  TEUCHOS_ASSERT(element_a==stk::mesh::Entity()); // sanity check
521  element_a = element;
522  entityId_a = entityId;
523  }
524  if(inBlock_b && unProc) {
525  TEUCHOS_ASSERT(element_b==stk::mesh::Entity()); // sanity check
526  element_b = element;
527  entityId_b = entityId;
528  }
529  }
530 
531  if(element_a!=stk::mesh::Entity() && element_b!=stk::mesh::Entity()) { // add element and Side ID to output vectors
532  elements_a.push_back(element_a);
533  localSideIds_a.push_back(entityId_a);
534 
535  // add element and Side ID to output vectors
536  elements_b.push_back(element_b);
537  localSideIds_b.push_back(entityId_b);
538  }
539  }
540 }
541 
543  const std::string & blockId,
544  const std::vector<stk::mesh::Entity> & nodes,
545  std::vector<std::size_t> & localNodeIds,
546  std::vector<stk::mesh::Entity> & elements)
547 {
548  getSubcellElements(mesh,blockId,nodes,localNodeIds,elements);
549 }
550 
552  const std::vector<stk::mesh::Entity> & entities,
553  std::vector<std::vector<stk::mesh::Entity> > & subcells)
554 {
555  // exit if there is no work to do
556  if(entities.size()==0) {
557  subcells.clear();
558  return;
559  }
560 
561  stk::mesh::BulkData& bulkData = *mesh.getBulkData();
562  stk::mesh::EntityRank master_rank = bulkData.entity_rank(entities[0]);
563 
564  std::vector<std::set<stk::mesh::Entity> > subcells_set(master_rank);
565 
566  // loop over each entitiy extracting elements and local entity ID that
567  // are containted in specified block.
568  std::vector<stk::mesh::Entity>::const_iterator entityItr;
569  for(entityItr=entities.begin();entityItr!=entities.end();++entityItr) {
570  stk::mesh::Entity entity = *entityItr;
571 
572  // sanity check, enforcing that there is only one rank
573  TEUCHOS_ASSERT(bulkData.entity_rank(entity)==master_rank);
574 
575  for(int i=0; i<static_cast<int>(master_rank); i++) {
576  stk::mesh::EntityRank const to_rank = static_cast<stk::mesh::EntityRank>(i);
577  const size_t num_rels = bulkData.num_connectivity(entity, to_rank);
578  stk::mesh::Entity const* relations = bulkData.begin(entity, to_rank);
579 
580  // for each relation insert the appropriate entity (into the set
581  // which gurantees uniqueness
582  for(std::size_t e=0; e<num_rels; ++e) {
583  stk::mesh::Entity subcell = relations[e];
584 
585  subcells_set[i].insert(subcell);
586  }
587  }
588  }
589 
590  // copy unique entities into vector
591  subcells.clear();
592  subcells.resize(subcells_set.size());
593  for(std::size_t i=0;i<subcells_set.size();i++)
594  subcells[i].assign(subcells_set[i].begin(),subcells_set[i].end());
595 }
596 
597 }
598 
599 }
void getSidesetNames(std::vector< std::string > &name) const
int baseCellDimension() const
Dimension of the base cell. NOT the dimension of the local side, even if the side() method returns tr...
void getIdsAndVertices(const panzer_stk::STK_Interface &mesh, std::string blockId, std::vector< std::size_t > &localIds, ArrayT &vertices)
void getElementBlockNames(std::vector< std::string > &names) const
stk::mesh::Part * getElementBlockPart(const std::string &name) const
get the block count
void getSubcellEntities(const panzer_stk::STK_Interface &mesh, const std::vector< stk::mesh::Entity > &entities, std::vector< std::vector< stk::mesh::Entity > > &subcells)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void getElementVertices(const std::vector< std::size_t > &localIds, ArrayT &vertices) const
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::vector< panzer::Workset > > buildWorksets(const panzer_stk::STK_Interface &mesh, const std::string &eBlock, const panzer::WorksetNeeds &needs)
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)
stk::mesh::Part * getSideset(const std::string &name) const
void getMySides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
std::size_t elementLocalId(stk::mesh::Entity elmt) 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)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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)
stk::mesh::EntityRank getSideRank() const
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
Teuchos::RCP< stk::mesh::MetaData > getMetaData() const
void getAllSides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
#define TEUCHOS_ASSERT(assertion_test)
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 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)
stk::mesh::Part * getOwnedPart() const
Get a pointer to the locally owned part.
Teuchos::RCP< const shards::CellTopology > getCellTopology(const std::string &eBlock) const
#define TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(throw_exception_test, Exception, msg)