better encapsulation

for results operations, do not rely directly on HDF5 module
This commit is contained in:
Martin Diehl 2019-11-24 07:26:21 +01:00
parent 2e834cc3c1
commit bb73a08cf4
3 changed files with 18 additions and 5 deletions

View File

@ -6,9 +6,6 @@ module discretization
use prec
use results
#if defined(PETSc) || defined(DAMASK_HDF5)
use HDF5_utilities
#endif
implicit none
private
@ -84,7 +81,7 @@ subroutine discretization_results
#if defined(PETSc) || defined(DAMASK_HDF5)
real(pReal), dimension(:,:), allocatable :: u
call HDF5_closeGroup(results_addGroup(trim('current/geometry')))
call results_closeGroup(results_addGroup(trim('current/geometry')))
u = discretization_NodeCoords (1:3,:discretization_sharedNodesBeginn) &
- discretization_NodeCoords0(1:3,:discretization_sharedNodesBeginn)

View File

@ -119,15 +119,17 @@ subroutine mesh_init(ip,el)
reshape(connectivity_cell,[elem%NcellNodesPerCell,elem%nIPs*nElems]),&
node0_cell,ip_reshaped)
!--------------------------------------------------------------------------------------------------
! geometry information required by the nonlocal CP model
call geometry_plastic_nonlocal_setIPvolume(IPvolume(elem,node0_cell,connectivity_cell))
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_results
end subroutine mesh_init
!--------------------------------------------------------------------------------------------------
!> @brief Writes all information needed for the DADF5 geometry
!--------------------------------------------------------------------------------------------------

View File

@ -50,6 +50,7 @@ module results
results_addIncrement, &
results_addGroup, &
results_openGroup, &
results_closeGroup, &
results_writeDataset, &
results_setLink, &
results_addAttribute, &
@ -120,6 +121,7 @@ subroutine results_addIncrement(inc,time)
end subroutine results_addIncrement
!--------------------------------------------------------------------------------------------------
!> @brief open a group from the results file
!--------------------------------------------------------------------------------------------------
@ -144,6 +146,18 @@ integer(HID_T) function results_addGroup(groupName)
end function results_addGroup
!--------------------------------------------------------------------------------------------------
!> @brief close a group
!--------------------------------------------------------------------------------------------------
subroutine results_closeGroup(group_id)
integer(HID_T), intent(in) :: group_id
call HDF5_closeGroup(group_id)
end subroutine results_closeGroup
!--------------------------------------------------------------------------------------------------
!> @brief set link to object in results file
!--------------------------------------------------------------------------------------------------