warp.fem.Subdomain#

class warp.fem.Subdomain(
domain,
element_mask=None,
element_indices=None,
temporary_store=None,
)[source]#

Restriction of domain to a subset of its elements.

Parameters:
__init__(
domain,
element_mask=None,
element_indices=None,
temporary_store=None,
)[source]#

Create a subdomain from a subset of elements.

Exactly one of element_mask and element_indices should be provided.

Parameters:
  • domain (GeometryDomain) – the containing domain

  • element_mask (array | None) – Array of length domain.element_count() indicating which elements should be included. Array values must be either 1 (selected) or 0 (not selected).

  • element_indices (array | None) – Explicit array of element indices to include

  • temporary_store (TemporaryStore | None)

Methods

__init__(domain[, element_mask, ...])

Create a subdomain from a subset of elements.

cell_domain()

Return the corresponding cell domain.

element_arg_value(device)

Value of the argument to be passed to device functions

element_count()

Number of elements in the domain.

element_index_arg_value(device)

fill_element_arg(arg, device)

Fill the element arguments for device functions.

fill_element_index_arg(arg, device)

Fill the element index arguments for device functions.

geometry_element_count()

Number of elements in the underlying geometry

notify_operator_usage(ops)

Makes the Domain aware that the operators ops will be applied

reference_element()

Type of reference element

supports_lookup(device)

Return whether element lookup is supported on the given device.

Attributes

DomainArg

Argument structure combining element geometry and indices.

dimension

Dimension of elements in the domain.

domain_cell_arg

Device function mapping domain arguments to cell-domain arguments.

element_kind

Kind of elements contained in the domain.

name

Name of the subdomain.

geometry_partition

Geometry partition containing the elements of the domain.

geometry

Underlying geometry.

ElementIndexArg

Structure containing arguments to be passed to device functions computing element indices.

element_index

Device function for retrieving an ElementIndex from a linearized index.

element_partition_index

Device function for retrieving linearized index in the domain's partition from an ElementIndex.

ElementArg

Structure containing arguments to be passed to device functions computing element geometry.

element_measure

Device function returning the measure determinant (e.g. volume, area) at a given point.

element_measure_ratio

Device function returning the ratio of the measure of a side to that of its neighbour cells.

element_position

Device function returning the element position at a sample point.

element_deformation_gradient

Device function returning the gradient of the position with respect to the element's reference space.

element_normal

Device function returning the element normal at a sample point.

element_closest_point

Device function returning the coordinates of the closest point in a given element to a world position.

element_coordinates

Device function returning the coordinates corresponding to a world position in a given element reference system.

element_lookup

Device function returning the sample point in the domain's geometry corresponding to a world position.

element_partition_lookup

Device function returning the sample point in the domain's geometry partition corresponding to a world position.

property name: str[source]#

Name of the subdomain.

property element_kind: ElementKind[source]#

Kind of elements contained in the domain.

property dimension: int[source]#

Dimension of elements in the domain.

element_count()[source]#

Number of elements in the domain.

Return type:

int

element_index_arg_value(device)[source]#
fill_element_index_arg(arg, device)[source]#

Fill the element index arguments for device functions.

Parameters:
  • arg (GeometryDomain.ElementIndexArg)

  • device (Device | str | None)

supports_lookup(device)[source]#

Return whether element lookup is supported on the given device.

cell_domain()[source]#

Return the corresponding cell domain.

property domain_cell_arg: Function#

Device function mapping domain arguments to cell-domain arguments.