Octopus
hgh_projector.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
22 use atom_oct_m
23 use blas_oct_m
24 use debug_oct_m
25 use global_oct_m
27 use mesh_oct_m
30 use ps_oct_m
33
34 implicit none
35
36 private
37 public :: &
46
47
48
50 private
51 integer :: n_s
52 real(real64), allocatable, public :: dp(:, :)
53 complex(real64), allocatable, public :: zp(:, :)
54 real(real64), public :: h(3, 3) = m_zero
55 real(real64), public :: k(3, 3) = m_zero
56 end type hgh_projector_t
57
58
59contains
60
61 ! ---------------------------------------------------------
62 subroutine hgh_projector_init(hgh_p, sm, reltyp, spec, l, lm, so_strength)
63 type(hgh_projector_t), intent(inout) :: hgh_p
64 type(submesh_t), intent(in) :: sm
65 integer, intent(in) :: reltyp
66 class(pseudopotential_t), intent(in) :: spec
67 integer, intent(in) :: l, lm
68 real(real64), intent(in) :: so_strength
69
70 integer :: i
71
72 push_sub(hgh_projector_init)
73
74 hgh_p%n_s = sm%np
75 if (reltyp == 0) then
76 safe_allocate(hgh_p%dp(1:hgh_p%n_s, 1:3))
77 do i = 1, 3
78 call pseudopotential_real_nl_projector(spec, hgh_p%n_s, sm%rel_x, sm%r, l, lm, i, hgh_p%dp(:, i))
79 end do
80 else
81 safe_allocate(hgh_p%zp(1:hgh_p%n_s, 1:3))
82 do i = 1, 3
83 call pseudopotential_nl_projector(spec, hgh_p%n_s, sm%rel_x, sm%r, l, lm, i, hgh_p%zp(:, i))
84 end do
85 end if
86
87 hgh_p%h(:, :) = spec%ps%h(l, :, :)
88 hgh_p%k(:, :) = spec%ps%k(l, :, :)*so_strength
89
90 pop_sub(hgh_projector_init)
91 end subroutine hgh_projector_init
92
93 ! ---------------------------------------------------------
94 subroutine hgh_projector_end(hgh_p)
95 type(hgh_projector_t), intent(inout) :: hgh_p
96
97 push_sub(hgh_projector_end)
98
99 safe_deallocate_a(hgh_p%dp)
100 safe_deallocate_a(hgh_p%zp)
101
102 pop_sub(hgh_projector_end)
103 end subroutine hgh_projector_end
104
105
106#include "undef.F90"
107#include "real.F90"
108#include "hgh_projector_inc.F90"
109
110#include "undef.F90"
111#include "complex.F90"
112#include "hgh_projector_inc.F90"
113
114end module hgh_projector_oct_m
115
116!! Local Variables:
117!! mode: f90
118!! coding: utf-8
119!! End:
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:120
real(real64), parameter, public m_zero
Definition: global.F90:200
subroutine, public zhgh_project_ket(hgh_p, ll, lmax, dim, reltype, uvpsi, ppsi)
THREADSAFE.
subroutine, public hgh_projector_end(hgh_p)
subroutine, public zhgh_project_bra(mesh, sm, hgh_p, dim, reltype, psi, uvpsi)
THREADSAFE.
subroutine, public hgh_projector_init(hgh_p, sm, reltyp, spec, l, lm, so_strength)
subroutine, public zhgh_project(mesh, sm, hgh_p, ll, lmax, dim, psi, ppsi, reltype)
zhgh_project calculates the action of the projector hgh_p on the psi wavefunction....
subroutine, public dhgh_project(mesh, sm, hgh_p, ll, lmax, dim, psi, ppsi, reltype)
dhgh_project calculates the action of the projector hgh_p on the psi wavefunction....
subroutine, public dhgh_project_bra(mesh, sm, hgh_p, dim, reltype, psi, uvpsi)
THREADSAFE.
subroutine, public dhgh_project_ket(hgh_p, ll, lmax, dim, reltype, uvpsi, ppsi)
THREADSAFE.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
Definition: ps.F90:116
subroutine, public pseudopotential_nl_projector(spec, np, x, r, l, lm, i, uV)
This routine returns the non-local projector, built using spherical harmonics.
subroutine, public pseudopotential_real_nl_projector(spec, np, x, r, l, lm, i, uV)
This routine returns the non-local projector and its derivative, built using real spherical harmonics...