45 #include "Teuchos_Assert.hpp"
46 #include "Intrepid2_CellTools.hpp"
47 #include "Shards_CellTopology.hpp"
53 : intrepidBasis_(intrepidBasis) {
58 iend = dofOrd.extent(0),
59 jend = dofOrd.extent(1);
62 for (
int i=0;i<iend;++i) {
64 for (
int j=0;j<jend;++j) {
65 const int ord = dofOrd(i, j, 0);
67 const int ndofs = dofTag(ord, 3);
69 for (
int k=0;k<ndofs;++k)
83 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
84 return ct.getSubcellCount(dim);
87 const std::vector<int> &
108 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
110 std::set<std::pair<unsigned,unsigned> > closure;
114 std::set<std::pair<unsigned,unsigned> >::const_iterator itr;
115 for (itr=closure.begin();itr!=closure.end();++itr) {
117 const std::vector<int> & subcellIndices =
getSubcellIndices(itr->first,itr->second);
120 indices.insert(indices.end(),subcellIndices.begin(),subcellIndices.end());
144 std::vector<unsigned> & nodes)
147 nodes.push_back(subCell);
152 unsigned subCellNodeCount = cellTopo.getNodeCount(dim,subCell);
153 for(
unsigned node=0;node<subCellNodeCount;++node)
154 nodes.push_back(cellTopo.getNodeMap(dim,subCell,node));
157 std::sort(nodes.begin(),nodes.end());
163 const std::vector<unsigned> & nodes,
164 std::set<std::pair<unsigned,unsigned> > & subCells)
166 unsigned subCellCount = cellTopo.getSubcellCount(dim);
167 for(
unsigned subCellOrd=0;subCellOrd<subCellCount;++subCellOrd) {
169 std::vector<unsigned> subCellNodes;
173 bool isSubset = std::includes( nodes.begin(), nodes.end(),
174 subCellNodes.begin(), subCellNodes.end());
176 subCells.insert(std::make_pair(dim,subCellOrd));
190 std::set<std::pair<unsigned,unsigned> > & closure)
194 closure.insert(std::make_pair(0,subCell));
197 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,0)));
198 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,1)));
199 closure.insert(std::make_pair(1,subCell));
203 unsigned cnt = (shards::CellTopology(cellTopo.getCellTopologyData(dim,subCell))).getSubcellCount(dim-1);
204 for(
unsigned i=0;i<cnt;i++) {
205 int edge = mapCellFaceEdge(cellTopo.getCellTopologyData(),subCell,i);
208 closure.insert(std::make_pair(2,subCell));
247 Kokkos::DynRankView<double,PHX::Device> & coords,
252 int numCells = cellNodes.extent(0);
255 Kokkos::DynRankView<double,PHX::Device> localCoords;
259 coords = Kokkos::DynRankView<double,PHX::Device>(
"coords",numCells,localCoords.extent(0),
getDimension());
262 Intrepid2::CellTools<PHX::Device> cellTools;
266 if (meshCellTopology==Teuchos::null) {
267 cellTools.mapToPhysicalFrame(coords,localCoords,cellNodes,
intrepidBasis_->getBaseCellTopology());
269 cellTools.mapToPhysicalFrame(coords,localCoords,cellNodes,*meshCellTopology);
virtual const std::vector< int > & getSubcellIndices(int dim, int cellIndex) const
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_
virtual shards::CellTopology getCellTopology() const
bool supportsInterpolatoryCoordinates() const
Does this field pattern support interpolatory coordinates?
Intrepid2FieldPattern(const Teuchos::RCP< Intrepid2::Basis< PHX::Device, double, double > > &intrepidBasis)
static void getSubcellNodes(const shards::CellTopology &cellTopo, unsigned dim, unsigned subCell, std::vector< unsigned > &nodes)
virtual void getSubcellClosureIndices(int dim, int cellIndex, std::vector< int > &indices) const
Teuchos::RCP< Intrepid2::Basis< PHX::Device, double, double > > getIntrepidBasis() const
Returns the underlying Intrepid2::Basis object.
std::vector< std::vector< std::vector< int > > > subcellIndicies_
static void findContainedSubcells(const shards::CellTopology &cellTopo, unsigned dim, const std::vector< unsigned > &nodes, std::set< std::pair< unsigned, unsigned > > &subCells)
void getInterpolatoryCoordinates(Kokkos::DynRankView< double, PHX::Device > &coords) const
#define TEUCHOS_ASSERT(assertion_test)
virtual int getSubcellCount(int dim) const
Teuchos::RCP< Intrepid2::Basis< PHX::Device, double, double > > intrepidBasis_