15 #include "../config/config.hpp" 16 #include "../general/array.hpp" 39 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
53 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
65 void Set(
const double x1,
const double x2,
const double x3,
const double w)
70 void Set3(
const double x1,
const double x2,
const double x3)
71 {
x = x1;
y = x2;
z = x3; }
75 void Set2w(
const double x1,
const double x2,
const double w)
80 void Set2(
const double x1,
const double x2) {
x = x1;
y = x2; }
84 void Set1w(
const double x1,
const double w) {
x = x1;
weight = w; }
100 void GrundmannMollerSimplexRule(
int s,
int n = 3);
102 void AddTriMidPoint(
const int off,
const double weight)
105 void AddTriPoints3(
const int off,
const double a,
const double b,
113 void AddTriPoints3(
const int off,
const double a,
const double weight)
114 { AddTriPoints3(off,
a, 1. - 2.*
a, weight); }
116 void AddTriPoints3b(
const int off,
const double b,
const double weight)
117 { AddTriPoints3(off, (1. -
b)/2.,
b, weight); }
119 void AddTriPoints3R(
const int off,
const double a,
const double b,
120 const double c,
const double weight)
127 void AddTriPoints3R(
const int off,
const double a,
const double b,
129 { AddTriPoints3R(off,
a,
b, 1. -
a -
b, weight); }
131 void AddTriPoints6(
const int off,
const double a,
const double b,
132 const double c,
const double weight)
142 void AddTriPoints6(
const int off,
const double a,
const double b,
144 { AddTriPoints6(off,
a,
b, 1. -
a -
b, weight); }
147 void AddTetPoints3(
const int off,
const double a,
const double b,
156 void AddTetPoints6(
const int off,
const double a,
const double b,
157 const double c,
const double weight)
167 void AddTetMidPoint(
const int off,
const double weight)
171 void AddTetPoints4(
const int off,
const double a,
const double weight)
174 AddTetPoints3(off + 1,
a, 1. - 3.*
a, weight);
178 void AddTetPoints4b(
const int off,
const double b,
const double weight)
180 const double a = (1. -
b)/3.;
182 AddTetPoints3(off + 1,
a,
b, weight);
186 void AddTetPoints6(
const int off,
const double a,
const double weight)
188 const double b = 0.5 -
a;
189 AddTetPoints3(off,
a,
b, weight);
190 AddTetPoints3(off + 3,
b,
a, weight);
194 void AddTetPoints12(
const int off,
const double a,
const double bc,
197 const double cb = 1. - 2*
a - bc;
198 AddTetPoints3(off,
a, bc, weight);
199 AddTetPoints3(off + 3,
a, cb, weight);
200 AddTetPoints6(off + 6,
a, bc, cb, weight);
204 void AddTetPoints12bc(
const int off,
const double b,
const double c,
207 const double a = (1. -
b - c)/2.;
208 AddTetPoints3(off,
a,
b, weight);
209 AddTetPoints3(off + 3,
a, c, weight);
210 AddTetPoints6(off + 6,
a,
b, c, weight);
221 for (
int i = 0; i < this->
Size(); i++)
285 static void CalculateUniformWeights(
IntegrationRule *ir,
const int type);
319 int own_rules, refined;
332 if (ir_array.
Size() <= Order)
334 ir_array.
SetSize(Order + 1, NULL);
339 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
341 int GetSegmentRealOrder(
int Order)
const void Set(const double *p, const int dim)
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
static void ClosedUniform(const int np, IntegrationRule *ir)
void Set1w(const double *p)
static void GivePolyPoints(const int np, double *pts, const int type)
~IntegrationRules()
Destroys an IntegrationRules object.
aka "open half" Newton-Cotes
Container class for integration rules.
void Set(const double x1, const double x2, const double x3, const double w)
IntegrationRules RefinedIntRules(1, Quadrature1D::GaussLegendre)
A global object with all refined integration rules.
static void OpenUniform(const int np, IntegrationRule *ir)
A class container for 1D quadrature type constants.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
static void GaussLobatto(const int np, IntegrationRule *ir)
void Set3(const double *p)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
const Array< double > & GetWeights() const
Return the quadrature weights in a contiguous array.
int GetOrder() const
Returns the order of the integration rule.
void Get(double *p, const int dim) const
~IntegrationRule()
Destroys an IntegrationRule object.
void Set3w(const double *p)
void Set2(const double x1, const double x2)
const IntegrationPoint & IntPoint(int i) const
Returns a const reference to the i-th integration point.
void SetPointIndices()
Sets the indices of each quadrature point on initialization.
void Set3(const double x1, const double x2, const double x3)
void Set2w(const double *p)
double p(const Vector &x, double t)
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
static void OpenHalfUniform(const int np, IntegrationRule *ir)
static void ClosedGL(const int np, IntegrationRule *ir)
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
void SetOrder(const int order)
Sets the order of the integration rule. This is only for keeping order information, it does not alter any data in the IntegrationRule.
aka closed Gauss Legendre
IntegrationRules(int Ref=0, int type=Quadrature1D::GaussLegendre)
Class for integration point with weight.
int Size() const
Return the logical size of the array.
void Set2(const double *p)
void Set2w(const double x1, const double x2, const double w)
void pts(int iphi, int t, double x[])
IntegrationRule(int NP)
Construct an integration rule with given number of points.
void Set(int GeomType, int Order, IntegrationRule &IntRule)
A Class that defines 1-D numerical quadrature rules on [0,1].
void Set1w(const double x1, const double w)
static void GaussLegendre(const int np, IntegrationRule *ir)