MGIS 3.1.0
Loading...
Searching...
No Matches
TensorOperations.hxx File Reference

File which declares functions rotating the tensorial values of a function into another basis and returning the result as a new function. More...

#include <span>
#include <optional>
#include "MGIS/Config.hxx"
#include "MGIS/Function/BasicLinearSpace.hxx"
#include "MGIS/Function/Function.hxx"
#include "MGIS/Function/TFEL/General.hxx"

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.

Enumerations

enum struct  mgis::function::TensorType { STENSOR , TENSOR , ST2TOST2 }
 type of tensor that are supported More...
enum struct  mgis::function::RotationOperation { FORWARD , BACKWARD }
 supported rotation operations More...

Functions

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedTensor (Context &, const BasicImmutableFunctionView &, const BasicImmutableFunctionView &, const TensorType=TensorType::STENSOR, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the tensorial values of a function and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedTensor (Context &, const BasicImmutableFunctionView &, const std::span< real > &, const TensorType=TensorType::STENSOR, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the tensorial values of a function with a given rotation matrix and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedSymmetricTensor (Context &, const BasicImmutableFunctionView &, const BasicImmutableFunctionView &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as symmetric tensors and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedSymmetricTensor (Context &, const BasicImmutableFunctionView &, const std::span< real > &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as symmetric tensors with a given rotation matrix and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedUnsymmetricTensor (Context &, const BasicImmutableFunctionView &, const BasicImmutableFunctionView &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as unsymmetric tensors and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedUnsymmetricTensor (Context &, const BasicImmutableFunctionView &, const std::span< real > &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as unsymmetric tensors with a given rotation matrix and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedST2toST2 (Context &, const BasicImmutableFunctionView &, const BasicImmutableFunctionView &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as fourth order tensors mapping symmetric tensors to symmetric tensors and return the result as a new function
MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedST2toST2 (Context &, const BasicImmutableFunctionView &, const std::span< real > &, const RotationOperation=RotationOperation::FORWARD) MGIS_NOEXCEPT
 rotate the values of a function seen as fourth order tensors mapping symmetric tensors to symmetric tensors with a given rotation matrix and return the result as a new function

Detailed Description

File which declares functions rotating the tensorial values of a function into another basis and returning the result as a new function.

Author
Thomas Helfer
Date
15/11/2025

Enumeration Type Documentation

◆ RotationOperation

supported rotation operations

  • If the rotation operation is FORWARD, the given rotation matrix is used directly.
  • If the rotation operation is BACKWARD, the transposed of the rotation matrix is used.

◆ TensorType

enum struct mgis::function::TensorType
strong

type of tensor that are supported

  • STENSOR designates a symmetric tensor,
  • TENSOR designates an unsymmetric tensor,
  • ST2TOST2 designates a fourth order tensor mapping symmetric tensors to symmetric tensors.

Function Documentation

◆ computeRotatedST2toST2() [1/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedST2toST2 ( Context & ,
const BasicImmutableFunctionView & ,
const BasicImmutableFunctionView & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as fourth order tensors mapping symmetric tensors to symmetric tensors and return the result as a new function

The number of components of s must be 9, 16 or 36, corresponding to fourth order tensors of dimension 1, 2 or 3. The rotation matrix is taken from the r view, which must have 9 components.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose fourth order tensorial values are rotated
[in]rview on the function whose values are the rotation matrices
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedST2toST2() [2/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedST2toST2 ( Context & ,
const BasicImmutableFunctionView & ,
const std::span< real > & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as fourth order tensors mapping symmetric tensors to symmetric tensors with a given rotation matrix and return the result as a new function

This is the same operation as the previous overload, except that the rotation matrix is given directly as a span of 9 values.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose fourth order tensorial values are rotated
[in]rvalues of the rotation matrix, which must have 9 components
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedSymmetricTensor() [1/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedSymmetricTensor ( Context & ,
const BasicImmutableFunctionView & ,
const BasicImmutableFunctionView & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as symmetric tensors and return the result as a new function

The number of components of s must be 3, 4 or 6, corresponding to symmetric tensors of dimension 1, 2 or 3. The rotation matrix is taken from the r view, which must have 9 components.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose symmetric tensorial values are rotated
[in]rview on the function whose values are the rotation matrices
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedSymmetricTensor() [2/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedSymmetricTensor ( Context & ,
const BasicImmutableFunctionView & ,
const std::span< real > & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as symmetric tensors with a given rotation matrix and return the result as a new function

This is the same operation as the previous overload, except that the rotation matrix is given directly as a span of 9 values.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose symmetric tensorial values are rotated
[in]rvalues of the rotation matrix, which must have 9 components
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedTensor() [1/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedTensor ( Context & ,
const BasicImmutableFunctionView & ,
const BasicImmutableFunctionView & ,
const TensorType = TensorType::STENSOR,
const RotationOperation = RotationOperation::FORWARD )

rotate the tensorial values of a function and return the result as a new function

The type of the tensorial objects handled is given by the type argument and the rotation is performed with the rotation matrix given by the r view. The number of components of t must be compatible with type: 3, 4 or 6 components for a symmetric tensor, 3, 5 or 9 components for an unsymmetric tensor and 9, 16 or 36 components for a fourth order tensor st2tost2.

Parameters
[in]ctxexecution context used to report the errors
[in]tview on the function whose values are rotated
[in]rview on the function whose values are the rotation matrices, which must have 9 components
[in]typetype of the tensorial objects handled by the function
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedTensor() [2/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedTensor ( Context & ,
const BasicImmutableFunctionView & ,
const std::span< real > & ,
const TensorType = TensorType::STENSOR,
const RotationOperation = RotationOperation::FORWARD )

rotate the tensorial values of a function with a given rotation matrix and return the result as a new function

This is the same operation as the previous overload, except that the rotation matrix is given directly as a span of 9 values instead of being taken from a function.

Parameters
[in]ctxexecution context used to report the errors
[in]tview on the function whose values are rotated
[in]rvalues of the rotation matrix, which must have 9 components
[in]typetype of the tensorial objects handled by the function
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedUnsymmetricTensor() [1/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedUnsymmetricTensor ( Context & ,
const BasicImmutableFunctionView & ,
const BasicImmutableFunctionView & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as unsymmetric tensors and return the result as a new function

The number of components of s must be 3, 5 or 9, corresponding to unsymmetric tensors of dimension 1, 2 or 3. The rotation matrix is taken from the r view, which must have 9 components.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose tensorial values are rotated
[in]rview on the function whose values are the rotation matrices
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler

◆ computeRotatedUnsymmetricTensor() [2/2]

MGIS_EXPORT std::optional< Function< BasicLinearSpace > > mgis::function::computeRotatedUnsymmetricTensor ( Context & ,
const BasicImmutableFunctionView & ,
const std::span< real > & ,
const RotationOperation = RotationOperation::FORWARD )

rotate the values of a function seen as unsymmetric tensors with a given rotation matrix and return the result as a new function

This is the same operation as the previous overload, except that the rotation matrix is given directly as a span of 9 values.

Parameters
[in]ctxexecution context used to report the errors
[in]sview on the function whose tensorial values are rotated
[in]rvalues of the rotation matrix, which must have 9 components
[in]rorotation operation to be performed
Returns
the function holding the rotated values or an empty optional if the inputs are inconsistent, in which case an error is reported through the error handler