![]() |
GeMA
The GeMA main application
|
Integration rule objects are the abstraction used by GeMA for defining the integration schema that will be used by physics objects when integrating values over an element domain or over an element border domain.
Although more complicated scenarios are supported, where integration rules can be defined by element (as in the XFEM plugin), in general rules are defined by element type. Each rule stores the number of integration points that will be used for that element, along with the natural coordinates and the weight for each integration point. The available schemas per element type are documented in the Element types page.
The set of integration rule objects associated with a mesh can be retrieved with the mesh:
elementIntegrationRule()
and mesh:
borderIntegrationRule()
methods. Tis is the preferred way for obtaining an integration rule object. Alternatively, new integration rule objects can be created by calls to IntegrationRule()
, BorderIntegrationRule()
, EdgeIntegrationRule()
or FaceIntegrationRule()
.
Example:
Index:
ir:
ruleName()
ir:
numNaturalCoord()
ir:
degree()
ir:
numPoints()
ir:
integrationPoint()
ir:
numBorderCoord()
ir:
translatePoint()
IntegrationRule(elemType, ruleType, rule1, rule2, rule3) IntegrationRule(elemType, P, Q, ruleType, rule1, rule2, rule3) | ||
---|---|---|
Description: | Returns an integration rule object configured with the given rule parameters. Rule parameters are particular to each element type. Check the Element types page for a list of available parameters for each type and their default settings. | |
Parameters: | elemType | The element type. |
P, Q | The P and Q parameters. Should be provided only for hierarchical element types. | |
ruleType | The type of integration rule that will be used. Accepted values are: - "auto" The type of integration rule will be the default type for the shape element type; - "gauss" The integration rule will be a Gauss integration rule; - "lobatto" The integration rule will be a Lobatto integration rule; - "newton" or "closed newton" The integration rule will be a closed Newton-Cotes integration rule; - "open newton" The integration rule will be an open Newton-Cotes integration rule; | |
rule1, rule2, rule3 | Optional rule order parameters. The meaning, accepted number of parameters, their possible values and defaults depends on the underlying element type. Compound rules, such as those used by quad or hex type elements, will accept one parameter per dimension, while tri and tet elements take just one parameter. Check the Element types page for details. | |
Returns: | Returns the integration rule object or nil if the given parameters do not specify a valid rule. |
Example:
BorderIntegrationRule(elemType, faceType, ruleType, rule1, rule2) BorderIntegrationRule(elemType, P, Q, faceType, ruleType, rule1, rule2) | ||
---|---|---|
Description: | Returns a border integration rule object configured with the given border rule parameters. Border rule parameters are particular to each element type and are undefined for 1D (bar) elements. For 2D elements it is equivalent to calling shape: edgeIntegrationRule() and for 3D elements to calling shape: faceIntegrationRule() . It can be used for building generic code that works for both 2D and 3D elements. Check the Element types page for a list of available parameters for each type and their default settings. | |
Parameters: | elemType | The element type. |
P, Q | The P and Q parameters. Should be provided only for hierarchical element types. | |
faceType | The face type parameter is required only when integrating over a face of a 3D element that has multiple face types (like a wedge, whose faces can be either triangles or quadrilaterals). In that case, it should be a string defining the type of the face (accepted values are "quad" and "tri" ). Otherwise it can be nil , but if given, it should match the element's face type; | |
ruleType | The type of integration rule that will be used. Accepted values are: - "auto" The type of integration rule will be the default type for the shape element type; - "gauss" The integration rule will be a Gauss integration rule; - "lobatto" The integration rule will be a Lobatto integration rule; - "newton" or "closed newton" The integration rule will be a closed Newton-Cotes integration rule; - "open newton" The integration rule will be an open Newton-Cotes integration rule; | |
rule1, rule2 | Optional rule order parameters. The meaning, accepted number of parameters, their possible values and defaults depends on the underlying border element type. Borders for 2D elements are analogue to bar elements, while borders to 3D elements are analogue to their corresponding face geometries (quad or tri elements). Check the Element types page for defatails. | |
Returns: | Returns the border integration rule object or nil if the given parameters do not specify a valid rule. |
Example:
EdgeIntegrationRule(elemType, ruleType, rule1) EdgeIntegrationRule(elemType, P, Q, ruleType, rule1) | ||
---|---|---|
Description: | Returns a border integration rule object configured with the given edge rule parameters. Edge rule parameters are particular to each element type and are undefined for 1D elements. Check the Element types page for a list of available parameters for each type and their default settings. | |
Parameters: | elemType | The element type. |
P, Q | The P and Q parameters. Should be provided only for hierarchical element types. | |
ruleType | The type of integration rule that will be used. Accepted values are: - "auto" The type of integration rule will be the default type for the shape element type; - "gauss" The integration rule will be a Gauss integration rule; - "lobatto" The integration rule will be a Lobatto integration rule; - "newton" or "closed newton" The integration rule will be a closed Newton-Cotes integration rule; - "open newton" The integration rule will be an open Newton-Cotes integration rule; | |
rule1 | Optional rule order parameter. The meaning, possible values and defaults depends on the underlying edge element type. Edge borders are analogue to their corresponding bar elements. Check the Element types page for defatails. | |
Returns: | Returns the border integration rule object or nil if the given parameters do not specify a valid rule. |
Example:
FaceIntegrationRule(elemType, faceType, ruleType, rule1, rule2) FaceIntegrationRule(elemType, P, Q, faceType, ruleType, rule1, rule2) | ||
---|---|---|
Description: | Returns a border integration rule object configured with the given face rule parameters. Face rule parameters are particular to each element type and are undefined for 1D and 2D elements. Check the Element types page for a list of available parameters for each type and their default settings. | |
Parameters: | elemType | The element type. |
P, Q | The P and Q parameters. Should be provided only for hierarchical element types. | |
faceType | The face type parameter is required only when integrating over a face of a 3D element that has multiple face types (like a wedge, whose faces can be either triangles or quadrilaterals). In that case, it should be a string defining the type of the face (accepted values are "quad" and "tri" ). Otherwise it can be nil , but if given, it should match the element's face type; | |
ruleType | The type of integration rule that will be used. Accepted values are: - "auto" The type of integration rule will be the default type for the shape element type; - "gauss" The integration rule will be a Gauss integration rule; - "lobatto" The integration rule will be a Lobatto integration rule; - "newton" or "closed newton" The integration rule will be a closed Newton-Cotes integration rule; - "open newton" The integration rule will be an open Newton-Cotes integration rule; | |
rule1, rule2 | Optional rule order parameters. The meaning, accepted number of parameters, their possible values and defaults depends on the underlying face element type. Face borders for 3D elements are analogue to their corresponding face geometries (quad or tri elements). Check the Element types page for defatails. | |
Returns: | Returns the border integration rule object or nil if the given parameters do not specify a valid rule. |
Example:
ir:ruleName() | |
---|---|
Description: | Returns the integration rule name, describing the adopted integration schema. |
Parameters: | None. |
Returns: | Returns a string with the rule name. |
Example:
ir:numNaturalCoord() | |
---|---|
Description: | Returns the number of natural coordinates for each integration point. This value is always equal to the number of natural coordinates used by the element's shape function, as returned by shape: numNaturalCoord() , and not necessarily equal to the problem dimension. |
Parameters: | None. |
Returns: | Returns the number of natural coordinates. |
Example:
ir:degree() | |
---|---|
Description: | Returns the integration degree for this rule. The returned number is the maximum polynomial degree for which this integration rule is exact. |
Parameters: | None. |
Returns: | Returns the rule degree. |
Example:
ir:numPoints() | |
---|---|
Description: | Returns the number of points in the adopted integration schema. |
Parameters: | None. |
Returns: | Returns the number of integration points in this rule. |
Example:
ir:integrationPoint(pointIndex) | |
---|---|
Description: | Returns the given integration point natural coordinates and weight. |
Parameters: | pointIndex - The desired point index (between 1 and ir: numPoints() ). |
Returns: | Returns two values: a vector object with the point natural coordinates and the point weight. |
Example:
ir:numBorderCoord() | |
---|---|
Description: | Returns the number of natural coordinates for each border integration point. Available only for border integration rules. As an example, the integration rule for a "quad4" element, returns points with two natural coordinates while a border integration rule for the same element type returns points with a single natural coordinate (the quad border is a line). |
Parameters: | None. |
Returns: | Returns the number of natural coordinates for border integration points. |
Example:
ir:translatePoint(border, borderCoord) | ||
---|---|---|
Description: | Given an integration point retrieved with a border integration rule, whose returned coordinate uses the border reference (edge or face), and so has less coordinates than the element coordinate system, returns a new point in the element reference system, filling the original set of coordinates with the missing, fixed, values assciated with the border. | |
Parameters: | border | The border index (between 1 and the number of edges/faces in the element - see the Element types documentationt and also the geometry: numEdges() and geometry: numFaces() methods). |
borderCoord | The border coordinate vector, as returned by ir: integrationPoint() . | |
Returns: | Returns a vector object with the element natural coordinates equivalent to the border coordinates or nil if border references an element border that can not be used for numerical integration (like the 0-length edges for an interface element). |
Example: