warp.fem.SpaceTopology#

class warp.fem.SpaceTopology(geometry, max_nodes_per_element)[source]#

Interface class for defining the topology of a function space.

The topology only considers the indices of the nodes in each element, and as such, the connectivity pattern of the function space. It does not specify the actual location of the nodes within the elements, or the valuation function.

Parameters:
__init__(geometry, max_nodes_per_element)[source]#
Parameters:

Methods

__init__(geometry, max_nodes_per_element)

element_node_count(geo_arg, topo_arg, ...)

Return the actual number of nodes in a given element.

element_node_index(geo_arg, topo_arg, ...)

Global node index for a given node in a given element

element_node_indices([out])

Return a temporary array containing the global index for each node of each element.

fill_topo_arg(arg, device)

Fill topology arguments for device functions.

full_space_topology()

Return the full space topology from which this topology is derived.

is_derived_from(other)

Check whether two topologies are equal, or self is the trace of other.

make_generic_side_neighbor_node_counts()

Variant of side neighbor node counts that can be used for topologies with varying node counts per element.

node_count()

Number of nodes in the interpolation basis

side_neighbor_node_counts(side_arg, ...)

Return the number of nodes for both the inner and outer cells of a given sides.

topo_arg_value(device)

trace()

Trace of the function space over lower-dimensional elements of the geometry

Attributes

TopologyArg

geometry

Underlying geometry

is_trace

Whether this topology is defined on the trace of the geometry

name

Unique name of the topology.

dimension

Embedding dimension of the function space.

MAX_NODES_PER_ELEMENT

maximum number of interpolation nodes per element of the geometry.

TopologyArg = <warp._src.codegen.Struct object>#
dimension: int#

Embedding dimension of the function space.

MAX_NODES_PER_ELEMENT: int#

maximum number of interpolation nodes per element of the geometry.

Note

This will change to be defined per-element in future versions

property geometry: Geometry[source]#

Underlying geometry

node_count()[source]#

Number of nodes in the interpolation basis

Return type:

int

topo_arg_value(device)[source]#
fill_topo_arg(arg, device)[source]#

Fill topology arguments for device functions.

property name#

Unique name of the topology.

static element_node_count(geo_arg, topo_arg, element_index)[source]#

Return the actual number of nodes in a given element.

Parameters:
  • geo_arg (ElementArg)

  • topo_arg (TopologyArg)

  • element_index (int)

Return type:

int

static element_node_index(
geo_arg,
topo_arg,
element_index,
node_index_in_elt,
)[source]#

Global node index for a given node in a given element

Parameters:
  • geo_arg (ElementArg)

  • topo_arg (TopologyArg)

  • element_index (int)

  • node_index_in_elt (int)

Return type:

int

static side_neighbor_node_counts(
side_arg,
topo_arg,
side_index,
)[source]#

Return the number of nodes for both the inner and outer cells of a given sides.

Parameters:
  • side_arg (ElementArg)

  • topo_arg (TopologyArg)

  • side_index (int)

Return type:

tuple[int, int]

element_node_indices(out=None)[source]#

Return a temporary array containing the global index for each node of each element.

Parameters:

out (array | None)

Return type:

array

trace()[source]#

Trace of the function space over lower-dimensional elements of the geometry

Return type:

TraceSpaceTopology

property is_trace: bool[source]#

Whether this topology is defined on the trace of the geometry

full_space_topology()[source]#

Return the full space topology from which this topology is derived.

Return type:

SpaceTopology

is_derived_from(other)[source]#

Check whether two topologies are equal, or self is the trace of other.

Parameters:

other (SpaceTopology)

Return type:

bool

make_generic_side_neighbor_node_counts()[source]#

Variant of side neighbor node counts that can be used for topologies with varying node counts per element. Derived classes that override element_node_count() can leverage this for convenience.