40 #include <lifev/core/fem/QuadratureRule.hpp> 62 for (
UInt i (0); i < nbQuadPt; ++i)
78 ASSERT (dim >= shapeDimension (M_shape),
" Downgrading quadrature rule is forbidden ")
82 M_pt[i] = QuadraturePoint (qr.M_pt[i], dim);
95 ASSERT (dimension >= shapeDimension (shape),
" Downgrading quadrature rule is forbidden ");
98 va_start (quadList, nbQuadPt);
99 for (
UInt iterArg (0); iterArg < nbQuadPt; ++iterArg)
102 for (
UInt i (0); i < dimension ; ++i)
104 nextPoint[i] = va_arg (quadList, Real);
106 M_pt[iterArg] = QuadraturePoint (nextPoint, va_arg (quadList,
double) );
122 c <<
" name: " << qr.M_name << std::endl;
123 c <<
" shape:" << (
int ) qr.M_shape << std::endl;
124 c <<
" nbQuadPt: " << qr.M_nbQuadPt << std::endl;
128 c << qr.M_pt[ i ] << std::endl;
140 output <<
" Name : " << M_name << std::endl;
141 output <<
" Shape : " << M_shape << std::endl;
142 output <<
" Size : " << M_nbQuadPt << std::endl;
143 output <<
" --- Points --- " << std::endl;
146 output << M_pt[i] << std::endl;
167 std::cerr <<
" No check for this shape ..." << std::endl;
174 std::ofstream output (filename.c_str() );
175 ASSERT (!output.fail(),
" Unable to open the file for the export of the quadrature ");
178 output <<
"# vtk DataFile Version 3.0" << std::endl;
179 output <<
"LifeV : Quadrature export" << std::endl;
180 output <<
"ASCII" << std::endl;
181 output <<
"DATASET POLYDATA" << std::endl;
182 output <<
"POINTS " << M_nbQuadPt <<
" float" << std::endl;
186 output << M_pt[i].coor (0) <<
" " << M_pt[i].coor (1) <<
" " << M_pt[i].coor (2) << std::endl;
189 output <<
"VERTICES " << M_nbQuadPt <<
" " << 2 * M_nbQuadPt << std::endl;
193 output << 1 <<
" " << i << std::endl;
206 M_pt.resize (pts.size() );
207 for (UInt i (0); i < pts.size(); ++i)
209 M_pt[i] = QuadraturePoint (pts[i], M_dimension);
212 M_nbQuadPt = pts.size();
217 ASSERT (coordinates.size() == weights.size(),
"Non matching length of the arguments");
220 M_pt.resize (coordinates.size() );
221 for (UInt i (0); i < M_pt.size(); ++i)
223 M_pt[i] = QuadraturePoint (coordinates[i], weights[i], M_dimension);
226 M_nbQuadPt = M_pt.size();
241 ASSERT (newDim >= shapeDimension (newShape),
" Impossible shape-dimension combinaison ");
246 for (UInt i (0); i < M_pt.size(); ++i)
248 M_pt[i] = QuadraturePoint (M_pt[i], newDim);
259 Real partialSum (0.0);
337 Real partialSum (0.0);
432 Real partialSum (0.0);
UInt M_degOfExact
degree of exactness
const Real & weight(const UInt &ig) const
weight(ig) is the ig-th quadrature weight
UInt M_nbQuadPt
number of quadrature points
void setDimensionShape(const UInt &newDim, const ReferenceShapes &newShape)
Change the dimension and the shape.
UInt M_dimension
Dimension in which the quadrature is stored.
UInt checkExactnessTetra() const
Check the exactness for quadrature rules on tetrahedra.
virtual ~QuadratureRule()
Destructor.
boost::numeric::ublas::vector< Real > GeoVector
UInt checkExactness() const
Check for the exactness of the quadrature.
QuadratureRule(const QuadratureRule &qr)
Copy constructor.
void updateInverseJacobian(const UInt &iQuadPt)
ReferenceShapes M_shape
geometrical shape of the domain on which the quadrature rule can be used
UInt checkExactnessSegment() const
Check the exactness for quadrature rules on segments.
QuadratureRule(const QuadratureRule &qr, const UInt dim)
Copy constructor using a different dimension.
void vtkExport(const std::string &filename) const
VTK export for the quadrature.
QuadratureRule()
Empty constructor.
QuadraturePoint - Simple container for a point of a quadrature rule.
static Real S_exactnessTol
Tolerance for the test of exactness.
UInt checkExactnessTriangle() const
Check the exactness for quadrature rules on triangles.
double Real
Generic real data.
std::string M_name
name of the quadrature rule
void setPoints(const std::vector< QuadraturePoint > &pts)
Change the quadrature points for the ones given here.
void showMe(std::ostream &output=std::cout) const
ShowMe method.
void setName(const std::string &newName)
Change the name of the quadrature.
void setPoints(const std::vector< GeoVector > &coordinates, const std::vector< Real > &weights)
Change the quadrature points for the one given here.
QuadratureRule - The basis class for storing and accessing quadrature rules.
void setExactness(const UInt &exactness)
Change the degree of exactness.
QuadratureRule(const QuadraturePoint *pt, int id, std::string name, ReferenceShapes shape, UInt nbQuadPt, UInt degOfExact)
Full constructor using pointers.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
const Real & quadPointCoor(const UInt &ig, const UInt &icoor) const
quadPointCoor(ig,icoor) is the coordinate icoor of the quadrature point ig
QuadratureRule(std::string name, ReferenceShapes shape, UInt dimension, UInt degreeOfExactness, UInt nbQuadPt,...)
Full constructor.