15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
32 void Set(
const double *p,
const int dim)
34 MFEM_ASSERT(1 <= dim && dim <= 3,
"invalid dim: " << dim);
46 void Get(
double *p,
const int dim)
const
48 MFEM_ASSERT(1 <= dim && dim <= 3,
"invalid dim: " << dim);
60 void Set(
const double x1,
const double x2,
const double x3,
const double w)
65 void Set3(
const double x1,
const double x2,
const double x3)
66 {
x = x1;
y = x2;
z = x3; }
68 void Set3(
const double *p) {
x = p[0];
y = p[1];
z = p[2]; }
70 void Set2w(
const double x1,
const double x2,
const double w)
75 void Set2(
const double x1,
const double x2) {
x = x1;
y = x2; }
77 void Set2(
const double *p) {
x = p[0];
y = p[1]; }
79 void Set1w(
const double x1,
const double w) {
x = x1;
weight = w; }
95 void GrundmannMollerSimplexRule(
int s,
int n = 3);
97 void AddTriMidPoint(
const int off,
const double weight)
100 void AddTriPoints3(
const int off,
const double a,
const double b,
108 void AddTriPoints3(
const int off,
const double a,
const double weight)
109 { AddTriPoints3(off, a, 1. - 2.*a, weight); }
111 void AddTriPoints3b(
const int off,
const double b,
const double weight)
112 { AddTriPoints3(off, (1. - b)/2., b, weight); }
114 void AddTriPoints3R(
const int off,
const double a,
const double b,
115 const double c,
const double weight)
122 void AddTriPoints3R(
const int off,
const double a,
const double b,
124 { AddTriPoints3R(off, a, b, 1. - a - b, weight); }
126 void AddTriPoints6(
const int off,
const double a,
const double b,
127 const double c,
const double weight)
137 void AddTriPoints6(
const int off,
const double a,
const double b,
139 { AddTriPoints6(off, a, b, 1. - a - b, weight); }
142 void AddTetPoints3(
const int off,
const double a,
const double b,
151 void AddTetPoints6(
const int off,
const double a,
const double b,
152 const double c,
const double weight)
162 void AddTetMidPoint(
const int off,
const double weight)
166 void AddTetPoints4(
const int off,
const double a,
const double weight)
169 AddTetPoints3(off + 1, a, 1. - 3.*a, weight);
173 void AddTetPoints4b(
const int off,
const double b,
const double weight)
175 const double a = (1. - b)/3.;
177 AddTetPoints3(off + 1, a, b, weight);
181 void AddTetPoints6(
const int off,
const double a,
const double weight)
183 const double b = 0.5 - a;
184 AddTetPoints3(off, a, b, weight);
185 AddTetPoints3(off + 3, b, a, weight);
189 void AddTetPoints12(
const int off,
const double a,
const double bc,
192 const double cb = 1. - 2*a - bc;
193 AddTetPoints3(off, a, bc, weight);
194 AddTetPoints3(off + 3, a, cb, weight);
195 AddTetPoints6(off + 6, a, bc, cb, weight);
199 void AddTetPoints12bc(
const int off,
const double b,
const double c,
202 const double a = (1. - b - c)/2.;
203 AddTetPoints3(off, a, b, weight);
204 AddTetPoints3(off + 3, a, c, weight);
205 AddTetPoints6(off + 6, a, b, c, weight);
216 for (
int i = 0; i < this->
Size(); i++)
307 int own_rules, refined;
322 if (ir_array.
Size() <= Order)
324 ir_array.
SetSize(Order + 1, NULL);
329 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
331 int GetSegmentRealOrder(
int Order)
const
int GetNPoints() const
Returns the number of the points in the integration rule.
void Set(const double *p, const int dim)
int Size() const
Logical size of the array.
void Get(double *p, const int dim) const
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.
void ClosedUniform(const int np, IntegrationRule *ir)
void Set1w(const double *p)
void GivePolyPoints(const int np, double *pts, const int type)
~IntegrationRules()
Destroys an IntegrationRules object.
Container class for integration rules.
void Set(const double x1, const double x2, const double x3, const double w)
const Array< double > & GetWeights() const
Return the quadrature weights in a contiguous array.
void OpenUniform(const int np, IntegrationRule *ir)
const IntegrationPoint & IntPoint(int i) const
Returns a const reference to the i-th integration point.
A class container for 1D quadrature type constants.
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.
~IntegrationRule()
Destroys an IntegrationRule object.
void Set3w(const double *p)
void Set2(const double x1, const double x2)
void Set3(const double x1, const double x2, const double x3)
void Set2w(const double *p)
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
void OpenHalfUniform(const int np, IntegrationRule *ir)
int GetOrder() const
Returns the order of the integration rule.
void SetSize(int nsize)
Change 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.
IntegrationRules(int Ref=0, int type=Quadrature1D::GaussLegendre)
Class for integration point with weight.
aka "open half" Newton-Cotes
void Set2(const double *p)
IntegrationRules RefinedIntRules(1, Quadrature1D::GaussLegendre)
A global object with all refined integration rules.
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)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
A Class that defines 1-D numerical quadrature rules on [0,1].
void Set1w(const double x1, const double w)
void GaussLegendre(const int np, IntegrationRule *ir)