17#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
48 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
62 MFEM_ASSERT(1 <=
dim &&
dim <= 3,
"invalid dim: " <<
dim);
80 {
x = x1;
y = x2;
z = x3; }
109 void GrundmannMollerSimplexRule(
int s,
int n = 3);
111 void AddTriMidPoint(
const int off,
const real_t weight)
122 void AddTriPoints3(
const int off,
const real_t a,
const real_t weight)
123 { AddTriPoints3(off,
a, 1. - 2.*
a, weight); }
125 void AddTriPoints3b(
const int off,
const real_t b,
const real_t weight)
126 { AddTriPoints3(off, (1. -
b)/2.,
b, weight); }
128 void AddTriPoints3R(
const int off,
const real_t a,
const real_t b,
136 void AddTriPoints3R(
const int off,
const real_t a,
const real_t b,
138 { AddTriPoints3R(off,
a,
b, 1. -
a -
b, weight); }
153 { AddTriPoints6(off,
a,
b, 1. -
a -
b, weight); }
176 void AddTetMidPoint(
const int off,
const real_t weight)
180 void AddTetPoints4(
const int off,
const real_t a,
const real_t weight)
183 AddTetPoints3(off + 1,
a, 1. - 3.*
a, weight);
187 void AddTetPoints4b(
const int off,
const real_t b,
const real_t weight)
191 AddTetPoints3(off + 1,
a,
b, weight);
195 void AddTetPoints6(
const int off,
const real_t a,
const real_t weight)
198 AddTetPoints3(off,
a,
b, weight);
199 AddTetPoints3(off + 3,
b,
a, weight);
203 void AddTetPoints12(
const int off,
const real_t a,
const real_t bc,
206 const real_t cb = 1. - 2*
a - bc;
207 AddTetPoints3(off,
a, bc, weight);
208 AddTetPoints3(off + 3,
a, cb, weight);
209 AddTetPoints6(off + 6,
a, bc, cb, weight);
213 void AddTetPoints12bc(
const int off,
const real_t b,
const real_t c,
217 AddTetPoints3(off,
a,
b, weight);
218 AddTetPoints3(off + 3,
a, c, weight);
219 AddTetPoints6(off + 6,
a,
b, c, weight);
230 for (
int i = 0; i < this->
Size(); i++)
283 patchRules1D(numPatches, dim_),
284 npatches(numPatches), dim(dim_) { }
290 bool & deleteRule)
const;
295 elementRule.push_back(ir_element);
296 return elementRule.size() - 1;
302 const std::size_t elementRuleIndex)
304 elementToRule[element] = elementRuleIndex;
310 std::vector<const IntegrationRule*> & ir1D);
336 return pointToElem[patch](i,j,k);
347 return patchRules1D_KnotSpan[patch][
dimension];
357 std::vector<IntegrationRule*> elementRule;
359 std::map<std::size_t, std::size_t> elementToRule;
361 std::vector<Array3D<int>> pointToElem;
362 std::vector<std::vector<Array<int>>> patchRules1D_KnotSpan;
389 static void CalculateUniformWeights(
IntegrationRule *ir,
const int type);
423 int own_rules, refined;
434#if defined(MFEM_THREAD_SAFE) && defined(MFEM_USE_OPENMP)
440 if (ir_array.
Size() <= Order)
442 ir_array.
SetSize(Order + 1, NULL);
447 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
449 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 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 Set2(const real_t x1, const real_t x2)
void Set1w(const real_t *p)
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()
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.
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...
IntegrationRule & GetElementRule(const int elem, const int patch, const int *ijk, Array< const KnotVector * > const &kv, bool &deleteRule) const
Returns a rule for 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...
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.
@ ClosedUniform
aka closed Newton-Cotes
@ ClosedGL
aka closed Gauss Legendre
@ OpenHalfUniform
aka "open half" Newton-Cotes
@ OpenUniform
aka open Newton-Cotes
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
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 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)
constexpr int dimension
This example only works in 3D. Kernels for 2D are not implemented.
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[])