From e5f0af638edb3ae6e53839d7388e56f26132b138 Mon Sep 17 00:00:00 2001 From: Christoph Kords Date: Wed, 26 May 2010 09:17:10 +0000 Subject: [PATCH] fixed calculation of dislocation stress for elements with a single ip and no neighbors; used to get segmentation fault --- code/constitutive_nonlocal.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index 22d716b0c..0eed2f500 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -911,7 +911,8 @@ do n = 1,FE_NipNeighbors(mesh_element(2,el)) opposite_n = n - 1_pInt + 2_pInt*mod(n,2_pInt) opposite_el = mesh_ipNeighborhood(1,opposite_n,ip,el) opposite_ip = mesh_ipNeighborhood(2,opposite_n,ip,el) - neighboring_el = opposite_el + if ( opposite_ip == 0 ) & ! if both neighbors not present... + cycle neighboring_el = opposite_el ! ... skip this element neighboring_ip = opposite_ip forall (t = 1:8) neighboring_rhoSgl(:,t) = max(0.0_pReal, 2.0_pReal * state(g,ip,el)%p((t-1)*ns+1:t*ns) & - state(g,opposite_ip,opposite_el)%p((t-1)*ns+1:t*ns) ) ! ... extrapolate density from opposite neighbor (but assure positive value for density)