From e80d91e30ac4aab3c7aaca666a2b144f917aa9bc Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Mon, 10 Jan 2022 20:34:50 +0100 Subject: [PATCH 1/6] thermal restart (WIP) --- src/grid/DAMASK_grid.f90 | 9 ++++- src/grid/grid_thermal_spectral.f90 | 57 ++++++++++++++++++++++++++---- src/phase.f90 | 11 ++++++ src/phase_thermal.f90 | 32 +++++++++++++++++ 4 files changed, 101 insertions(+), 8 deletions(-) diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index b1da0c2a2..a5f441cc0 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -466,7 +466,14 @@ program DAMASK_grid call MPI_Allreduce(interface_SIGUSR2,signal,1,MPI_LOGICAL,MPI_LOR,MPI_COMM_WORLD,ierr) if (ierr /= 0) error stop 'MPI error' if (mod(inc,loadCases(l)%f_restart) == 0 .or. signal) then - call mechanical_restartWrite + do field = 1, nActiveFields + select case (ID(field)) + case(FIELD_MECH_ID) + call mechanical_restartWrite + case(FIELD_THERMAL_ID) + call grid_thermal_spectral_restartWrite + end select + end do call CPFEM_restartWrite endif if (signal) call interface_setSIGUSR2(.false.) diff --git a/src/grid/grid_thermal_spectral.f90 b/src/grid/grid_thermal_spectral.f90 index 67c7ba1c3..0f539b73b 100644 --- a/src/grid/grid_thermal_spectral.f90 +++ b/src/grid/grid_thermal_spectral.f90 @@ -17,6 +17,9 @@ module grid_thermal_spectral use parallelization use IO use spectral_utilities + use DAMASK_interface + use HDF5 + use HDF5_utilities use discretization_grid use homogenization use YAML_types @@ -55,6 +58,7 @@ module grid_thermal_spectral public :: & grid_thermal_spectral_init, & grid_thermal_spectral_solution, & + grid_thermal_spectral_restartWrite, & grid_thermal_spectral_forward contains @@ -70,7 +74,9 @@ subroutine grid_thermal_spectral_init(T_0) PetscInt, dimension(0:worldsize-1) :: localK integer :: i, j, k, ce DM :: thermal_grid + real(pReal), dimension(:), allocatable :: T_restart, T_lastInc_restart PetscScalar, dimension(:,:,:), pointer :: T_PETSc + integer(HID_T) :: fileHandle, groupHandle PetscErrorCode :: ierr class(tNode), pointer :: & num_grid @@ -130,17 +136,26 @@ subroutine grid_thermal_spectral_init(T_0) xend = xstart + xend - 1 yend = ystart + yend - 1 zend = zstart + zend - 1 - allocate(T_current(grid(1),grid(2),grid3), source=0.0_pReal) - allocate(T_lastInc(grid(1),grid(2),grid3), source=0.0_pReal) - allocate(T_stagInc(grid(1),grid(2),grid3), source=0.0_pReal) + allocate(T_current(grid(1),grid(2),grid3), source=T_0) + allocate(T_lastInc(grid(1),grid(2),grid3), source=T_0) + allocate(T_stagInc(grid(1),grid(2),grid3), source=T_0) + + restartRead: if (interface_restartInc > 0) then + print'(/,1x,a,i0,a)', 'reading restart data of increment ', interface_restartInc, ' from file' + + fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r') + groupHandle = HDF5_openGroup(fileHandle,'solver') + + call HDF5_read(T_restart,groupHandle,'T',.false.) + T_current = reshape(T_restart,[grid(1),grid(2),grid3]) + call HDF5_read(T_lastInc_restart,groupHandle,'T_lastInc',.false.) + T_lastInc = reshape(T_lastInc_restart,[grid(1),grid(2),grid3]) + end if restartRead ce = 0 do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1) ce = ce + 1 - T_current(i,j,k) = T_0 - T_lastInc(i,j,k) = T_current(i,j,k) - T_stagInc(i,j,k) = T_current(i,j,k) - call homogenization_thermal_setField(T_0,0.0_pReal,ce) + call homogenization_thermal_setField(T_current(i,j,k),0.0_pReal,ce) end do; end do; end do call DMDAVecGetArrayF90(thermal_grid,solution_vec,T_PETSc,ierr); CHKERRQ(ierr) @@ -242,6 +257,34 @@ subroutine grid_thermal_spectral_forward(cutBack) end subroutine grid_thermal_spectral_forward +!-------------------------------------------------------------------------------------------------- +!> @brief Write current solver and constitutive data for restart to file +!-------------------------------------------------------------------------------------------------- +subroutine grid_thermal_spectral_restartWrite + + PetscErrorCode :: ierr + DM :: dm_local + integer(HID_T) :: fileHandle, groupHandle + PetscScalar, dimension(:,:,:), pointer :: T + + call SNESGetDM(thermal_snes,dm_local,ierr); CHKERRQ(ierr) + call DMDAVecGetArrayF90(dm_local,solution_vec,T,ierr); CHKERRQ(ierr) + + print'(1x,a)', 'writing solver data required for restart to file'; flush(IO_STDOUT) + + fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','w') + groupHandle = HDF5_addGroup(fileHandle,'solver') + call HDF5_write(T,groupHandle,'T') + call HDF5_write(T_lastInc,groupHandle,'T_lastInc') + call HDF5_closeGroup(groupHandle) + call HDF5_closeFile(fileHandle) + + call DMDAVecRestoreArrayF90(dm_local,solution_vec,T,ierr); CHKERRQ(ierr) + +end subroutine grid_thermal_spectral_restartWrite + + + !-------------------------------------------------------------------------------------------------- !> @brief forms the spectral thermal residual vector !-------------------------------------------------------------------------------------------------- diff --git a/src/phase.f90 b/src/phase.f90 index 6035b4491..9ee3d5a4b 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -123,11 +123,20 @@ module phase integer, intent(in) :: ph end subroutine mechanical_restartWrite + module subroutine thermal_restartWrite(groupHandle,ph) + integer(HID_T), intent(in) :: groupHandle + integer, intent(in) :: ph + end subroutine thermal_restartWrite + module subroutine mechanical_restartRead(groupHandle,ph) integer(HID_T), intent(in) :: groupHandle integer, intent(in) :: ph end subroutine mechanical_restartRead + module subroutine thermal_restartRead(groupHandle,ph) + integer(HID_T), intent(in) :: groupHandle + integer, intent(in) :: ph + end subroutine thermal_restartRead module function mechanical_S(ph,en) result(S) integer, intent(in) :: ph,en @@ -640,6 +649,7 @@ subroutine phase_restartWrite(fileHandle) groupHandle(2) = HDF5_addGroup(groupHandle(1),material_name_phase(ph)) call mechanical_restartWrite(groupHandle(2),ph) + call thermal_restartWrite(groupHandle(2),ph) call HDF5_closeGroup(groupHandle(2)) @@ -668,6 +678,7 @@ subroutine phase_restartRead(fileHandle) groupHandle(2) = HDF5_openGroup(groupHandle(1),material_name_phase(ph)) call mechanical_restartRead(groupHandle(2),ph) + call thermal_restartRead(groupHandle(2),ph) call HDF5_closeGroup(groupHandle(2)) diff --git a/src/phase_thermal.f90 b/src/phase_thermal.f90 index a3e4dd628..fb98039fd 100644 --- a/src/phase_thermal.f90 +++ b/src/phase_thermal.f90 @@ -254,6 +254,38 @@ function integrateThermalState(Delta_t, ph,en) result(broken) end function integrateThermalState +module subroutine thermal_restartWrite(groupHandle,ph) + + integer(HID_T), intent(in) :: groupHandle + integer, intent(in) :: ph + + integer(HID_T) :: new_group + integer :: so + + do so = 1,thermal_Nsources(ph) + !new_group = HDF5_addGroup(groupHandle, + call HDF5_write(thermalState(ph)%p(so)%state,groupHandle,'omega2') + enddo + +end subroutine thermal_restartWrite + + +module subroutine thermal_restartRead(groupHandle,ph) + + integer(HID_T), intent(in) :: groupHandle + integer, intent(in) :: ph + + integer(HID_T) :: new_group + integer :: so + + do so = 1,thermal_Nsources(ph) + !new_group = HDF5_addGroup(groupHandle, + call HDF5_read(thermalState(ph)%p(so)%state0,groupHandle,'omega2') + enddo + +end subroutine thermal_restartRead + + module subroutine thermal_forward() integer :: ph, so From 236f0297ac21b76bfd8d69124a0ffff1443c9d2d Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 12 Jan 2022 20:42:37 +0100 Subject: [PATCH 2/6] test added --- PRIVATE | 2 +- src/grid/grid_thermal_spectral.f90 | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/PRIVATE b/PRIVATE index b898a8b55..f3b0cfa68 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit b898a8b5552bd9d1c555edc3d8134564dd32fe53 +Subproject commit f3b0cfa68febbc90369e414c38733ccdc22258bb diff --git a/src/grid/grid_thermal_spectral.f90 b/src/grid/grid_thermal_spectral.f90 index 0f539b73b..3b4ded7e6 100644 --- a/src/grid/grid_thermal_spectral.f90 +++ b/src/grid/grid_thermal_spectral.f90 @@ -74,7 +74,6 @@ subroutine grid_thermal_spectral_init(T_0) PetscInt, dimension(0:worldsize-1) :: localK integer :: i, j, k, ce DM :: thermal_grid - real(pReal), dimension(:), allocatable :: T_restart, T_lastInc_restart PetscScalar, dimension(:,:,:), pointer :: T_PETSc integer(HID_T) :: fileHandle, groupHandle PetscErrorCode :: ierr @@ -146,10 +145,8 @@ subroutine grid_thermal_spectral_init(T_0) fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r') groupHandle = HDF5_openGroup(fileHandle,'solver') - call HDF5_read(T_restart,groupHandle,'T',.false.) - T_current = reshape(T_restart,[grid(1),grid(2),grid3]) - call HDF5_read(T_lastInc_restart,groupHandle,'T_lastInc',.false.) - T_lastInc = reshape(T_lastInc_restart,[grid(1),grid(2),grid3]) + call HDF5_read(T_current,groupHandle,'T',.false.) + call HDF5_read(T_lastInc,groupHandle,'T_lastInc',.false.) end if restartRead ce = 0 @@ -270,10 +267,10 @@ subroutine grid_thermal_spectral_restartWrite call SNESGetDM(thermal_snes,dm_local,ierr); CHKERRQ(ierr) call DMDAVecGetArrayF90(dm_local,solution_vec,T,ierr); CHKERRQ(ierr) - print'(1x,a)', 'writing solver data required for restart to file'; flush(IO_STDOUT) + print'(1x,a)', 'writing thermal solver data required for restart to file'; flush(IO_STDOUT) - fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','w') - groupHandle = HDF5_addGroup(fileHandle,'solver') + fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','a') + groupHandle = HDF5_openGroup(fileHandle,'solver') call HDF5_write(T,groupHandle,'T') call HDF5_write(T_lastInc,groupHandle,'T_lastInc') call HDF5_closeGroup(groupHandle) From ad319efdd7049a3c81a495128c35987ab909d0b1 Mon Sep 17 00:00:00 2001 From: Sharan Date: Tue, 1 Feb 2022 22:11:02 +0100 Subject: [PATCH 3/6] updated PRIVATE repo --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index f3b0cfa68..88023f5ff 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit f3b0cfa68febbc90369e414c38733ccdc22258bb +Subproject commit 88023f5ff135b580c953e09c83e467dabba1bcd8 From 1bd654781b5931737ab113b1915e436974fe0e0c Mon Sep 17 00:00:00 2001 From: Sharan Date: Wed, 2 Feb 2022 00:02:03 +0100 Subject: [PATCH 4/6] tests updated --- PRIVATE | 2 +- python/damask/_result.py | 2 +- python/tests/test_Orientation.py | 2 +- python/tests/test_Result.py | 4 ++-- python/tests/test_Rotation.py | 2 +- python/tests/test_VTK.py | 8 ++++---- python/tests/test_grid_filters.py | 26 +++++++++++++------------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/PRIVATE b/PRIVATE index 88023f5ff..a498ed64a 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 88023f5ff135b580c953e09c83e467dabba1bcd8 +Subproject commit a498ed64ac5d98d95fc6ba14f87ca16fadbb892a diff --git a/python/damask/_result.py b/python/damask/_result.py index 02d4174c9..de51eb611 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -5,7 +5,7 @@ import os import copy import datetime import warnings -import xml.etree.ElementTree as ET +import xml.etree.ElementTree as ET # noqa import xml.dom.minidom from pathlib import Path from functools import partial diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 2a32adea4..75f42da0f 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -287,7 +287,7 @@ class TestOrientation: @pytest.mark.parametrize('family',crystal_families) @pytest.mark.parametrize('proper',[True,False]) def test_in_SST(self,family,proper): - assert Orientation(family=family).in_SST(np.zeros(3),proper) + assert Orientation(family=family).in_SST(np.zeros(3),proper) # noqa @pytest.mark.parametrize('function',['in_SST','IPF_color']) def test_invalid_argument(self,function): diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 1da56dedf..0af4353e0 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -367,7 +367,7 @@ class TestResult: @pytest.mark.parametrize('mode',['cell','node']) def test_coordinates(self,default,mode): - if mode == 'cell': + if mode == 'cell': # noqa a = grid_filters.coordinates0_point(default.cells,default.size,default.origin) b = default.coordinates0_point.reshape(tuple(default.cells)+(3,),order='F') elif mode == 'node': @@ -421,7 +421,7 @@ class TestResult: def test_XDMF_datatypes(self,tmp_path,single_phase,update,ref_path): for shape in [('scalar',()),('vector',(3,)),('tensor',(3,3)),('matrix',(12,))]: for dtype in ['f4','f8','i1','i2','i4','i8','u1','u2','u4','u8']: - single_phase.add_calculation(f"np.ones(np.shape(#F#)[0:1]+{shape[1]},'{dtype}')",f'{shape[0]}_{dtype}') + single_phase.add_calculation(f"np.ones(np.shape(#F#)[0:1]+{shape[1]},'{dtype}')",f'{shape[0]}_{dtype}') # noqa fname = os.path.splitext(os.path.basename(single_phase.fname))[0]+'.xdmf' os.chdir(tmp_path) single_phase.export_XDMF() diff --git a/python/tests/test_Rotation.py b/python/tests/test_Rotation.py index a431bc64b..9b603c3c3 100644 --- a/python/tests/test_Rotation.py +++ b/python/tests/test_Rotation.py @@ -1076,7 +1076,7 @@ class TestRotation: def test_from_fiber_component(self,N,sigma): p = [] for run in range(5): - alpha = np.random.random()*2*np.pi,np.arccos(np.random.random()) + alpha = np.random.random()*2*np.pi,np.arccos(np.random.random()) # noqa beta = np.random.random()*2*np.pi,np.arccos(np.random.random()) f_in_C = np.array([np.sin(alpha[0])*np.cos(alpha[1]), np.sin(alpha[0])*np.sin(alpha[1]), np.cos(alpha[0])]) diff --git a/python/tests/test_VTK.py b/python/tests/test_VTK.py index e59409a20..4a96fef1c 100644 --- a/python/tests/test_VTK.py +++ b/python/tests/test_VTK.py @@ -173,9 +173,9 @@ class TestVTK: polyData = VTK.from_poly_data(points) polyData.add(points,'coordinates') if update: - polyData.save(ref_path/'polyData') + polyData.save(ref_path/'polyData') # noqa else: - reference = VTK.load(ref_path/'polyData.vtp') + reference = VTK.load(ref_path/'polyData.vtp') # noqa assert polyData.__repr__() == reference.__repr__() and \ np.allclose(polyData.get('coordinates'),points) @@ -189,8 +189,8 @@ class TestVTK: rectilinearGrid.add(np.ascontiguousarray(c),'cell') rectilinearGrid.add(np.ascontiguousarray(n),'node') if update: - rectilinearGrid.save(ref_path/'rectilinearGrid') + rectilinearGrid.save(ref_path/'rectilinearGrid') # noqa else: - reference = VTK.load(ref_path/'rectilinearGrid.vtr') + reference = VTK.load(ref_path/'rectilinearGrid.vtr') # noqa assert rectilinearGrid.__repr__() == reference.__repr__() and \ np.allclose(rectilinearGrid.get('cell'),c) diff --git a/python/tests/test_grid_filters.py b/python/tests/test_grid_filters.py index d5458f0eb..6b01ff44d 100644 --- a/python/tests/test_grid_filters.py +++ b/python/tests/test_grid_filters.py @@ -8,19 +8,19 @@ from damask import seeds class TestGridFilters: def test_coordinates0_point(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) coord = grid_filters.coordinates0_point(cells,size) assert np.allclose(coord[0,0,0],size/cells*.5) and coord.shape == tuple(cells) + (3,) def test_coordinates0_node(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) coord = grid_filters.coordinates0_node(cells,size) assert np.allclose(coord[-1,-1,-1],size) and coord.shape == tuple(cells+1) + (3,) def test_coord0(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) c = grid_filters.coordinates0_point(cells+1,size+size/cells) n = grid_filters.coordinates0_node(cells,size) + size/cells*.5 @@ -28,16 +28,16 @@ class TestGridFilters: @pytest.mark.parametrize('mode',['point','node']) def test_grid_DNA(self,mode): - """Ensure that cellsSizeOrigin_coordinates0_xx is the inverse of coordinates0_xx.""" + """Ensure that cellsSizeOrigin_coordinates0_xx is the inverse of coordinates0_xx.""" # noqa cells = np.random.randint(8,32,(3)) size = np.random.random(3) origin = np.random.random(3) - coord0 = eval(f'grid_filters.coordinates0_{mode}(cells,size,origin)') # noqa + coord0 = eval(f'grid_filters.coordinates0_{mode}(cells,size,origin)') # noqa _cells,_size,_origin = eval(f'grid_filters.cellsSizeOrigin_coordinates0_{mode}(coord0.reshape(-1,3,order="F"))') assert np.allclose(cells,_cells) and np.allclose(size,_size) and np.allclose(origin,_origin) def test_displacement_fluct_equivalence(self): - """Ensure that fluctuations are periodic.""" + """Ensure that fluctuations are periodic.""" # noqa size = np.random.random(3) cells = np.random.randint(8,32,(3)) F = np.random.random(tuple(cells)+(3,3)) @@ -45,14 +45,14 @@ class TestGridFilters: grid_filters.point_to_node(grid_filters.displacement_fluct_point(size,F))) def test_interpolation_to_node(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) F = np.random.random(tuple(cells)+(3,3)) assert np.allclose(grid_filters.coordinates_node(size,F) [1:-1,1:-1,1:-1], grid_filters.point_to_node(grid_filters.coordinates_point(size,F))[1:-1,1:-1,1:-1]) def test_interpolation_to_cell(self): - cells = np.random.randint(1,30,(3)) + cells = np.random.randint(1,30,(3)) # noqa coordinates_node_x = np.linspace(0,np.pi*2,num=cells[0]+1) node_field_x = np.cos(coordinates_node_x) @@ -66,7 +66,7 @@ class TestGridFilters: @pytest.mark.parametrize('mode',['point','node']) def test_coordinates0_origin(self,mode): - origin= np.random.random(3) + origin= np.random.random(3) # noqa size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) shifted = eval(f'grid_filters.coordinates0_{mode}(cells,size,origin)') @@ -79,7 +79,7 @@ class TestGridFilters: @pytest.mark.parametrize('function',[grid_filters.displacement_avg_point, grid_filters.displacement_avg_node]) def test_displacement_avg_vanishes(self,function): - """Ensure that random fluctuations in F do not result in average displacement.""" + """Ensure that random fluctuations in F do not result in average displacement.""" # noqa size = np.random.random(3) cells = np.random.randint(8,32,(3)) F = np.random.random(tuple(cells)+(3,3)) @@ -89,7 +89,7 @@ class TestGridFilters: @pytest.mark.parametrize('function',[grid_filters.displacement_fluct_point, grid_filters.displacement_fluct_node]) def test_displacement_fluct_vanishes(self,function): - """Ensure that constant F does not result in fluctuating displacement.""" + """Ensure that constant F does not result in fluctuating displacement.""" # noqa size = np.random.random(3) cells = np.random.randint(8,32,(3)) F = np.broadcast_to(np.random.random((3,3)), tuple(cells)+(3,3)) @@ -142,13 +142,13 @@ class TestGridFilters: function(unordered,mode) def test_regrid_identity(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) F = np.broadcast_to(np.eye(3), tuple(cells)+(3,3)) assert all(grid_filters.regrid(size,F,cells) == np.arange(cells.prod())) def test_regrid_double_cells(self): - size = np.random.random(3) + size = np.random.random(3) # noqa cells = np.random.randint(8,32,(3)) g = Grid.from_Voronoi_tessellation(cells,size,seeds.from_random(size,10)) F = np.broadcast_to(np.eye(3), tuple(cells)+(3,3)) From 2a45d2d48dff8aa9c4617a9064c10051ac5cd6bd Mon Sep 17 00:00:00 2001 From: Sharan Date: Wed, 2 Feb 2022 23:00:53 +0100 Subject: [PATCH 5/6] private updated --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index a498ed64a..ebb7f0ce7 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit a498ed64ac5d98d95fc6ba14f87ca16fadbb892a +Subproject commit ebb7f0ce78d11275020af0ba60f929f95b446932 From 038cdad85e196149c60d66746fffe8c1711b8ce8 Mon Sep 17 00:00:00 2001 From: Sharan Date: Wed, 2 Feb 2022 23:22:44 +0100 Subject: [PATCH 6/6] new naming --- src/homogenization.f90 | 4 ++-- src/phase_mechanical.f90 | 4 ++-- src/phase_thermal.f90 | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index cc29ed619..3d96b007f 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -414,7 +414,7 @@ subroutine homogenization_restartWrite(fileHandle) groupHandle(2) = HDF5_addGroup(groupHandle(1),material_name_homogenization(ho)) - call HDF5_write(homogState(ho)%state,groupHandle(2),'omega') ! ToDo: should be done by mech + call HDF5_write(homogState(ho)%state,groupHandle(2),'omega_mechanical') ! ToDo: should be done by mech call HDF5_closeGroup(groupHandle(2)) @@ -441,7 +441,7 @@ subroutine homogenization_restartRead(fileHandle) groupHandle(2) = HDF5_openGroup(groupHandle(1),material_name_homogenization(ho)) - call HDF5_read(homogState(ho)%state0,groupHandle(2),'omega') ! ToDo: should be done by mech + call HDF5_read(homogState(ho)%state0,groupHandle(2),'omega_mechanical') ! ToDo: should be done by mech call HDF5_closeGroup(groupHandle(2)) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 1917d81c9..2252b941d 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -1248,7 +1248,7 @@ module subroutine mechanical_restartWrite(groupHandle,ph) integer, intent(in) :: ph - call HDF5_write(plasticState(ph)%state,groupHandle,'omega') + call HDF5_write(plasticState(ph)%state,groupHandle,'omega_plastic') call HDF5_write(phase_mechanical_Fi(ph)%data,groupHandle,'F_i') call HDF5_write(phase_mechanical_Li(ph)%data,groupHandle,'L_i') call HDF5_write(phase_mechanical_Lp(ph)%data,groupHandle,'L_p') @@ -1265,7 +1265,7 @@ module subroutine mechanical_restartRead(groupHandle,ph) integer, intent(in) :: ph - call HDF5_read(plasticState(ph)%state0,groupHandle,'omega') + call HDF5_read(plasticState(ph)%state0,groupHandle,'omega_plastic') call HDF5_read(phase_mechanical_Fi0(ph)%data,groupHandle,'F_i') call HDF5_read(phase_mechanical_Li0(ph)%data,groupHandle,'L_i') call HDF5_read(phase_mechanical_Lp0(ph)%data,groupHandle,'L_p') diff --git a/src/phase_thermal.f90 b/src/phase_thermal.f90 index fb98039fd..c7a9ea75a 100644 --- a/src/phase_thermal.f90 +++ b/src/phase_thermal.f90 @@ -263,8 +263,7 @@ module subroutine thermal_restartWrite(groupHandle,ph) integer :: so do so = 1,thermal_Nsources(ph) - !new_group = HDF5_addGroup(groupHandle, - call HDF5_write(thermalState(ph)%p(so)%state,groupHandle,'omega2') + call HDF5_write(thermalState(ph)%p(so)%state,groupHandle,'omega_thermal') enddo end subroutine thermal_restartWrite @@ -279,8 +278,7 @@ module subroutine thermal_restartRead(groupHandle,ph) integer :: so do so = 1,thermal_Nsources(ph) - !new_group = HDF5_addGroup(groupHandle, - call HDF5_read(thermalState(ph)%p(so)%state0,groupHandle,'omega2') + call HDF5_read(thermalState(ph)%p(so)%state0,groupHandle,'omega_thermal') enddo end subroutine thermal_restartRead