* in flux calculation: take care of special case for single element model

* do not overwrite "constitutive_nonlocal_rhoDotFlux" when doing a state perturbation, so we can use it for output
This commit is contained in:
Christoph Kords 2011-02-24 10:01:41 +00:00
parent 8aef9b1c13
commit e49e5e13af
1 changed files with 11 additions and 8 deletions

View File

@ -1287,6 +1287,7 @@ subroutine constitutive_nonlocal_dotState(dotState, Tstar_v, previousTstar_v, Fe
use prec, only: pReal, & use prec, only: pReal, &
pInt, & pInt, &
p_vec p_vec
use numerics, only: numerics_integrationMode
use IO, only: IO_error use IO, only: IO_error
use debug, only: debugger, & use debug, only: debugger, &
debug_g, & debug_g, &
@ -1555,7 +1556,6 @@ where (rhoSgl(1:ns,1:2) > 0.0_pReal) &
!**************************************************************************** !****************************************************************************
!*** calculate dislocation fluxes (only for nonlocal constitution) !*** calculate dislocation fluxes (only for nonlocal constitution)
constitutive_nonlocal_rhoDotFlux(:,:,g,ip,el) = 0.0_pReal
rhoDotFlux = 0.0_pReal rhoDotFlux = 0.0_pReal
if (.not. phase_localConstitution(material_phase(g,ip,el))) then ! only for nonlocal constitution if (.not. phase_localConstitution(material_phase(g,ip,el))) then ! only for nonlocal constitution
@ -1574,14 +1574,17 @@ if (.not. phase_localConstitution(material_phase(g,ip,el))) then
fluxdensity = rhoSgl(1:ns,1:4) * constitutive_nonlocal_v(1:ns,1:4,g,ip,el) fluxdensity = rhoSgl(1:ns,1:4) * constitutive_nonlocal_v(1:ns,1:4,g,ip,el)
do n = 1,FE_NipNeighbors(mesh_element(2,el)) ! loop through my neighbors do n = 1,FE_NipNeighbors(mesh_element(2,el)) ! loop through my neighbors
neighboring_el = mesh_ipNeighborhood(1,n,ip,el) neighboring_el = mesh_ipNeighborhood(1,n,ip,el)
neighboring_ip = mesh_ipNeighborhood(2,n,ip,el) neighboring_ip = mesh_ipNeighborhood(2,n,ip,el)
if (neighboring_el > 0_pInt .and. neighboring_ip > 0_pInt) then ! if neighbor exists ... if (neighboring_el > 0_pInt .and. neighboring_ip > 0_pInt) then ! if neighbor exists ...
do neighboring_n = 1,FE_NipNeighbors(mesh_element(2,neighboring_el)) ! find neighboring index that points from my neighbor to myself do neighboring_n = 1,FE_NipNeighbors(mesh_element(2,neighboring_el)) ! find neighboring index that points from my neighbor to myself
if ( el == mesh_ipNeighborhood(1,neighboring_n,neighboring_ip,neighboring_el) & if ( el == mesh_ipNeighborhood(1,neighboring_n,neighboring_ip,neighboring_el) &
.and. ip == mesh_ipNeighborhood(2,neighboring_n,neighboring_ip,neighboring_el) ) & .and. ip == mesh_ipNeighborhood(2,neighboring_n,neighboring_ip,neighboring_el)) then ! possible candidate
exit if (math_mul3x3(mesh_ipAreaNormal(1:3,n,ip,el),&
mesh_ipAreaNormal(1:3,neighboring_n,neighboring_ip,neighboring_el)) < 0.0_pReal) then ! area normals have opposite orientation (we have to check that because of special case for single element with two ips and periodicity. In this case the neighbor is identical in two different directions.)
exit
endif
endif
enddo enddo
endif endif
@ -1671,11 +1674,11 @@ if (.not. phase_localConstitution(material_phase(g,ip,el))) then
endif endif
enddo ! neighbor loop enddo ! neighbor loop
constitutive_nonlocal_rhoDotFlux(1:ns,1:10,g,ip,el) = constitutive_nonlocal_rhoDotFlux(1:ns,1:10,g,ip,el) + rhoDotFlux
endif endif
if (numerics_integrationMode == 1_pInt) &
constitutive_nonlocal_rhoDotFlux(1:ns,1:10,g,ip,el) = rhoDotFlux(1:ns,1:10) ! save flux calculation for output (if in central integration mode)
!**************************************************************************** !****************************************************************************
!*** calculate dipole formation and annihilation !*** calculate dipole formation and annihilation