From 8de3b67c2694b2cf89a0137e3c784d5e075fa701 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 13 Jul 2020 21:13:53 +0200 Subject: [PATCH] no silent crash --- src/IO.f90 | 2 ++ src/constitutive_plastic_nonlocal.f90 | 6 +++++- src/grid/discretization_grid.f90 | 1 + src/marc/discretization_marc.f90 | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/IO.f90 b/src/IO.f90 index aae5f69cc..0092fd1e2 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -529,6 +529,8 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg) msg = 'unknown material parameter:' case (211) msg = 'material parameter out of bounds:' + case (212) + msg = 'nonlocal model not supported' !-------------------------------------------------------------------------------------------------- ! numerics error messages diff --git a/src/constitutive_plastic_nonlocal.f90 b/src/constitutive_plastic_nonlocal.f90 index ea55024b9..19f9794d7 100644 --- a/src/constitutive_plastic_nonlocal.f90 +++ b/src/constitutive_plastic_nonlocal.f90 @@ -386,7 +386,11 @@ module subroutine plastic_nonlocal_init call material_allocateState(plasticState(p),NipcMyPhase,sizeState,sizeDotState,sizeDeltaState) - plasticState(p)%nonlocal = config%KeyExists('/nonlocal/') + plasticState(p)%nonlocal = config%KeyExists('/nonlocal/') + if(plasticState(p)%nonlocal .and. .not. allocated(geometry_plastic_nonlocal_IPneighborhood)) & + call IO_error(212,ext_msg='IPneighborhood does not exist') + + plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention st0%rho => plasticState(p)%state0 (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:) diff --git a/src/grid/discretization_grid.f90 b/src/grid/discretization_grid.f90 index dad7036cf..ce1c07fc2 100644 --- a/src/grid/discretization_grid.f90 +++ b/src/grid/discretization_grid.f90 @@ -118,6 +118,7 @@ subroutine discretization_grid_init(restart) call results_addAttribute('origin',origin, 'geometry') call results_closeJobFile endif + !-------------------------------------------------------------------------------------------------- ! geometry information required by the nonlocal CP model call geometry_plastic_nonlocal_setIPvolume(reshape([(product(mySize/real(myGrid,pReal)),j=1,product(myGrid))], & diff --git a/src/marc/discretization_marc.f90 b/src/marc/discretization_marc.f90 index eee635065..989c4aeb1 100644 --- a/src/marc/discretization_marc.f90 +++ b/src/marc/discretization_marc.f90 @@ -119,6 +119,7 @@ subroutine discretization_marc_init unscaledNormals = IPareaNormal(elem,nElems,connectivity_cell,node0_cell) call geometry_plastic_nonlocal_setIParea(norm2(unscaledNormals,1)) call geometry_plastic_nonlocal_setIPareaNormal(unscaledNormals/spread(norm2(unscaledNormals,1),1,3)) + !call geometry_plastic_nonlocal_setIPneighborhood ToDo: Support nonlocal call geometry_plastic_nonlocal_results end subroutine discretization_marc_init