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);
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));
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>()));