warp.fem.ShapeFunction#
- class warp.fem.ShapeFunction[source]#
Interface class for defining scalar-valued shape functions over a single element.
Methods
Create a device function returning the value of the shape function associated to a given node at given coordinates.
Create a device function returning the gradient of the shape function associated to a given node at given coordinates.
Create a device function returning the coordinates of each node.
Create a device function returning the reference-space dual weight of each node.
Create a device function returning the weight of each node when used as a quadrature point over the element.
Create a device function returning the weight of each node when used as a quadrature point over the element boundary.
Attributes
Unique name encoding all parameters defining the shape function
Value type of the shape function.
Maximum degree of the polynomials used to define the shape function.
Number of shape function nodes.
- class Value(*values)[source]#
- Scalar = 0#
Scalar-valued shape function.
- CovariantVector = 1#
Covariant vector-valued shape function.
- ContravariantVector = 2#
Contravariant vector-valued shape function.
- make_node_coords_in_element()[source]#
Create a device function returning the coordinates of each node.
- make_node_quadrature_weight()[source]#
Create a device function returning the weight of each node when used as a quadrature point over the element.
- make_trace_node_quadrature_weight()[source]#
Create a device function returning the weight of each node when used as a quadrature point over the element boundary.
- make_element_inner_weight()[source]#
Create a device function returning the value of the shape function associated to a given node at given coordinates.
- make_element_inner_weight_gradient()[source]#
Create a device function returning the gradient of the shape function associated to a given node at given coordinates.
- make_node_dual_weight()[source]#
Create a device function returning the reference-space dual weight of each node.
The degree of freedom of node
ireproducing a reference-space valuevisv * d_ifor scalar-valued shape functions, ordot(v, d_i)for vector-valued ones, withd_ithe returned dual weight. For vector-valued shape functions,d_iis aligned with the edge tangent (covariant) or side normal (contravariant) associated to the node, and scaled such thatdot(d_i, w_i) = 1, withw_ithe node weight at the node coordinates.The default implementation returns
1 / w_ifor scalar-valued shape functions, and must be overridden for vector-valued ones.