quadratureformulas_quad2d
Quadrature Formula Implementation for 2D Quadrilateral Elements.
This module implements numerical integration formulas for 2D quadrilateral elements, providing both Gauss-Legendre and Gauss-Jacobi quadrature schemes. The implementation focuses on accurate numerical integration required for finite element computations.
Key functionalities
- Gauss-Legendre quadrature for quadrilateral elements
- Gauss-Jacobi quadrature with Lobatto points
- Tensor product based 2D quadrature point generation
- Weight computation for various quadrature orders
The implementation provides
- Flexible quadrature order selection
- Multiple quadrature schemes
- Efficient tensor product based computations
- Automated weight and point generation
Key classes
- Quadratureformulas_Quad2D: Main class for 2D quadrature computations
Dependencies
- numpy: For numerical computations
- scipy.special: For special function evaluations (roots, weights)
- scipy.special.orthogonal: For orthogonal polynomial computations
Note
The implementation assumes tensor-product based quadrature rules for 2D elements. Specialized non-tensor product rules are not included.
References
[1] Karniadakis, G., & Sherwin, S. (2013). Spectral/hp Element Methods for Computational Fluid Dynamics. Oxford University Press.
[2] Kharazmi - hp-VPINNs github repository
Version
27/Dec/2024: Initial version - Thivin Anandh D
Quadratureformulas_Quad2D
Bases: Quadratureformulas
Implements quadrature formulas for 2D quadrilateral elements.
This class provides methods to compute quadrature points and weights for 2D quadrilateral elements using either Gauss-Legendre or Gauss-Jacobi quadrature schemes. The implementation uses tensor products of 1D rules.
Attributes:
Name | Type | Description |
---|---|---|
quad_order |
Order of quadrature rule |
|
quad_type |
Type of quadrature ('gauss-legendre' or 'gauss-jacobi') |
|
num_quad_points |
Total number of quadrature points (quad_order^2) |
|
xi_quad |
x-coordinates of quadrature points in reference element |
|
eta_quad |
y-coordinates of quadrature points in reference element |
|
quad_weights |
Weights for each quadrature point |
Example
quad = Quadratureformulas_Quad2D(quad_order=3, quad_type='gauss-legendre') weights, xi, eta = quad.get_quad_values() n_points = quad.get_num_quad_points()
Note
- Gauss-Legendre points are optimal for polynomial integrands
- Gauss-Jacobi points include element vertices (useful for certain FEM applications)
- All computations are performed in the reference element [-1,1]×[-1,1]
Source code in scirex/core/sciml/fe/quadratureformulas_quad2d.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
__init__(quad_order, quad_type)
Constructor for the Quadratureformulas_Quad2D class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
quad_order
|
int
|
Order of quadrature rule |
required |
quad_type
|
str
|
Type of quadrature ('gauss-legendre' or 'gauss-jacobi') |
required |
Returns:
Type | Description |
---|---|
None |
Raises:
Type | Description |
---|---|
ValueError
|
If the quadrature type is not supported. |
Source code in scirex/core/sciml/fe/quadratureformulas_quad2d.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
get_num_quad_points()
Returns the number of quadrature points.
Returns:
Name | Type | Description |
---|---|---|
int |
The number of quadrature points |
get_quad_values()
Returns the quadrature weights, xi and eta values.
Returns:
Name | Type | Description |
---|---|---|
tuple |
The quadrature weights, xi and eta values in a numpy array format |