.TH "tensor4" 2rheolef "Sat Mar 13 2021" "Version 7.1" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME tensor4 \- d-dimensional physical fourth-order tensor (rheolef-7\&.1) .PP .SH "DESCRIPTION" .PP The \fCtensor4\fP class defines a \fCd^4\fP array with floating coefficients\&. This class is suitable for defining fourth-order tensors, i\&.e\&. \fBfield(2)\fP with \fCd^4\fP matrix values at each physical position\&. .PP It is represented as a fourth-dimensional array of coordinates\&. The coordinate indexes start at zero and finishes at \fCd-1\fP, e\&.g\&. \fCa(0,0,0,0)\fP, \fCa(0,0,0,1)\fP, \&.\&.\&., \fCa(2,2,2,2)\fP\&. .PP The default constructor set all components to zero: .PP .nf tensor4 a; .fi .PP The standard linear algebra is supported\&. .SH "IMPLEMENTATION" .PP This documentation has been generated from file fem/geo_element/tensor4\&.h .PP The \fCtensor4\fP class is simply an alias to the \fC\fBtensor4_basic\fP\fP class .PP .PP .nf typedef tensor4_basic tensor4; .fi .PP The \fC\fBtensor4_basic\fP\fP class is a template class with the floating type as parameter: .PP .PP .nf template class tensor4_basic { public: typedef size_t size_type; typedef T element_type; typedef T float_type; // allocators: tensor4_basic (); explicit tensor4_basic (const T& init_val); tensor4_basic (const tensor4_basic& a); static tensor4_basic eye (size_type d = 3); tensor4_basic (const std::initializer_list > > >& il); // affectation: tensor4_basic& operator= (const tensor4_basic& a); tensor4_basic& operator= (const T& val); // accessors: T& operator()(size_type i, size_type j, size_type k, size_type l); const T& operator()(size_type i, size_type j, size_type k, size_type l) const; tensor_basic& operator()(size_type i, size_type j); const tensor_basic& operator()(size_type i, size_type j) const; // algebra: tensor4_basic operator* (const T& k) const; tensor4_basic operator/ (const T& k) const; tensor4_basic operator+ (const tensor4_basic& b) const; tensor4_basic operator- (const tensor4_basic& b) const; tensor4_basic& operator+= (const tensor4_basic&); tensor4_basic& operator-= (const tensor4_basic&); tensor4_basic& operator*= (const T& k); tensor4_basic& operator/= (const T& k) { return operator*= (1\&./k); } // io: std::ostream& put (std::ostream& out, size_type d=3) const; .fi .PP .PP .nf }; .fi .PP \fB\fP .RS 4 .RE .PP The norm and contracted product with a second-order tensor is provided, together with the \fCdexp\fP fuinction, that represents the derivative of the tensor matrix function\&. .PP .PP .nf template T norm (const tensor4_basic& a) { return sqrt(norm2(a)); } template T norm2 (const tensor4_basic&); template tensor_basic ddot (const tensor4_basic&, const tensor_basic&); template tensor_basic ddot (const tensor_basic&, const tensor4_basic&); template tensor4_basic dexp (const tensor_basic& a, size_t d = 3); .fi .PP .SH AUTHOR Pierre Saramito .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.