warp.fem.FunctionSpace#
- class warp.fem.FunctionSpace(basis)[source]#
Interface class for function spaces, i.e. geometry + interpolation basis
- The value of a function f at a position x is 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 at xL(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, ...)Computes the projection of a world-space value onto the basis of a single degree of freedom :param - space_value: world-space value :param - node_weight: weight associated to the node, as given per the basis space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
Whether gradient operator can be computed.
local_value_map_inner(elt_arg, ...)Builds the local value map transforming from node to world space
local_value_map_outer(elt_arg, ...)Builds the local value map transforming vector-valued from node to world space
make_field([space_partition])Creates 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, ...)space_gradient(dof_value, ...)Assembles the world-space gradient of the function space :param - dof_value: node value in the degrees-of-freedom basis :param - node_weight_gradient: gradient of the weight associated to the node, either w.r.t element or world space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
space_value(dof_value, node_weight, ...)Assembles the world-space value of the function space :param - dof_value: node value in the degrees-of-freedom basis :param - node_weight: weight associated to the node, as given per the basis space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
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]#
Creates 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]#
Builds 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]#
Builds 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]#
Assembles the world-space value of the function space :param - dof_value: node value in the degrees-of-freedom basis :param - node_weight: weight associated to the node, as given per the basis space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
- Parameters:
dof_value (FunctionSpace.dof_dtype)
node_weight (FunctionSpace.weight_dtype)
local_value_map (FunctionSpace.LocalValueMap)
- static space_gradient(
- dof_value,
- node_weight_gradient,
- local_value_map,
Assembles the world-space gradient of the function space :param - dof_value: node value in the degrees-of-freedom basis :param - node_weight_gradient: gradient of the weight associated to the node, either w.r.t element or world space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
- Parameters:
dof_value (FunctionSpace.dof_dtype)
node_weight_gradient (Any)
local_value_map (FunctionSpace.LocalValueMap)
- static space_divergence(
- dof_value,
- node_weight_gradient,
- local_value_map,
” Assembles the world-space divergence of the function space :param - dof_value: node value in the degrees-of-freedom basis :param - node_weight_gradient: gradient of the weight associated to the node, either w.r.t element or world space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
- Parameters:
dof_value (FunctionSpace.dof_dtype)
node_weight_gradient (Any)
local_value_map (FunctionSpace.LocalValueMap)
- static dof_value(space_value, node_weight, local_value_map)[source]#
Computes the projection of a world-space value onto the basis of a single degree of freedom :param - space_value: world-space value :param - node_weight: weight associated to the node, as given per the basis space :param - local_value_map: data encoding local transformation from node space to world space, as given per local_map_value_(inn|out)er
- Parameters:
space_value (FunctionSpace.dtype)
node_weight (FunctionSpace.weight_dtype)
local_value_map (FunctionSpace.LocalValueMap)