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 comm_oct_m
23 use debug_oct_m
28 use global_oct_m
29 use grid_oct_m
30 use io_oct_m
32 use iso_c_binding
33 use, intrinsic :: iso_fortran_env
38 use math_oct_m
39 use mesh_oct_m
42 use mpi_oct_m
46 use space_oct_m
50 use xc_cam_oct_m
51 use xc_f03_lib_m
52#ifdef HAVE_LIBXC_FUNCS
53 use xc_f03_funcs_m
54#endif
55 use xc_fbe_oct_m
58 use xc_lrc_oct_m
61
62 implicit none
63
64 private
65 public :: xc_get_vxc
66
67contains
68
69#include "xc_vxc_inc.F90"
70
71 ! Keep these helpers local to the heavy VXC implementation module.
72 subroutine copy_global_to_local(global, local, n_block, nspin, ip)
73 real(real64), intent(in) :: global(:,:)
74 real(real64), intent(out) :: local(:,:)
75 integer, intent(in) :: n_block
76 integer, intent(in) :: nspin
77 integer, intent(in) :: ip
78
79 integer :: ib, is
80
81 push_sub(copy_global_to_local)
82
83 do is = 1, nspin
84 !$omp parallel do
85 do ib = 1, n_block
86 local(is, ib) = global(ib + ip - 1, is)
87 end do
88 end do
89
91 end subroutine copy_global_to_local
92
93 subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
94 real(real64), intent(in) :: local(:,:)
95 real(real64), intent(inout) :: global(:,:)
96 integer, intent(in) :: n_block
97 integer, intent(in) :: spin_channels
98 integer, intent(in) :: ip
99
100 integer :: ib, is
101
103
104 do is = 1, spin_channels
105 !$omp parallel do
106 do ib = 1, n_block
107 global(ib + ip - 1, is) = global(ib + ip - 1, is) + local(is, ib)
108 end do
109 end do
110
112 end subroutine copy_local_to_global
113end module xc_vxc_oct_m
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:116
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:580
pure logical function, public family_is_gga(family, only_collinear)
Is the xc function part of the GGA family.
Definition: xc.F90:553
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:599
real(real64), parameter, public xc_tiny
Arbitrary definition of tiny, for use in XC context.
Definition: xc.F90:216
integer, parameter, public lr_x
Definition: xc.F90:218
pure logical function, public family_is_supported(family)
Is the xc family internally supported by Octopus.
Definition: xc.F90:571
pure logical function, public in_family(family, xc_families)
Definition: xc.F90:627
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)
Definition: xc_vxc.F90:185
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:410
subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
Definition: xc_vxc.F90:1387
subroutine copy_global_to_local(global, local, n_block, nspin, ip)
Definition: xc_vxc.F90:1366