42 #include "Intrepid2_config.h" 43 #if ! defined( HAVE_INTREPID2_KOKKOS_DYNRANKVIEW ) 47 #include "Intrepid2_CellTools.hpp" 48 #include "Shards_CellTopology.hpp" 54 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
55 return ct.getSubcellCount(dim);
60 const std::vector<std::vector<std::vector<int> > > & ordData =
intrepidBasis_->getDofOrdinalData();
63 if((std::size_t) dim<ordData.size()) {
65 if((std::size_t) cellIndex<ordData[dim].size()) {
66 if(ordData[dim][cellIndex].size()!=1)
67 return ordData[dim][cellIndex];
68 else if(ordData[dim][cellIndex][0]<0)
71 return ordData[dim][cellIndex];
90 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
91 std::set<std::pair<unsigned,unsigned> > closure;
95 std::set<std::pair<unsigned,unsigned> >::const_iterator itr;
96 for(itr=closure.begin();itr!=closure.end();++itr) {
98 const std::vector<int> & subcellIndices =
getSubcellIndices(itr->first,itr->second);
101 indices.insert(indices.end(),subcellIndices.begin(),subcellIndices.end());
107 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
108 return ct.getDimension();
117 std::vector<unsigned> & nodes)
120 nodes.push_back(subCell);
125 unsigned subCellNodeCount = cellTopo.getNodeCount(dim,subCell);
126 for(
unsigned node=0;node<subCellNodeCount;++node)
127 nodes.push_back(cellTopo.getNodeMap(dim,subCell,node));
130 std::sort(nodes.begin(),nodes.end());
134 const std::vector<unsigned> & nodes,
135 std::set<std::pair<unsigned,unsigned> > & subCells)
138 unsigned subCellCount = cellTopo.getSubcellCount(dim);
139 for(
unsigned subCellOrd=0;subCellOrd<subCellCount;++subCellOrd) {
141 std::vector<unsigned> subCellNodes;
145 bool isSubset = std::includes( nodes.begin(), nodes.end(),
146 subCellNodes.begin(), subCellNodes.end());
148 subCells.insert(std::make_pair(dim,subCellOrd));
160 std::set<std::pair<unsigned,unsigned> > & closure)
164 closure.insert(std::make_pair(0,subCell));
167 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,0)));
168 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,1)));
169 closure.insert(std::make_pair(1,subCell));
173 unsigned cnt = (shards::CellTopology(cellTopo.getCellTopologyData(dim,subCell))).getSubcellCount(dim-1);
174 for(
unsigned i=0;i<cnt;i++) {
175 int edge = mapCellFaceEdge(cellTopo.getCellTopologyData(),subCell,i);
178 closure.insert(std::make_pair(2,subCell));
189 typedef Intrepid2::DofCoordsInterface<Kokkos::DynRankView<double,PHX::Device> > CoordsInterface;
192 using Teuchos::rcp_dynamic_cast;
199 return coordsInterface!=Teuchos::null;
209 typedef Intrepid2::DofCoordsInterface<Kokkos::DynRankView<double,PHX::Device> > CoordsInterface;
212 using Teuchos::rcp_dynamic_cast;
214 bool throwOnFail =
true;
222 coordsInterface->getDofCoords(coords);
231 Kokkos::DynRankView<double,PHX::Device> & coords)
const 235 int numCells = cellVertices.dimension(0);
238 Kokkos::DynRankView<double,PHX::Device> localCoords;
242 coords = Kokkos::DynRankView<double,PHX::Device>(
"coords",numCells,localCoords.dimension(0),
getDimension());
246 Intrepid2::CellTools<double> cellTools;
247 cellTools.mapToPhysicalFrame(coords,localCoords,cellVertices,
intrepidBasis_->getBaseCellTopology());
virtual int getSubcellCount(int dim) const
virtual const std::vector< int > & getSubcellIndices(int dim, int cellIndex) const
bool supportsInterpolatoryCoordinates() const
Does this field pattern support interpolatory coordinates?
virtual int getDimension() const
static void buildSubcellClosure(const shards::CellTopology &cellTopo, unsigned dim, unsigned subCell, std::set< std::pair< unsigned, unsigned > > &closure)
std::vector< int > empty_
Teuchos::RCP< Intrepid2::Basis< double, Kokkos::DynRankView< double, PHX::Device > > > intrepidBasis_
virtual void getSubcellClosureIndices(int dim, int cellIndex, std::vector< int > &indices) const
static void getSubcellNodes(const shards::CellTopology &cellTopo, unsigned dim, unsigned subCell, std::vector< unsigned > &nodes)
void getInterpolatoryCoordinates(Kokkos::DynRankView< double, PHX::Device > &coords) const
virtual shards::CellTopology getCellTopology() const
static void findContainedSubcells(const shards::CellTopology &cellTopo, unsigned dim, const std::vector< unsigned > &nodes, std::set< std::pair< unsigned, unsigned > > &subCells)
#define TEUCHOS_ASSERT(assertion_test)