26 use,
intrinsic :: iso_fortran_env
44 integer :: iter, max_iter
45 real(real64),
parameter :: tol = 1e-10_real64
46 real(real64),
parameter :: solution = 2.0134438978154419300_real64
47 real(real64) :: rhoin(1,1), rhoout(1,1)
49 type(mixfield_t),
pointer :: mixfield
50 type(derivatives_t) :: der
51 type(mesh_t),
target :: mesh
52 type(space_t) :: space
59 der%mesh%use_curvilinear = .false.
60 der%mesh%volume_element =
m_one
61 der%mesh%parallel_in_domains = .false.
71 write(
message(1),
'(a, f20.13)')
"Starting point : ", rhoin
78 write(
message(1),
'(a, i3, a, f20.13)')
"At iter. ", iter,
" the value is ", rhoout
82 if(abs(rhoout(1,1)-rhoin(1,1)) < tol)
exit
91 if (iter < max_iter)
then
92 write(
message(2),
'(a,f25.15,a,i3,a)')
"Computed fixed point ", rhoout,
" after ", iter,
" iterations."
94 write(
message(2),
'(a,f25.15,a,i3,a)')
"Failure: fixed point ", rhoout,
" after ", iter,
" iterations."
96 write(
message(3),
'(a, f25.15, a )')
"Numerical fixed point should be ", solution,
" ."
105 real(real64),
intent(in) :: x
106 real(real64),
intent(out) :: fx
double sin(double __x) __attribute__((__nothrow__
double atan(double __x) __attribute__((__nothrow__
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
real(real64), parameter, public m_one
This module defines the meshes, which are used in Octopus.
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public mixing(namespace, smix)
Main entry-point to SCF mixer.
subroutine, public mix_get_field(this, mixfield)
subroutine, public mix_init(smix, namespace, space, der, d1, d2, def_, func_type_, prefix_)
Initialise mix_t instance.
This module implements unit tests for the mixing methods.
subroutine, public mix_tests_run()
subroutine test_function(x, fx)
A simple test function.
type(namespace_t), public global_namespace
type(type_t), public type_float