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.");
static void zwgrjp(Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta)
Gauss-Radau-Jacobi zeros and weights with end point at z=1.
void getAccuracy(std::vector< int > &accuracy) const
Returns max. degree of polynomials that are integrated exactly. The return vector has size 1...
EIntrepidPLPoly
Enumeration of coordinate frames (reference/ambient) for geometrical entities (cells, points).
static void zwglj(Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta)
Gauss-Lobatto-Jacobi zeros and weights with end point at z=-1,1.
static void zwgrjm(Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta)
Gauss-Radau-Jacobi zeros and weights with end point at z=-1.
const char * getName() const
Returns cubature name.
void getCubature(ArrayPoint &cubPoints, ArrayWeight &cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
int getNumPoints() const
Returns the number of cubature points.
Utilizes cubature (integration) rules contained in the library Polylib (Spencer Sherwin, Aeronautics, Imperial College London) within Intrepid.
virtual int getDimension() const
Returns dimension of integration domain.
CubaturePolylib(int degree=0, EIntrepidPLPoly pt_type=PL_GAUSS, Scalar alpha=0.0, Scalar beta=0.0)
Constructor.
static void zwgj(Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta)
Gauss-Jacobi zeros and weights.