Octopus
xc_vxc.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module xc_vxc_oct_m
22 use accel_oct_m
24 use comm_oct_m
25 use debug_oct_m
30 use global_oct_m
31 use grid_oct_m
32 use io_oct_m
34 use iso_c_binding
35 use, intrinsic :: iso_fortran_env
40 use math_oct_m
41 use mesh_oct_m
44 use mpi_oct_m
48 use space_oct_m
51 use types_oct_m
53 use xc_cam_oct_m
54 use xc_f03_lib_m
55#ifdef HAVE_LIBXC_FUNCS
56 use xc_f03_funcs_m
57#endif
58 use xc_fbe_oct_m
61 use xc_lrc_oct_m
64
65 implicit none
66
67 private
68 public :: xc_get_vxc
69
70 type(accel_kernel_t), save :: kernel_xc_dens_extract_block
71 type(accel_kernel_t), save :: kernel_xc_dens_apply_corrections
72
73contains
74
75#include "xc_vxc_inc.F90"
76
77 ! Keep these helpers local to the heavy VXC implementation module.
78 subroutine copy_global_to_local(global, local, n_block, nspin, ip)
79 real(real64), intent(in) :: global(:,:)
80 real(real64), intent(out) :: local(:,:)
81 integer, intent(in) :: n_block
82 integer, intent(in) :: nspin
83 integer, intent(in) :: ip
84
85 integer :: ib, is
86
87 push_sub(copy_global_to_local)
88
89 do is = 1, nspin
90 !$omp parallel do
91 do ib = 1, n_block
92 local(is, ib) = global(ib + ip - 1, is)
93 end do
94 end do
95
97 end subroutine copy_global_to_local
98
99 subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
100 real(real64), intent(in) :: local(:,:)
101 real(real64), intent(inout) :: global(:,:)
102 integer, intent(in) :: n_block
103 integer, intent(in) :: spin_channels
104 integer, intent(in) :: ip
105
106 integer :: ib, is
107
109
110 do is = 1, spin_channels
111 !$omp parallel do
112 do ib = 1, n_block
113 global(ib + ip - 1, is) = global(ib + ip - 1, is) + local(is, ib)
114 end do
115 end do
118 end subroutine copy_local_to_global
119end module xc_vxc_oct_m
This module contains interfaces for routines in allocate_hardware_aware.c.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
This module implements the underlying real-space grid.
Definition: grid.F90:119
Definition: io.F90:116
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
This module handles spin dimensions of the states and the k-point distribution.
This module defines the unit system, used for input and output.
Definition: xc.F90:120
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:702
pure logical function, public family_is_gga(family, only_collinear)
Is the xc function part of the GGA family.
Definition: xc.F90:675
logical pure function, public family_is_mgga_with_exc(xcs)
Is the xc function part of the mGGA family with an energy functional.
Definition: xc.F90:721
real(real64), parameter, public xc_tiny
Arbitrary definition of tiny, for use in XC context.
Definition: xc.F90:255
integer, parameter, public lr_x
Definition: xc.F90:257
pure logical function, public family_is_supported(family)
Is the xc family internally supported by Octopus.
Definition: xc.F90:693
pure logical function, public in_family(family, xc_families)
Definition: xc.F90:749
subroutine, public xc_get_vxc(gr, xcs, st, kpoints, psolver, namespace, space, rho, ispin, rcell_volume, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc, force_orbitalfree, force_host)
Definition: xc_vxc.F90:191
subroutine xc_compute_vxc(der, xcs, st, psolver, namespace, space, quantities, ispin, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc)
Definition: xc_vxc.F90:503
subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
Definition: xc_vxc.F90:1659
subroutine copy_global_to_local(global, local, n_block, nspin, ip)
Definition: xc_vxc.F90:1638