From 0b2dd86bbf30d4ae5bb6e9a2cdc52621960782a0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Aug 2018 13:36:46 +0200 Subject: [PATCH] handling cluster orientation --- src/homogenization_RGC.f90 | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/homogenization_RGC.f90 b/src/homogenization_RGC.f90 index 66825d6f9..4a8b7c6c4 100644 --- a/src/homogenization_RGC.f90 +++ b/src/homogenization_RGC.f90 @@ -165,7 +165,6 @@ subroutine homogenization_RGC_init(fileUnit) allocate(homogenization_RGC_sizePostResult(maxval(homogenization_Noutput),maxNinstance),& source=0_pInt) allocate(homogenization_RGC_orientation(3,3,mesh_maxNips,mesh_NcpElems), source=0.0_pReal) - homogenization_RGC_orientation = spread(spread(math_I3,3,mesh_maxNips),4,mesh_NcpElems) ! initialize to identity do h = 1_pInt, size(homogenization_type) if (homogenization_type(h) /= HOMOGENIZATION_RGC_ID) cycle @@ -177,7 +176,28 @@ subroutine homogenization_RGC_init(fileUnit) prm%xiAlpha = config_homogenization(h)%getFloat('scalingparameter') prm%ciAlpha = config_homogenization(h)%getFloat('overproportionality') prm%dAlpha = config_homogenization(h)%getFloats('grainsize',requiredShape=[3]) - prm%angles = config_homogenization(h)%getFloats('clusterorientation', requiredShape=[3]) + prm%angles = config_homogenization(h)%getFloats('clusterorientation',requiredShape=[3],& + defaultVal=[400.0_pReal,400.0_pReal,400.0_pReal]) + +!-------------------------------------------------------------------------------------------------- +! * assigning cluster orientations + elementLooping: do e = 1_pInt,mesh_NcpElems + if (homogenization_typeInstance(mesh_element(3,e)) == instance) then + noOrientationGiven: if (all (prm%angles >= 399.9_pReal)) then + homogenization_RGC_orientation(1:3,1:3,1,e) = math_EulerToR(math_sampleRandomOri()) + do i = 2_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) + homogenization_RGC_orientation(1:3,1:3,i,e) = merge(homogenization_RGC_orientation(1:3,1:3,1,e), & + math_EulerToR(math_sampleRandomOri()), & + microstructure_elemhomo(mesh_element(4,e))) + enddo + else noOrientationGiven + do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) + homogenization_RGC_orientation(1:3,1:3,i,e) = math_EulerToR(prm%angles*inRad) + enddo + endif noOrientationGiven + endif + enddo elementLooping + end associate enddo