Get a pure function whose argument is a vector or a matrix for a given tensor
Contributed by:
E. Chan-López & Víctor Castellanos
Examples
Basic Examples (3)
Define a function that takes a matrix of variables as input and returns a vector:
Apply the function:
Use TensorPureFunction with a tensor of rank 3:
Apply the function:
Use TensorPureFunction with a tensor of rank 4:
Apply the function:
Scope (3)
Use TensorPureFunction in combination with Grad:
Use TensorPureFunction in combination with Curl:
Use TensorPureFunction to compute a Jacobian matrix:
Apply the Jacobian function:
Use TensorPureFunction to compute a Hessian matrix:
Apply the Hessian function:
Options (1)
IndexingMethod (1)
The IndexingMethod option allows specifying the method used to indexing elements of argvars in the TensorPureFunction. By default, the method is set to "UseIndexed", which uses the Indexed function. Alternatively, can be set the option to "UsePart" to use the Part function. This option provides flexibility in choosing the preferred method of indexing elements of argvars within the TensorPureFunction:
Applications (4)
Multilinear Functions (2)
Use TensorPureFunction with the following trilinear function:
Apply the trilinear function:
Deformation Gradient and Vorticity Tensor (2)
Define a simple function to compute the deformation gradient given a velocity field at the point :
The calculation of the deformation gradient for the -velocity is as follows:
Now, use TensorPureFunction to obtain a pure function of the above array:
Define a simple function to compute the vorticity tensor given a velocity field at the point :
The calculation of the vorticity tensor for the -velocity is as follows:
Now, use TensorPureFunction to obtain a pure function of the above array:
Properties and Relations (3)
Use TensorPureFunction with the resource function JacobianMatrix:
This is equivalent the computing the Jacobian directly:
Use TensorPureFunction with the resource function HessianMatrix:
This is equivalent the computing the Hessian directly:
Use TensorPureFunction with the resource function DVectorField:
The previous tensors are identical:
Publisher
Ramón Eduardo Chan López
Requirements
Wolfram Language 13.0
(December 2021) or above
Version History
-
2.1.1
– 26 March 2025
-
2.1.0
– 19 February 2025
-
2.0.1
– 20 March 2024
-
2.0.0
– 02 October 2023
-
1.0.0
– 08 November 2022
Related Resources