51 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
53 TEUCHOS_TEST_FOR_EXCEPTION((degree < 0),
55 ">>> ERROR (CubaturePolylib): No cubature rule implemented for the desired polynomial degree.");
58 poly_type_ = poly_type;
65 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
67 return cubature_name_;
72 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
79 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
84 np = (degree_+(int)2)/(int)2;
86 case PL_GAUSS_RADAU_LEFT:
87 case PL_GAUSS_RADAU_RIGHT:
91 np = (degree_+(int)3)/(int)2;
93 case PL_GAUSS_LOBATTO:
94 np = (degree_+(int)4)/(int)2;
97 TEUCHOS_TEST_FOR_EXCEPTION((1),
98 std::invalid_argument,
99 ">>> ERROR (CubaturePolylib): Unknown point type argument.");
106 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
108 accuracy.assign(1, degree_);
113 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
118 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
120 int numCubPoints = getNumPoints();
121 int cellDim = getDimension();
123 TEUCHOS_TEST_FOR_EXCEPTION( ( ( (
int)cubPoints.size() < numCubPoints*cellDim ) || ( (
int)cubWeights.size() < numCubPoints ) ),
125 ">>> ERROR (CubatureDirect): Insufficient space allocated for cubature points or weights.");
132 switch (poly_type_) {
136 case PL_GAUSS_RADAU_LEFT:
139 case PL_GAUSS_RADAU_RIGHT:
142 case PL_GAUSS_LOBATTO:
146 TEUCHOS_TEST_FOR_EXCEPTION((1),
147 std::invalid_argument,
148 ">>> ERROR (CubaturePolylib): Unknown point type argument.");
152 for (
int pointId = 0; pointId < numCubPoints; pointId++) {
153 for (
int dim = 0; dim < cellDim; dim++) {
154 cubPoints(pointId,dim) = z[pointId];
156 cubWeights(pointId) = w[pointId];
160 template <
class Scalar,
class ArrayPo
int,
class ArrayWeight>
162 ArrayWeight & cubWeights,
163 ArrayPoint& cellCoords)
const
165 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
166 ">>> ERROR (CubaturePolylib): Cubature defined in reference space calling method for physical space cubature.");