Merge branch 'write_displacements' into 'development'

writing out nodal displacements

See merge request damask/DAMASK!407
This commit is contained in:
Abisheik Panneerselvam 2021-07-03 18:02:38 +00:00
commit 0ad4fd00b1
7 changed files with 374804 additions and 323847 deletions

@ -1 +1 @@
Subproject commit 1361c4a9f090a76dfcec5bd6dd4eb5e3b4b78cb2 Subproject commit d399050216d814627edbe0ff1c05afe8f76c7b40

View File

@ -23,6 +23,11 @@ phase:
xi_inf_sl: [63e6] xi_inf_sl: [63e6]
material: material:
- constituents:
- O: [1., 0., 0., 0.] # dummy material
v: 1.0
phase: Aluminum
homogenization: SX
- constituents: - constituents:
- O: [0.12807292351503236, 0.22200469518411023, 0.6352813278477609, -0.7285114110750144] - O: [0.12807292351503236, 0.22200469518411023, 0.6352813278477609, -0.7285114110750144]
v: 1.0 v: 1.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,12 @@
$Loadcase 1 time 0.0005 incs 1 frequency 5 $Loadcase 1 time 0.0005 incs 1 frequency 5
Face 1 X 0.01 Face 1 X 0.01
Face 2 X 0.00 Face 2 X 0.00
Face 2 Y 0.00
Face 2 Z 0.00
$EndLoadcase $EndLoadcase
$Loadcase 2 time 10.0 incs 200 frequency 5 $Loadcase 2 time 10.0 incs 200 frequency 5
Face 1 X 0.01 Face 1 X 0.01
Face 2 X 0.00 Face 2 X 0.00
Face 2 Y 0.00
Face 2 Z 0.00
$EndLoadcase $EndLoadcase

View File

@ -372,6 +372,7 @@ program DAMASK_mesh
if (mod(inc,loadCases(currentLoadCase)%outputFrequency) == 0) then ! at output frequency if (mod(inc,loadCases(currentLoadCase)%outputFrequency) == 0) then ! at output frequency
print'(/,a)', ' ... writing results to file ......................................' print'(/,a)', ' ... writing results to file ......................................'
call FEM_mechanical_updateCoords
call CPFEM_results(totalIncsCounter,time) call CPFEM_results(totalIncsCounter,time)
endif endif

View File

@ -16,6 +16,7 @@ module mesh_mechanical_FEM
use prec use prec
use FEM_utilities use FEM_utilities
use discretization
use discretization_mesh use discretization_mesh
use DAMASK_interface use DAMASK_interface
use config use config
@ -67,7 +68,8 @@ module mesh_mechanical_FEM
public :: & public :: &
FEM_mechanical_init, & FEM_mechanical_init, &
FEM_mechanical_solution, & FEM_mechanical_solution, &
FEM_mechanical_forward FEM_mechanical_forward, &
FEM_mechanical_updateCoords
contains contains
@ -664,4 +666,40 @@ subroutine FEM_mechanical_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reaso
end subroutine FEM_mechanical_converged end subroutine FEM_mechanical_converged
!--------------------------------------------------------------------------------------------------
!> @brief Calculate current coordinates (FEM nodal coordinates only at the moment)
!--------------------------------------------------------------------------------------------------
subroutine FEM_mechanical_updateCoords()
real(pReal), pointer, dimension(:) :: &
nodeCoords_linear !< nodal coordinates (dimPlex*Nnodes)
real(pReal), pointer, dimension(:,:) :: &
nodeCoords !< nodal coordinates (3,Nnodes)
DM :: dm_local
Vec :: x_local
PetscErrorCode :: ierr
PetscInt :: dimPlex, pStart, pEnd, p, s, e
PetscSection :: section
call SNESGetDM(mechanical_snes,dm_local,ierr); CHKERRQ(ierr)
call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr)
call DMGetLocalVector(dm_local,x_local,ierr); CHKERRQ(ierr)
call DMGetDimension(dm_local,dimPlex,ierr); CHKERRQ(ierr)
call DMPlexGetDepthStratum(dm_local,0,pStart,pEnd,ierr); CHKERRQ(ierr)
allocate(nodeCoords(3,pStart:pEnd-1),source=0.0_pReal)
call VecGetArrayF90(x_local,nodeCoords_linear,ierr); CHKERRQ(ierr)
do p=pStart, pEnd-1
call DMPlexGetPointLocal(dm_local, p, s, e, ierr); CHKERRQ(ierr)
nodeCoords(1:dimPlex,p)=nodeCoords_linear(s+1:e)
end do
call discretization_setNodeCoords(nodeCoords)
call VecRestoreArrayF90(x_local,nodeCoords_linear,ierr); CHKERRQ(ierr)
call DMRestoreLocalVector(dm_local,x_local,ierr); CHKERRQ(ierr)
end subroutine FEM_mechanical_updateCoords
end module mesh_mechanical_FEM end module mesh_mechanical_FEM