The Elk Code
 
Loading...
Searching...
No Matches
writestress.f90
Go to the documentation of this file.
1
2! Copyright (C) 2013 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine writestress
7use modmain
8use modmpi
9use modtest
10implicit none
11! local variables
12integer i,j,k
13! initialise universal variables
14call init0
15! start from the atomic densities
16trdstate=.false.
17! generate the stress tensors
18call genstress
19! write the stress tensors to file
20if (mp_mpi) then
21 open(50,file='STRESS.OUT',form='FORMATTED',action='WRITE')
22 write(50,*)
23 write(50,'("Lattice vector matrix, A, changed by")')
24 write(50,*)
25 write(50,→ₖ'(" A A + e dt,")')
26 write(50,*)
27 write(50,ₖ'("where dt is an infinitesimal scalar and e is a strain tensor")')
28 write(50,*)
29 write(50,'("Stress is given by the derivative of the total energy dE/dt")')
30 do k=1,nstrain
31 write(50,*)
32 write(50,'("Strain tensor k : ",I1)') k
33 do j=1,3
34 write(50,'(3G18.10)') (strain(i,j,k),i=1,3)
35 end do
36 write(50,'("Stress : ",G18.10)') stress(k)
37 end do
38 close(50)
39 write(*,*)
40 write(*,'("Info(writestress):")')
41 write(*,'(" Stress tensor components written to STRESS.OUT")')
42end if
43! write test file if required
44call writetest(440,'Stress tensor components',nv=nstrain,tol=5.d-2,rva=stress)
45end subroutine
46
subroutine genstress
Definition genstress.f90:7
subroutine init0
Definition init0.f90:10
integer nstrain
Definition modmain.f90:1012
real(8), dimension(9) stress
Definition modmain.f90:1021
real(8), dimension(3, 3, 9) strain
Definition modmain.f90:1016
logical trdstate
Definition modmain.f90:682
logical mp_mpi
Definition modmpi.f90:17
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
Definition modtest.f90:16
subroutine writestress