58 template<
class Scalar,
class ArrayPo
int,
class ArrayWeight>
60 const ArrayPoint& cellVertices,
62 : degree_(degree), cubDimension_(2), cellTopology_(cellTopology), cellVertices_(cellVertices){
65 ">>> ERROR (CubaturePolygon): No direct cubature rule implemented for the desired polynomial degree.");
68 std::vector<Scalar> centroid(2,0);
71 for (
int i=0;i<numNodes;i++){
79 centroid[0] /= (6*area);
80 centroid[1] /= (6*area);
90 cubatureTri.
getCubature(cubatureTriPoints,cubatureTriWeights);
95 for (
int k=0;k<numCells;k++){
96 for (
int i=0;i<numCubPointsPerTri;i++){
97 for (
int j=0;j<cubDim;j++){
98 cubatureCellPoints(k,i,j) = cubatureTriPoints(i,j);
105 shards::CellTopology triangleTopology(shards::getCellTopologyData<shards::Triangle<3> >());
106 int totalCubPoints = numCubPointsPerTri*
cellTopology_.getEdgeCount();
114 for (
int i=0;i<numCells;i++){
115 for (
int j=0;j<cubDim;j++){
118 trianglePoints(i,2,j) = centroid[j];
131 for (
int i=0;i<numCells;i++){
132 for (
int j=0;j<numCubPointsPerTri;j++){
133 for (
int k=0;k<cubDim;k++){
142 template<
class Scalar,
class ArrayPo
int,
class ArrayWeight>
144 ArrayWeight& cubWeights)
const{
145 int numCubPoints = numPoints_;
146 int cellDim = cubDimension_;
148 TEUCHOS_TEST_FOR_EXCEPTION ( ( cubPoints.size() < numCubPoints*cellDim || cubWeights.size() < numCubPoints ),
150 ">>> ERROR (CubaturePolygon): Insufficient space allocated for cubature points or weights.");
152 for (
int pointId = 0; pointId < numCubPoints; pointId++){
153 for (
int dim = 0; dim < cellDim; dim++){
154 cubPoints(pointId,dim) = cubaturePoints_(pointId,dim);
156 cubWeights(pointId) = cubatureWeights_(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 (CubaturePolygon): Cubature defined in reference space calling method for physical space cubature.");
171 template<
class Scalar,
class ArrayPo
int,
class ArrayWeight>
176 template<
class Scalar,
class ArrayPo
int,
class ArrayWeight>
178 return cubDimension_;
181 template<
class Scalar,
class ArrayPo
int,
class ArrayWeight>
183 accuracy.assign(1,degree_);
188 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
190 #warning "The Intrepid package is deprecated"
int cubDimension_
Dimension of integration domain.
virtual void getCubature(ArrayPoint &cubPoints, ArrayWeight &cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
int getDimension() const
Returns dimension of integration domain.
Header file for utility class to provide multidimensional containers.
#define INTREPID_CUBATURE_TRI_DEFAULT_MAX
The maximum degree of the polynomial that can be integrated exactly by a direct triangle rule of the ...
virtual int getNumPoints() const
Returns the number of cubature points.
shards::CellTopology cellTopology_
The topology of the polygon.
void getAccuracy(std::vector< int > &accuracy) const
Returns max. degree of polynomials that are integrated exactly on each triangle. The return vector ha...
int degree_
The degree of the polynomials that are integrated exactly on each triangle.
FieldContainer< Scalar > cubatureWeights_
Local copy of cubature weights.
void getCubature(ArrayPoint &cubPoints, ArrayWeight &cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
FieldContainer< Scalar > cubaturePoints_
Local copy of cubature points.
Header file for the Intrepid::CubatureDirectTriDefault class.
virtual int getDimension() const
Returns dimension of integration domain.
void resize(const int dim0)
Resizes FieldContainer to a rank-1 container with the specified dimension, initialized by 0...
Defines direct integration rules on a triangle.
int getNumPoints() const
Returns the number of cubature points.
CubaturePolygon(const shards::CellTopology &cellTopology, const ArrayPoint &cellVertices, int degree)
int numPoints_
The number of cubature points.
ArrayPoint cellVertices_
The vertices of the polygon.