fixed calculation of dislocation stress for elements with a single ip and no neighbors; used to get segmentation fault

This commit is contained in:
Christoph Kords 2010-05-26 09:17:10 +00:00
parent 0c5bc83469
commit e5f0af638e
1 changed files with 2 additions and 1 deletions

View File

@ -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)