From 1f41549a2c3870e6859a17448e58bc2ed2bf7c7e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Mar 2019 12:37:48 +0100 Subject: [PATCH] avoid explicit loops --- src/plastic_disloUCLA.f90 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plastic_disloUCLA.f90 b/src/plastic_disloUCLA.f90 index 1cdebe87f..88aa27432 100644 --- a/src/plastic_disloUCLA.f90 +++ b/src/plastic_disloUCLA.f90 @@ -208,9 +208,9 @@ subroutine plastic_disloUCLA_init() prm%nonSchmid_neg = prm%Schmid endif - prm%h_sl_sl = lattice_interaction_SlipBySlip(prm%N_sl, & + prm%h_sl_sl = transpose(lattice_interaction_SlipBySlip(prm%N_sl, & config%getFloats('interaction_slipslip'), & - config%getString('lattice_structure')) + config%getString('lattice_structure'))) prm%forestProjectionEdge = lattice_forestProjection(prm%N_sl,config%getString('lattice_structure'),& config%getFloat('c/a',defaultVal=0.0_pReal)) @@ -484,13 +484,11 @@ subroutine plastic_disloUCLA_dependentState(instance,of) associate(prm => param(instance), stt => state(instance),dst => dependentState(instance)) - forall (i = 1:prm%sum_N_sl) + forall (i = 1:prm%sum_N_sl) & dislocationSpacing(i) = sqrt(dot_product(stt%rho_mob(:,of)+stt%rho_dip(:,of), & prm%forestProjectionEdge(:,i))) - dst%threshold_stress(i,of) = prm%mu*prm%b_sl(i) & - * sqrt(dot_product(stt%rho_mob(:,of)+stt%rho_dip(:,of), & - prm%h_sl_sl(:,i))) - end forall + dst%threshold_stress(:,of) = prm%mu*prm%b_sl & + * sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of))) dst%Lambda_sl(:,of) = prm%D/(1.0_pReal+prm%D*dislocationSpacing/prm%i_sl)