warp.fem.PointBasisSpace#
- class warp.fem.PointBasisSpace(
- quadrature,
- kernel_func=None,
- kernel_grad_func=None,
- kernel_values=None,
- distance_space='reference',
- max_nodes_per_element=-1,
Unstructured basis space with radial basis kernel functions.
This basis space places nodes at quadrature point locations and uses radial kernel functions (defaulting to Dirac delta) to define the basis. Useful for particle-in-cell (PIC) methods and meshless discretizations.
The kernel function receives the squared distance from the sample point to each node center, allowing for smooth interpolation kernels like Gaussian or spline-based functions.
See also
- Parameters:
- __init__(
- quadrature,
- kernel_func=None,
- kernel_grad_func=None,
- kernel_values=None,
- distance_space='reference',
- max_nodes_per_element=-1,
Create a point basis space with radial basis kernels.
By default uses the Dirac delta function as the kernel.
- Parameters:
quadrature (Quadrature) – Quadrature formula defining the node locations and quadrature weights
kernel_func (Function | None) – Kernel function to be used for the basis space. First two arguments must be squared distance to the kernel center and the quadrature point index, then optionally additional kernel values. Default to Dirac delta function.
kernel_grad_func (Function | None) – Gradient of the kernel function. Must take same arguments as kernel_func. Defaults to zero gradient.
kernel_values (dict[str, Any] | None) – Dictionary of additional values to be passed to the kernel function
distance_space (str) – Space in which to compute the distance between the sample and the kernel center point. Can be “reference” or “world”. Defaults to “reference”.
max_nodes_per_element (int) – Maximum number of point nodes per element to consider. If not provided, get from the quadrature.
Methods
__init__(quadrature[, kernel_func, ...])Create a point basis space with radial basis kernels.
basis_arg_value(device)Return the basis argument structure for device functions.
fill_basis_arg(arg, device)Fill basis arguments for device functions.
Create a device function returning inner element shape weights.
Create a device function returning gradients of inner element weights.
Create a device function returning outer element shape weights.
Create a device function returning gradients of outer element weights.
Create a device function returning node coordinates within an element.
Create a device function returning node quadrature weights.
make_trace_node_quadrature_weight(trace_basis)Create a device function returning trace node quadrature weights.
node_positions([out])Return a temporary array containing the world position for each node.
trace()Return a trace basis space on lower-dimensional elements.
Attributes
Argument structure for basis-related device functions.
geometryUnderlying geometry of the basis space
Dictionary of additional values to be passed to the kernel function
Unique name of the basis space.
topologyUnderlying topology of the basis space
Value type of the basis space.
weight_gradient_typeData type of node weight gradients returned by the basis.
weight_typeData type of node weights returned by the basis.
- property kernel_values: dict[str, Any][source]#
Dictionary of additional values to be passed to the kernel function
- property BasisArg: <property object at 0x7f8935fd7b50>[source]#
Argument structure for basis-related device functions.
- fill_basis_arg(arg, device)[source]#
Fill basis arguments for device functions.
- Parameters:
arg (<property object at 0x7f8935fd7b50>)
- basis_arg_value(device)[source]#
Return the basis argument structure for device functions.
- Return type:
<property object at 0x7f8935fd7b50>
- make_node_coords_in_element()[source]#
Create a device function returning node coordinates within an element.
- make_element_inner_weight()[source]#
Create a device function returning inner element shape weights.
- make_element_inner_weight_gradient()[source]#
Create a device function returning gradients of inner element weights.
- make_element_outer_weight()[source]#
Create a device function returning outer element shape weights.