11 #include "PanzerDiscFE_config.hpp"
20 using Teuchos::rcp_dynamic_cast;
29 std::vector<std::string> elementBlockIds;
30 std::vector<shards::CellTopology> elementBlockTopologies;
36 numElementBlocks != static_cast<int>(elementBlockIds.size()) &&
37 numElementBlocks != static_cast<int>(elementBlockTopologies.size()),
39 "panzer::buildIntrepidOrientation: Number of element blocks does not match to element block meta data");
42 const auto cellTopo = elementBlockTopologies.at(0);
43 const int numVerticesPerCell = cellTopo.getVertexCount();
50 for (
int i=0;i<numElementBlocks;++i) {
54 orientation.resize(total_elems);
56 for (
int i=0;i<numElementBlocks;++i) {
58 const auto &elementBlock = connMgr.
getElementBlock(elementBlockIds.at(i));
60 const int numElementsPerBlock = elementBlock.size();
63 for (
int c=0;c<numElementsPerBlock;++c) {
64 const int localCellId = elementBlock.at(c);
68 orientation[localCellId] = (Intrepid2::Orientation::getOrientation(cellTopo, vertices));
76 using Teuchos::rcp_dynamic_cast;
80 auto orientation =
rcp(
new std::vector<Intrepid2::Orientation>);
86 if (ugi!=Teuchos::null) {
90 "panzer::buildIntrepidOrientation: ConnManager is null!");
98 "panzer::buildIntrepidOrientation: Could not cast GlobalIndexer");
103 std::map<std::string,std::vector<Intrepid2::Orientation>> & orientations)
105 using Teuchos::rcp_dynamic_cast;
110 auto& connMgr = *connMgrPtr;
113 std::map<std::string,shards::CellTopology> eb_name_to_topo;
115 std::vector<std::string> elementBlockIds;
116 connMgr.getElementBlockIds(elementBlockIds);
118 std::vector<shards::CellTopology> elementBlockTopologies;
119 connMgr.getElementBlockTopologies(elementBlockTopologies);
121 for (
size_t i=0; i < elementBlockIds.size(); ++i) {
122 eb_name_to_topo[elementBlockIds[i]] = elementBlockTopologies[i];
127 const auto cellTopo = eb_name_to_topo[eBlockNames[0]];
128 const int numVerticesPerCell = cellTopo.getVertexCount();
131 connMgr.buildConnectivity(fp);
134 for (
size_t i=0;i<eBlockNames.size();++i) {
136 const auto &
lids = connMgr.getElementBlock(eBlockNames[i]);
137 const size_t num_elems =
lids.size();
138 auto& orts = orientations[eBlockNames[i]];
139 orts.resize(num_elems);
141 for (
size_t c=0;c<num_elems;++c) {
142 const int lid =
lids[c];
144 vertices(connMgr.getConnectivity(lid),numVerticesPerCell);
147 orts[c] = Intrepid2::Orientation::getOrientation(cellTopo, vertices);
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void buildIntrepidOrientations(const std::vector< std::string > &eBlockNames, const panzer::ConnManager &connMgrInput, std::map< std::string, std::vector< Intrepid2::Orientation >> &orientations)
Builds the element orientations for the specified element blocks.
void buildIntrepidOrientation(std::vector< Intrepid2::Orientation > &orientation, panzer::ConnManager &connMgr)
Builds the element orientations for all element blocks.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual const std::vector< LocalOrdinal > & getElementBlock(const std::string &blockID) const =0
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const =0
virtual Teuchos::RCP< ConnManager > noConnectivityClone() const =0
virtual Teuchos::RCP< const ConnManager > getConnManager() const =0
Returns the connection manager currently being used.
Pure virtual base class for supplying mesh connectivity information to the DOF Manager.
virtual void getElementBlockTopologies(std::vector< shards::CellTopology > &elementBlockTopologies) const =0
virtual std::size_t numElementBlocks() const =0
Kokkos::View< const LO **, Kokkos::LayoutRight, PHX::Device > lids
virtual void buildConnectivity(const FieldPattern &fp)=0
virtual const GlobalOrdinal * getConnectivity(LocalOrdinal localElmtId) const =0