diff --git a/PRIVATE b/PRIVATE index a8bd47ad5..8c0a24006 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit a8bd47ad55125b477e6c03277ee38ce3998a66ca +Subproject commit 8c0a24006f355ce8d7602daa77a33348183a2bc7 diff --git a/src/grid/grid_damage_spectral.f90 b/src/grid/grid_damage_spectral.f90 index 8b544ec87..643f6a274 100644 --- a/src/grid/grid_damage_spectral.f90 +++ b/src/grid/grid_damage_spectral.f90 @@ -70,7 +70,9 @@ contains subroutine grid_damage_spectral_init() PetscInt, dimension(0:worldsize-1) :: localK + integer :: i, j, k, ce DM :: damage_grid + PetscScalar, dimension(:,:,:), pointer :: phi_PETSc Vec :: uBound, lBound integer(MPI_INTEGER_KIND) :: err_MPI PetscErrorCode :: err_PETSc @@ -110,9 +112,9 @@ subroutine grid_damage_spectral_init() !-------------------------------------------------------------------------------------------------- ! init fields - allocate(phi_current(cells(1),cells(2),cells3), source=1.0_pReal) - allocate(phi_lastInc(cells(1),cells(2),cells3), source=1.0_pReal) - allocate(phi_stagInc(cells(1),cells(2),cells3), source=1.0_pReal) + phi_current = discretization_grid_getInitialCondition('phi') + phi_lastInc = phi_current + phi_stagInc = phi_current !-------------------------------------------------------------------------------------------------- ! initialize solver specific parts of PETSc @@ -164,7 +166,17 @@ subroutine grid_damage_spectral_init() call DMRestoreGlobalVector(damage_grid,uBound,err_PETSc) CHKERRQ(err_PETSc) end if - call VecSet(solution_vec,1.0_pReal,err_PETSc) + + ce = 0 + do k = 1, cells3; do j = 1, cells(2); do i = 1, cells(1) + ce = ce + 1 + call homogenization_set_phi(phi_current(i,j,k),ce) + end do; end do; end do + + call DMDAVecGetArrayF90(damage_grid,solution_vec,phi_PETSc,err_PETSc) + CHKERRQ(err_PETSc) + phi_PETSc = phi_current + call DMDAVecRestoreArrayF90(damage_grid,solution_vec,phi_PETSc,err_PETSc) CHKERRQ(err_PETSc) call updateReference() diff --git a/src/homogenization_damage.f90 b/src/homogenization_damage.f90 index 3363408d0..d370c1c5e 100644 --- a/src/homogenization_damage.f90 +++ b/src/homogenization_damage.f90 @@ -168,7 +168,7 @@ module subroutine damage_results(ho,group) outputsLoop: do o = 1,size(prm%output) select case(prm%output(o)) case ('phi') - call results_writeDataset(damagestate_h(ho)%state(1,:),group,prm%output(o),& + call results_writeDataset(current(ho)%phi,group,prm%output(o),& 'damage indicator','-') end select end do outputsLoop