warp.fem.FunctionSpace#
- class warp.fem.FunctionSpace(basis)[source]#
Interface class for function spaces, i.e. geometry + interpolation basis.
- The value of a function
fat a positionxis generally computed as f(x) = L(x)[sum_i f_i N_i(x)]- with:
f_ithe value of the ith node’s degrees-of-freedom (dof)N_i(x)the weight associated to the node atxL(x)local linear transformation from node-space to world-space
- Parameters:
basis (BasisSpace)
- __init__(basis)[source]#
- Parameters:
basis (BasisSpace)
Methods
__init__(basis)Whether divergence of this field can be computed.
dof_value(space_value, node_weight, ...)Compute the projection of a world-space value onto the basis of a single degree of freedom.
Whether gradient operator can be computed.
local_value_map_inner(elt_arg, ...)Build the local value map transforming from node to world space.
local_value_map_outer(elt_arg, ...)Build the local value map transforming vector-valued from node to world space.
make_field([space_partition])Create a zero-initialized discrete field over the function space holding values for all degrees of freedom of nodes in a space partition.
node_basis_element(dof_coord)Basis element for node degrees of freedom.
Number of nodes in the interpolation basis.
space_divergence(dof_value, ...)Assemble the world-space divergence of the function space.
space_gradient(dof_value, ...)Assemble the world-space gradient of the function space.
space_value(dof_value, node_weight, ...)Assemble the world-space value of the function space.
trace()Trace of the function space over lower-dimensional elements of the geometry.
value_basis_element(dof_coord)Basis element for the function space values.
Attributes
Underlying basis space.
Maximum polynomial degree of the underlying basis.
Function space embedding dimension.
Kind of element the function space is expressed over.
Underlying geometry.
Underlying geometry.
Value type of the interpolation functions.
Data type of the degrees of freedom of each node.
Data type of the shape functions associated to each node.
Type of the local map for transforming vector-valued functions from reference to world space.
Number of degrees of freedom per value, as a Warp constant.
Number of degrees of freedom per node, as a Warp constant.
Polynomial degree of the function space, used to determine integration order.
- LocalValueMap: type#
Type of the local map for transforming vector-valued functions from reference to world space.
- property topology: SpaceTopology[source]#
Underlying geometry.
- property basis: BasisSpace[source]#
Underlying basis space.
- property element_kind: ElementKind[source]#
Kind of element the function space is expressed over.
- trace()[source]#
Trace of the function space over lower-dimensional elements of the geometry.
- Return type:
- make_field(space_partition=None)[source]#
Create a zero-initialized discrete field over the function space holding values for all degrees of freedom of nodes in a space partition.
- Parameters:
space_partition – If provided, the subset of nodes to consider
See also:
make_space_partition()
- gradient_valid()[source]#
Whether gradient operator can be computed. Only for scalar and vector fields as higher-order tensors are not supported yet.
- Return type:
- divergence_valid()[source]#
Whether divergence of this field can be computed. Only for vector and tensor fields with same dimension as embedding geometry.
- Return type:
- static node_basis_element(dof_coord)[source]#
Basis element for node degrees of freedom.
Assumes 0 <= dof_coord < NODE_DOF_COUNT
- Parameters:
dof_coord (int)
- static value_basis_element(dof_coord)[source]#
Basis element for the function space values.
Assumes 0 <= dof_coord < VALUE_DOF_COUNT.
- Parameters:
dof_coord (int)
- static local_value_map_inner(elt_arg, element_index, coords)[source]#
Build the local value map transforming from node to world space.
- Parameters:
elt_arg (SpaceTopology.ElementArg)
element_index (ElementIndex)
coords (Coords)
- static local_value_map_outer(elt_arg, element_index, coords)[source]#
Build the local value map transforming vector-valued from node to world space.
- Parameters:
elt_arg (SpaceTopology.ElementArg)
element_index (ElementIndex)
coords (Coords)
- static space_value(dof_value, node_weight, local_value_map)[source]#
Assemble the world-space value of the function space.
- Parameters:
dof_value (-) – node value in the degrees-of-freedom basis
node_weight (-) – weight associated to the node, as given per the basis space
local_value_map (-) – data encoding local transformation from node space to world space, as given per
local_map_value_(inn|out)er
- static space_gradient(
- dof_value,
- node_weight_gradient,
- local_value_map,
Assemble the world-space gradient of the function space.
- Parameters:
dof_value (-) – node value in the degrees-of-freedom basis
node_weight_gradient (-) – gradient of the weight associated to the node, either w.r.t element or world space
local_value_map (-) – data encoding local transformation from node space to world space, as given per
local_map_value_(inn|out)er
- static space_divergence(
- dof_value,
- node_weight_gradient,
- local_value_map,
Assemble the world-space divergence of the function space.
- Parameters:
dof_value (-) – node value in the degrees-of-freedom basis
node_weight_gradient (-) – gradient of the weight associated to the node, either w.r.t element or world space
local_value_map (-) – data encoding local transformation from node space to world space, as given per
local_map_value_(inn|out)er
- static dof_value(space_value, node_weight, local_value_map)[source]#
Compute the projection of a world-space value onto the basis of a single degree of freedom.
- Parameters:
space_value (-) – world-space value
node_weight (-) – weight associated to the node, as given per the basis space
local_value_map (-) – data encoding local transformation from node space to world space, as given per
local_map_value_(inn|out)er
- The value of a function