warp.fem.Subdomain#

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

Subdomain – 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()

element_arg_value(device)

Value of the argument to be passed to device functions

element_count()

element_index_arg_value(device)

fill_element_arg(arg, device)

fill_element_index_arg(arg, device)

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)

Attributes

DomainArg

dimension

domain_cell_arg

element_kind

name

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]#
property element_kind: ElementKind[source]#
property dimension: int[source]#
element_count()[source]#
Return type:

int

element_index_arg_value(device)[source]#
fill_element_index_arg(arg, device)[source]#
Parameters:
  • arg (GeometryDomain.ElementIndexArg)

  • device (Device | str | None)

supports_lookup(device)[source]#
cell_domain()[source]#
property domain_cell_arg: Function#