thelfer / MFrontGenericInterfaceSupport

This project aims at providing support for MFront generic behaviours. This project can be embedded in open-source and propriary sofware
38 stars 35 forks source link

Better support of orthotropic behaviours #34

Closed thelfer closed 4 years ago

thelfer commented 4 years ago

For the moment, MGIS assumes that the calling solver handles the rotation to the material frame. The object of this issue is to provide appropriate function to handle the rotation.

thelfer commented 4 years ago

For orthotropic behaviours, the Behaviour structure exposes 6 function pointers:

Those functions takes pointer to the raw memory. The callee is responsible of the consistency of the data.

In place transformations

All those functions take two parameters: the pointer to the rotated data on output and the pointer to the original data on input. In place transformations is allowed, i.e. those pointers can be equal.

The rotation matrix argument

All those functions takes the rotation matrix from the global frame to the material frame as last argument. If required, i.e. for thermodynamic forces and tangent operator blocks, this matrix is transposed internally to have the inverse transformation.

The rotation matrix is given as a (3\times3) matrix, packed in an (9) continuous array in C-like column-major storage.

No checks are made to ensure that the columns of the matrix makes and orthonormal basis of (\mathcal{R}^{3}). In (1D), this matrix is discarded an no operation is performed. In (2D), only the upper-left part of the matrix is used.

For convenience (and debugging), the call to those functions pointers are mapped into the following free functions: rotateGradients, rotateArrayOfGradients, rotateThermodynamicForces and rotateArrayOfThermodynamicForces. Those functions perform additional consistency checks (compared to the functions exposed by the Behaviour class) which might hurt performances, especially when dealing with one integration point only. Each of these functions is overloaded twice for in-place operations and out-of-place operations.

Example

The following example shows how to rotate the gradients of a small strain strain behaviour in generalised plane strain:

const std::array<real, 9> r = {0, 1, 0, 1, 0, 0, 0, 0, 1};
const std::array<real, 4> ge = {1, 0, 0, 0};
std::array<real, 4> me;
rotateGradients(me, b, ge, r);