warp.fem#
Finite Element Method (FEM) toolkit for solving differential equations.
This module provides tools for solving physical systems described as partial differential equations (PDEs) using finite-element-based Galerkin methods. It supports diffusion, convection, fluid flow, and elasticity problems with various FEM formulations and discretization schemes.
The core workflow involves defining geometries (grids, meshes, NanoVDB volumes), function
spaces with shape functions, integration domains, and using the integrate() function
with integrand()-decorated kernels to build linear and bilinear forms for solving
linear systems.
- Usage:
This module must be explicitly imported:
import warp.fem
See also
FEM Toolkit for comprehensive documentation and examples.
Submodules#
These modules are automatically available when you import warp.fem.
API#
Adaptive sparse grid |
|
Interface class for defining shape functions over a geometry. |
|
A Domain containing boundary sides of the geometry or geometry partition |
|
Geometry partition based on a subset of cells. |
|
A Domain containing all cells of the geometry or geometry partition |
|
alias of |
|
Explicitly-valued field defined over a partition of a discrete function space |
|
Base class from mapping node degrees of freedom to function values |
|
Tag for domain-like integrand arguments |
|
Enumeration of reference element types |
|
Choice of basis function to equip individual elements |
|
alias of |
|
Type of geometry elements |
|
Quadrature using explicit per-cell points and weights. |
|
Tag for field-like integrand arguments |
|
Base class for integrable fields |
|
A Domain containing frontier sides of the geometry partition (sides shared with at least another partition) |
|
Interface class for function spaces, i.e. geometry + interpolation basis. |
|
Interface class for discrete geometries |
|
Interface class for domains, i.e. (partial) views of elements in a Geometry. |
|
Base class for fields defined over a geometry |
|
Base class for geometry partitions, i.e. subset of cells and sides. |
|
Two-dimensional regular grid geometry |
|
Three-dimensional regular grid geometry |
|
Hexahedral mesh geometry |
|
Field defined from an arbitrary function over a domain. |
|
An integrand is a device function containing arbitrary expressions over Field and Domain variables. |
|
Sparse grid geometry |
|
Quadrature using space node points as quadrature points |
|
alias of |
|
Field defined as the map of a DiscreteField over a non-conforming geometry. |
|
Operators provide syntactic sugar over Field and Domain evaluation functions and arguments |
|
Particle-based quadrature formula, using a global set of points unevenly spread out over geometry elements. |
|
Polynomial family defining interpolation nodes over an interval |
|
Two-dimensional quadrilateral mesh |
|
Three-dimensional quadrilateral mesh |
|
Interface class for quadrature rules |
|
alias of |
|
Regular quadrature formula, using a constant set of quadrature points per element |
|
Per-sample point context for evaluating fields and related operators in integrands |
|
Base class for defining shape-function-based basis spaces. |
|
Interface class for defining scalar-valued shape functions over a single element |
|
A Domain containing all (interior and boundary) sides of the geometry or geometry partition |
|
Orthonormal isomorphism from R^{n (n-1)} to nxn skew-symmetric tensors, using usual L2 norm for vectors and half Frobenius norm, (tau : tau)/2 for tensors. |
|
Restriction of a space partition to a given GeometryDomain |
|
Interface class for defining the topology of a function space. |
|
Subdomain -- restriction of domain to a subset of its elements |
|
Orthonormal isomorphism from R^{n (n+1)} to nxn symmetric tensors, using usual L2 norm for vectors and half Frobenius norm, (tau : tau)/2 for tensors. |
|
alias of |
|
Shared pool of temporary arrays that will be persisted and reused across invocations of |
|
Tetrahedral mesh geometry |
|
2D Triangular mesh geometry |
|
3D Triangular mesh geometry |
|
Field defined as a constant value over a domain. |
|
Symmetric part of the (inner) gradient of the field at s |
|
Constructs a |
|
Constructs a |
|
Returns a copy of the Sample s moved to the coordinates of a local node of the field f. |
|
Average between inner and outer element values |
|
Borrows and returns a temporary array with specified attributes from a shared pool. |
|
Borrows and returns a temporary array with the same attributes as another array or temporary. |
|
Converts a domain defined on geometry sides to a domain defined of cells. |
|
Skew part of the (inner) gradient of the field at s, as a vector such that |
|
Evaluates the gradient of the domain position with respect to the element reference space at the sample point s |
|
Polynomial degree of a field |
|
Evaluates the field divergence at a sample point s. |
|
Evaluates the field divergence at a sample point s. |
|
Computes the coordinates of the closest point to a world position within a given element. |
|
Returns the coordinates in an element reference system corresponding to a work position. |
|
Returns the index in the geometry of the domain_element_index'th domain element. |
|
Returns the index of the passed cell in the domain's geometry partition, or NULL_ELEMENT_INDEX if not part of the partition. |
|
Evaluates the field gradient at a sample point s. |
|
Average between inner and outer element gradients |
|
Jump between inner and outer element gradients on an interior side. |
|
Evaluates the field gradient at a sample point s. |
|
Evaluates the field at a sample point s. |
|
Decorator for functions to be integrated (or interpolated) using warp.fem |
|
Integrates a constant, linear or bilinear form, and returns a scalar, array, or sparse matrix, respectively. |
|
Interpolates a function at a finite set of sample points and optionally assigns the result to a discrete field, raw warp array, or sparse matrix. |
|
Jump between inner and outer element values on an interior side. |
|
Looks-up the sample point corresponding to a world position x, projecting to the closest point on the geometry. |
|
Constructs a function space from a scalar-valued basis space and a value type, such that all degrees of freedom of the value type are stored at each of the basis nodes. |
|
Constructs a contravariant function space from a vector-valued basis space |
|
Constructs a covariant function space from a vector-valued basis space |
|
Constructs a zero-initialized discrete field over a function space or partition |
|
Makes a space topology from a geometry and an element-based shape function. |
|
Equips a reference element with a shape function basis. |
|
Returns a |
|
Equips a geometry with a polynomial basis. |
|
Equips a geometry with a collocated, polynomial function space. |
|
Restricts a discrete field to a subset of elements. |
|
Computes the subset of nodes from a function space topology that touch a geometry partition |
|
Restricts a function space partition to a Domain, i.e. a subset of its elements. |
|
Constructs a test field over a function space or its restriction |
|
Constructs a trial field over a function space or partition |
|
Returns the measure (volume, area, or length) determinant of an element at a sample point s |
|
Returns the maximum ratio between the measure of this element and that of higher-dimensional neighbors. |
|
Returns the number of nodes associated to the field f in the element containing the sample s |
|
Returns the index in the function space of a local node of the field f. |
|
Returns the inner element weight associated to a local node of the field f at the sample point s. |
|
Returns the gradient (w.r.t world coordinates) of the inner element weight associated to a local node of the field f at the sample point s. |
|
Returns the outer element weight associated to a local node of the field f at the sample point s. |
|
Returns the gradient (w.r.t world coordinates) of the outer element weight associated to a local node of the field f at the sample point s. |
|
For a NodalField f, returns the index of a given node in the fields's space partition, or |
|
Evaluates the element normal at the sample point s. |
|
Scale projector so that it becomes idempotent, and apply the same scaling to fixed_value if provided |
|
Evaluates the field at a sample point s. |
|
Looks-up the sample point corresponding to a world position x, projecting to the closest point on the geometry partition. |
|
Evaluates the world position of the sample point s |
|
Projects both the left-hand-side and right-hand-side of a linear system to enforce Dirichlet boundary conditions |
|
Projects the right-hand-side of a linear system to enforce Dirichlet boundary conditions |
|
Projects the right-hand-side of a linear system to enforce Dirichlet boundary conditions |
|
Globally sets the default |
|
Converts a |
|
Converts a |
|
Converts a |
|