17#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
58 {
x = x1;
y = x2;
z = x3; }
69 {
Set3w(x1, x2, x3, w); }
73 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
76 case 3:
Set3(
p);
break;
77 case 2:
Set2(
p);
break;
78 case 1:
Set1(
p);
break;
84 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
105 void GrundmannMollerSimplexRule(
int s,
int n = 3);
119 { AddTriPoints3(off,
a, 1. - 2.*
a,
weight); }
122 { AddTriPoints3(off, (1. -
b)/2.,
b,
weight); }
137 { AddTriPoints6(off,
a,
b, 1. -
a -
b,
weight); }
167 AddTetPoints3(off + 1,
a, 1. - 3.*
a,
weight);
175 AddTetPoints3(off + 3,
b,
a,
weight);
179 void AddTetPoints12(
const int off,
const real_t a,
const real_t bc,
182 const real_t cb = 1. - 2*
a - bc;
183 AddTetPoints3(off,
a, bc,
weight);
184 AddTetPoints3(off + 3,
a, cb,
weight);
185 AddTetPoints6(off + 6,
a, bc, cb,
weight);
189 void AddTetPoints24(
const int off,
const real_t a,
const real_t b,
229 for (
int i = 0; i < this->
Size(); i++)
289 patchRules1D(numPatches, dim_),
290 npatches(numPatches), dim(dim_) { }
300 elementRule.push_back(ir_element);
301 return elementRule.size() - 1;
307 const std::size_t elementRuleIndex)
309 elementToRule[element] = elementRuleIndex;
315 std::vector<const IntegrationRule*> & ir1D);
341 return pointToElem[patch](i,j,k);
352 return patchRules1D_KnotSpan[patch][
dimension];
362 std::vector<IntegrationRule*> elementRule;
364 std::map<std::size_t, std::size_t> elementToRule;
366 std::vector<Array3D<int>> pointToElem;
367 std::vector<std::vector<Array<int>>> patchRules1D_KnotSpan;
369#ifndef MFEM_THREAD_SAFE
403 static void CalculateUniformWeights(
IntegrationRule *ir,
const int type);
437 int own_rules, refined;
448#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
454 if (ir_array.
Size() <= Order)
456 ir_array.
SetSize(Order + 1, NULL);
461 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
463 int GetSegmentRealOrder(
int Order)
const
508#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
514 if (ir_array.
Size() <= Order)
516 ir_array.
SetSize(Order + 1, NULL);
521 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
523 int GetSegmentRealOrder(
int Order)
const
Dynamic 2D array using row-major layout.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Class for integration point with weight.
void Set1(const real_t x1)
void Get(real_t *p, const int dim) const
void Set(const real_t *p, const int dim)
void Set2w(const real_t *p)
void Set2w(const real_t x1, const real_t x2, const real_t w)
void Set2(const real_t *p)
void Set3(const real_t *p)
void Set1w(const real_t x1, const real_t w)
void Set3w(const real_t *p)
void Set1(const real_t *p)
void Set2(const real_t x1, const real_t x2)
void Set1w(const real_t *p)
void Set3w(const real_t x1, const real_t x2, const real_t x3, const real_t w)
void Set(const real_t x1, const real_t x2, const real_t x3, const real_t w)
void Set3(const real_t x1, const real_t x2, const real_t x3)
Class for an integration rule - an Array of IntegrationPoint.
IntegrationRule Reorder(const Array< int > &ordering) const
Returns an integration rule such that the new IntegrationPoints are re-ordered based on ordering.
~IntegrationRule()
Destroys an IntegrationRule object.
IntegrationRule(int NP)
Construct an integration rule with given number of points.
int GetOrder() const
Returns the order of the integration rule.
const IntegrationPoint & IntPoint(int i) const
Returns a const reference to the i-th integration point.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationRule * ApplyToKnotIntervals(KnotVector const &kv) const
Return an integration rule for KnotVector kv, defined by applying this rule on each knot interval.
const Array< real_t > & GetWeights() const
Return the quadrature weights in a contiguous array.
void SetOrder(const int order)
Sets the order of the integration rule. This is only for keeping order information,...
void SetPointIndices()
Sets the indices of each quadrature point on initialization.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Container class for integration rules.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
IntegrationRules(int ref=0, int type=Quadrature1D::GaussLegendre)
void Set(int GeomType, int Order, IntegrationRule &IntRule)
~IntegrationRules()
Destroys an IntegrationRules object.
A vector of knots in one dimension, with B-spline basis functions of a prescribed order.
Class for defining different integration rules on each NURBS patch.
const IntegrationRule * GetPatchRule1D(const int patch, const int dimension) const
For tensor product rules defined on each patch by SetPatchRules1D(), return a pointer to the 1D rule ...
void Finalize(Mesh const &mesh)
Finalize() must be called before this class can be used for assembly. In particular,...
NURBSMeshRules(const int numPatches, const int dim_)
Construct a rule for each patch, using SetPatchRules1D.
int GetPointElement(int patch, int i, int j, int k) const
For tensor product rules defined on each patch by SetPatchRules1D(), returns the index of the element...
void SetPatchRules1D(const int patch, std::vector< const IntegrationRule * > &ir1D)
Set 1D integration rules to be used as a tensor product rule on the patch with index patch....
const Array< int > & GetPatchRule1D_KnotSpan(const int patch, const int dimension) const
For tensor product rules defined on each patch by SetPatchRules1D(), returns an array of knot span in...
void GetIntegrationPointFrom1D(const int patch, int i, int j, int k, IntegrationPoint &ip)
For tensor product rules defined on each patch by SetPatchRules1D(), return the integration point wit...
void SetElementRule(const std::size_t element, const std::size_t elementRuleIndex)
Set the integration rule for the element of the given index. This rule is used instead of the rule fo...
IntegrationRule & GetElementRule(const int elem, const int patch, const int *ijk, Array< const KnotVector * > const &kv) const
Returns a rule for the element.
std::size_t AddElementRule(IntegrationRule *ir_element)
Add a rule to be used for individual elements. Returns the rule index.
A class container for 1D quadrature type constants.
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
@ ClosedUniform
aka closed Newton-Cotes
@ ClosedGL
aka closed Gauss Legendre
@ OpenHalfUniform
aka "open half" Newton-Cotes
@ OpenUniform
aka open Newton-Cotes
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
A Class that defines 1-D numerical quadrature rules on [0,1].
static void GaussLegendre(const int np, IntegrationRule *ir)
static void ClosedUniform(const int np, IntegrationRule *ir)
static void OpenUniform(const int np, IntegrationRule *ir)
static void ClosedGL(const int np, IntegrationRule *ir)
static void GaussJacobi(const int np, const real_t alpha, const real_t beta, IntegrationRule *ir)
static void GivePolyPoints(const int np, real_t *pts, const int type)
static void OpenHalfUniform(const int np, IntegrationRule *ir)
static void GaussLobatto(const int np, IntegrationRule *ir)
Container class for integration rules.
~StroudIntegrationRules()
Destroys an StroudIntegrationRules object.
const IntegrationRule & Get(int GeomType, int Order)
Returns a Stroud integration rule for given GeomType and Order.
constexpr int dimension
This example only works in 3D. Kernels for 2D are not implemented.
real_t weight(const Vector &x)
StroudIntegrationRules StroudIntRules
A global object with all Stroud integration rules (defined in intrules.cpp)
IntegrationRule DuffyTrans(const IntegrationRule &ir, int dim)
IntegrationRules RefinedIntRules(1, Quadrature1D::GaussLegendre)
A global object with all refined integration rules.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
real_t p(const Vector &x, real_t t)
void pts(int iphi, int t, real_t x[])