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
*
?)|
?)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.
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...) thederivative_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, soderivative_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
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 forstensor<N, double>
andderivative_type<stensor<N, double>, tensor<N, double>>
is an alias tot2tost2<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:One can request the size of this object which is of arity 2 (symmetric tensors are represented as 1D array and vectors two).
prints:
The second derivative has arity 3, as demonstrated here:
which prints:
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).