warp.fem.Quadrature#

class warp.fem.Quadrature(domain)[source]#

Interface class for quadrature rules.

Parameters:

domain (GeometryDomain)

__init__(domain)[source]#
Parameters:

domain (GeometryDomain)

Methods

__init__(domain)

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(arg, device)

Fill the argument with the value of the argument to be passed to device

max_points_per_element()

Maximum number of points per element if known, or None otherwise

point_coords(elt_arg, qp_arg, ...)

Coordinate values in element of the element's qp_index'th quadrature point.

point_count(elt_arg, qp_arg, ...)

Number of quadrature points for a given element.

point_evaluation_index(elt_arg, qp_arg, ...)

Quadrature point index according to evaluation order.

point_index(elt_arg, qp_arg, ...)

Global index of the element's qp_index'th quadrature point.

point_weight(elt_arg, qp_arg, ...)

Weight of the element's qp_index'th quadrature point.

total_point_count()

Number of unique quadrature points that can be indexed by this rule.

Attributes

Arg

ElementIndexArg

Mapping from evaluation point indices to element indices.

domain

Domain over which this quadrature is defined

evaluation_point_element_index

Arg = <warp._src.codegen.Struct object>#
property domain[source]#

Domain over which this quadrature is defined

arg_value(device)[source]#
fill_arg(arg, device)[source]#

Fill the argument with the value of the argument to be passed to device

Parameters:

arg (Arg)

total_point_count()[source]#

Number of unique quadrature points that can be indexed by this rule. Returns a number such that point_index() is always smaller than this number.

evaluation_point_count()[source]#

Number of quadrature points that needs to be evaluated, mostly for internal purposes. If the indexing scheme is sparse, or if a quadrature point is shared among multiple elements (e.g, nodal quadrature), evaluation_point_count may be different than total_point_count(). Returns a number such that evaluation_point_index() is always smaller than this number.

max_points_per_element()[source]#

Maximum number of points per element if known, or None otherwise

static point_count(
elt_arg,
qp_arg,
domain_element_index,
geo_element_index,
)[source]#

Number of quadrature points for a given element.

Parameters:
  • elt_arg (GeometryDomain.ElementArg)

  • qp_arg (Arg)

  • domain_element_index (int)

  • geo_element_index (int)

static point_coords(
elt_arg,
qp_arg,
domain_element_index,
geo_element_index,
element_qp_index,
)[source]#

Coordinate values in element of the element’s qp_index’th quadrature point.

Parameters:
  • elt_arg (GeometryDomain.ElementArg)

  • qp_arg (Arg)

  • domain_element_index (int)

  • geo_element_index (int)

  • element_qp_index (int)

static point_weight(
elt_arg,
qp_arg,
domain_element_index,
geo_element_index,
element_qp_index,
)[source]#

Weight of the element’s qp_index’th quadrature point.

Parameters:
  • elt_arg (GeometryDomain.ElementArg)

  • qp_arg (Arg)

  • domain_element_index (int)

  • geo_element_index (int)

  • element_qp_index (int)

static point_index(
elt_arg,
qp_arg,
domain_element_index,
geo_element_index,
element_qp_index,
)[source]#

Global index of the element’s qp_index’th quadrature point. May be shared among elements. This is what determines qp_index in integrands’ Sample arguments.

Parameters:
  • elt_arg (GeometryDomain.ElementArg)

  • qp_arg (Arg)

  • domain_element_index (int)

  • geo_element_index (int)

  • element_qp_index (int)

static point_evaluation_index(
elt_arg,
qp_arg,
domain_element_index,
geo_element_index,
element_qp_index,
)[source]#

Quadrature point index according to evaluation order.

Quadrature points for distinct elements must have different evaluation indices. Only required if evaluation_point_element_index is not overloaded.

Parameters:
  • elt_arg (GeometryDomain.ElementArg)

  • qp_arg (Arg)

  • domain_element_index (int)

  • geo_element_index (int)

  • element_qp_index (int)

ElementIndexArg = array(ndim=1, dtype=warp._src.fem.quadrature.quadrature.QuadraturePointElementIndex)#

Mapping from evaluation point indices to element indices.

element_index_arg_value(device)[source]#
evaluation_point_element_index = <Function Quadrature__evaluation_point_element_index(element_index_arg: array(ndim=1, dtype=warp._src.fem.quadrature.quadrature.QuadraturePointElementIndex), qp_eval_index: int)>#
Parameters:
  • element_index_arg (array(ndim=1, dtype=warp._src.fem.quadrature.quadrature.QuadraturePointElementIndex))

  • qp_eval_index (int)