warp.fem.BasisSpace#
- class warp.fem.BasisSpace(topology)[source]#
Interface class for defining shape functions over a geometry.
A basis space is a component of a function space, and is responsible for defining the node positions and their weights over individual elements of the geometry. The connectivity pattern between elements of geometry is defined by the
SpaceTopology. The actual valuation of the space is defined by theFunctionSpace, allowing to reuse a single basis space for multiple value types (e.g, scalar, vector, or tensor).See also:
make_polynomial_basis_space(),make_collocated_function_space()Methods
basis_arg_value(device)fill_basis_arg(arg, device)Fill the arguments to be passed to basis-related device functions
Create a device function returning inner element shape weights.
Create a device function returning gradients of inner element weights.
Create a device function returning outer element shape weights.
Create a device function returning gradients of outer element weights.
Create a device function returning node coordinates within an element.
Create a device function returning the dual weight of each element node.
Create a device function returning node quadrature weights.
Create a device function locating an element node's physical anchor.
Create a device function returning trace node quadrature weights.
node_positions([out])Return a temporary array containing the world position for each node.
trace()Return a trace basis space on lower-dimensional elements.
Attributes
Underlying geometry of the basis space
Whether
make_node_sample()may return another element than the one it is given.Whether nodal assembly may assume a diagonal node coupling.
Whether this basis may supply nodal quadrature points and weights.
Underlying topology of the basis space
Value type for the underlying shape functions
Data type of node weight gradients returned by the basis.
Data type of node weights returned by the basis.
- Parameters:
topology (SpaceTopology)
- supports_nodal_assembly = True#
Whether nodal assembly may assume a diagonal node coupling.
- supports_nodal_quadrature = True#
Whether this basis may supply nodal quadrature points and weights.
- moves_node_samples = False#
Whether
make_node_sample()may return another element than the one it is given.
- BasisArg = <warp._src.codegen.Struct object>#
- property topology: SpaceTopology[source]#
Underlying topology of the basis space
- fill_basis_arg(arg, device)[source]#
Fill the arguments to be passed to basis-related device functions
- node_positions(out=None)[source]#
Return a temporary array containing the world position for each node.
- make_node_coords_in_element()[source]#
Create a device function returning node coordinates within an element.
- make_node_sample()[source]#
Create a device function locating an element node’s physical anchor.
The result is an element index, in-element coordinates, and the same node’s local slot on that element. Constrained spaces may return a different element containing the independent master node.
- make_element_inner_weight()[source]#
Create a device function returning inner element shape weights.
- make_element_outer_weight()[source]#
Create a device function returning outer element shape weights.
- make_element_inner_weight_gradient()[source]#
Create a device function returning gradients of inner element weights.
- make_element_outer_weight_gradient()[source]#
Create a device function returning gradients of outer element weights.
- make_trace_node_quadrature_weight()[source]#
Create a device function returning trace node quadrature weights.
- make_node_dual_weight()[source]#
Create a device function returning the dual weight of each element node.
The dual weight
dof a node extracts its degree of freedom from a node-space valuevreproduced by the basis at the node location, asv * dfor scalar-valued bases ordot(v, d)for vector-valued bases.The default implementation returns the inverse of the node weight at the node location, which is only valid for scalar-valued bases whose node weights vanish at the other nodes. See
ShapeFunction.make_node_dual_weight().