30PointRule(
const std::string & point_rule_name,
32 const int num_points_per_cell,
34 const int num_points_per_face,
35 const Teuchos::RCP<const shards::CellTopology> & cell_topology)
37 setup(point_rule_name, num_cells, num_points_per_cell, num_faces, num_points_per_face, cell_topology);
52setup(
const std::string & ptName,
61 _num_points_per_face = -1;
64 TEUCHOS_TEST_FOR_EXCEPTION(topology==Teuchos::null,std::runtime_error,
65 "PointRule::setup - Base topology from cell_data cannot be null!");
66 TEUCHOS_TEST_FOR_EXCEPTION(spatial_dimension!=(
int) topology->getDimension(), std::runtime_error,
67 "PointRule::setup - Spatial dimension from cell_data does not match the cell topology.");
69 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(topology), std::runtime_error,
70 "PointRule::setup - Failed to allocate cell topology!");
73 if(cell_data.
isSide() && spatial_dimension==1) {
74 TEUCHOS_ASSERT(num_points==1);
78 side_topology = getSideTopology(cell_data);
79 if (side_topology!=Teuchos::null)
80 side = cell_data.
side();
82 TEUCHOS_TEST_FOR_EXCEPTION(side >= 0 && Teuchos::is_null(side_topology),
84 "Failed to allocate side topology!");
91 rcp(
new MDALayout<Cell,IP>(workset_size,num_points));
94 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,
98 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,
103 rcp(
new MDALayout<Cell,IP,Dim>(workset_size, num_points,3));
105 rcp(
new MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,3,3));
111setup(
const std::string & point_rule_name,
113 const int num_points_per_cell,
115 const int num_points_per_face,
116 const Teuchos::RCP<const shards::CellTopology> & cell_topology)
119 topology = cell_topology;
120 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(topology),std::runtime_error,
121 "PointRule::setup - Cell topology cannot be null.");
123 point_name = point_rule_name;
124 num_points = num_points_per_cell;
125 spatial_dimension = cell_topology->getDimension();
126 workset_size = num_cells;
127 _num_faces = num_faces;
128 _num_points_per_face = num_points_per_face;
132 dl_scalar = Teuchos::rcp(
new PHX::MDALayout<Cell,IP>(workset_size,num_points));
133 dl_vector = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim>(workset_size, num_points,spatial_dimension));
134 dl_tensor = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,spatial_dimension,spatial_dimension));
136 dl_vector3 = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim>(workset_size, num_points,3));
137 dl_tensor3x3 = Teuchos::rcp(
new PHX::MDALayout<Cell,IP,Dim,Dim>(workset_size, num_points,3,3));
153 Teuchos::RCP<shards::CellTopology> sideTopo;
155 Teuchos::RCP<const shards::CellTopology> topology = cell_data.
getCellTopology();
157 if (cell_data.
isSide() && spatial_dimension>1) {
158 int side = cell_data.
side();
160 TEUCHOS_TEST_FOR_EXCEPTION( (side >=
static_cast<int>(topology->getSideCount())),
161 std::runtime_error,
"Error - local side "
162 << side <<
" is not in range (0->" << topology->getSideCount()-1
163 <<
") of topologic entity!");
165 sideTopo = Teuchos::rcp(
new shards::CellTopology(topology->getCellTopologyData(topology->getDimension()-1,side)));
167 else if(cell_data.
isSide() && spatial_dimension==1) {
168 sideTopo = Teuchos::rcp(
new shards::CellTopology(shards::getCellTopologyData<shards::Node>()));