45 #include "Phalanx_DataLayout.hpp" 46 #include "Phalanx_DataLayout_MDALayout.hpp" 49 #include "Panzer_Workset_Builder.hpp" 58 #include "Shards_CellTopology.hpp" 68 const size_t num_cells = partition.
local_cells.extent(0);
77 Kokkos::View<int*, PHX::Device> cell_ids = Kokkos::View<int*, PHX::Device>(
"cell_ids",num_cells);
82 for(
size_t cell=0;cell<num_cells;++cell){
95 const Kokkos::View<double***,PHX::Device> & cell_vertices,
99 const size_t num_cells = cell_vertices.extent(0);
100 const size_t num_vertices_per_cell = cell_vertices.extent(1);
101 const size_t num_dims_per_vertex = cell_vertices.extent(2);
108 cell_vertex_coordinates = af.template buildStaticArray<double, Cell, NODE, Dim>(
"cell_vertices",num_cells, num_vertices_per_cell, num_dims_per_vertex);
110 for(
size_t i=0;i<num_cells;++i)
111 for(
size_t j=0;j<num_vertices_per_cell;++j)
112 for(
size_t k=0;k<num_dims_per_vertex;++k)
120 const std::vector<panzer::BasisDescriptor> & basis_descriptors = needs.
getBases();
121 const std::vector<panzer::IntegrationDescriptor> & integration_descriptors = needs.
getIntegrators();
122 const std::vector<panzer::PointDescriptor> & point_descriptors = needs.
getPoints();
127 Teuchos::RCP<panzer::PureBasis> basis = Teuchos::rcp(
new panzer::PureBasis(basis_description, cell_topology, num_cells));
140 Teuchos::RCP<panzer::IntegrationRule> ir = Teuchos::rcp(
new panzer::IntegrationRule(integration_description, cell_topology, num_cells, num_faces));
153 const Teuchos::RCP<const panzer::PureBasis> & basis =
_pure_basis_map[basis_description.getKey()];
160 bv->setupArrays(b_layout);
162 bv->evaluateValues(iv->ref_ip_coordinates,
166 iv->weighted_measure,
171 bv->evaluateValuesCV(iv->ref_ip_coordinates,
176 bv->evaluateValues(iv->cub_points,
180 iv->weighted_measure,
183 _basis_map[basis_description.getKey()][integration_description.getKey()] = bv;
192 auto points = point_description.getGenerator().getPoints(*cell_topology);
195 Teuchos::RCP<panzer::PointRule> pr = Teuchos::rcp(
new panzer::PointRule(point_description,
211 const Teuchos::RCP<const panzer::PureBasis> & basis =
_pure_basis_map[basis_description.getKey()];
218 bv->setupArrays(b_layout);
220 bv->evaluateValues(pv->coords_ref,
225 _basis_map[basis_description.getKey()][point_description.getKey()] = bv;
244 return *(itr->second);
252 return *(itr->second);
260 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr ==
_basis_map.end(),
261 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" " 262 "of order " + std::to_string(basis_description.
getOrder()));
263 const auto & integration_map = itr->second;
264 const auto itr2 = integration_map.find(integration_description.
getKey());
265 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr2 == integration_map.end(),
266 "Workset::getBasisValues: Can't find integration " + std::to_string(integration_description.
getType()) +
" " 267 "of order " + std::to_string(integration_description.
getOrder()));
268 return *(itr2->second);
276 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr ==
_basis_map.end(),
277 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" " 278 "of order " + std::to_string(basis_description.
getOrder()));
279 const auto & point_map = itr->second;
280 const auto itr2 = point_map.find(point_description.
getKey());
281 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr2 == point_map.end(),
282 "Workset::getBasisValues: Can't find point values \"" + point_description.
getType() +
"\"");
283 return *(itr2->second);
291 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr ==
_basis_map.end(),
292 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" " 293 "of order " + std::to_string(basis_description.
getOrder()));
294 const auto & integration_map = itr->second;
295 const auto itr2 = integration_map.find(integration_description.
getKey());
296 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr2 == integration_map.end(),
297 "Workset::getBasisValues: Can't find integration " + std::to_string(integration_description.
getType()) +
" " 298 "of order " + std::to_string(integration_description.
getOrder()));
299 return *(itr2->second);
306 TEUCHOS_TEST_FOR_EXCEPT_MSG(itr ==
_point_map.end(),
307 "Workset::getPointValues: Can't find point values \"" + point_description.
getType() +
"\"");
308 return *(itr->second);
316 return *(itr->second);
323 os <<
"Workset" << endl;
324 os <<
" block_id=" << w.
block_id << endl;
325 os <<
" num_cells:" << w.
num_cells << endl;
326 os <<
" cell_local_ids (size=" << w.
cell_local_ids.size() <<
")" << endl;
330 os <<
" ir_degrees: " << endl;
331 for (std::vector<int>::const_iterator ir = w.
ir_degrees->begin();
333 os <<
" " << *ir << std::endl;
335 std::vector<int>::const_iterator ir = w.
ir_degrees->begin();
339 os <<
" IR Values (Degree=" << *ir <<
"):" << endl;
341 os <<
" cub_points:" << endl;
342 os << (*irv)->cub_points << endl;
344 os <<
" side_cub_points:" << endl;
345 os << (*irv)->side_cub_points << endl;
347 os <<
" cub_weights:" << endl;
348 os << (*irv)->cub_weights << endl;
350 os <<
" node_coordinates:" << endl;
351 os << (*irv)->node_coordinates << endl;
353 os <<
" jac:" << endl;
354 os << (*irv)->jac << endl;
356 os <<
" jac_inv:" << endl;
357 os << (*irv)->jac_inv << endl;
359 os <<
" jac_det:" << endl;
360 os << (*irv)->jac_det << endl;
362 os <<
" weighted_measure:" << endl;
363 os << (*irv)->weighted_measure << endl;
365 os <<
" covarient:" << endl;
366 os << (*irv)->covarient << endl;
368 os <<
" contravarient:" << endl;
369 os << (*irv)->contravarient << endl;
371 os <<
" norm_contravarient:" << endl;
372 os << (*irv)->norm_contravarient << endl;
374 os <<
" ip_coordinates:" << endl;
375 os << (*irv)->ip_coordinates << endl;
377 os <<
" int_rule->getName():" << (*irv)->int_rule->getName() << endl;
381 os <<
" basis_names: " << endl;
382 for (std::vector<std::string>::const_iterator b = w.
basis_names->begin();
384 os <<
" " << *b << std::endl;
386 std::vector<std::string>::const_iterator b = w.
basis_names->begin();
390 os <<
" Basis Values (basis_name=" << *b <<
"):" << endl;
418 os <<
" basis_layout->name():" << (*bv)->basis_layout->name() << endl;
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 ...
std::map< size_t, std::map< size_t, Teuchos::RCP< panzer::BasisValues2< double > > > > _basis_map
Control volume side integral.
const panzer::IntegrationRule & getIntegrationRule(const panzer::IntegrationDescriptor &description) const
Grab the integration rule (contains data layouts) for a given integration description (throws error i...
std::string element_block_name
std::map< size_t, Teuchos::RCP< const panzer::IntegrationRule > > _integration_rule_map
const std::vector< panzer::BasisDescriptor > & getBases() const
Get a list of bases being requested.
const int & getType() const
Get type of integrator.
Integral over a specific side of cells (side must be set)
Teuchos::RCP< std::vector< int > > ir_degrees
If workset corresponds to a sub cell, what is the index?
panzer::BasisValues2< double > & getBasisValues(const panzer::BasisDescriptor &basis_description, const panzer::IntegrationDescriptor &integration_description)
Grab the basis values for a given basis description and integration description (throws error if it d...
std::vector< Teuchos::RCP< panzer::BasisValues2< double > > > bases
Static basis function data, key is basis name, value is index in the static_bases vector...
Teuchos::RCP< std::vector< std::string > > basis_names
Value corresponds to basis type. Use the offest for indexing.
const 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...
std::map< size_t, Teuchos::RCP< const panzer::PureBasis > > _pure_basis_map
Generates a SubcellConnectivity associated with faces and cells given a partition of the local mesh...
Teuchos::RCP< const shards::CellTopology > cell_topology
const std::string & getType() const
Get unique string associated with the type of point descriptor. This will be used generate a hash to ...
CellCoordArray cell_vertex_coordinates
Kokkos::View< LO * > local_cells
const std::vector< panzer::IntegrationDescriptor > & getIntegrators() const
Get a list of integrators being requested.
const std::vector< panzer::PointDescriptor > & getPoints() const
Get a list of points being requested.
const panzer::IntegrationValues2< double > & getIntegrationValues(const panzer::IntegrationDescriptor &description) const
Grab the integration values for a given integration description (throws error if integration doesn't ...
std::map< size_t, Teuchos::RCP< const panzer::PointRule > > _point_rule_map
void setupNeeds(Teuchos::RCP< const shards::CellTopology > cell_topology, const Kokkos::View< double ***, PHX::Device > &cell_vertices, const panzer::WorksetNeeds &needs)
Teuchos::RCP< panzer::SubcellConnectivity > _face_connectivity
std::map< size_t, Teuchos::RCP< const panzer::IntegrationValues2< double > > > _integrator_map
std::vector< Teuchos::RCP< panzer::IntegrationValues2< double > > > int_rules
Kokkos::View< double ***, PHX::Device > cell_vertices
Kokkos::View< const int *, PHX::Device > cell_local_ids_k
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...
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
int numSubcells() const
Gives number of subcells (e.g. faces) in connectivity.
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 panzer::SubcellConnectivity & getFaceConnectivity() const
Grab the face connectivity for this workset.
std::map< size_t, Teuchos::RCP< const panzer::PointValues2< double > > > _point_map
Description and data layouts associated with a particular basis.
void populateValueArrays(std::size_t num_cells, bool isSide, const WorksetNeeds &needs, WorksetDetails &details, const Teuchos::RCP< WorksetDetails > other_details)
int getOrder() const
Get order of basis.
std::vector< GO > cell_local_ids
const std::string & getType() const
Get type of basis.
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 int & getOrder() const
Get order of integrator.
void setup(const panzer::LocalMeshPartition< int, panzer::Ordinal64 > &partition, const panzer::WorksetNeeds &needs)
Constructs the workset details from a given chunk of the mesh.