splinepy.helpme.mapper.Mapper#
- class splinepy.helpme.mapper.Mapper(field, reference)[source]#
Bases:
SplinepyBase
Map expressions and derivatives into the physical domain using a geometric mapper
The mapper has access to two fields: the solution field and the underlying geometry representation, both are assumed to be spline-functions. Hence, we assume a geometry representation in the form:
\[x_i (\mathbf{u}) = \sum_b N^b (\mathbf{u}) x^b_i\]as well as a field representation in the form :
\[f_i (\mathbf{u}) = \sum_a N^a (\mathbf{u}) f^a_i\]With \(x_i\), \(f_i\) being (vector valued) geometry and solution field functions, with their respective shape/basis functions \(N^b\), \(N^a\) and their associated coefficients/control points, \(x^b_i\) and \(f^a_i\). Further, using the definition of the Jacobian and it’s inverse we can write
\[\mathbf{J}^{-1} = \bar{\mathbf{J}}\]\[J_{ij} = \frac{\partial x_i}{\partial u_j}\]\[\bar{J}_{ij} = \frac{\partial u_i}{\partial x_j}\]Basis function derivatives of the first order can be mapped into the physical domain, using the following equation:
\[\frac{\partial N^a}{\partial x_i} = \frac{ \partial N^a}{\partial u_j} \frac{ \partial u_j}{\partial x_i} = \frac{\partial N^a}{ \partial u_j} \bar{J}_{ji}\]Using the definition of the solution field, field gradients (and divergences) can be computed in a similar fashion
\[\frac{\partial f_i}{\partial x_j} = \sum_a \frac{\partial N^a}{\partial x_j} f^a_i\]Divergences are computed by summing up the respective components.
Second order derivatives of the basis function values with respect to the reference coordinates are written as (similar for \(H^b\)):
\[H^a_{ij} = \frac{\partial^2 N^a}{\partial u_i\partial u_j}\]The hessians can be mapped into physical space using the following equation:
\[\frac{\partial^2 N^a}{\partial x_i\partial x_j} = \bar{J}_{li} \left( H^a_{kl} - \frac{\partial N^a}{\partial u_n}\bar{J}_{nm} x^b_m H^b_{lk} \right) \bar{J}_{kj}\]Here, the expression \(x^b_mH^b_{lk}\) represents the Hessian of the geometric reference spline \(\tilde{H}_{mlk}\), which can sometimes be calculated more efficiently using spline methods implemented in SplineLib and Bezman.
Here we used the following identity:
\[\begin{split}\frac{\partial \bar{J}_{li} }{\partial u_k} = - \bar{J}_{lm} \frac{\partial J_{mn}}{\partial u_k} \bar{J}_{ni}\\\end{split}\]- Parameters:
field (spline) – Field that is to be mapped
reference (spline) – Reference for mapping (geometry)
Methods
Mapper.basis_function_derivatives
(queries[, ...])Function to retrieve more than one basis function derivative
Mapper.basis_gradient_and_support
(queries[, ...])Map gradient of basis functions into the physical domain
Mapper.basis_hessian_and_support
(queries[, ...])Map hessian of basis functions into the physical domain
Mapper.basis_laplacian_and_support
(queries)Map laplacian of basis functions into the physical domain
Mapper.divergence
(queries[, nthreads])Map field divergence (where applicable) into the physical domain
Mapper.field_derivatives
(queries[, ...])Function to retrieve more than one field derivative
Mapper.gradient
(queries[, nthreads])Map gradient field into the physical domain
Mapper.hessian
(queries[, nthreads])Map hessian field into the physical domain
Mapper.laplacian
(queries[, nthreads])Map laplacian field into the physical domain