Octopus
electron_space.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 debug_oct_m
23 use global_oct_m
26 use parser_oct_m
28 use space_oct_m
30
31 implicit none
32
33 private
34
35 public :: &
37
39 type, extends(space_t) :: electron_space_t
40
41 integer :: ispin
42
43 end type electron_space_t
44
46 integer, public, parameter :: &
47 UNPOLARIZED = 1, &
48 spin_polarized = 2, &
49 spinors = 3
50
51 interface electron_space_t
52 procedure electron_space_constructor
53 end interface electron_space_t
54
55
56contains
57
58 !----------------------------------------------------------
59 function electron_space_constructor(namespace) result(this)
60 type(electron_space_t) :: this
61 type(namespace_t), intent(in) :: namespace
62
64
65 ! Initialize first an euclidian space
66 this%space_t = space_t(namespace)
67
68 !%Variable SpinComponents
69 !%Type integer
70 !%Default unpolarized
71 !%Section States
72 !%Description
73 !% The calculations may be done in three different ways: spin-restricted (TD)DFT (<i>i.e.</i>, doubly
74 !% occupied "closed shells"), spin-unrestricted or "spin-polarized" (TD)DFT (<i>i.e.</i> we have two
75 !% electronic systems, one with spin up and one with spin down), or making use of two-component
76 !% spinors.
77 !%Option unpolarized 1
78 !% Spin-restricted calculations.
79 !%Option polarized 2
80 !%Option spin_polarized 2
81 !% (Synonym <tt>polarized</tt>.) Spin-unrestricted, also known as spin-DFT, SDFT. This mode will double the number of
82 !% wavefunctions necessary for a spin-unpolarized calculation.
83 !%Option non_collinear 3
84 !%Option spinors 3
85 !% (Synonym: <tt>non_collinear</tt>.) The spin-orbitals are two-component spinors. This effectively allows the spin-density to
86 !% be oriented non-collinearly: <i>i.e.</i> the magnetization vector is allowed to take different
87 !% directions at different points. This vector is always in 3D regardless of <tt>Dimensions</tt>.
88 !%End
89 call parse_variable(namespace, 'SpinComponents', unpolarized, this%ispin)
90 if (.not.varinfo_valid_option('SpinComponents', this%ispin)) call messages_input_error(namespace, 'SpinComponents')
91 call messages_print_var_option('SpinComponents', this%ispin, namespace=namespace)
92
95
96end module electron_space_oct_m
97
98!! Local Variables:
99!! mode: f90
100!! coding: utf-8
101!! End:
102
type(electron_space_t) function electron_space_constructor(namespace)
integer, parameter, public spinors
integer, parameter, public spin_polarized
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:723
Extension of space that contains the knowledge of the spin dimension.