43 use,
intrinsic :: iso_fortran_env
91 type(namespace_t),
intent(in) :: namespace
92 type(grid_t),
intent(inout) :: gr
93 type(hamiltonian_elec_t),
intent(inout) :: hm
94 type(states_elec_t),
intent(inout) :: st
95 type(ions_t),
intent(inout) :: ions
96 type(v_ks_t),
intent(in) :: ks
97 type(partner_list_t),
intent(in) :: ext_partners
99 real(real64),
allocatable :: rho_total(:)
100 real(real64) :: stress(3,3)
101 real(real64) :: stress_kin(3,3), stress_Hartree(3,3), stress_xc(3,3), stress_xc_nlcc(3,3)
102 real(real64) :: stress_ps(3,3), stress_ps_nl(3,3), stress_ps_local(3,3), stress_ii(3,3)
103 real(real64) :: stress_hubbard(3,3)
105 real(real64),
allocatable :: vh(:)
106 real(real64),
allocatable :: grad_vh(:,:)
107 real(real64) :: ehartree
113 write(
message(1),
'(a)')
'The stress tensors for real wavefunctions has not been implemented!'
115 if (hm%kpoints%full%npoints == 1)
then
116 write(
message(2),
'(a)')
'For testing this feature, you can add ForceComplex=yes to the input file'
123 if (ions%space%periodic_dim == 1)
then
127 if ( .not. (ks%theory_level ==
kohn_sham_dft .and.
in_family(hm%xc%family, [xc_family_lda, xc_family_gga])) &
129 write(
message(1),
'(a)')
'The stress tensor computation is currently only possible at the Kohn-Sham DFT level'
130 write(
message(2),
'(a)')
'with LDA and GGA functionals or for independent particles.'
134 if (
in_family(hm%xc%family, [xc_family_gga]) .and. st%d%ispin ==
spinors)
then
138 if (ks%vdw%vdw_correction /= option__vdwcorrection__none .and. ks%vdw%vdw_correction /= option__vdwcorrection__vdw_d3)
then
139 write(
message(1),
'(a)')
'The stress tensor is currently only implemented with DFT-D3 vdW correction'
143 if (hm%pcm%run_pcm)
then
147 if (
allocated(hm%v_static))
then
151 if (ks%has_photons)
then
155 if (.not. hm%vnl%apply_projector_matrices)
then
165 safe_allocate(rho_total(1:gr%np_part))
167 rho_total(ip) = sum(st%rho(ip, 1:st%d%nspin))
176 safe_allocate(vh(1:gr%np_part))
177 safe_allocate(grad_vh(1:gr%np, 1:gr%der%dim))
179 ehartree = hm%energy%hartree
187 call stress_from_kinetic(gr, ions%space, hm, st, gr%symm, ions%latt%rcell_volume, stress_kin)
188 stress = stress + stress_kin
194 call stress_from_hartree(gr, ions%space, ions%latt%rcell_volume, vh, grad_vh, ehartree, stress_hartree)
195 stress = stress + stress_hartree
197 call stress_from_xc(hm%energy, ions%latt%rcell_volume, ions%space%periodic_dim, stress_xc)
200 if (
allocated(st%rho_core))
then
202 stress_xc = stress_xc + stress_xc_nlcc
205 stress_xc = stress_xc + ks%stress_xc_gga / ions%latt%rcell_volume
206 stress = stress + stress_xc
211 stress_ps = stress_ps_local
212 stress = stress + stress_ps_local
214 safe_deallocate_a(vh)
215 safe_deallocate_a(grad_vh)
218 stress_ps = stress_ps + stress_ps_nl
219 stress = stress + stress_ps_nl
221 call stress_from_hubbard(namespace, gr, st, hm, ions%space, ions%latt%rcell_volume, stress_hubbard)
222 stress = stress + stress_hubbard
224 call ion_interaction_stress(ions%ion_interaction, ions%space, ions%latt, ions%atom, ions%natoms, ions%pos, stress_ii)
225 stress = stress + stress_ii
232 st%stress_tensors%kinetic = stress_kin
233 st%stress_tensors%Hartree = stress_hartree
234 st%stress_tensors%xc = stress_xc
235 st%stress_tensors%ps_local = stress_ps_local
236 st%stress_tensors%ps_nl = stress_ps_nl
237 st%stress_tensors%hubbard = stress_hubbard
238 st%stress_tensors%ion_ion = stress_ii
241 if (ks%vdw%vdw_correction /= option__vdwcorrection__none)
then
242 st%stress_tensors%vdw = hm%ep%vdw_stress
244 st%stress_tensors%vdw =
m_zero
246 stress = stress + st%stress_tensors%vdw
249 if (hm%kpoints%use_symmetries)
then
255 st%stress_tensors%total = stress
259 st%stress_tensors%kinetic_sumrule =
m_zero
261 st%stress_tensors%Hartree_sumrule =
m_zero
262 if(ions%space%periodic_dim == 3)
then
263 st%stress_tensors%kinetic_sumrule = (stress_kin(1,1) + stress_kin(2,2) + stress_kin(3,3))*ions%latt%rcell_volume
264 st%stress_tensors%kinetic_sumrule = st%stress_tensors%kinetic_sumrule -
m_two * hm%energy%kinetic
267 st%stress_tensors%hartree_sumrule = (stress_hartree(1,1) + stress_hartree(2,2) + stress_hartree(3,3))*ions%latt%rcell_volume
268 st%stress_tensors%hartree_sumrule = st%stress_tensors%hartree_sumrule - hm%energy%hartree
271 safe_deallocate_a(rho_total)
293 type(
grid_t),
intent(in) :: gr
294 class(
space_t),
intent(in) :: space
298 real(real64),
intent(in) :: rcell_volume
299 real(real64),
intent(out) :: stress_kin(3, 3)
301 integer :: ik, ist, idir, jdir, ib, minst, maxst
302 complex(real64),
allocatable :: stress_l_block(:)
310 safe_allocate(stress_l_block(1:st%block_size))
312 do ik = st%d%kpt%start, st%d%kpt%end
315 do ib = st%group%block_start, st%group%block_end
325 do idir = 1, space%periodic_dim
326 do jdir = idir, space%periodic_dim
329 do ist = minst, maxst
330 stress_kin(idir,jdir) = stress_kin(idir,jdir) &
331 + st%kweights(ik) * st%occ(ist, ik) &
332 * real(stress_l_block(ist - minst + 1), real64)
337 do idir = 1, space%dim
338 call gpsib(idir)%end()
345 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
354 if (hm%kpoints%use_symmetries)
then
358 stress_kin = stress_kin / rcell_volume
382 type(
grid_t),
intent(in) :: gr
383 class(
space_t),
intent(in) :: space
384 real(real64),
intent(in) :: volume
385 real(real64),
intent(in) :: vh(:)
386 real(real64),
intent(in) :: grad_vh(:,:)
387 real(real64),
intent(in) :: ehartree
388 real(real64),
intent(out) :: stress_Hartree(3, 3)
390 integer :: idir, jdir
395 stress_hartree(:,:) =
m_zero
397 do idir = 1, space%periodic_dim
398 do jdir = idir, space%periodic_dim
399 stress_hartree(idir, jdir) = -
dmf_dotp(gr, grad_vh(:,idir), grad_vh(:, jdir))/
m_four/
m_pi
401 stress_hartree(idir, idir) = stress_hartree(idir, idir) + ehartree
406 stress_hartree = stress_hartree/volume
430 subroutine stress_from_xc(energy, rcell_volume, periodic_dim, stress_xc)
431 type(
energy_t),
intent(in) :: energy
432 real(real64),
intent(in) :: rcell_volume
433 integer,
intent(in) :: periodic_dim
434 real(real64),
intent(out) :: stress_xc(3, 3)
442 do idir = 1, periodic_dim
443 stress_xc(idir, idir) = - energy%exchange - energy%correlation + energy%intnvxc
445 stress_xc(:,:) = stress_xc(:,:) / rcell_volume
460 real(real64),
intent(in) :: rcell_volume
461 type(
grid_t),
intent(in) :: gr
463 type(
ions_t),
intent(in) :: ions
464 real(real64),
intent(in) :: vxc(:,:)
465 real(real64),
intent(out) :: stress_xc_nlcc(3, 3)
467 integer :: idir, jdir, iat
468 real(real64),
allocatable :: gnlcc(:,:), gnlcc_x(:,:,:), vxc_tot(:)
473 assert(
allocated(st%rho_core))
478 safe_allocate(gnlcc(gr%np, gr%der%dim))
479 safe_allocate(gnlcc_x(gr%np, gr%der%dim, gr%der%dim))
481 do iat = ions%atoms_dist%start, ions%atoms_dist%end
482 assert(ions%atom(iat)%species%is_ps())
484 ions%pos(:,iat), gr, gnlcc, gnlcc_x)
486 safe_deallocate_a(gnlcc)
488 if (ions%atoms_dist%parallel)
then
493 safe_allocate(vxc_tot(1:gr%np))
494 vxc_tot = vxc(1:gr%np, 1)
495 if(st%d%nspin > 1) vxc_tot = vxc_tot + vxc(1:gr%np, 2)
497 do idir = 1, ions%space%periodic_dim
498 do jdir = idir, ions%space%periodic_dim
499 stress_xc_nlcc(idir, jdir) =
dmf_dotp(gr, vxc_tot, gnlcc_x(:,idir, jdir))
502 safe_deallocate_a(vxc_tot)
503 safe_deallocate_a(gnlcc_x)
507 stress_xc_nlcc(:,:) = stress_xc_nlcc(:,:) / rcell_volume
533 type(
grid_t),
target,
intent(in) :: gr
536 type(
ions_t),
intent(in) :: ions
537 real(real64),
intent(out) :: stress_ps_nl(3, 3)
539 integer :: ik, ist, idir, jdir
540 integer :: ib, minst, maxst
541 type(
wfs_elec_t) :: psib, rvnl_psib(3), gpsib(3)
542 complex(real64),
allocatable :: stress_tmp(:)
549 safe_allocate(stress_tmp(1:st%block_size))
553 do ik = st%d%kpt%start, st%d%kpt%end
557 do ib = st%group%block_start, st%group%block_end
568 do idir = 1, gr%der%dim
569 call psib%copy_to(rvnl_psib(idir))
572 call hm%vnl%zr_vn_local(gr, st%d, gr%der%boundaries%spiral, psib, rvnl_psib)
574 do idir = 1, ions%space%periodic_dim
575 do jdir = idir, ions%space%periodic_dim
578 do ist = minst, maxst
579 stress_ps_nl(idir, jdir) = stress_ps_nl(idir, jdir) &
580 +
m_two * st%kweights(ik) * st%occ(ist, ik) * real(stress_tmp(ist-minst+1), real64)
586 do idir = 1, gr%der%dim
587 call rvnl_psib(idir)%end()
588 call gpsib(idir)%end()
594 safe_deallocate_a(stress_tmp)
596 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
604 if (hm%kpoints%use_symmetries)
then
609 do idir = 1, ions%space%periodic_dim
610 stress_ps_nl(idir, idir) = stress_ps_nl(idir, idir) + hm%energy%extern_non_local
613 stress_ps_nl = stress_ps_nl/ions%latt%rcell_volume
639 type(
grid_t),
target,
intent(in) :: gr
642 type(
ions_t),
intent(in) :: ions
643 real(real64),
contiguous,
intent(inout) :: rho_total(:)
644 real(real64),
intent(in) :: vh(:)
645 real(real64),
intent(in) :: grad_vh(:,:)
646 real(real64),
intent(out) :: stress_ps_local(3, 3)
649 real(real64) :: stress_SR(3, 3), stress_LR(3, 3)
650 real(real64) :: energy_ps_SR, charge, zi
651 real(real64),
allocatable :: vloc(:), rvloc(:,:), rho_local_lr(:), rho_lr(:)
652 real(real64),
allocatable :: grad_rho(:,:), rho_lr_x(:,:), vlr(:), grad_vlr(:,:)
653 integer :: idir, jdir, iatom
654 type(
ps_t),
pointer :: spec_ps
662 safe_allocate(vloc(1:gr%np))
664 safe_allocate(rvloc(1:gr%np, 1:gr%der%dim))
666 do iatom = 1, ions%natoms
669 safe_deallocate_a(vloc)
671 safe_allocate(grad_rho(1:gr%np,1:gr%der%dim))
674 energy_ps_sr = hm%energy%extern_local
675 do idir = 1, ions%space%periodic_dim
676 do jdir = idir, ions%space%periodic_dim
677 stress_sr(idir, jdir) = stress_sr(idir, jdir) &
678 +
dmf_dotp(gr, rvloc(:, jdir), grad_rho(:, idir))
680 stress_sr(idir,idir) = stress_sr(idir,idir) + energy_ps_sr
685 stress_sr = stress_sr/ions%latt%rcell_volume
687 safe_deallocate_a(rvloc)
688 safe_deallocate_a(grad_rho)
696 safe_allocate(rho_lr(1:gr%np_part))
697 safe_allocate(rho_lr_x(1:gr%np, 1:gr%der%dim))
700 safe_allocate(rho_local_lr(1:gr%np))
701 do iatom = ions%atoms_dist%start, ions%atoms_dist%end
702 assert(ions%atom(iatom)%species%is_ps())
704 ions%pos(:, iatom), gr, rho_local_lr, nlr_x=rho_lr_x)
708 safe_deallocate_a(rho_local_lr)
710 if (ions%atoms_dist%parallel)
then
715 do idir = 1, ions%space%periodic_dim
716 do jdir = idir, ions%space%periodic_dim
717 stress_lr(idir, jdir) = stress_lr(idir, jdir) +
dmf_dotp(gr, rho_lr_x(:,jdir), grad_vh(:, idir))
720 safe_deallocate_a(rho_lr_x)
722 safe_allocate(vlr(1:gr%np_part))
729 safe_deallocate_a(rho_lr)
731 safe_allocate(grad_vlr(1:gr%np, 1:gr%der%dim))
733 safe_deallocate_a(vlr)
735 do idir = 1, ions%space%periodic_dim
736 do jdir = idir, ions%space%periodic_dim
737 stress_lr(idir, jdir) = stress_lr(idir, jdir) -
dmf_dotp(gr, grad_vh(:,idir), grad_vlr(:, jdir))/
m_two/
m_pi
743 safe_deallocate_a(grad_vlr)
747 if (ions%space%periodic_dim == 3)
then
749 do iatom = 1, ions%natoms
750 charge = charge + ions%atom(iatom)%species%get_zval()
753 do iatom = 1, ions%natoms
754 select type(spec => ions%atom(iatom)%species)
759 do idir = 1, ions%space%periodic_dim
760 stress_lr(idir, idir) = stress_lr(idir, idir) &
761 +
m_two*
m_pi*spec_ps%sigma_erf**2*charge*zi /ions%latt%rcell_volume
767 stress_lr = stress_lr/ions%latt%rcell_volume
769 stress_ps_local = stress_sr + stress_lr
778 class(
mesh_t),
intent(in) :: mesh
779 type(
ions_t),
intent(in) :: ions
780 integer,
intent(in) :: iatom
781 real(real64),
intent(inout) :: vpsl(:)
782 real(real64),
intent(inout) :: rvpsl(:,:)
785 real(real64) :: radius, vl_ip
787 type(
ps_t),
pointer :: ps
791 if (.not. ions%atom(iatom)%species%is_ps())
then
798 select type(spec=>ions%atom(iatom)%species)
803 radius = ps%vl%x_threshold*1.05_real64
805 call submesh_init(sphere, ions%space, mesh, ions%latt, ions%pos(:, iatom), radius)
811 vpsl(sphere%map(ip)) = vpsl(sphere%map(ip)) + vl_ip
812 rvpsl(sphere%map(ip), 1:ions%space%periodic_dim) = rvpsl(sphere%map(ip), 1:ions%space%periodic_dim) &
813 + sphere%rel_x(1:ions%space%periodic_dim, ip) * vl_ip
843 type(
grid_t),
target,
intent(in) :: gr
846 type(
space_t),
intent(in) :: space
847 real(real64),
intent(in) :: rcell_volume
848 real(real64),
intent(out) :: stress_hubbard(3, 3)
850 integer :: ik, ist, idir, jdir
851 integer :: ib, minst, maxst
852 type(
wfs_elec_t) :: psib, rvu_psib(3), gpsib(3)
853 complex(real64),
allocatable :: stress_tmp(:)
864 safe_allocate(stress_tmp(1:st%block_size))
868 do ik = st%d%kpt%start, st%d%kpt%end
872 do ib = st%group%block_start, st%group%block_end
882 do idir = 1, gr%der%dim
883 call psib%copy_to(rvu_psib(idir))
887 call zlda_u_rvu(hm%lda_u, gr, space, hm%d, namespace, psib, rvu_psib)
893 do ist = minst, maxst
894 stress_hubbard(idir, jdir) = stress_hubbard(idir, jdir) &
895 +
m_two * st%kweights(ik) * st%occ(ist, ik) * real(stress_tmp(ist-minst+1), real64)
901 do idir = 1, gr%der%dim
902 call rvu_psib(idir)%end()
903 call gpsib(idir)%end()
909 safe_deallocate_a(stress_tmp)
911 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
919 if (hm%kpoints%use_symmetries)
then
925 stress_hubbard(idir, idir) = stress_hubbard(idir, idir) + hm%energy%int_dft_u
928 stress_hubbard = stress_hubbard/rcell_volume
935 subroutine output_stress(iunit, space_dim, stress_tensors, all_terms)
936 integer,
intent(in) :: iunit
937 integer,
intent(in) :: space_dim
938 type(
stress_t),
intent(in) :: stress_tensors
939 logical,
optional,
intent(in) :: all_terms
941 logical :: write_all_terms
942 character(len=16) :: stress_unit
944 if (
present(all_terms))
then
945 write_all_terms = all_terms
947 write_all_terms = .
true.
955 if (write_all_terms)
then
956 write(iunit,
'(3a)')
'Kinetic stress tensor [', trim(stress_unit),
'] ='
958 if (space_dim == 3)
then
959 write(iunit,
'(a, es15.6, 3a)')
'Kinetic pressure sumrule violation: ', &
966 write(iunit,
'(3a)')
'Hartree stress tensor [', trim(stress_unit),
'] ='
968 if (space_dim == 3)
then
969 write(iunit,
'(a, es15.6, 3a)')
'Hartree pressure sumrule violation: ', &
975 write(iunit,
'(3a)')
'XC stress tensor [', trim(stress_unit),
'] ='
978 write(iunit,
'(3a)')
'Local pseudo. stress tensor [', trim(stress_unit),
'] ='
981 write(iunit,
'(3a)')
'Nonlocal pseudo. stress tensor [', trim(stress_unit),
'] ='
984 write(iunit,
'(3a)')
'Ion-ion stress tensor [', trim(stress_unit),
'] ='
987 write(iunit,
'(3a)')
'vdW stress tensor [', trim(stress_unit),
'] ='
990 write(iunit,
'(3a)')
'Hubbard stress tensor [', trim(stress_unit),
'] ='
994 write(iunit,
'(3a)')
'Total stress tensor [', trim(stress_unit),
'] ='
1002 integer,
intent(in) :: iunit
1003 integer,
intent(in) :: space_dim
1004 real(real64),
intent(in) :: total_stress_tensor(3,3)
1007 real(real64),
parameter :: au_to_GPa = 29421.02648438959_real64
1010 real(real64) :: pressure =
m_zero
1011 character(len=16) :: stress_unit
1016 do idim = 1, space_dim
1017 pressure = pressure - total_stress_tensor(idim, idim) / real(space_dim, real64)
1020 write(iunit,
'(3a,es16.8)', advance=
"no")
'Pressure [', trim(stress_unit),
'] = ', &
1022 if (space_dim == 3)
then
1023 write(iunit,
'(2x,a,f16.8)')
'Pressure [GPa] = ', pressure * au_to_gpa
1031 integer,
intent(in) :: ounit
1032 integer,
intent(in) :: space_dim
1033 real(real64),
intent(in) :: tensor(3,3)
1035 real(real64) :: tensor_with_unit(3,3)
1036 integer :: idim, jdim
1040 write(ounit,
'(a9,2x)', advance=
"no")
"T_{ij}"
1041 do jdim = 1, space_dim
1042 write(ounit,
'(i18)', advance=
"no") jdim
1045 do idim = 1, space_dim
1046 write(ounit,
'(i9,2x)', advance=
"no") idim
1047 do jdim = 1, space_dim
1048 write(ounit,
'(es18.9)', advance=
"no") tensor_with_unit(idim, jdim)
constant times a vector plus a vector
Copies a vector x, to a vector y.
This module implements common operations on batches of mesh functions.
subroutine, public batch_set_zero(this, np, async)
fill all mesh functions of the batch with zero
Module implementing boundary conditions in Octopus.
This module implements a calculator for the density and defines related functions.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_grad(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the gradient to a mesh function
subroutine, public zderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, metric, factor)
apply the gradient to a batch of mesh functions
integer, parameter, public spinors
subroutine, public energy_calc_total(namespace, space, hm, gr, st, ext_partners, iunit, full)
This subroutine calculates the total energy of the system. Basically, it adds up the KS eigenvalues,...
integer, parameter, public scalar_relativistic_zora
integer, parameter, public fully_relativistic_zora
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_four
real(real64), parameter, public m_pi
some mathematical constants
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_one
This module implements the underlying real-space grid.
subroutine, public hamiltonian_elec_copy_and_set_phase(hm, gr, kpt, psib, psib_with_phase)
Copy a batch to another batch and apply the Bloch phase to it.
integer, parameter, public independent_particles
integer, parameter, public kohn_sham_dft
This module defines classes and functions for interaction partners.
subroutine, public ion_interaction_stress(this, space, latt, atom, natoms, pos, stress_ii)
Computes the contribution to the stress tensor the ion-ion energy.
integer, parameter, public dft_u_none
subroutine, public zlda_u_rvu(this, mesh, space, d, namespace, psib, gpsib)
This routine computes .
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public dsymmetrize_matrix(nn, aa)
This module defines functions over batches of mesh functions.
subroutine, public zmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
calculate the vector of dot-products of mesh functions between two batches
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
logical function mpi_grp_is_root(grp)
type(mpi_grp_t), public mpi_world
logical pure function, public poisson_solver_is_iterative(this)
subroutine, public dpoisson_solve(this, namespace, pot, rho, all_nodes, kernel)
Calculates the Poisson equation. Given the density returns the corresponding potential.
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
subroutine, public species_get_long_range_density(species, namespace, space, latt, pos, mesh, rho, sphere_inout, nlr_x)
subroutine, public species_get_nlcc_grad(species, space, latt, pos, mesh, rho_core_grad, gnlcc_x)
real(real64) function, public spline_eval(spl, x)
This module handles spin dimensions of the states and the k-point distribution.
integer pure function, public states_elec_block_max(st, ib)
return index of last state in block ib
integer pure function, public states_elec_block_min(st, ib)
return index of first state in block ib
This module implements the calculation of the stress tensor.
subroutine stress_from_kinetic(gr, space, hm, st, symm, rcell_volume, stress_kin)
Computes the contribution to the stress tensor from the kinetic energy.
subroutine stress_from_xc(energy, rcell_volume, periodic_dim, stress_xc)
Computes the contribution to the stress tensor from the xc energy.
subroutine print_stress_tensor(ounit, space_dim, tensor)
subroutine, public output_pressure(iunit, space_dim, total_stress_tensor)
subroutine epot_local_pseudopotential_sr(mesh, ions, iatom, vpsl, rvpsl)
subroutine, public stress_calculate(namespace, gr, hm, st, ions, ks, ext_partners)
This computes the total stress on the lattice.
subroutine stress_from_hubbard(namespace, gr, st, hm, space, rcell_volume, stress_hubbard)
Computes the contribution to the stress tensor from the Hubbard energy.
subroutine stress_from_xc_nlcc(rcell_volume, gr, st, ions, vxc, stress_xc_nlcc)
Computes the NLCC contribution to the stress tensor from the xc energy.
subroutine stress_from_pseudo_nonloc(gr, st, hm, ions, stress_ps_nl)
Computes the contribution to the stress tensor from the nonlocal part of the pseudopotentials.
subroutine stress_from_hartree(gr, space, volume, vh, grad_vh, ehartree, stress_Hartree)
Computes the contribution to the stress tensor from the Hartree energy.
subroutine, public output_stress(iunit, space_dim, stress_tensors, all_terms)
subroutine stress_from_pseudo_local(gr, st, hm, ions, rho_total, vh, grad_vh, stress_ps_local)
Computes the contribution from the local part of the pseudopotential.
subroutine, public submesh_end(this)
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
subroutine, public dsymmetrize_tensor_cart(symm, tensor, use_non_symmorphic)
Symmetric a rank-2 tensor defined in Cartesian space.
type(type_t), public type_cmplx
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
character(len=20) pure function, public units_abbrev(this)
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
pure logical function, public in_family(family, xc_families)
Description of the grid, containing information on derivatives, stencil, and symmetries.
Describes mesh distribution to nodes.
The states_elec_t class contains all electronic wave functions.
A submesh is a type of mesh, used for the projectors in the pseudopotentials It contains points on a ...
batches of electronic states