warp.fem.PicQuadrature#
- class warp.fem.PicQuadrature(
- domain,
- positions,
- measures=None,
- requires_grad=False,
- max_dist=0.0,
- temporary_store=None,
Particle-based quadrature formula, using a global set of points unevenly spread out over geometry elements.
Useful for Particle-In-Cell and derived methods.
- Parameters:
domain (GeometryDomain) – Underlying domain for the quadrature
positions (wp.array(dtype=wp.vecXd) | tuple[wp.array(dtype=ElementIndex), wp.array(dtype=Coords)]) – Either an array containing the world positions of all particles, or a tuple of arrays containing the cell indices and coordinates for each particle.
measures (wp.array(dtype=float) | None) – Array containing the measure (area/volume) of each particle, used to defined the integration weights. If
None, defaults to the cell measure divided by the number of particles in the cell.max_dist (float) – When providing world positions that fall outside of the domain’s geometry partition, maximum distance to look up for embedding cells
requires_grad (bool) – Whether gradients should be allocated for the computed quantities
temporary_store (TemporaryStore) – shared pool from which to allocate temporary arrays
- __init__(
- domain,
- positions,
- measures=None,
- requires_grad=False,
- max_dist=0.0,
- temporary_store=None,
- Parameters:
domain (GeometryDomain)
positions (wp.array(dtype=wp.vecXd) | tuple[wp.array(dtype=ElementIndex), wp.array(dtype=Coords)])
measures (wp.array(dtype=float) | None)
requires_grad (bool)
max_dist (float)
temporary_store (TemporaryStore)
Methods
__init__(domain, positions[, measures, ...])Number of cells containing at least one particle
arg_value(device)element_index_arg_value(device)evaluation_point_count()Number of quadrature points that needs to be evaluated, mostly for internal purposes.
fill_arg(args, device)Fill the quadrature argument structure for device functions.
fill_element_mask(mask)Fills a mask array such that all non-empty elements are set to 1, all empty elements to zero.
Maximum number of quadrature points per element.
Total number of quadrature points.
Attributes
ElementIndexArgMapping from evaluation point indices to element indices.
Domain over which this quadrature is defined
evaluation_point_element_indexUnique name of the quadrature rule.
- Arg = <warp._src.codegen.Struct object>#
- fill_arg(args, device)[source]#
Fill the quadrature argument structure for device functions.
- Parameters:
args (Arg)
- point_count = <Function PicQuadrature__point_count(elt_arg: typing.Any, qp_arg: warp._src.fem.quadrature.pic_quadrature.PicQuadrature.Arg, domain_element_index: int, element_index: int)>#
- point_coords = <Function PicQuadrature__point_coords(elt_arg: typing.Any, qp_arg: warp._src.fem.quadrature.pic_quadrature.PicQuadrature.Arg, domain_element_index: int, element_index: int, index: int)>#
- point_weight = <Function PicQuadrature__point_weight(elt_arg: typing.Any, qp_arg: warp._src.fem.quadrature.pic_quadrature.PicQuadrature.Arg, domain_element_index: int, element_index: int, index: int)>#
- point_index = <Function PicQuadrature__point_index(elt_arg: typing.Any, qp_arg: warp._src.fem.quadrature.pic_quadrature.PicQuadrature.Arg, domain_element_index: int, element_index: int, index: int)>#
- point_evaluation_index = <Function PicQuadrature__point_evaluation_index(elt_arg: typing.Any, qp_arg: warp._src.fem.quadrature.pic_quadrature.PicQuadrature.Arg, domain_element_index: int, element_index: int, index: int)>#