27 use,
intrinsic :: iso_fortran_env
61 character(len=1),
parameter :: &
62 l_notation(0:3) = (/
's',
'p',
'd',
'f' /)
64 integer,
public,
parameter :: MAX_L = 4
69 real(real64) function atomic_orbital_get_radius(species, mesh, iorb, ispin, truncation, threshold) result(radius)
70 class(species_t),
intent(in) :: species
71 type(mesh_t),
intent(in) :: mesh
72 integer,
intent(in) :: iorb, ispin
73 integer(int64),
intent(in) :: truncation
74 real(real64),
intent(in) :: threshold
78 push_sub(atomic_orbital_get_radius)
80 call species%get_iwf_ilm(iorb, ispin, ii, ll, mm)
82 if (truncation == option__aotruncation__ao_full)
then
83 radius = species%get_iwf_radius(ii, ispin, threshold)
85 radius = species%get_iwf_radius(ii, ispin)
87 if (truncation == option__aotruncation__ao_box)
then
91 radius = min(radius, minval(mesh%box%bounding_box_l(1:mesh%box%dim)-mesh%spacing(1:mesh%box%dim)*1.01_real64))
98 radius = min(radius, species%get_radius())
104 radius = max(radius,
m_two*maxval(mesh%spacing))
106 pop_sub(atomic_orbital_get_radius)
112 type(namespace_t),
intent(in) :: namespace
113 class(space_t),
intent(in) :: space
114 type(lattice_vectors_t),
intent(in) :: latt
115 real(real64),
intent(in) :: center(:)
116 class(mesh_t),
intent(in) :: mesh
117 type(submesh_t),
intent(inout) :: sm
118 real(real64),
intent(in) :: radius
122 if (sm%np == -1)
then
124 select type (box => mesh%box)
125 type is (box_minimum_t)
126 if (radius > box%radius)
then
127 message(1) =
"The radius of an orbital set is bigger than the radius of the simulation box."
128 message(2) =
"Increase the value of Radius or decrease the value of AOThreshold."
129 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
130 call messages_fatal(3, namespace=namespace)
133 type is (box_sphere_t)
134 if (radius > box%radius)
then
135 message(1) =
"The radius of an orbital set is bigger than the radius of the simulation box."
136 message(2) =
"Increase the value of Radius or decrease the value of AOThreshold."
137 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
138 call messages_fatal(3, namespace=namespace)
140 if (norm2(center - box%center) + radius > box%radius)
then
141 message(1) =
"An orbital set has points outside of the simulation box."
142 message(2) =
"Increase the value of Radius or decrease the value of AOThreshold."
143 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
144 call messages_fatal(3, namespace=namespace)
147 type is (box_cylinder_t)
148 if (radius > box%radius)
then
149 message(1) =
"The radius of an orbital set is bigger than the radius of the simulation box."
150 message(2) =
"Increase the value of Radius or decrease the value of AOThreshold."
151 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
152 call messages_fatal(3, namespace=namespace)
154 if (radius > box%half_length)
then
155 message(1) =
"The radius of an orbital set is bigger than the length of the cylinder box."
156 message(2) =
"Increase the value of XLength or decrease the value of AOThreshold."
157 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
158 call messages_fatal(3, namespace=namespace)
161 if (norm2(center(2:mesh%box%dim) - box%center(2:mesh%box%dim)) + radius > box%radius)
then
162 message(1) =
"An orbital set has points outside of the simulation box."
163 message(2) =
"Increase the value of Radius or decrease the value of AOThreshold."
164 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
165 call messages_fatal(3, namespace=namespace)
167 if (abs(center(1) - box%center(1)) + radius > box%half_length)
then
168 message(1) =
"An orbital set has points outside of the simulation box."
169 message(2) =
"Increase the value of Xlength or decrease the value of AOThreshold."
170 write(message(3),
'(a,f8.5,a,i5,a)')
'The value of the radius is ', radius,
' Bohr.'
171 call messages_fatal(3, namespace=namespace)
177 call submesh_init(sm, space, mesh, latt, center, radius)
189#include "atomic_orbital_inc.F90"
192#include "complex.F90"
193#include "atomic_orbital_inc.F90"
subroutine, public atomic_orbital_init_submesh(namespace, space, latt, center, mesh, sm, radius)
Initialize a submesh given a center and a radius.
subroutine, public zatomic_orbital_get_submesh_safe(species, submesh, ii, ll, mm, ispin, phi)
subroutine, public zget_atomic_orbital(namespace, space, latt, pos, species, mesh, sm, ii, ll, jj, os, orbind, radius, d_dim, use_mesh, normalize, index_shift)
This routine returns the atomic orbital basis – provided by the pseudopotential structure in geo.
character(len=1), dimension(0:3), parameter, public l_notation
real(real64) function, public atomic_orbital_get_radius(species, mesh, iorb, ispin, truncation, threshold)
subroutine, public dget_atomic_orbital(namespace, space, latt, pos, species, mesh, sm, ii, ll, jj, os, orbind, radius, d_dim, use_mesh, normalize, index_shift)
This routine returns the atomic orbital basis – provided by the pseudopotential structure in geo.
subroutine, public datomic_orbital_get_submesh(species, submesh, ii, ll, mm, ispin, phi, derivative)
subroutine, public datomic_orbital_get_submesh_safe(species, submesh, ii, ll, mm, ispin, phi)
subroutine, public zatomic_orbital_get_submesh(species, submesh, ii, ll, mm, ispin, phi, derivative)
real(real64), parameter, public m_two
This module is intended to contain "only mathematical" functions and procedures.
This module defines the meshes, which are used in Octopus.