Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_Workset.cpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
11#include "Panzer_Workset.hpp"
12
13#include "Phalanx_DataLayout.hpp"
14#include "Phalanx_DataLayout_MDALayout.hpp"
15
17#include "Panzer_Workset_Builder.hpp"
19#include "Panzer_Dimension.hpp"
23#include "Panzer_HashUtils.hpp"
25
28
29#include "Shards_CellTopology.hpp"
30
31namespace panzer {
32
33namespace {
34
35void buildLocalOrientations(const int num_cells,
36 const Kokkos::View<const panzer::LocalOrdinal*,PHX::Device> & local_cell_ids,
37 const Teuchos::RCP<const OrientationsInterface> & orientations_interface,
38 std::vector<Intrepid2::Orientation> & workset_orientations)
39{
40 // from a list of cells in the workset, extract the subset of orientations that correspond
41
42 const auto & local_orientations = *orientations_interface->getOrientations();
43 workset_orientations.resize(num_cells);
44
45 // We can only apply orientations to owned and ghost cells - virtual cells are ignored (no orientations available)
46 auto local_cell_ids_host = Kokkos::create_mirror_view(local_cell_ids);
47 Kokkos::deep_copy(local_cell_ids_host, local_cell_ids);
48 for(int i=0; i<num_cells; ++i)
49 workset_orientations[i] = local_orientations[local_cell_ids_host[i]];
50}
51
52void
53applyBV2Orientations(const int num_cells,
54 BasisValues2<double> & basis_values,
55 const Kokkos::View<const panzer::LocalOrdinal*,PHX::Device> & local_cell_ids,
56 const Teuchos::RCP<const OrientationsInterface> & orientations_interface)
57{
58 // This call exists because there is a middle man we have to go through.
59 // orientations_interface is a 'local' object, not a workset object so we need to map local cells to workset cells
60
61 // If the object doesn't exist, feel free to skip applying orientations, they aren't needed in some cases (e.g. DG/FV)
62 if(orientations_interface.is_null())
63 return;
64
65 // Ignore this operation if it has already been applied
66 if(basis_values.orientationsApplied())
67 return;
68
69 // pull out the subset of orientations required for this workset
70 std::vector<Intrepid2::Orientation> workset_orientations(num_cells);
71 buildLocalOrientations(num_cells,local_cell_ids,orientations_interface, workset_orientations);
72
73 basis_values.applyOrientations(workset_orientations,num_cells);
74}
75
76}
77
80 : num_cells(0)
81 , subcell_dim(-1)
82 , subcell_index(-1)
83 , ir_degrees(new std::vector<int>())
84 , basis_names(new std::vector<std::string>())
85 , setup_(false)
86 , num_owned_cells_(0)
87 , num_ghost_cells_(0)
88 , num_virtual_cells_(0)
89 , num_dimensions_(-1)
90{ }
91
92void
94setup(const panzer::LocalMeshPartition & partition,
95 const WorksetOptions & options)
96{
97
98 num_cells = partition.local_cells.extent(0);
102 options_ = options;
103
105
106 TEUCHOS_ASSERT(partition.cell_topology != Teuchos::null);
107 cell_topology_ = partition.cell_topology;
108
109 num_dimensions_ = cell_topology_->getDimension();
110 subcell_dim = partition.subcell_dimension;
111 subcell_index = partition.subcell_index;
112 block_id = partition.element_block_name;
113 sideset_ = partition.sideset_name;
114
115
116 // Allocate and fill the local cell indexes for this workset
117 {
118 Kokkos::View<LocalOrdinal*, PHX::Device> cell_ids = Kokkos::View<LocalOrdinal*, PHX::Device>("cell_ids",num_cells);
119 Kokkos::deep_copy(cell_ids, partition.local_cells);
120 cell_local_ids_k = cell_ids;
121
122 // DEPRECATED - only retain for backward compatability
123 auto local_cells_h = Kokkos::create_mirror_view(partition.local_cells);
124 Kokkos::deep_copy(local_cells_h, partition.local_cells);
125 cell_local_ids.resize(num_cells,-1);
126 for(int cell=0;cell<num_cells;++cell){
127 const int local_cell = local_cells_h(cell);
128 cell_local_ids[cell] = local_cell;
129 }
130 }
131
132 // Allocate and fill the cell nodes
133 {
134 // Double check this
135 TEUCHOS_ASSERT(partition.cell_nodes.rank == 3);
136
137 // Grab the size of the cell node array
138 const int num_partition_cells = partition.cell_nodes.extent(0);
139 const int num_nodes_per_cell = partition.cell_nodes.extent(1);
140 const int num_dims_per_node = partition.cell_nodes.extent(2);
141
142 // Make sure there isn't some strange problem going on
143 TEUCHOS_ASSERT(num_partition_cells == num_cells);
144 TEUCHOS_ASSERT(num_nodes_per_cell > 0);
145 TEUCHOS_ASSERT(num_dims_per_node > 0);
146
147 // Allocate the worksets copy of the cell nodes
148 MDFieldArrayFactory af("",true);
149 cell_node_coordinates = af.buildStaticArray<double, Cell, NODE, Dim>("cell nodes", num_partition_cells, num_nodes_per_cell, num_dims_per_node);
150
151 // Copy nodes over
152 const auto partition_nodes = partition.cell_nodes;
153 auto cnc = cell_node_coordinates.get_view();
154 Kokkos::parallel_for(num_cells, KOKKOS_LAMBDA (int i) {
155 for(int j=0;j<num_nodes_per_cell;++j)
156 for(int k=0;k<num_dims_per_node;++k)
157 cnc(i,j,k) = partition_nodes(i,j,k);
158 });
159 Kokkos::fence();
160 }
161
162 // Add the subcell connectivity
163 if(partition.has_connectivity){
164 auto face_connectivity = Teuchos::rcp(new FaceConnectivity);
165 face_connectivity->setup(partition);
166 face_connectivity_ = face_connectivity;
167 }
168 // We have enough information to construct Basis/Point/Integration Values on the fly
169 setup_ = true;
170
171}
172
173bool
175hasSubcellConnectivity(const unsigned int subcell_dimension) const
176{
177 TEUCHOS_ASSERT(setup_);
178 return (subcell_dimension == (numDimensions() - 1)) and (not face_connectivity_.is_null());
179}
180
181
184getSubcellConnectivity(const unsigned int subcell_dimension) const
185{
186 TEUCHOS_ASSERT(setup_);
187 TEUCHOS_TEST_FOR_EXCEPT_MSG(not hasSubcellConnectivity(subcell_dimension),
188 "Workset::getSubcellConnectivity : Requested subcell dimension "<<subcell_dimension<<" for a "<<num_dimensions_<<"D workset. This is not supported.");
189 // Right now we have only one option
190 return *face_connectivity_;
191}
192
195{
196 TEUCHOS_ASSERT(face_connectivity_ != Teuchos::null);
197 return *face_connectivity_;
198}
199
203 const bool lazy_version) const
204{
205 TEUCHOS_ASSERT(setup_);
206
207 // We need unique keys for the lazy copy or else we get some weird behavior
208 size_t key = description.getKey();
209 if(lazy_version)
210 panzer::hash_combine<int>(key, 123);
211
212 // Check if exists
213 const auto itr = integration_values_map_.find(key);
214 if(itr != integration_values_map_.end())
215 return *(itr->second);
216
217 // Since it doesn't exist, we need to create it
218 const unsigned int subcell_dimension = numDimensions()-1;
219 int num_faces = -1;
220 if(hasSubcellConnectivity(subcell_dimension))
221 num_faces = getSubcellConnectivity(subcell_dimension).numSubcells();
222
223 // For now, we need to make sure the descriptor lines up with the workset
225 TEUCHOS_TEST_FOR_EXCEPT_MSG(description.getSide() != getSubcellIndex(),
226 "Workset::getIntegrationValues : Attempted to build integration values for side '"<<description.getSide()<<"', but workset is constructed for side '"<<getSubcellIndex()<<"'");
227 }
228 auto ir = Teuchos::rcp(new IntegrationRule(description, cell_topology_, numCells(), num_faces));
229
230 // Create the integration values object
231 Teuchos::RCP<IntegrationValues2<double>> iv;
232 if(lazy_version){
233 iv = Teuchos::rcp(new IntegrationValues2<double>());
234
235 iv->setup(ir,getCellNodes(),numCells());
236
237 // Surface integration schemes need to properly "permute" their entries to line up the surface points between cells
239 iv->setupPermutations(face_connectivity_, numVirtualCells());
240
241 } else {
242
243 iv = Teuchos::rcp(new IntegrationValues2<double>("",true));
244 iv->setupArrays(ir);
245 iv->evaluateValues(getCellNodes(), numCells(), face_connectivity_, numVirtualCells());
246
247 // This is an advanced feature that requires changes to the workset construction
248 // Basically there needs to be a way to grab the side assembly for both "details" belonging to the same workset, which requires a refactor
249 // Alternatively, we can do this using a face connectivity object, but the refactor is more important atm.
250 TEUCHOS_ASSERT(not (options_.side_assembly_ and options_.align_side_points_));
251
252 }
253
254 integration_values_map_[key] = iv;
255 ir_degrees->push_back(iv->int_rule->cubature_degree);
256 int_rules.push_back(iv);
257
258 return *iv;
259
260}
261
264getBasisValues(const panzer::BasisDescriptor & description,
265 const bool lazy_version) const
266{
267 TEUCHOS_ASSERT(setup_);
268
269 // Check if one exists (can be of any integration order)
270 const auto itr = basis_integration_values_map_.find(description.getKey());
271 if(itr != basis_integration_values_map_.end()){
272 for(const auto & pr : itr->second)
273 return *pr.second;
274 }
275
276 // TODO: We currently overlap BasisIntegrationValues and BasisValues
277 // To counter this we create a fake integration rule at this point to ensure the basis values exist
278
280
281 // We have to have the right integrator if this is a side workset
283 TEUCHOS_ASSERT(getSubcellIndex() >= 0);
285 }
286
287 // Now just use the other call
288 return getBasisValues(description, id, lazy_version);
289
290}
291
292
295getBasisValues(const panzer::BasisDescriptor & basis_description,
296 const panzer::IntegrationDescriptor & integration_description,
297 const bool lazy_version) const
298{
299 TEUCHOS_ASSERT(setup_);
300
301 // We need unique keys for the lazy copy or else we get some weird behavior
302 size_t basis_key = basis_description.getKey();
303 if(lazy_version)
304 panzer::hash_combine<int>(basis_key, 123);
305
306 // We need unique keys for the lazy copy or else we get some weird behavior
307 size_t integration_key = integration_description.getKey();
308 if(lazy_version)
309 panzer::hash_combine<int>(integration_key, 123);
310
311 // Check if exists
312 const auto itr = basis_integration_values_map_.find(basis_key);
313 if(itr != basis_integration_values_map_.end()){
314 const auto & submap = itr->second;
315 const auto itr2 = submap.find(integration_key);
316 if(itr2 != submap.end())
317 return *(itr2->second);
318
319 }
320
321 // Get the integration values for this description
322 const auto & iv = getIntegrationValues(integration_description,lazy_version);
323 auto bir = Teuchos::rcp(new BasisIRLayout(basis_description.getType(), basis_description.getOrder(), *iv.int_rule));
324
325 Teuchos::RCP<BasisValues2<double>> biv;
326
327 if(lazy_version){
328
329 // Initialized for lazy evaluation
330
331 biv = Teuchos::rcp(new BasisValues2<double>());
332
333 if(integration_description.getType() == IntegrationDescriptor::VOLUME)
334 biv->setupUniform(bir, iv.getUniformCubaturePointsRef(false), iv.getJacobian(false), iv.getJacobianDeterminant(false), iv.getJacobianInverse(false));
335 else
336 biv->setup(bir, iv.getCubaturePointsRef(false), iv.getJacobian(false), iv.getJacobianDeterminant(false), iv.getJacobianInverse(false));
337
338 // pull out the subset of orientations required for this workset
339 std::vector<Intrepid2::Orientation> workset_orientations;
340 buildLocalOrientations(numOwnedCells()+numGhostCells(),getLocalCellIDs(),options_.orientations_, workset_orientations);
341
342 biv->setOrientations(workset_orientations, numOwnedCells()+numGhostCells());
343 biv->setWeightedMeasure(iv.getWeightedMeasure(false));
344 biv->setCellNodeCoordinates(cell_node_coordinates);
345
346 } else {
347
348 // Standard, fully allocated version of BasisValues2
349
350 biv = Teuchos::rcp(new BasisValues2<double>("", true, true));
351 biv->setupArrays(bir);
352 if((integration_description.getType() == IntegrationDescriptor::CV_BOUNDARY) or
353 (integration_description.getType() == IntegrationDescriptor::CV_SIDE) or
354 (integration_description.getType() == IntegrationDescriptor::CV_VOLUME)){
355
356 biv->evaluateValuesCV(iv.ref_ip_coordinates,
357 iv.jac,
358 iv.jac_det,
359 iv.jac_inv,
360 getCellNodes(),
361 true,
362 numCells());
363 } else {
364
365 if(integration_description.getType() == IntegrationDescriptor::VOLUME){
366
367 // TODO: Eventually we will use the other call, however, that will be part of the BasisValues2 refactor
368 // The reason we don't do it now is that there are small differences (machine precision) that break EMPIRE testing
369 biv->evaluateValues(iv.cub_points,
370 iv.jac,
371 iv.jac_det,
372 iv.jac_inv,
373 iv.weighted_measure,
374 getCellNodes(),
375 true,
376 numCells());
377
378 } else {
379
380 biv->evaluateValues(iv.ref_ip_coordinates,
381 iv.jac,
382 iv.jac_det,
383 iv.jac_inv,
384 iv.weighted_measure,
385 getCellNodes(),
386 true,
387 numCells());
388 }
389 }
390
391 applyBV2Orientations(numOwnedCells()+numGhostCells(),*biv,getLocalCellIDs(),options_.orientations_);
392
393 }
394
395 basis_integration_values_map_[basis_key][integration_key] = biv;
396 bases.push_back(biv);
397 basis_names->push_back(biv->basis_layout->name());
398
399 return *biv;
400
401}
402
403
406getPointValues(const panzer::PointDescriptor & description) const
407{
408 TEUCHOS_ASSERT(setup_);
409
410
411 // Check if exists
412 const auto itr = point_values_map_.find(description.getKey());
413 if(itr != point_values_map_.end())
414 return *(itr->second);
415
416 TEUCHOS_TEST_FOR_EXCEPT_MSG(not description.hasGenerator(),
417 "Point Descriptor of type '"<<description.getType()<<"' does not have associated generator.");
418
419 auto pr = Teuchos::rcp(new PointRule(description, cell_topology_, numCells()));
420
421 auto pv = Teuchos::rcp(new PointValues2<double>("",true));
422
423 pv->setupArrays(pr);
424
425 // Point values are not necessarily set at the workset level, but can be set by evaluators
426 if(description.hasGenerator())
427 if(description.getGenerator().hasPoints(*cell_topology_))
428 pv->evaluateValues(getCellNodes(), description.getGenerator().getPoints(*cell_topology_),false, numCells());
429
430 point_values_map_[description.getKey()] = pv;
431
432 return *pv;
433
434}
435
438getBasisValues(const panzer::BasisDescriptor & basis_description,
439 const panzer::PointDescriptor & point_description,
440 const bool lazy_version) const
441{
442 TEUCHOS_ASSERT(setup_);
443
444 // We need unique keys for the lazy copy or else we get some weird behavior
445 size_t basis_key = basis_description.getKey();
446 if(lazy_version)
447 panzer::hash_combine<int>(basis_key, 123);
448
449 // Check if exists
450 const auto itr = basis_point_values_map_.find(basis_key);
451 if(itr != basis_point_values_map_.end()){
452 const auto & submap = itr->second;
453 const auto itr2 = submap.find(point_description.getKey());
454 if(itr2 != submap.end())
455 return *(itr2->second);
456
457 }
458
459 // Get the integration values for this description
460 const auto & pv = getPointValues(point_description);
461
462 auto bir = Teuchos::rcp(new BasisIRLayout(basis_description.getType(), basis_description.getOrder(), *pv.point_rule));
463
464 Teuchos::RCP<BasisValues2<double>> bpv;
465
466 if(lazy_version){
467
468 // Initialized for lazy evaluation
469
470 bpv = Teuchos::rcp(new BasisValues2<double>());
471
472 bpv->setupUniform(bir, pv.coords_ref, pv.jac, pv.jac_det, pv.jac_inv);
473
474 // pull out the subset of orientations required for this workset
475 std::vector<Intrepid2::Orientation> workset_orientations;
476 buildLocalOrientations(numOwnedCells()+numGhostCells(),getLocalCellIDs(),options_.orientations_, workset_orientations);
477
478 bpv->setOrientations(workset_orientations, numOwnedCells()+numGhostCells());
479 bpv->setCellNodeCoordinates(cell_node_coordinates);
480
481 } else {
482
483 // Standard fully allocated version
484
485 bpv = Teuchos::rcp(new BasisValues2<double>("", true, false));
486 bpv->setupArrays(bir);
487 bpv->evaluateValues(pv.coords_ref,
488 pv.jac,
489 pv.jac_det,
490 pv.jac_inv,
491 numCells());
492
493 // TODO: We call this separately due to how BasisValues2 is structured - needs to be streamlined
494 bpv->evaluateBasisCoordinates(getCellNodes(),numCells());
495
496 applyBV2Orientations(numOwnedCells()+numGhostCells(),*bpv, getLocalCellIDs(), options_.orientations_);
497
498 }
499
500 basis_point_values_map_[basis_key][point_description.getKey()] = bpv;
501
502 return *bpv;
503
504}
505
508getIntegrationRule(const panzer::IntegrationDescriptor & description) const
509{
510 const auto itr = _integration_rule_map.find(description.getKey());
511 if(itr == _integration_rule_map.end()){
512
513 // Must run setup or cell topology wont be set properly
514 TEUCHOS_ASSERT(setup_);
515
516 // Since it doesn't exist, we need to create it
517 const unsigned int subcell_dimension = numDimensions()-1;
518 int num_faces = -1;
519 if(hasSubcellConnectivity(subcell_dimension))
520 num_faces = getSubcellConnectivity(subcell_dimension).numSubcells();
521
522 // For now, we need to make sure the descriptor lines up with the workset
524 TEUCHOS_TEST_FOR_EXCEPT_MSG(description.getSide() != getSubcellIndex(),
525 "Workset::getIntegrationValues : Attempted to build integration values for side '"<<description.getSide()<<"', but workset is constructed for side '"<<getSubcellIndex()<<"'");
526 }
527
528 auto ir = Teuchos::rcp(new IntegrationRule(description, cell_topology_, numCells(), num_faces));
529
530 _integration_rule_map[description.getKey()] = ir;
531
532 return *ir;
533 }
534 return *(itr->second);
535}
536
537const panzer::PureBasis &
539getBasis(const panzer::BasisDescriptor & description) const
540{
541 const auto itr = _pure_basis_map.find(description.getKey());
542 if(itr == _pure_basis_map.end()){
543
544 // Must run setup or cell topology wont be set properly
545 TEUCHOS_ASSERT(setup_);
546
547 // Create and storethe pure basis
548 Teuchos::RCP<panzer::PureBasis> basis = Teuchos::rcp(new panzer::PureBasis(description, cell_topology_, numCells()));
549 _pure_basis_map[description.getKey()] = basis;
550 return *basis;
551 }
552 return *(itr->second);
553}
554
555
556void
558setNumberOfCells(const int o_cells,
559 const int g_cells,
560 const int v_cells)
561{
562 num_owned_cells_ = o_cells;
563 num_ghost_cells_ = g_cells;
564 num_virtual_cells_ = v_cells;
565 num_cells = o_cells + g_cells + v_cells;
566}
567
568std::ostream&
569operator<<(std::ostream& os,
570 const panzer::Workset& w)
571{
572 using std::endl;
573
574 os << "Workset" << endl;
575 os << " block_id=" << w.getElementBlock() << endl;
576 os << " num_cells:" << w.num_cells << endl;
577 os << " num_owned_cells:" << w.numOwnedCells() << endl;
578 os << " num_ghost_cells:" << w.numGhostCells() << endl;
579 os << " num_virtual_cells:" << w.numVirtualCells() << endl;
580 os << " cell_local_ids (size=" << w.getLocalCellIDs().size() << ")" << endl;
581 os << " subcell_dim = " << w.getSubcellDimension() << endl;
582 os << " subcell_index = " << w.getSubcellIndex() << endl;
583
584 os << " ir_degrees: " << endl;
585 for (std::vector<int>::const_iterator ir = w.ir_degrees->begin();
586 ir != w.ir_degrees->end(); ++ir)
587 os << " " << *ir << std::endl;
588
589 std::vector<int>::const_iterator ir = w.ir_degrees->begin();
590 for (std::vector<Teuchos::RCP<panzer::IntegrationValues2<double> > >::const_iterator irv = w.int_rules.begin();
591 irv != w.int_rules.end(); ++irv,++ir) {
592
593 os << " IR Values (Degree=" << *ir << "):" << endl;
594
595 os << " cub_points:" << endl;
596 os << (*irv)->cub_points << endl;
597
598 os << " side_cub_points:" << endl;
599 os << (*irv)->side_cub_points << endl;
600
601 os << " cub_weights:" << endl;
602 os << (*irv)->cub_weights << endl;
603
604 os << " node_coordinates:" << endl;
605 os << (*irv)->node_coordinates << endl;
606
607 os << " jac:" << endl;
608 os << (*irv)->jac << endl;
609
610 os << " jac_inv:" << endl;
611 os << (*irv)->jac_inv << endl;
612
613 os << " jac_det:" << endl;
614 os << (*irv)->jac_det << endl;
615
616 os << " weighted_measure:" << endl;
617 os << (*irv)->weighted_measure << endl;
618
619 os << " covarient:" << endl;
620 os << (*irv)->covarient << endl;
621
622 os << " contravarient:" << endl;
623 os << (*irv)->contravarient << endl;
624
625 os << " norm_contravarient:" << endl;
626 os << (*irv)->norm_contravarient << endl;
627
628 os << " ip_coordinates:" << endl;
629 os << (*irv)->ip_coordinates << endl;
630
631 os << " int_rule->getName():" << (*irv)->int_rule->getName() << endl;
632 }
633
634
635 os << " basis_names: " << endl;
636 for (std::vector<std::string>::const_iterator b = w.basis_names->begin();
637 b != w.basis_names->end(); ++b)
638 os << " " << *b << std::endl;
639
640 std::vector<std::string>::const_iterator b = w.basis_names->begin();
641
642 for (std::vector<Teuchos::RCP< panzer::BasisValues2<double> > >::const_iterator bv = w.bases.begin(); bv != w.bases.end(); ++bv,++b) {
643
644 os << " Basis Values (basis_name=" << *b << "):" << endl;
645
646/*
647 os << " basis_ref:" << endl;
648 os << (*bv)->basis_ref << endl;
649
650 os << " basis:" << endl;
651 os << (*bv)->basis_scalar << endl;
652
653 os << " grad_basis_ref:" << endl;
654 os << (*bv)->grad_basis_ref << endl;
655
656 os << " grad_basis:" << endl;
657 os << (*bv)->grad_basis << endl;
658
659 os << " curl_basis_ref:" << endl;
660 os << (*bv)->curl_basis_ref_vector << endl;
661
662 os << " curl_basis:" << endl;
663 os << (*bv)->curl_basis_vector << endl;
664
665 os << " basis_coordinates_ref:" << endl;
666 os << (*bv)->basis_coordinates_ref << endl;
667
668 os << " basis_coordinates:" << endl;
669 os << (*bv)->basis_coordinates << endl;
670*/
671
672 os << " basis_layout->name():" << (*bv)->basis_layout->name() << endl;
673 }
674
675
676
677 return os;
678}
679
680}
int getOrder() const
Get order of basis.
const std::string & getType() const
Get type of basis.
std::size_t getKey() const
Get unique key associated with basis of this order and type The key is used to sort through a map of ...
Generates a SubcellConnectivity associated with faces and cells given a partition of the local mesh.
@ VOLUME
No integral specified - default state.
@ CV_VOLUME
Integral over a specific side of cells (side must be set)
@ CV_BOUNDARY
Control volume side integral.
@ SIDE
Integral over all sides of cells (closed surface integral)
const int & getSide() const
Get side associated with integration - this is for backward compatibility.
std::size_t getKey() const
Get unique key associated with integrator of this order and type The key is used to sort through a ma...
const int & getType() const
Get type of integrator.
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
const PointGenerator & getGenerator() const
bool hasGenerator() const
Check if the point descriptor has a generator for generating point values.
const std::string & getType() const
Get unique string associated with the type of point descriptor. This will be used generate a hash to ...
std::size_t getKey() const
Get unique key associated with integrator of this order and type The key is used to sort through a ma...
virtual Kokkos::DynRankView< double > getPoints(const shards::CellTopology &topo) const =0
Get the points for a particular topology.
virtual bool hasPoints(const shards::CellTopology &topo) const =0
Check if the generator can generate points for the given topology.
Description and data layouts associated with a particular basis.
KOKKOS_INLINE_FUNCTION int numSubcells() const
Gives number of subcells (e.g. faces) in connectivity.
int numOwnedCells() const
Number of cells owned by this workset.
CellCoordArray cell_node_coordinates
DEPRECATED - use: getCellNodes()
const panzer::IntegrationRule & getIntegrationRule(const panzer::IntegrationDescriptor &description) const
Grab the integration rule for a given integration description (throws error if integration doesn't ex...
std::string block_id
DEPRECATED - use: getElementBlock()
Teuchos::RCP< panzer::SubcellConnectivity > face_connectivity_
std::map< size_t, Teuchos::RCP< const panzer::IntegrationValues2< double > > > integration_values_map_
std::map< size_t, std::map< size_t, Teuchos::RCP< panzer::BasisValues2< double > > > > basis_integration_values_map_
CellCoordArray getCellNodes() const
Get the node coordinates for the cells.
const panzer::SubcellConnectivity & getFaceConnectivity() const
int subcell_dim
DEPRECATED - use: getSubcellDimension()
std::vector< Teuchos::RCP< panzer::BasisValues2< double > > > bases
Static basis function data, key is basis name, value is index in the static_bases vector.
std::vector< Teuchos::RCP< panzer::IntegrationValues2< double > > > int_rules
Teuchos::RCP< const shards::CellTopology > cell_topology_
const std::string & getElementBlock() const
Get the element block id.
PHX::View< const int * > cell_local_ids_k
std::map< size_t, Teuchos::RCP< const panzer::IntegrationRule > > _integration_rule_map
unsigned int numDimensions() const
Get the cell dimension for the mesh.
Kokkos::View< const int *, PHX::Device > getLocalCellIDs() const
Get the local cell IDs for the workset.
int num_cells
DEPRECATED - use: numCells()
bool hasSubcellConnectivity(const unsigned int subcell_dimension) const
Check if subcell connectivity exists for a given dimension.
panzer::PointValues2< double > & getPointValues(const panzer::PointDescriptor &point_description) const
Grab the basis values for a given basis description and integration description (throws error if it d...
int numCells() const
Number of total cells in workset (owned, ghost, and virtual)
Teuchos::RCP< std::vector< std::string > > basis_names
Value corresponds to basis type. Use the offest for indexing.
const panzer::IntegrationValues2< double > & getIntegrationValues(const panzer::IntegrationDescriptor &description, const bool lazy_version=false) const
Get the integration values for a given integration description.
std::map< size_t, Teuchos::RCP< const panzer::PureBasis > > _pure_basis_map
std::map< size_t, std::map< size_t, Teuchos::RCP< panzer::BasisValues2< double > > > > basis_point_values_map_
int numGhostCells() const
Number of cells owned by a different workset.
Teuchos::RCP< std::vector< int > > ir_degrees
If workset corresponds to a sub cell, what is the index?
const panzer::PureBasis & getBasis(const panzer::BasisDescriptor &description) const
Grab the pure basis (contains data layouts) for a given basis description (throws error if integratio...
const SubcellConnectivity & getSubcellConnectivity(const unsigned int subcell_dimension) const
Get the subcell connectivity for the workset topology.
int getSubcellDimension() const
Get the subcell dimension.
int subcell_index
DEPRECATED - use: getSubcellIndex()
void setNumberOfCells(const int owned_cells, const int ghost_cells, const int virtual_cells)
Provides access to set numbers of cells (required for backwards compatibility)
const panzer::BasisValues2< double > & getBasisValues(const panzer::BasisDescriptor &basis_description, const bool lazy_version=false) const
std::map< size_t, Teuchos::RCP< panzer::PointValues2< double > > > point_values_map_
WorksetDetails()
Default constructor.
int getSubcellIndex() const
Get the subcell index (returns -1 if not a subcell)
int numVirtualCells() const
Number of cells not owned by any workset - these are used for boundary conditions.
std::vector< size_t > cell_local_ids
void setup(const LocalMeshPartition &partition, const WorksetOptions &options)
Constructs the workset details from a given chunk of the mesh.
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
panzer::LocalOrdinal num_owned_cells
panzer::LocalOrdinal num_ghstd_cells
panzer::LocalOrdinal num_virtual_cells
PHX::View< panzer::LocalOrdinal * > local_cells
PHX::View< double *** > cell_nodes
Teuchos::RCP< const shards::CellTopology > cell_topology
Used to define options for lazy evaluation of BasisValues and IntegrationValues objects.
bool align_side_points_
If workset side integration values must align with another workset, there must be a unique order assi...
Teuchos::RCP< const OrientationsInterface > orientations_
Must be set to apply orientations - if it is set, then orientations will be applied to basis values.
bool side_assembly_
Build integration values for sides.