Menu

#225 Manage derivatives of second-order tensors with respect to vectors

4.0.0
accepted
None
2021-08-16
2020-03-13
No

In the view of extending MFront to generalized behaviours, some models include tensorial as well as vectorial variables (gradients or fluxes).

The derivation of the tangent operator therefore requires blocks involving the derivative of tensorial objects with respect to a vectorial quantity, leading to a third-order tensor.
In addition to standard operations (addition, substraction, etc.), we would most likely need

  • simple contraction with a vector (use * ?)
  • double contraction with a second-order tensor (use | ?)
  • transposition

Should there be two types with something like VtoST2Concept and ST2toVConcept (and possibly variants with non-symmetric versions for the second-order tensor ?). We can then have also the dyadic product so that S^v matches the VtoST2Concept and v^S matches the ST2toST2Concept.

Discussion

  • Helfer Thomas

    Helfer Thomas - 2020-03-14
    • status: open --> accepted
    • assigned_to: Helfer Thomas
     
  • Helfer Thomas

    Helfer Thomas - 2021-07-05

    Hi Jérémy,

    Just to keep discussion alive, the current development version of TFEL as introduced a generic FixedSizeArrayDerivative class which represents any derivative of a mathematical object of the library with respect to another mathematical object.

    To take into account existing objects (such as st2tost2, t2tot2, tmatrix, etc...) the derivative_type provides a convenient alias:

    • derivative_type<Stensor, scalar> => Stensor
    • derivative_type<Stensor, Stensor> => ST2toST2
    • derivative_type<Stensor, TVector> => FixedSizeArrayDerivative<Stensor,TVector>

    Note that derivative_type works with scalars. More, it even handles quantities (i.e. floating points with units) into account, so

    • derivative_type<stress, strain> => stress

    The FixedSizeArrayDerivative is still experimental, but it seems a nice basis. However, dyadic products are not yet defined.

    All those features now work out of the box in the implicit DSLs of MFront, including views to the residual and jacobian matrix.

    Best,

    Thomas

     
  • Helfer Thomas

    Helfer Thomas - 2021-08-16
    • Milestone: 3.4.0 --> 4.0.0
     
  • Helfer Thomas

    Helfer Thomas - 2021-08-16

    Such derivatives are automatically supported in TFEL-4.0.

    The derivative_type alias which points to the correct derivative implementation. For example, derivative_type<stensor<N, double>, double> is an alias for stensor<N, double> and derivative_type<stensor<N, double>, tensor<N, double>> is an alias to t2tost2<N,double>.

    By default (i.e. if no better alternative exists), a generic class called FixedSizeArrayDerivative is used. This class is used for defining the derivative of a symmetric tensor with respect to a vector, as follows:

    constexpr unsigned short N = 3;
    derivative_type<stensor<N, double>, tvector<N, double>> d;
    

    One can request the size of this object which is of arity 2 (symmetric tensors are represented as 1D array and vectors two).

    std::cout << "d (" << d.arity << "): " << d.size(0) << ", "
                << d.size(1) << '\n';
    

    prints:

    d: 6, 3
    

    The second derivative has arity 3, as demonstrated here:

    derivative_type<derivative_type<stensor<N, double>, tvector<N, double>>,
                      tvector<N, double>>
          d2;
      std::cout << "d2 (" << d2.arity << "): " << d2.size(0) << ", "
                << d2.size(1) << ", " << d2.size(2) << '\n';
    

    which prints:

    d2 (3): 6, 3, 3
    

    I don't close this issue because no special operations on the FixedSizeArrayDerivative are not supported right now (apart from addition and multiplications by a scalar) , so we need to define them to make this feature useful.

    Note that derivative_type works well with quantities (scalar with units !) and that the views to those objects are well supported (in the residual and the jacobian matrix).

     

Log in to post a comment.