Interpolation Nodes#
Generic Shape-Based Interface#
- modepy.node_tuples_for_space(space: FunctionSpace) Sequence[Tuple[int]] [source]#
- modepy.node_tuples_for_space(space: PN)
- modepy.node_tuples_for_space(space: TensorProductSpace)
- modepy.equispaced_nodes_for_space(space: FunctionSpace, shape: Shape) ndarray [source]#
- modepy.equispaced_nodes_for_space(space: PN, shape: Simplex)
- modepy.equispaced_nodes_for_space(space: TensorProductSpace, shape: TensorProductShape)
- modepy.edge_clustered_nodes_for_space(space: FunctionSpace, shape: Shape) ndarray [source]#
- modepy.edge_clustered_nodes_for_space(space: PN, shape: Simplex)
- modepy.edge_clustered_nodes_for_space(space: TensorProductSpace, shape: TensorProductShape)
- modepy.random_nodes_for_shape(shape: Shape, nnodes: int, rng: Generator | None = None) ndarray [source]#
- modepy.random_nodes_for_shape(shape: Simplex, nnodes: int, rng=None)
- modepy.random_nodes_for_shape(shape: TensorProductShape, nnodes: int, rng=None)
- Parameters:
rng โ a
numpy.random.Generator
.- Returns:
a
numpy.ndarray
of shape (dim, nnodes) of random nodes in the reference shape.
Simplices#
- modepy.equidistant_nodes(dims: int, n: int, node_tuples: Sequence[Tuple[int, ...]] | None = None) ndarray [source]#
- Parameters:
dims โ dimensionality of desired simplex (e.g. 1, 2 or 3, for interval, triangle or tetrahedron).
n โ Desired maximum total polynomial degree to interpolate.
node_tuples โ a list of tuples of integers indicating the node order. Use default order if None, see
pytools.generate_nonnegative_integer_tuples_summing_to_at_most()
.
- Returns:
An array of shape (dims, nnodes) containing bi-unit coordinates of the interpolation nodes. (see Coordinates on the triangle and Coordinates on the tetrahedron)
- modepy.warp_and_blend_nodes(dims: int, n: int, node_tuples: Sequence[Tuple[int, ...]] | None = None) ndarray [source]#
Return interpolation nodes as described in [warburton-nodes]
[warburton-nodes]Warburton, T. โAn Explicit Construction of Interpolation Nodes on the Simplex.โ Journal of Engineering Mathematics 56, no. 3 (2006): 247-262. http://dx.doi.org/10.1007/s10665-006-9086-6
- Parameters:
dims โ dimensionality of desired simplex (1, 2 or 3, i.e. interval, triangle or tetrahedron).
n โ Desired maximum total polynomial degree to interpolate.
node_tuples โ a list of tuples of integers indicating the node order. Use default order if None, see
pytools.generate_nonnegative_integer_tuples_summing_to_at_most()
.
- Returns:
An array of shape (dims, nnodes) containing unit coordinates of the interpolation nodes. (see Coordinates on the triangle and Coordinates on the tetrahedron)
The generated nodes have benign Lebesgue constants. (See also
modepy.tools.estimate_lebesgue_constant()
)
Also see modepy.VioreanuRokhlinSimplexQuadrature
if nodes on the
boundary are not required.
Hypercubes#
- modepy.tensor_product_nodes(dims_or_nodes: int | Sequence[ndarray], nodes_1d: ndarray | None = None) ndarray [source]#
- Returns:
an array of shape
(dims, nnodes_1d**dims)
.
New in version 2017.1.
Changed in version 2020.3: The node ordering has changed and is no longer documented.
Changed in version 2021.3: dims_or_nodes can contain nodes of general size
(dims, nnodes)
, not only one dimensional nodes.Changed in version 2022.1: The node ordering changed once again, and it is now accessible, via
modepy.tools.reshape_array_for_tensor_product_space()
.