From 44125f3f090909f8126f044f14be526c79af8164 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Sep 2019 17:36:37 -0700 Subject: [PATCH] convenience function for symmetric 4th order tensors unfortunately, array size does not qualify to distinguish generics --- src/rotations.f90 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/rotations.f90 b/src/rotations.f90 index 4f44c0c50..b02bff011 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -74,6 +74,7 @@ module rotations procedure, public :: rotVector procedure, public :: rotTensor2 procedure, public :: rotTensor4 + procedure, public :: rotTensor4sym procedure, public :: misorientation end type rotation @@ -284,6 +285,7 @@ pure function rotTensor2(self,T,active) result(tRot) end function rotTensor2 + !--------------------------------------------------------------------------------------------------- !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief rotate a rank-4 tensor passively (default) or actively @@ -316,6 +318,27 @@ pure function rotTensor4(self,T,active) result(tRot) end function rotTensor4 +!--------------------------------------------------------------------------------------------------- +!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH +!> @brief rotate a symmetric rank-4 tensor stored as (6,6) passively (default) or actively +!! ToDo: Need to check active/passive !!! +!--------------------------------------------------------------------------------------------------- +pure function rotTensor4sym(self,T,active) result(tRot) + + real(pReal), dimension(6,6) :: tRot + class(rotation), intent(in) :: self + real(pReal), intent(in), dimension(6,6) :: T + logical, intent(in), optional :: active + + if (present(active)) then + tRot = math_sym3333to66(rotTensor4(self,math_66toSym3333(T),active)) + else + tRot = math_sym3333to66(rotTensor4(self,math_66toSym3333(T))) + endif + +end function rotTensor4sym + + !--------------------------------------------------------------------------------------------------- !> @brief misorientation !---------------------------------------------------------------------------------------------------