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,
98 const size_t num_cells = cell_vertices.extent(0);
99 const size_t num_vertices_per_cell = cell_vertices.extent(1);
100 const size_t num_dims_per_vertex = cell_vertices.extent(2);
107 cell_vertex_coordinates = af.template buildStaticArray<double, Cell, NODE, Dim>(
"cell_vertices",num_cells, num_vertices_per_cell, num_dims_per_vertex);
109 for(
size_t i=0;i<num_cells;++i)
110 for(
size_t j=0;j<num_vertices_per_cell;++j)
111 for(
size_t k=0;k<num_dims_per_vertex;++k)
119 const std::vector<panzer::BasisDescriptor> & basis_descriptors = needs.
getBases();
120 const std::vector<panzer::IntegrationDescriptor> & integration_descriptors = needs.
getIntegrators();
121 const std::vector<panzer::PointDescriptor> & point_descriptors = needs.
getPoints();
152 const int space_dim = cell_topology->getDimension();
153 const int faces_per_cell = cell_topology->getSubcellCount(space_dim-1);
154 const int points = iv->surface_normals.extent_int(1);
155 const int points_per_face = points / faces_per_cell;
156 for (
int virtual_cell_ordinal=0; virtual_cell_ordinal<
_num_virtual_cells; virtual_cell_ordinal++)
158 const panzer::LocalOrdinal virtual_cell = virtual_cell_ordinal+num_real_cells;
159 int virtual_local_face_id = -1;
160 int face_ordinal = -1;
161 for (
int local_face_id=0; local_face_id<faces_per_cell; local_face_id++)
164 if (face_ordinal >= 0)
166 virtual_local_face_id = local_face_id;
170 if (face_ordinal >= 0)
173 const panzer::LocalOrdinal other_side = (first_cell_for_face == virtual_cell) ? 1 : 0;
174 const panzer::LocalOrdinal real_cell =
_face_connectivity->cellForSubcell(face_ordinal,other_side);
175 const panzer::LocalOrdinal face_in_real_cell =
_face_connectivity->localSubcellForSubcell(face_ordinal,other_side);
177 for (
int point_ordinal=0; point_ordinal<points_per_face; point_ordinal++)
179 int virtual_cell_point = points_per_face * virtual_local_face_id + point_ordinal;
180 int real_cell_point = points_per_face * face_in_real_cell + point_ordinal;
182 double normal[3], transverse[3], binormal[3];
190 for (
int d=0; d<space_dim; d++)
192 const auto n_d = iv->surface_normals(real_cell,real_cell_point,d);
193 iv->surface_normals(virtual_cell,virtual_cell_point,d) = -n_d;
199 for(
int dim=0; dim<3; ++dim){
200 iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,0,dim) = normal[dim];
201 iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,1,dim) = transverse[dim];
202 iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,2,dim) = binormal[dim];
206 for (
int local_face_id=0; local_face_id<faces_per_cell; local_face_id++)
208 if (local_face_id == virtual_local_face_id)
continue;
209 for (
int point_ordinal=0; point_ordinal<points_per_face; point_ordinal++)
211 int point = local_face_id * points_per_face + point_ordinal;
212 for (
int dim=0; dim<space_dim; dim++)
214 iv->surface_normals(virtual_cell,point,dim) = 0.0;
216 for(
int dim1=0; dim1<3; ++dim1)
218 for(
int dim2=0; dim2<3; ++dim2)
220 iv->surface_rotation_matrices(virtual_cell,point,dim1,dim2) = 0;
241 bv->setupArrays(b_layout);
243 bv->evaluateValues(iv->ref_ip_coordinates,
247 iv->weighted_measure,
254 bv->evaluateValuesCV(iv->ref_ip_coordinates,
259 bv->evaluateValues(iv->cub_points,
263 iv->weighted_measure,
268 _basis_map[basis_description.getKey()][integration_description.getKey()] = bv;
277 auto points = point_description.getGenerator().getPoints(*cell_topology);
303 bv->setupArrays(b_layout);
305 bv->evaluateValues(pv->coords_ref,
310 _basis_map[basis_description.getKey()][point_description.getKey()] = bv;
329 return *(itr->second);
337 return *(itr->second);
346 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" "
347 "of order " + std::to_string(basis_description.
getOrder()));
348 const auto & integration_map = itr->second;
349 const auto itr2 = integration_map.find(integration_description.
getKey());
351 "Workset::getBasisValues: Can't find integration " + std::to_string(integration_description.
getType()) +
" "
352 "of order " + std::to_string(integration_description.
getOrder()));
353 return *(itr2->second);
362 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" "
363 "of order " + std::to_string(basis_description.
getOrder()));
364 const auto & point_map = itr->second;
365 const auto itr2 = point_map.find(point_description.
getKey());
367 "Workset::getBasisValues: Can't find point values \"" + point_description.
getType() +
"\"");
368 return *(itr2->second);
377 "Workset::getBasisValues: Can't find basis \"" + basis_description.
getType() +
"\" "
378 "of order " + std::to_string(basis_description.
getOrder()));
379 const auto & integration_map = itr->second;
380 const auto itr2 = integration_map.find(integration_description.
getKey());
382 "Workset::getBasisValues: Can't find integration " + std::to_string(integration_description.
getType()) +
" "
383 "of order " + std::to_string(integration_description.
getOrder()));
384 return *(itr2->second);
392 "Workset::getPointValues: Can't find point values \"" + point_description.
getType() +
"\"");
393 return *(itr->second);
401 return *(itr->second);
408 os <<
"Workset" << endl;
409 os <<
" block_id=" << w.
block_id << endl;
410 os <<
" num_cells:" << w.
num_cells << endl;
411 os <<
" cell_local_ids (size=" << w.
cell_local_ids.size() <<
")" << endl;
415 os <<
" ir_degrees: " << endl;
416 for (std::vector<int>::const_iterator ir = w.
ir_degrees->begin();
418 os <<
" " << *ir << std::endl;
420 std::vector<int>::const_iterator ir = w.
ir_degrees->begin();
424 os <<
" IR Values (Degree=" << *ir <<
"):" << endl;
426 os <<
" cub_points:" << endl;
427 os << (*irv)->cub_points << endl;
429 os <<
" side_cub_points:" << endl;
430 os << (*irv)->side_cub_points << endl;
432 os <<
" cub_weights:" << endl;
433 os << (*irv)->cub_weights << endl;
435 os <<
" node_coordinates:" << endl;
436 os << (*irv)->node_coordinates << endl;
438 os <<
" jac:" << endl;
439 os << (*irv)->jac << endl;
441 os <<
" jac_inv:" << endl;
442 os << (*irv)->jac_inv << endl;
444 os <<
" jac_det:" << endl;
445 os << (*irv)->jac_det << endl;
447 os <<
" weighted_measure:" << endl;
448 os << (*irv)->weighted_measure << endl;
450 os <<
" covarient:" << endl;
451 os << (*irv)->covarient << endl;
453 os <<
" contravarient:" << endl;
454 os << (*irv)->contravarient << endl;
456 os <<
" norm_contravarient:" << endl;
457 os << (*irv)->norm_contravarient << endl;
459 os <<
" ip_coordinates:" << endl;
460 os << (*irv)->ip_coordinates << endl;
462 os <<
" int_rule->getName():" << (*irv)->int_rule->getName() << endl;
466 os <<
" basis_names: " << endl;
467 for (std::vector<std::string>::const_iterator b = w.
basis_names->begin();
469 os <<
" " << *b << std::endl;
471 std::vector<std::string>::const_iterator b = w.
basis_names->begin();
475 os <<
" Basis Values (basis_name=" << *b <<
"):" << endl;
503 os <<
" basis_layout->name():" << (*bv)->basis_layout->name() << endl;
std::map< size_t, std::map< size_t, Teuchos::RCP< panzer::BasisValues2< double > > > > _basis_map
static void convertNormalToRotationMatrix(const Scalar normal[3], Scalar transverse[3], Scalar binormal[3])
Control volume side integral.
Kokkos::View< double ***, PHX::Device > cell_vertices
Teuchos::RCP< const shards::CellTopology > cell_topology
std::map< size_t, Teuchos::RCP< const panzer::IntegrationRule > > _integration_rule_map
Kokkos::View< panzer::LocalOrdinal * > local_cells
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::size_t getKey() const
Get unique key associated with integrator of this order and type The key is used to sort through a ma...
Integral over a specific side of cells (side must be set)
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 ...
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.
void setup(const panzer::LocalMeshPartition &partition, const panzer::WorksetNeeds &needs)
Constructs the workset details from a given chunk of the mesh.
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...
const int & getType() const
Get type of integrator.
panzer::LocalOrdinal num_owned_cells
CellCoordArray cell_vertex_coordinates
const std::vector< panzer::PointDescriptor > & getPoints() const
Get a list of points being requested.
const std::vector< panzer::BasisDescriptor > & getBases() const
Get a list of bases being requested.
panzer::LocalOrdinal num_virtual_cells
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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 ...
const std::string & getType() const
Get type of basis.
#define TEUCHOS_TEST_FOR_EXCEPT_MSG(throw_exception_test, msg)
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)
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...
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
panzer::LocalOrdinal num_ghstd_cells
int getOrder() const
Get order of basis.
KOKKOS_INLINE_FUNCTION int numSubcells() const
Gives number of subcells (e.g. faces) in connectivity.
const panzer::IntegrationRule & getIntegrationRule(const panzer::IntegrationDescriptor &description) const
Grab the integration rule (contains data layouts) for a given integration description (throws error i...
const std::vector< panzer::IntegrationDescriptor > & getIntegrators() const
Get a list of integrators being requested.
Kokkos::View< const int *, PHX::Device > cell_local_ids_k
const std::string & getType() const
Get unique string associated with the type of point descriptor. This will be used generate a hash to ...
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
std::string element_block_name
std::map< size_t, Teuchos::RCP< const panzer::PointValues2< double > > > _point_map
Description and data layouts associated with a particular basis.
#define TEUCHOS_ASSERT(assertion_test)
void populateValueArrays(std::size_t num_cells, bool isSide, const WorksetNeeds &needs, WorksetDetails &details, const Teuchos::RCP< WorksetDetails > other_details)
const panzer::SubcellConnectivity & getFaceConnectivity() const
Grab the face connectivity for this workset.
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::vector< GO > cell_local_ids
const int & getOrder() const
Get order of integrator.