You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides the standard building blocks consisting of domains, basis functions and
263
-
node sets, `modepy` also offers a wide array of quadrature rules that can be
264
-
used on each domain. The quadrature rules are provided as implementations of
265
-
the `Quadrature` superclass.
266
-
267
-
For the interval, a broad selection of quadrature rules are present:
268
-
Clenshaw--Curtis, Fejér, and Jacobi-Gauss. The latter class includes the
269
-
commonly used Chebyshev and Legendre types, among others. Lobatto (that is,
270
-
endpoint-included) variants of these are also available. The line segment
271
-
quadratures can be used as part of the `TensorProductQuadrature` class to
272
-
define different higher-dimensional rules. Additionally, several
273
-
state-of-the-art higher-dimensional rules are available:
208
+
Besides the standard building blocks above, `modepy` also offers a wide array
209
+
of quadrature rules that can be used on each reference element. The quadrature
210
+
rules are provided as implementations of the `Quadrature` superclass. For the
211
+
interval, a broad selection of quadrature rules are present: Clenshaw--Curtis,
212
+
Fejér, and Jacobi-Gauss(-Lobatto). Additionally, several state-of-the-art
213
+
higher-dimensional rules are available:
274
214
275
215
* Grundmann--Möller [@Grundmann1978] rules for the $n$-simplex.
276
216
* Vioreanu--Rokhlin [@Vioreanu2014] rules for the two- and
277
-
three-dimensional simplex (see \autoref{FigureQuadrature}). The quadrature
278
-
nodes from these rules are also suitable for interpolation.
217
+
three-dimensional simplex (see \autoref{FigureQuadrature}).
279
218
* Xiao--Gimbutas [@Xiao2010] rules for the two- and three-dimensional
280
219
simplex.
281
220
* Jáskowiec--Sukumar [@Jaskowiec2021] rules for the tetrahedron.
282
221
* Witherden--Vincent [@Witherden2015] rules for the two- and
283
-
three-dimensional hypercube (see \autoref{FigureQuadrature}). These rules
284
-
have significantly fewer nodes than an equivalent tensor product rule, while
285
-
maintaining positive weights.
222
+
three-dimensional hypercube (see \autoref{FigureQuadrature}).
286
223
287
224
{#FigureQuadrature width="50%"}
288
225
@@ -296,84 +233,11 @@ constructing desired quadrature nodes on a given domain. This can be found in
296
233
While `modepy` is sufficiently flexible to accommodate different applications,
297
234
it also provides functionality specific to FEM needs. In particular, it allows
298
235
constructing a variety of matrix operators that define necessary resampling
299
-
operators and bilinear forms used in FEM codes.
300
-
301
-
The Vandermonde matrix used in interpolation is provided by the `vandermonde`
302
-
function. This can be used to obtain point-to-point interpolants using
303
-
`resampling_matrix`. In a similar fashion, the `differentiation_matrices`
304
-
function can be used to construct derivative operators along each reference
305
-
axis.
306
-
307
-
A specific bilinear form matrix can be obtained using
308
-
`nodal_quadrature_bilinear_form_matrix`, which requires providing the usual
309
-
test functions, trial functions and corresponding nodes for the input and
310
-
output. This allows constructing very general families of bilinear forms with
311
-
or without oversampling. One such example is the standard mass matrix, which
312
-
can be obtained more easily using the `mass_matrix` function. If the provided
313
-
functions are derivatives of the basis functions, standard weak forms of
314
-
differentiation operators can also be obtained.
315
-
316
-
# A Practical Example
317
-
318
-
In the following example, we demonstrate how to use the library to define a
319
-
non-default tensor product shape --- the prism --- and construct a first
320
-
derivative in the $x$ direction on this reference element. To produce the
321
-
derivative matrix operator, we go through all the objects described in the
322
-
previous section: nodes, modes, and quadrature rules.
323
-
324
-
```python
325
-
import numpy as np
326
-
import modepy as mp
327
-
328
-
# Define the shape on which we will operate
329
-
line = mp.Simplex(1)
330
-
triangle = mp.Simplex(2)
331
-
prism = mp.TensorProductShape((triangle, line))
332
-
333
-
assert prism.dim ==3
334
-
335
-
# Define a function space for the prism of order 12
336
-
n =12
337
-
space = mp.TensorProductSpace((mp.PN(triangle.dim, n), mp.PN(line.dim, n)))
0 commit comments