13 #include "Teuchos_Assert.hpp"
14 #include "Intrepid2_CellTools.hpp"
15 #include "Shards_CellTopology.hpp"
21 : intrepidBasis_(intrepidBasis) {
26 iend = dofOrd.extent(0),
27 jend = dofOrd.extent(1);
30 for (
int i=0;i<iend;++i) {
32 for (
int j=0;j<jend;++j) {
33 const int ord = dofOrd(i, j, 0);
35 const int ndofs = dofTag(ord, 3);
37 for (
int k=0;k<ndofs;++k)
51 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
52 return ct.getSubcellCount(dim);
55 const std::vector<int> &
76 const shards::CellTopology ct =
intrepidBasis_->getBaseCellTopology();
78 std::set<std::pair<unsigned,unsigned> > closure;
82 std::set<std::pair<unsigned,unsigned> >::const_iterator itr;
83 for (itr=closure.begin();itr!=closure.end();++itr) {
85 const std::vector<int> & subcellIndices =
getSubcellIndices(itr->first,itr->second);
88 indices.insert(indices.end(),subcellIndices.begin(),subcellIndices.end());
112 std::vector<unsigned> & nodes)
115 nodes.push_back(subCell);
120 unsigned subCellNodeCount = cellTopo.getNodeCount(dim,subCell);
121 for(
unsigned node=0;node<subCellNodeCount;++node)
122 nodes.push_back(cellTopo.getNodeMap(dim,subCell,node));
125 std::sort(nodes.begin(),nodes.end());
131 const std::vector<unsigned> & nodes,
132 std::set<std::pair<unsigned,unsigned> > & subCells)
134 unsigned subCellCount = cellTopo.getSubcellCount(dim);
135 for(
unsigned subCellOrd=0;subCellOrd<subCellCount;++subCellOrd) {
137 std::vector<unsigned> subCellNodes;
141 bool isSubset = std::includes( nodes.begin(), nodes.end(),
142 subCellNodes.begin(), subCellNodes.end());
144 subCells.insert(std::make_pair(dim,subCellOrd));
158 std::set<std::pair<unsigned,unsigned> > & closure)
162 closure.insert(std::make_pair(0,subCell));
165 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,0)));
166 closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,1)));
167 closure.insert(std::make_pair(1,subCell));
171 unsigned cnt = (shards::CellTopology(cellTopo.getCellTopologyData(dim,subCell))).getSubcellCount(dim-1);
172 for(
unsigned i=0;i<cnt;i++) {
173 int edge = mapCellFaceEdge(cellTopo.getCellTopologyData(),subCell,i);
176 closure.insert(std::make_pair(2,subCell));
215 Kokkos::DynRankView<double,PHX::Device> & coords,
220 int numCells = cellNodes.extent(0);
223 Kokkos::DynRankView<double,PHX::Device> localCoords;
227 coords = Kokkos::DynRankView<double,PHX::Device>(
"coords",numCells,localCoords.extent(0),
getDimension());
230 Intrepid2::CellTools<PHX::Device> cellTools;
234 if (meshCellTopology==Teuchos::null) {
235 cellTools.mapToPhysicalFrame(coords,localCoords,cellNodes,
intrepidBasis_->getBaseCellTopology());
237 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_