46#include "Teuchos_Assert.hpp"
47#include "Phalanx_DataLayout_MDALayout.hpp"
48#include "Intrepid2_DefaultCubatureFactory.hpp"
59 setup(ptName,np,cell_data);
63PointRule(
const std::string & point_rule_name,
65 const int num_points_per_cell,
67 const int num_points_per_face,
68 const Teuchos::RCP<const shards::CellTopology> & cell_topology)
70 setup(point_rule_name, num_cells, num_points_per_cell, num_faces, num_points_per_face, cell_topology);
77 const Teuchos::RCP<const shards::CellTopology> & cell_topology,
81 setup(description.
getType(), num_cells, num_points_per_cell, 0, 0, cell_topology);
85setup(
const std::string & ptName,
94 _num_points_per_face = -1;
97 TEUCHOS_TEST_FOR_EXCEPTION(topology==Teuchos::null,std::runtime_error,
98 "PointRule::setup - Base topology from cell_data cannot be null!");
99 TEUCHOS_TEST_FOR_EXCEPTION(spatial_dimension!=(
int) topology->getDimension(), std::runtime_error,
100 "PointRule::setup - Spatial dimension from cell_data does not match the cell topology.");
102 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(topology), std::runtime_error,
103 "PointRule::setup - Failed to allocate cell topology!");
106 if(cell_data.
isSide() && spatial_dimension==1) {
107 TEUCHOS_ASSERT(num_points==1);
111 side_topology = getSideTopology(cell_data);
112 if (side_topology!=Teuchos::null)
113 side = cell_data.
side();
115 TEUCHOS_TEST_FOR_EXCEPTION(side >= 0 && Teuchos::is_null(side_topology),
117 "Failed to allocate side topology!");
121 using PHX::MDALayout;
124 rcp(
new MDALayout<Cell,IP>(workset_size,num_points));
127 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,
131 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,
136 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,3));
138 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,3,3));
144setup(
const std::string & point_rule_name,
146 const int num_points_per_cell,
148 const int num_points_per_face,
149 const Teuchos::RCP<const shards::CellTopology> & cell_topology)
152 topology = cell_topology;
153 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(topology),std::runtime_error,
154 "PointRule::setup - Cell topology cannot be null.");
156 point_name = point_rule_name;
157 num_points = num_points_per_cell;
158 spatial_dimension = cell_topology->getDimension();
159 workset_size = num_cells;
160 _num_faces = num_faces;
161 _num_points_per_face = num_points_per_face;
165 dl_scalar = Teuchos::rcp(
new PHX::MDALayout<Cell,IP>(workset_size,num_points));
166 dl_vector = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim>(workset_size, num_points,spatial_dimension));
167 dl_tensor = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,spatial_dimension,spatial_dimension));
169 dl_vector3 = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim>(workset_size, num_points,3));
170 dl_tensor3x3 = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,3,3));
181 return (!Teuchos::is_null(side_topology));
186 Teuchos::RCP<shards::CellTopology> sideTopo;
188 Teuchos::RCP<const shards::CellTopology> topology = cell_data.
getCellTopology();
190 if (cell_data.
isSide() && spatial_dimension>1) {
191 int side = cell_data.
side();
193 TEUCHOS_TEST_FOR_EXCEPTION( (side >=
static_cast<int>(topology->getSideCount())),
194 std::runtime_error,
"Error - local side "
195 << side <<
" is not in range (0->" << topology->getSideCount()-1
196 <<
") of topologic entity!");
198 sideTopo = Teuchos::rcp(
new shards::CellTopology(topology->getCellTopologyData(topology->getDimension()-1,side)));
200 else if(cell_data.
isSide() && spatial_dimension==1) {
201 sideTopo = Teuchos::rcp(
new shards::CellTopology(shards::getCellTopologyData<shards::Node>()));
207Teuchos::RCP<PHX::DataLayout>
209{
return Teuchos::rcp(
new PHX::MDALayout<Cell>(workset_size));}
211Teuchos::RCP<PHX::DataLayout>
213{
return Teuchos::rcp(
new PHX::MDALayout<Cell,Dim>(workset_size, dim0));}
215Teuchos::RCP<PHX::DataLayout>
217{
return Teuchos::rcp(
new PHX::MDALayout<Cell,Dim,Dim>(workset_size, dim0, dim1));}
220Teuchos::RCP<PHX::DataLayout>
222{
return Teuchos::rcp(
new PHX::MDALayout<Cell,IP>(workset_size, num_points));}
224Teuchos::RCP<PHX::DataLayout>
226{
return Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim>(workset_size, num_points, dim0));}
228Teuchos::RCP<PHX::DataLayout>
230{
return Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points, dim0, dim1));}
233Teuchos::RCP<PHX::DataLayout>
235{
return Teuchos::rcp(
new PHX::MDALayout<Face>(_num_faces));}
237Teuchos::RCP<PHX::DataLayout>
239{
return Teuchos::rcp(
new PHX::MDALayout<Face,Dim>(_num_faces, dim0));}
241Teuchos::RCP<PHX::DataLayout>
243{
return Teuchos::rcp(
new PHX::MDALayout<Face,Dim,Dim>(_num_faces, dim0, dim1));}
246Teuchos::RCP<PHX::DataLayout>
248{
return Teuchos::rcp(
new PHX::MDALayout<Face,IP>(_num_faces, _num_points_per_face));}
250Teuchos::RCP<PHX::DataLayout>
252{
return Teuchos::rcp(
new PHX::MDALayout<Face,IP,Dim>(_num_faces, _num_points_per_face, dim0));}
254Teuchos::RCP<PHX::DataLayout>
256{
return Teuchos::rcp(
new PHX::MDALayout<Face,IP,Dim,Dim>(_num_faces, _num_points_per_face, dim0, dim1));}
262 os <<
"panzer::PointRule ( "
263 <<
"Name = " << getName()
264 <<
", Dimension = " << spatial_dimension
265 <<
", Workset Size = " << workset_size
266 <<
", Num Points = " << num_points
267 <<
", Side = " << side
Data for determining cell topology and dimensionality.
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.
std::size_t numCells() const
const PointGenerator & getGenerator() const
const std::string & getType() const
Get unique string associated with the type of point descriptor. This will be used generate a hash to ...
virtual int numPoints(const shards::CellTopology &topo) const =0
Get the points for a particular topology.
Teuchos::RCP< PHX::DataLayout > getFaceDataLayout() const
Teuchos::RCP< PHX::DataLayout > getFacePointDataLayout() const
static Teuchos::RCP< shards::CellTopology > getSideTopology(const CellData &cell_data)
virtual void print(std::ostream &os)
print information about the integration rule
void setup(const std::string &ptName, int np, const panzer::CellData &cell_data)
Teuchos::RCP< PHX::DataLayout > getCellDataLayout() const
Teuchos::RCP< PHX::DataLayout > getCellPointDataLayout() const
const std::string & getName() const