2019-06-06 17:29:16 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief spatial discretization
|
2019-06-15 19:10:43 +05:30
|
|
|
!> @details serves as an abstraction layer between the different solvers and DAMASK
|
2019-06-06 17:29:16 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
module discretization
|
|
|
|
|
|
|
|
use prec
|
|
|
|
use results
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
private
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-06-07 02:19:17 +05:30
|
|
|
integer, public, protected :: &
|
2020-10-28 01:57:26 +05:30
|
|
|
discretization_nIPs, &
|
|
|
|
discretization_Nelems
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-06-07 02:19:17 +05:30
|
|
|
integer, public, protected, dimension(:), allocatable :: &
|
2021-05-22 20:51:07 +05:30
|
|
|
discretization_materialAt !ToDo: discretization_ID_material
|
2019-06-06 21:58:10 +05:30
|
|
|
|
2021-05-22 20:51:07 +05:30
|
|
|
real(pReal), public, protected, dimension(:,:), allocatable :: &
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_IPcoords0, &
|
|
|
|
discretization_IPcoords, &
|
2020-01-27 01:45:21 +05:30
|
|
|
discretization_NodeCoords0, &
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_NodeCoords
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-09-29 06:34:00 +05:30
|
|
|
integer :: &
|
2020-03-10 02:50:33 +05:30
|
|
|
discretization_sharedNodesBegin
|
2019-06-06 17:29:16 +05:30
|
|
|
|
|
|
|
public :: &
|
|
|
|
discretization_init, &
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_results, &
|
2019-09-28 02:37:34 +05:30
|
|
|
discretization_setIPcoords, &
|
|
|
|
discretization_setNodeCoords
|
2019-06-06 17:29:16 +05:30
|
|
|
|
|
|
|
contains
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-06-15 19:10:43 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief stores the relevant information in globally accesible variables
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-10-01 16:13:05 +05:30
|
|
|
subroutine discretization_init(materialAt,&
|
2019-09-29 06:34:00 +05:30
|
|
|
IPcoords0,NodeCoords0,&
|
2020-03-10 02:50:33 +05:30
|
|
|
sharedNodesBegin)
|
2019-06-06 17:29:16 +05:30
|
|
|
|
2019-06-15 19:10:43 +05:30
|
|
|
integer, dimension(:), intent(in) :: &
|
2020-10-01 16:13:05 +05:30
|
|
|
materialAt
|
2019-06-06 21:58:10 +05:30
|
|
|
real(pReal), dimension(:,:), intent(in) :: &
|
|
|
|
IPcoords0, &
|
|
|
|
NodeCoords0
|
2020-01-12 23:02:20 +05:30
|
|
|
integer, optional, intent(in) :: &
|
2020-06-21 02:21:00 +05:30
|
|
|
sharedNodesBegin !< index of first node shared among different processes (MPI)
|
2019-06-06 17:29:16 +05:30
|
|
|
|
2020-09-17 22:59:49 +05:30
|
|
|
print'(/,a)', ' <<<+- discretization init -+>>>'; flush(6)
|
2019-06-07 00:24:19 +05:30
|
|
|
|
2020-10-28 01:57:26 +05:30
|
|
|
discretization_Nelems = size(materialAt,1)
|
|
|
|
discretization_nIPs = size(IPcoords0,2)/discretization_Nelems
|
2019-06-06 17:29:16 +05:30
|
|
|
|
2021-05-22 20:51:07 +05:30
|
|
|
discretization_materialAt = materialAt
|
2019-06-07 00:24:19 +05:30
|
|
|
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_IPcoords0 = IPcoords0
|
|
|
|
discretization_IPcoords = IPcoords0
|
2019-06-07 00:24:19 +05:30
|
|
|
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_NodeCoords0 = NodeCoords0
|
|
|
|
discretization_NodeCoords = NodeCoords0
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2020-03-10 02:50:33 +05:30
|
|
|
if(present(sharedNodesBegin)) then
|
|
|
|
discretization_sharedNodesBegin = sharedNodesBegin
|
2019-09-29 06:34:00 +05:30
|
|
|
else
|
2020-03-10 02:50:33 +05:30
|
|
|
discretization_sharedNodesBegin = size(discretization_NodeCoords0,2)
|
2019-09-29 06:34:00 +05:30
|
|
|
endif
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-06-06 17:29:16 +05:30
|
|
|
end subroutine discretization_init
|
|
|
|
|
|
|
|
|
2019-06-15 19:10:43 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief write the displacements
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-06-06 17:29:16 +05:30
|
|
|
subroutine discretization_results
|
2019-12-19 00:35:51 +05:30
|
|
|
|
2019-06-06 21:58:10 +05:30
|
|
|
real(pReal), dimension(:,:), allocatable :: u
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2020-01-12 23:02:20 +05:30
|
|
|
call results_closeGroup(results_addGroup('current/geometry'))
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2020-03-10 02:50:33 +05:30
|
|
|
u = discretization_NodeCoords (1:3,:discretization_sharedNodesBegin) &
|
|
|
|
- discretization_NodeCoords0(1:3,:discretization_sharedNodesBegin)
|
2020-01-12 23:02:20 +05:30
|
|
|
call results_writeDataset('current/geometry',u,'u_n','displacements of the nodes','m')
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-09-29 06:34:00 +05:30
|
|
|
u = discretization_IPcoords &
|
|
|
|
- discretization_IPcoords0
|
2020-12-04 02:28:24 +05:30
|
|
|
call results_writeDataset('current/geometry',u,'u_p','displacements of the materialpoints (cell centers)','m')
|
2019-12-19 00:35:51 +05:30
|
|
|
|
2019-06-06 17:29:16 +05:30
|
|
|
end subroutine discretization_results
|
|
|
|
|
2019-06-06 21:58:10 +05:30
|
|
|
|
2019-06-15 19:10:43 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief stores current IP coordinates
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-06-06 21:58:10 +05:30
|
|
|
subroutine discretization_setIPcoords(IPcoords)
|
|
|
|
|
|
|
|
real(pReal), dimension(:,:), intent(in) :: IPcoords
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-06-06 21:58:10 +05:30
|
|
|
discretization_IPcoords = IPcoords
|
|
|
|
|
|
|
|
end subroutine discretization_setIPcoords
|
|
|
|
|
2019-09-28 02:37:34 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief stores current IP coordinates
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
subroutine discretization_setNodeCoords(NodeCoords)
|
|
|
|
|
|
|
|
real(pReal), dimension(:,:), intent(in) :: NodeCoords
|
2021-05-22 20:51:07 +05:30
|
|
|
|
2019-09-28 02:37:34 +05:30
|
|
|
discretization_NodeCoords = NodeCoords
|
|
|
|
|
|
|
|
end subroutine discretization_setNodeCoords
|
|
|
|
|
|
|
|
|
2019-06-06 17:29:16 +05:30
|
|
|
end module discretization
|