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,
)[source]#

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.

Parameters:
__init__(
quadrature,
kernel_func=None,
kernel_grad_func=None,
kernel_values=None,
distance_space='reference',
max_nodes_per_element=-1,
)[source]#

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.

make_element_inner_weight()

Create a device function returning inner element shape weights.

make_element_inner_weight_gradient()

Create a device function returning gradients of inner element weights.

make_element_outer_weight()

Create a device function returning outer element shape weights.

make_element_outer_weight_gradient()

Create a device function returning gradients of outer element weights.

make_node_coords_in_element()

Create a device function returning node coordinates within an element.

make_node_quadrature_weight()

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

BasisArg

Argument structure for basis-related device functions.

geometry

Underlying geometry of the basis space

kernel_values

Dictionary of additional values to be passed to the kernel function

name

Unique name of the basis space.

topology

Underlying topology of the basis space

value

Value type of the basis space.

weight_gradient_type

Data type of node weight gradients returned by the basis.

weight_type

Data 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 name[source]#

Unique name of the basis space.

property value: Value[source]#

Value type of the basis space.

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_node_quadrature_weight()[source]#

Create a device function returning node quadrature weights.

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.

make_element_outer_weight_gradient()[source]#

Create a device function returning gradients of outer element weights.

make_trace_node_quadrature_weight(trace_basis)[source]#

Create a device function returning trace node quadrature weights.