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. .not. any(ks%vdw%vdw_correction ==
d3_lib_options))
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
169 safe_allocate(rho_total(1:gr%np_part))
171 rho_total(ip) = sum(st%rho(ip, 1:st%d%nspin))
180 safe_allocate(vh(1:gr%np_part))
181 safe_allocate(grad_vh(1:gr%np, 1:gr%der%dim))
183 ehartree = hm%energy%hartree
191 call stress_from_kinetic(gr, ions%space, hm, st, gr%symm, ions%latt%rcell_volume, stress_kin)
192 stress = stress + stress_kin
198 call stress_from_hartree(gr, ions%space, ions%latt%rcell_volume, vh, grad_vh, ehartree, stress_hartree)
199 stress = stress + stress_hartree
201 call stress_from_xc(hm%energy, ions%latt%rcell_volume, ions%space%periodic_dim, stress_xc)
204 if (
allocated(st%rho_core))
then
206 stress_xc = stress_xc + stress_xc_nlcc
209 stress_xc = stress_xc + ks%stress_xc_gga / ions%latt%rcell_volume
210 stress = stress + stress_xc
215 stress_ps = stress_ps_local
216 stress = stress + stress_ps_local
218 safe_deallocate_a(vh)
219 safe_deallocate_a(grad_vh)
222 stress_ps = stress_ps + stress_ps_nl
223 stress = stress + stress_ps_nl
225 call stress_from_hubbard(namespace, gr, st, hm, ions%space, ions%latt%rcell_volume, stress_hubbard)
226 stress = stress + stress_hubbard
228 call ion_interaction_stress(ions%ion_interaction, ions%space, ions%latt, ions%atom, ions%natoms, ions%pos, stress_ii)
229 stress = stress + stress_ii
236 st%stress_tensors%kinetic = stress_kin
237 st%stress_tensors%Hartree = stress_hartree
238 st%stress_tensors%xc = stress_xc
239 st%stress_tensors%ps_local = stress_ps_local
240 st%stress_tensors%ps_nl = stress_ps_nl
241 st%stress_tensors%hubbard = stress_hubbard
242 st%stress_tensors%ion_ion = stress_ii
245 if (ks%vdw%vdw_correction /= option__vdwcorrection__none)
then
246 st%stress_tensors%vdw = hm%ep%vdw_stress
248 st%stress_tensors%vdw =
m_zero
250 stress = stress + st%stress_tensors%vdw
253 if (hm%kpoints%use_symmetries)
then
259 st%stress_tensors%total = stress
263 st%stress_tensors%kinetic_sumrule =
m_zero
265 st%stress_tensors%Hartree_sumrule =
m_zero
266 if(ions%space%periodic_dim == 3)
then
267 st%stress_tensors%kinetic_sumrule = (stress_kin(1,1) + stress_kin(2,2) + stress_kin(3,3))*ions%latt%rcell_volume
268 st%stress_tensors%kinetic_sumrule = st%stress_tensors%kinetic_sumrule -
m_two * hm%energy%kinetic
271 st%stress_tensors%hartree_sumrule = (stress_hartree(1,1) + stress_hartree(2,2) + stress_hartree(3,3))*ions%latt%rcell_volume
272 st%stress_tensors%hartree_sumrule = st%stress_tensors%hartree_sumrule - hm%energy%hartree
275 safe_deallocate_a(rho_total)
297 type(
grid_t),
intent(in) :: gr
298 class(
space_t),
intent(in) :: space
302 real(real64),
intent(in) :: rcell_volume
303 real(real64),
intent(out) :: stress_kin(3, 3)
305 integer :: ik, ist, idir, jdir, ib, minst, maxst
306 complex(real64),
allocatable :: stress_l_block(:)
314 safe_allocate(stress_l_block(1:st%block_size))
316 do ik = st%d%kpt%start, st%d%kpt%end
319 do ib = st%group%block_start, st%group%block_end
329 do idir = 1, space%periodic_dim
330 do jdir = idir, space%periodic_dim
333 do ist = minst, maxst
334 stress_kin(idir,jdir) = stress_kin(idir,jdir) &
335 + st%kweights(ik) * st%occ(ist, ik) &
336 * real(stress_l_block(ist - minst + 1), real64)
341 do idir = 1, space%dim
342 call gpsib(idir)%end()
349 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
358 if (hm%kpoints%use_symmetries)
then
362 stress_kin = stress_kin / rcell_volume
386 type(
grid_t),
intent(in) :: gr
387 class(
space_t),
intent(in) :: space
388 real(real64),
intent(in) :: volume
389 real(real64),
intent(in) :: vh(:)
390 real(real64),
intent(in) :: grad_vh(:,:)
391 real(real64),
intent(in) :: ehartree
392 real(real64),
intent(out) :: stress_Hartree(3, 3)
394 integer :: idir, jdir
399 stress_hartree(:,:) =
m_zero
401 do idir = 1, space%periodic_dim
402 do jdir = idir, space%periodic_dim
403 stress_hartree(idir, jdir) = -
dmf_dotp(gr, grad_vh(:,idir), grad_vh(:, jdir))/
m_four/
m_pi
405 stress_hartree(idir, idir) = stress_hartree(idir, idir) + ehartree
410 stress_hartree = stress_hartree/volume
434 subroutine stress_from_xc(energy, rcell_volume, periodic_dim, stress_xc)
435 type(
energy_t),
intent(in) :: energy
436 real(real64),
intent(in) :: rcell_volume
437 integer,
intent(in) :: periodic_dim
438 real(real64),
intent(out) :: stress_xc(3, 3)
446 do idir = 1, periodic_dim
447 stress_xc(idir, idir) = - energy%exchange - energy%correlation + energy%intnvxc
449 stress_xc(:,:) = stress_xc(:,:) / rcell_volume
464 real(real64),
intent(in) :: rcell_volume
465 type(
grid_t),
intent(in) :: gr
467 type(
ions_t),
intent(in) :: ions
468 real(real64),
intent(in) :: vxc(:,:)
469 real(real64),
intent(out) :: stress_xc_nlcc(3, 3)
471 integer :: idir, jdir, iat
472 real(real64),
allocatable :: gnlcc(:,:), gnlcc_x(:,:,:), vxc_tot(:)
477 assert(
allocated(st%rho_core))
482 safe_allocate(gnlcc(gr%np, gr%der%dim))
483 safe_allocate(gnlcc_x(gr%np, gr%der%dim, gr%der%dim))
485 do iat = ions%atoms_dist%start, ions%atoms_dist%end
486 assert(ions%atom(iat)%species%is_ps())
488 ions%pos(:,iat), gr, gnlcc, gnlcc_x)
490 safe_deallocate_a(gnlcc)
492 if (ions%atoms_dist%parallel)
then
497 safe_allocate(vxc_tot(1:gr%np))
498 vxc_tot = vxc(1:gr%np, 1)
499 if(st%d%nspin > 1) vxc_tot = vxc_tot + vxc(1:gr%np, 2)
501 do idir = 1, ions%space%periodic_dim
502 do jdir = idir, ions%space%periodic_dim
503 stress_xc_nlcc(idir, jdir) =
dmf_dotp(gr, vxc_tot, gnlcc_x(:,idir, jdir))
506 safe_deallocate_a(vxc_tot)
507 safe_deallocate_a(gnlcc_x)
511 stress_xc_nlcc(:,:) = stress_xc_nlcc(:,:) / rcell_volume
537 type(
grid_t),
target,
intent(in) :: gr
540 type(
ions_t),
intent(in) :: ions
541 real(real64),
intent(out) :: stress_ps_nl(3, 3)
543 integer :: ik, ist, idir, jdir
544 integer :: ib, minst, maxst
545 type(
wfs_elec_t) :: psib, rvnl_psib(3), gpsib(3)
546 complex(real64),
allocatable :: stress_tmp(:)
553 safe_allocate(stress_tmp(1:st%block_size))
557 do ik = st%d%kpt%start, st%d%kpt%end
561 do ib = st%group%block_start, st%group%block_end
572 do idir = 1, gr%der%dim
573 call psib%copy_to(rvnl_psib(idir))
576 call hm%vnl%zr_vn_local(gr, st%d, gr%der%boundaries%spiral, psib, rvnl_psib)
578 do idir = 1, ions%space%periodic_dim
579 do jdir = idir, ions%space%periodic_dim
582 do ist = minst, maxst
583 stress_ps_nl(idir, jdir) = stress_ps_nl(idir, jdir) &
584 +
m_two * st%kweights(ik) * st%occ(ist, ik) * real(stress_tmp(ist-minst+1), real64)
590 do idir = 1, gr%der%dim
591 call rvnl_psib(idir)%end()
592 call gpsib(idir)%end()
598 safe_deallocate_a(stress_tmp)
600 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
608 if (hm%kpoints%use_symmetries)
then
613 do idir = 1, ions%space%periodic_dim
614 stress_ps_nl(idir, idir) = stress_ps_nl(idir, idir) + hm%energy%extern_non_local
617 stress_ps_nl = stress_ps_nl/ions%latt%rcell_volume
643 type(
grid_t),
target,
intent(in) :: gr
646 type(
ions_t),
intent(in) :: ions
647 real(real64),
contiguous,
intent(inout) :: rho_total(:)
648 real(real64),
intent(in) :: vh(:)
649 real(real64),
intent(in) :: grad_vh(:,:)
650 real(real64),
intent(out) :: stress_ps_local(3, 3)
653 real(real64) :: stress_SR(3, 3), stress_LR(3, 3)
654 real(real64) :: energy_ps_SR, charge, zi
655 real(real64),
allocatable :: vloc(:), rvloc(:,:), rho_local_lr(:), rho_lr(:)
656 real(real64),
allocatable :: grad_rho(:,:), rho_lr_x(:,:), vlr(:), grad_vlr(:,:)
657 integer :: idir, jdir, iatom
658 type(
ps_t),
pointer :: spec_ps
666 safe_allocate(vloc(1:gr%np))
668 safe_allocate(rvloc(1:gr%np, 1:gr%der%dim))
670 do iatom = 1, ions%natoms
673 safe_deallocate_a(vloc)
675 safe_allocate(grad_rho(1:gr%np,1:gr%der%dim))
678 energy_ps_sr = hm%energy%extern_local
679 do idir = 1, ions%space%periodic_dim
680 do jdir = idir, ions%space%periodic_dim
681 stress_sr(idir, jdir) = stress_sr(idir, jdir) &
682 +
dmf_dotp(gr, rvloc(:, jdir), grad_rho(:, idir))
684 stress_sr(idir,idir) = stress_sr(idir,idir) + energy_ps_sr
689 stress_sr = stress_sr/ions%latt%rcell_volume
691 safe_deallocate_a(rvloc)
692 safe_deallocate_a(grad_rho)
700 safe_allocate(rho_lr(1:gr%np_part))
701 safe_allocate(rho_lr_x(1:gr%np, 1:gr%der%dim))
704 safe_allocate(rho_local_lr(1:gr%np))
705 do iatom = ions%atoms_dist%start, ions%atoms_dist%end
706 assert(ions%atom(iatom)%species%is_ps())
708 ions%pos(:, iatom), gr, rho_local_lr, nlr_x=rho_lr_x)
712 safe_deallocate_a(rho_local_lr)
714 if (ions%atoms_dist%parallel)
then
719 do idir = 1, ions%space%periodic_dim
720 do jdir = idir, ions%space%periodic_dim
721 stress_lr(idir, jdir) = stress_lr(idir, jdir) +
dmf_dotp(gr, rho_lr_x(:,jdir), grad_vh(:, idir))
724 safe_deallocate_a(rho_lr_x)
726 safe_allocate(vlr(1:gr%np_part))
733 safe_deallocate_a(rho_lr)
735 safe_allocate(grad_vlr(1:gr%np, 1:gr%der%dim))
737 safe_deallocate_a(vlr)
739 do idir = 1, ions%space%periodic_dim
740 do jdir = idir, ions%space%periodic_dim
741 stress_lr(idir, jdir) = stress_lr(idir, jdir) -
dmf_dotp(gr, grad_vh(:,idir), grad_vlr(:, jdir))/
m_two/
m_pi
747 safe_deallocate_a(grad_vlr)
751 if (ions%space%periodic_dim == 3)
then
753 do iatom = 1, ions%natoms
754 charge = charge + ions%atom(iatom)%species%get_zval()
757 do iatom = 1, ions%natoms
758 select type(spec => ions%atom(iatom)%species)
763 do idir = 1, ions%space%periodic_dim
764 stress_lr(idir, idir) = stress_lr(idir, idir) &
765 +
m_two*
m_pi*spec_ps%sigma_erf**2*charge*zi /ions%latt%rcell_volume
771 stress_lr = stress_lr/ions%latt%rcell_volume
773 stress_ps_local = stress_sr + stress_lr
782 class(
mesh_t),
intent(in) :: mesh
783 type(
ions_t),
intent(in) :: ions
784 integer,
intent(in) :: iatom
785 real(real64),
intent(inout) :: vpsl(:)
786 real(real64),
intent(inout) :: rvpsl(:,:)
789 real(real64) :: radius, vl_ip
791 type(
ps_t),
pointer :: ps
795 if (.not. ions%atom(iatom)%species%is_ps())
then
802 select type(spec=>ions%atom(iatom)%species)
807 radius = ps%vl%x_threshold*1.05_real64
809 call submesh_init(sphere, ions%space, mesh, ions%latt, ions%pos(:, iatom), radius)
815 vpsl(sphere%map(ip)) = vpsl(sphere%map(ip)) + vl_ip
816 rvpsl(sphere%map(ip), 1:ions%space%periodic_dim) = rvpsl(sphere%map(ip), 1:ions%space%periodic_dim) &
817 + sphere%rel_x(1:ions%space%periodic_dim, ip) * vl_ip
847 type(
grid_t),
target,
intent(in) :: gr
850 type(
space_t),
intent(in) :: space
851 real(real64),
intent(in) :: rcell_volume
852 real(real64),
intent(out) :: stress_hubbard(3, 3)
854 integer :: ik, ist, idir, jdir
855 integer :: ib, minst, maxst
856 type(
wfs_elec_t) :: psib, rvu_psib(3), gpsib(3)
857 complex(real64),
allocatable :: stress_tmp(:)
868 safe_allocate(stress_tmp(1:st%block_size))
872 do ik = st%d%kpt%start, st%d%kpt%end
876 do ib = st%group%block_start, st%group%block_end
886 do idir = 1, gr%der%dim
887 call psib%copy_to(rvu_psib(idir))
891 call zlda_u_rvu(hm%lda_u, gr, space, hm%d, namespace, psib, rvu_psib)
897 do ist = minst, maxst
898 stress_hubbard(idir, jdir) = stress_hubbard(idir, jdir) &
899 +
m_two * st%kweights(ik) * st%occ(ist, ik) * real(stress_tmp(ist-minst+1), real64)
905 do idir = 1, gr%der%dim
906 call rvu_psib(idir)%end()
907 call gpsib(idir)%end()
913 safe_deallocate_a(stress_tmp)
915 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
923 if (hm%kpoints%use_symmetries)
then
929 stress_hubbard(idir, idir) = stress_hubbard(idir, idir) + hm%energy%int_dft_u
932 stress_hubbard = stress_hubbard/rcell_volume
939 subroutine output_stress(iunit, space_dim, stress_tensors, all_terms)
940 integer,
intent(in) :: iunit
941 integer,
intent(in) :: space_dim
942 type(
stress_t),
intent(in) :: stress_tensors
943 logical,
optional,
intent(in) :: all_terms
945 logical :: write_all_terms
946 character(len=16) :: stress_unit
948 if (
present(all_terms))
then
949 write_all_terms = all_terms
951 write_all_terms = .
true.
959 if (write_all_terms)
then
960 write(iunit,
'(3a)')
'Kinetic stress tensor [', trim(stress_unit),
'] ='
962 if (space_dim == 3)
then
963 write(iunit,
'(a, es15.6, 3a)')
'Kinetic pressure sumrule violation: ', &
970 write(iunit,
'(3a)')
'Hartree stress tensor [', trim(stress_unit),
'] ='
972 if (space_dim == 3)
then
973 write(iunit,
'(a, es15.6, 3a)')
'Hartree pressure sumrule violation: ', &
979 write(iunit,
'(3a)')
'XC stress tensor [', trim(stress_unit),
'] ='
982 write(iunit,
'(3a)')
'Local pseudo. stress tensor [', trim(stress_unit),
'] ='
985 write(iunit,
'(3a)')
'Nonlocal pseudo. stress tensor [', trim(stress_unit),
'] ='
988 write(iunit,
'(3a)')
'Ion-ion stress tensor [', trim(stress_unit),
'] ='
991 write(iunit,
'(3a)')
'vdW stress tensor [', trim(stress_unit),
'] ='
994 write(iunit,
'(3a)')
'Hubbard stress tensor [', trim(stress_unit),
'] ='
998 write(iunit,
'(3a)')
'Total stress tensor [', trim(stress_unit),
'] ='
1006 integer,
intent(in) :: iunit
1007 integer,
intent(in) :: space_dim
1008 real(real64),
intent(in) :: total_stress_tensor(3,3)
1011 real(real64),
parameter :: au_to_GPa = 29421.02648438959_real64
1014 real(real64) :: pressure =
m_zero
1015 character(len=16) :: stress_unit
1020 do idim = 1, space_dim
1021 pressure = pressure - total_stress_tensor(idim, idim) / real(space_dim, real64)
1024 write(iunit,
'(3a,es16.8)', advance=
"no")
'Pressure [', trim(stress_unit),
'] = ', &
1026 if (space_dim == 3)
then
1027 write(iunit,
'(2x,a,f16.8)')
'Pressure [GPa] = ', pressure * au_to_gpa
1035 integer,
intent(in) :: ounit
1036 integer,
intent(in) :: space_dim
1037 real(real64),
intent(in) :: tensor(3,3)
1039 real(real64) :: tensor_with_unit(3,3)
1040 integer :: idim, jdim
1044 write(ounit,
'(a9,2x)', advance=
"no")
"T_{ij}"
1045 do jdim = 1, space_dim
1046 write(ounit,
'(i18)', advance=
"no") jdim
1049 do idim = 1, space_dim
1050 write(ounit,
'(i9,2x)', advance=
"no") idim
1051 do jdim = 1, space_dim
1052 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)
Is the current MPI process of grpcomm, root.
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
logical pure function, public xc_is_energy_functional(xcs)
Is one of the x or c functional is not an energy functional.
pure logical function, public in_family(family, xc_families)
A module that takes care of xc contribution from vdW interactions.
integer(int64), dimension(5), parameter, public d3_lib_options
VDWCORRECTION options that correspond to the DFT-D3 library.
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