46 #include "Teuchos_Assert.hpp" 47 #include "Phalanx_DataLayout_MDALayout.hpp" 48 #include "Intrepid2_DefaultCubatureFactory.hpp" 58 setup(ptName,np,cell_data);
62 setup(
const std::string & ptName,
72 TEUCHOS_TEST_FOR_EXCEPTION(topology==Teuchos::null,std::runtime_error,
73 "PointRule::setup - Base topology from cell_data cannot be null!");
74 TEUCHOS_TEST_FOR_EXCEPTION(spatial_dimension!=(
int) topology->getDimension(), std::runtime_error,
75 "PointRule::setup - Spatial dimension from cell_data does not match the cell topology.");
77 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(topology), std::runtime_error,
78 "PointRule::setup - Failed to allocate cell topology!");
81 if(cell_data.
isSide() && spatial_dimension==1) {
82 TEUCHOS_ASSERT(num_points==1);
86 side_topology = getSideTopology(cell_data);
87 if (side_topology!=Teuchos::null)
88 side = cell_data.
side();
90 TEUCHOS_TEST_FOR_EXCEPTION(side >= 0 && Teuchos::is_null(side_topology),
92 "Failed to allocate side topology!");
99 rcp(
new MDALayout<Cell,IP>(workset_size,num_points));
102 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,
106 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,
111 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,3));
113 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,3,3));
124 return (!Teuchos::is_null(side_topology));
129 Teuchos::RCP<shards::CellTopology> sideTopo;
131 Teuchos::RCP<const shards::CellTopology> topology = cell_data.
getCellTopology();
133 if (cell_data.
isSide() && spatial_dimension>1) {
134 int side = cell_data.
side();
136 TEUCHOS_TEST_FOR_EXCEPTION( (side >= static_cast<int>(topology->getSideCount())),
137 std::runtime_error,
"Error - local side " 138 << side <<
" is not in range (0->" << topology->getSideCount()-1
139 <<
") of topologic entity!");
141 sideTopo = Teuchos::rcp(
new shards::CellTopology(topology->getCellTopologyData(topology->getDimension()-1,side)));
143 else if(cell_data.
isSide() && spatial_dimension==1) {
144 sideTopo = Teuchos::rcp(
new shards::CellTopology(shards::getCellTopologyData<shards::Node>()));
152 os <<
"panzer::PointRule ( " 153 <<
"Name = " << getName()
154 <<
", Dimension = " << spatial_dimension
155 <<
", Workset Size = " << workset_size
156 <<
", Num Points = " << num_points
157 <<
", Side = " << side
void setup(const std::string &ptName, int np, const panzer::CellData &cell_data)
int baseCellDimension() const
Dimension of the base cell. NOT the dimension of the local side, even if the side() method returns tr...
Teuchos::RCP< const shards::CellTopology > getCellTopology() const
Get CellTopology for the base cell.
virtual void print(std::ostream &os)
print information about the integration rule
Data for determining cell topology and dimensionality.
static Teuchos::RCP< shards::CellTopology > getSideTopology(const CellData &cell_data)
const std::string & getName() const
std::size_t numCells() const