![]() |
GemaCoreLib
The GeMA Core library
|
A class storing tables with (position, weight) pairs for line, triangle and tetrahedron Open & closed Newton Cotes integration rules. More...
#include <gmNewtonCotesIntegrationTables.h>
Static Public Member Functions | |
static const QVector< QPair< double, double > > * | lineRuleTable (int rule, bool closed) |
Returns the table storing (position, weight) pairs for the given open or closed line Newton Cotes rule. Rule SHOULD be in the interval 1 to 5. Returns NULL for any unknown rule. | |
static int | lineRuleDegree (int rule) |
Returns the integration degree for the given line Newton Cotes rule (The polynomial degree for which this rule is exact). Returns an undefined value for invalid rules. The degree is independent on the rule being open or closed and follows the pattern: 1, 1 ,3, 3, 5, ... | |
static const QVector< QPair< GmVector, double > > * | triRuleTable (int rule, bool closed) |
Returns the table storing (position, weight) pairs for the given open or closed triangle Newton Cotes rule. Rule SHOULD be in the interval 1 to 5. Returns NULL for any unknown rule. | |
static int | triRuleDegree (int rule) |
Returns the integration degree for the given triangle Newton rule (The polynomial degree for which this rule is exact). Returns an undefined value for invalid rules For triangle Newton rules, the degree is the rule number! | |
static const QVector< QPair< GmVector, double > > * | tetRuleTable (int rule, bool closed) |
Returns the table storing (position, weight) pairs for the given open or closed tetrahedron Newton Cotes rule. Rule SHOULD be in the interval 1 to 5. Returns NULL for any unknown rule. | |
static int | tetRuleDegree (int rule) |
Returns the integration degree for the given tetrahedron Newton rule (The polynomial degree for which this rule is exact). Returns an undefined value for invalid rules For tetrahedron Newton rules, the degree is the rule number! | |
static bool | initTables () |
Initialization function for the set of integration rule tables. Must be called once. | |
Static Private Member Functions | |
template<class T > | |
static const T * | select (int rule, bool closed, const T ct[], const T ot[]) |
Helper function retuning the rule table selecting from the open or closed version. | |
static void | initLineTables () |
Initializes tables needed to compute line Newton Cotes quadrature rules. More... | |
static void | initTriTables () |
Initializes tables needed to compute Open and Closed Newton Cotes quadrature rules for triangles. More... | |
static void | initTetTables () |
Initializes tables needed to compute Open and Closed Newton Cotes quadrature rules for tetrahedrons. More... | |
static void | simplexRulesPermutations (const char *s, QStringList &permutations) |
Fills the permutations list with all permutations of the given string numbers. If s is "100", returns {"100", "010", "001"}. More... | |
static double | simplexRulesPointAndWeight (int degree, const char *index, int u, int num, int den, QVector< GmVector > &posList) |
Calculates the weight and the set of positions for a given table line, as defined in the Silvester paper, tables I or II. See the reference on the initTriTables() comment. "u" should be 0 for closed rules and 1 for open ones. Fills posList with natural coordinates for the given index permutations and returns the common weight for those points. If posList is not empty, it will be clered before adding new entries. | |
Static Private Attributes | |
static QVector< QPair< double, double > > | _closedLineTable [5] |
The static table storing (position, weight) pairs for the first 5 closed line Newton Cotes rules. | |
static QVector< QPair< double, double > > | _openLineTable [5] |
The static table storing (position, weight) pairs for the first 5 open line Newton Cotes rules. | |
static QVector< QPair< GmVector, double > > | _closedTriTable [5] |
The static table storing (position, weight) pairs for the first 5 closed triangle Newton Cotes rules. Position vectors store natural coordinates with 3 components. | |
static QVector< QPair< GmVector, double > > | _openTriTable [5] |
The static table storing (position, weight) pairs for the first 5 open triangle Newton Cotes rules. Position vectors store natural coordinates with 3 components. | |
static QVector< QPair< GmVector, double > > | _closedTetTable [5] |
The static table storing (position, weight) pairs for the first 5 closed tetrahedron Newton Cotes rules. Position vectors store natural coordinates with 4 components. | |
static QVector< QPair< GmVector, double > > | _openTetTable [5] |
The static table storing (position, weight) pairs for the first 5 open tetrahedron Newton Cotes rules. Position vectors store natural coordinates with 4 components. | |
A class storing tables with (position, weight) pairs for line, triangle and tetrahedron Open & closed Newton Cotes integration rules.
|
staticprivate |
Initializes tables needed to compute line Newton Cotes quadrature rules.
This function initializes tables _xxxLineTable (where xxx can be either closed or open) with coordinate constants and weight pairs for each of the first five rules used for 1D, 2D and 3D quadrature rules.
See: Daryl Logan, chapter 10, table 17.1 (page 10-1) or www.dynasupport.com/tutorial/ls-dyna-users-guide/elements
For onpen rules, see also: https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas#:~:text=In%20numerical%20analysis%2C%20the%20Newton,Isaac%20Newton%20and%20Roger%20Cotes. https://mathworld.wolfram.com/Newton-CotesFormulas.html
Only the first five rules are currently implemented.
|
staticprivate |
Initializes tables needed to compute Open and Closed Newton Cotes quadrature rules for tetrahedrons.
This function initializes tables _closedTetTable and _openTetTable with weight and coordinate constants for each of the first 5 rules used for tetrahedrons.
See: P. Silvester, Symmetric Quadrature Formulae fo Simplexes Mathematics of Computation, Volume 24, Number 109, January 1970, pages 95-100. https://www.ams.org/journals/mcom/1970-24-109/S0025-5718-1970-0258283-6/S0025-5718-1970-0258283-6.pdf
|
staticprivate |
Initializes tables needed to compute Open and Closed Newton Cotes quadrature rules for triangles.
This function initializes tables _closedTriTable and _openTriTable with weight and coordinate constants for each of the first 5 rules used for triangles.
See: P. Silvester, Symmetric Quadrature Formulae fo Simplexes Mathematics of Computation, Volume 24, Number 109, January 1970, pages 95-100. https://www.ams.org/journals/mcom/1970-24-109/S0025-5718-1970-0258283-6/S0025-5718-1970-0258283-6.pdf
|
staticprivate |
Fills the permutations list with all permutations of the given string numbers. If s is "100", returns {"100", "010", "001"}.
Only works for rules up to 9 (or else 10 would be indistinguishable from 1 followed by 0).