92 integer :: repetitions
93 integer :: min_blocksize
94 integer :: max_blocksize
99 type(derivatives_t),
pointer :: der_aux => null()
100 type(preconditioner_t) :: prec_aux
108 type(namespace_t),
intent(in) :: namespace
110 type(test_parameters_t) :: param
194 call parse_variable(namespace,
'TestType', option__testtype__all, param%type)
195 if (param%type < 1 .or. param%type > 5)
then
196 message(1) =
"Invalid option for TestType."
213 call parse_variable(namespace,
'TestRepetitions', 1, param%repetitions)
226 call parse_variable(namespace,
'TestMinBlockSize', 1, param%min_blocksize)
239 call parse_variable(namespace,
'TestMaxBlockSize', 128, param%max_blocksize)
249 select case (test_mode)
250 case (option__testmode__hartree)
252 case (option__testmode__derivatives)
254 case (option__testmode__orthogonalization)
256 case (option__testmode__interpolation)
258 case (option__testmode__ion_interaction)
260 case (option__testmode__projector)
262 case (option__testmode__dft_u)
264 case (option__testmode__hamiltonian_apply)
266 case (option__testmode__density_calc)
268 case (option__testmode__exp_apply)
270 case (option__testmode__boundaries)
272 case (option__testmode__subspace_diag)
274 case (option__testmode__batch_ops)
276 case (option__testmode__clock)
278 case (option__testmode__linear_solver)
280 case (option__testmode__cgal)
282 case (option__testmode__dense_eigensolver)
284 case (option__testmode__grid_interpolation)
286 case (option__testmode__iihash)
288 case (option__testmode__sihash)
290 case (option__testmode__sphash)
292 case (option__testmode__mpiwrappers)
294 case (option__testmode__regridding)
296 case (option__testmode__helmholtz_decomposition)
298 case (option__testmode__vecpot_analytical)
300 case (option__testmode__current_density)
318 sys =>
electrons_t(namespace, generate_epot=.false.)
320 call poisson_test(sys%hm%psolver, sys%space, sys%gr, sys%ions%latt, namespace, param%repetitions)
321 safe_deallocate_p(sys)
338 sys =>
electrons_t(namespace, generate_epot=.false.)
341 call helmholtz%init(namespace, sys%gr, sys%mc, sys%space)
344 write(
message(1),
'(a)')
"Helmholtz decomposition: beginning Hertzian dipole test"
348 write(
message(1),
'(a)')
"Helmholtz decomposition: beginning Gaussian test"
350 call gaussian_test(helmholtz, sys%gr, sys%namespace, sys%space)
352 safe_deallocate_p(sys)
362 float,
allocatable :: rho(:), x(:)
363 float :: center(max_dim)
364 float :: rr, alpha, beta, res
367 float,
parameter :: threshold = cnst(1e-7)
373 sys =>
electrons_t(namespace, generate_epot=.false.)
387 alpha =
m_four * sys%gr%spacing(1)
388 beta =
m_one / (alpha**sys%space%dim *
sqrt(
m_pi)**sys%space%dim)
392 safe_allocate(rho(1:sys%gr%np))
395 call mesh_r(sys%gr, ip, rr, origin = center(:))
396 rho(ip) = beta*
exp(-(rr/alpha)**2)
399 safe_allocate(x(1:sys%gr%np))
405 write(
message(1),
'(a,i6,a)')
"Info: CG converged with ", iter,
" iterations."
406 write(
message(2),
'(a,e14.6)')
"Info: The residue is ", res
407 write(
message(3),
'(a,e14.6)')
"Info: Norm solution CG ",
dmf_nrm2(sys%gr, x)
412 safe_deallocate_a(rho)
413 safe_deallocate_p(sys)
428 float,
intent(in) :: x(:)
429 float,
contiguous,
intent(out) :: hx(:)
431 float,
allocatable :: tmpx(:)
435 safe_allocate(tmpx(1:
mesh_aux%np_part))
440 safe_deallocate_a(tmpx)
455 cmplx,
allocatable :: psi(:, :)
461 call messages_write(
'Info: Testing the nonlocal part of the pseudopotential with SOC')
466 sys =>
electrons_t(namespace, generate_epot=.false.)
475 call sys%st%group%psib(1, 1)%copy_to(epsib)
479 do itime = 1, param%repetitions
481 sys%hm%ep%natoms, 2, sys%st%group%psib(1, 1), epsib)
484 safe_allocate(psi(1:sys%gr%np, 1:sys%st%d%dim))
485 do itime = 1, epsib%nst
487 write(
message(1),
'(a,i1,3x, f12.6)')
"Norm state ", itime,
zmf_nrm2(sys%gr, 2, psi)
490 safe_deallocate_a(psi)
494 safe_deallocate_p(sys)
506 integer :: itime, ist
508 float,
allocatable :: ddot(:,:,:), dweight(:,:)
509 cmplx,
allocatable :: zdot(:,:,:), zweight(:,:)
522 sys =>
electrons_t(namespace, generate_epot=.false.)
527 if (sys%st%d%pack_states)
call sys%st%pack()
529 call sys%st%group%psib(1, 1)%copy_to(epsib2, copy_data = .
true.)
532 if (.not.
allocated(sys%hm%hm_base%phase))
then
533 call sys%st%group%psib(1, 1)%copy_to(epsib, copy_data = .
true.)
535 call sys%st%group%psib(1, 1)%copy_to(epsib)
536 call sys%hm%hm_base%apply_phase(sys%gr, sys%gr%np, &
537 .false., epsib, src=sys%st%group%psib(1, 1))
538 epsib2%has_phase = .
true.
544 call dorbitalbasis_build(basis, sys%namespace, sys%ions, sys%gr, sys%st%d%kpt, sys%st%d%dim, &
545 allocated(sys%hm%hm_base%phase), .false., .false.)
546 safe_allocate(dweight(1:basis%orbsets(1)%norbs, 1:epsib%nst_linear))
547 safe_allocate(ddot(1:sys%st%d%dim, 1:basis%orbsets(1)%norbs, 1:epsib%nst))
549 call zorbitalbasis_build(basis, sys%namespace, sys%ions, sys%gr, sys%st%d%kpt, sys%st%d%dim, &
550 allocated(sys%hm%hm_base%phase), .false., .false.)
552 safe_allocate(zweight(1:basis%orbsets(1)%norbs, 1:epsib%nst_linear))
553 safe_allocate(zdot(1:sys%st%d%dim, 1:basis%orbsets(1)%norbs, 1:epsib%nst))
556 if (
allocated(sys%hm%hm_base%phase))
then
562 do itime = 1, param%repetitions
577 if (epsib%is_packed())
then
578 call epsib%do_unpack(force = .
true.)
581 do ist = 1, epsib%nst
583 write(
message(1),
'(a,i2,3x,e13.6)')
"Dotp state ", ist, ddot(1,1,ist)
585 write(
message(1),
'(a,i2,2(3x,e13.6))')
"Dotp state ", ist, zdot(1,1,ist)
593 safe_deallocate_a(dweight)
594 safe_deallocate_a(zweight)
595 safe_deallocate_a(ddot)
596 safe_deallocate_a(zdot)
602 safe_deallocate_p(sys)
614 integer :: itime, terms
633 call parse_variable(namespace,
'TestHamiltonianApply', option__testhamiltonianapply__term_all, terms)
634 if (terms == 0) terms = huge(1)
639 call messages_write(
'Info: Testing the application of the Hamiltonian')
644 sys =>
electrons_t(namespace, generate_epot=.false.)
651 if (sys%st%d%pack_states .and. sys%hm%apply_packed())
call sys%st%pack()
654 call v_ks_calc(sys%ks, sys%namespace, sys%space, sys%hm, sys%st, sys%ions, sys%ext_partners)
656 call boundaries_set(sys%gr%der%boundaries, sys%gr, sys%st%group%psib(1, 1))
658 call sys%st%group%psib(1, 1)%copy_to(hpsib)
660 if (sys%hm%apply_packed())
then
661 call sys%st%group%psib(1, 1)%do_pack()
662 call hpsib%do_pack(copy = .false.)
665 do itime = 1, param%repetitions
675 if (hpsib%is_packed())
then
676 call hpsib%do_unpack(force = .
true.)
681 call hpsib%end(copy = .false.)
683 safe_deallocate_p(sys)
706 sys =>
electrons_t(namespace, generate_epot=.false.)
711 if (sys%st%d%pack_states)
call sys%st%pack()
713 do itime = 1, param%repetitions
717 write(
message(1),
'(a,3x, f12.6)')
"Norm density ",
dmf_nrm2(sys%gr, sys%st%rho(:,1))
721 safe_deallocate_p(sys)
744 sys =>
electrons_t(namespace, generate_epot=.false.)
749 if (sys%st%d%pack_states)
call sys%st%pack()
751 do itime = 1, param%repetitions
752 call boundaries_set(sys%gr%der%boundaries, sys%gr, sys%st%group%psib(1, 1))
758 safe_deallocate_p(sys)
782 sys =>
electrons_t(namespace, generate_epot=.false.)
789 if (sys%st%d%pack_states .and. sys%hm%apply_packed())
call sys%st%pack()
792 call v_ks_calc(sys%ks, sys%namespace, sys%space, sys%hm, sys%st, sys%ions, sys%ext_partners)
796 if (sys%hm%apply_packed())
then
797 call sys%st%group%psib(1, 1)%do_pack()
800 do itime = 1, param%repetitions
801 call te%apply_batch(sys%namespace, sys%gr, sys%hm, sys%st%group%psib(1, 1),
m_one)
807 safe_deallocate_p(sys)
821 float,
allocatable :: diff(:)
832 sys =>
electrons_t(namespace, generate_epot=.false.)
838 if (sys%st%d%pack_states .and. sys%hm%apply_packed())
call sys%st%pack()
841 call v_ks_calc(sys%ks, sys%namespace, sys%space, sys%hm, sys%st, sys%ions, sys%ext_partners)
843 call sdiag%init(sys%namespace, sys%st)
845 safe_allocate(diff(1:sys%st%nst))
847 do itime = 1, param%repetitions
849 call dsubspace_diag(sdiag, sys%namespace, sys%gr, sys%st, sys%hm, 1, sys%st%eigenval(:, 1), diff)
851 call zsubspace_diag(sdiag, sys%namespace, sys%gr, sys%st, sys%hm, 1, sys%st%eigenval(:, 1), diff)
855 safe_deallocate_a(diff)
860 safe_deallocate_p(sys)
872 integer :: itime, ops, ops_default, ist, jst, nst
874 float,
allocatable :: tmp(:)
875 float,
allocatable :: ddotv(:)
876 cmplx,
allocatable :: zdotv(:)
877 float,
allocatable :: ddot(:,:)
878 cmplx,
allocatable :: zdot(:,:)
903 option__testbatchops__ops_axpy + &
904 option__testbatchops__ops_scal + &
905 option__testbatchops__ops_nrm2 + &
906 option__testbatchops__ops_dotp_matrix + &
907 option__testbatchops__ops_dotp_self + &
908 option__testbatchops__ops_dotp_vector
919 sys =>
electrons_t(namespace, generate_epot=.false.)
924 if (sys%st%d%pack_states)
call sys%st%pack()
926 if (
bitand(ops, option__testbatchops__ops_axpy) /= 0)
then
927 message(1) =
'Info: Testing axpy'
930 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
931 call sys%st%group%psib(1, 1)%copy_to(yy, copy_data = .
true.)
933 do itime = 1, param%repetitions
942 if (
bitand(ops, option__testbatchops__ops_scal) /= 0)
then
943 message(1) =
'Info: Testing scal'
946 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
947 call sys%st%group%psib(1, 1)%copy_to(yy, copy_data = .
true.)
949 do itime = 1, param%repetitions
958 if (
bitand(ops, option__testbatchops__ops_nrm2) /= 0)
then
959 message(1) =
'Info: Testing nrm2'
962 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
963 call sys%st%group%psib(1, 1)%copy_to(yy, copy_data = .
true.)
965 safe_allocate(tmp(1:xx%nst))
967 do itime = 1, param%repetitions
971 write(
message(1),
'(a,i1,3x,e23.16)')
"Nrm2 norm state ", itime, tmp(itime)
975 safe_deallocate_a(tmp)
981 if (
bitand(ops, option__testbatchops__ops_dotp_matrix) /= 0)
then
983 message(1) =
'Info: Testing dotp_matrix'
986 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
987 call sys%st%group%psib(1, 1)%copy_to(yy, copy_data = .
true.)
989 nst = sys%st%group%psib(1, 1)%nst
992 safe_allocate(ddot(1:nst, 1:nst))
997 write(
message(jst),
'(a,2i3,3x,e23.16)')
'Dotp_matrix states', ist, jst, ddot(ist,jst)
1001 safe_deallocate_a(ddot)
1003 safe_allocate(zdot(1:nst, 1:nst))
1008 write(
message(jst),
'(a,2i3,3x,2(e23.16,1x))')
'Dotp_matrix states', ist, jst, zdot(ist,jst)
1012 safe_deallocate_a(zdot)
1019 if (
bitand(ops, option__testbatchops__ops_dotp_vector) /= 0)
then
1021 message(1) =
'Info: Testing dotp_vector'
1024 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
1025 call sys%st%group%psib(1, 1)%copy_to(yy, copy_data = .
true.)
1027 nst = sys%st%group%psib(1, 1)%nst
1030 safe_allocate(ddotv(1:nst))
1034 write(
message(ist),
'(a,i3,3x,e23.16)')
'Dotp_vector state', ist, ddotv(ist)
1037 safe_deallocate_a(ddotv)
1039 safe_allocate(zdotv(1:nst))
1042 write(
message(ist),
'(a,i3,3x,2(e23.16,1x))')
'Dotp_vector state', ist, zdotv(ist)
1045 safe_deallocate_a(zdotv)
1052 if (
bitand(ops, option__testbatchops__ops_dotp_self) /= 0)
then
1054 message(1) =
'Info: Testing dotp_self'
1057 call sys%st%group%psib(1, 1)%copy_to(xx, copy_data = .
true.)
1059 nst = sys%st%group%psib(1, 1)%nst
1062 safe_allocate(ddot(1:nst, 1:nst))
1067 write(
message(jst),
'(a,2i3,3x,e23.16)')
'Dotp_self states', ist, jst, ddot(ist,jst)
1071 safe_deallocate_a(ddot)
1073 safe_allocate(zdot(1:nst, 1:nst))
1077 write(
message(jst),
'(a,2i3,3x,2(e23.16,1x))')
'Dotp_self states', ist, jst, zdot(ist,jst)
1081 safe_deallocate_a(zdot)
1088 safe_deallocate_p(sys)
1102 sys =>
electrons_t(namespace, generate_epot=.false.)
1103 call sys%init_parallelization(
mpi_world)
1105 message(1) =
'Info: Testing the finite-differences derivatives.'
1109 if (param%type == option__testtype__all .or. param%type == option__testtype__real)
then
1110 call dderivatives_test(sys%gr%der, sys%namespace, param%repetitions, param%min_blocksize, param%max_blocksize)
1113 if (param%type == option__testtype__all .or. param%type == option__testtype__complex)
then
1114 call zderivatives_test(sys%gr%der, sys%namespace, param%repetitions, param%min_blocksize, param%max_blocksize)
1117 safe_deallocate_p(sys)
1136 sys =>
electrons_t(namespace, generate_epot=.false.)
1137 call sys%init_parallelization(
mpi_world)
1139 message(1) =
'Info: Testing orthogonalization.'
1143 if (param%type == option__testtype__all .or. param%type == option__testtype__real)
then
1144 message(1) =
'Info: Real wave-functions.'
1146 do itime = 1, param%repetitions
1151 if (param%type == option__testtype__all .or. param%type == option__testtype__complex)
then
1152 message(1) =
'Info: Complex wave-functions.'
1154 do itime = 1, param%repetitions
1159 safe_deallocate_p(sys)
1174 sys =>
electrons_t(namespace, generate_epot=.false.)
1175 call sys%init_parallelization(
mpi_world)
1177 if (param%type == option__testtype__all .or. param%type == option__testtype__real)
then
1186 if (param%type == option__testtype__all .or. param%type == option__testtype__complex)
then
1188 call messages_write(
'Info: Testing complex interpolation routines')
1196 safe_deallocate_p(sys)
1211 sys =>
electrons_t(namespace, generate_epot=.false.)
1212 call sys%init_parallelization(
mpi_world)
1214 call ion_interaction_test(sys%space, sys%ions%latt, sys%ions%atom, sys%ions%natoms, sys%ions%pos, &
1215 sys%gr%box%bounding_box_l, namespace, sys%mc)
1217 safe_deallocate_p(sys)
1226 type(
grid_t),
intent(in) :: gr
1227 class(
batch_t),
intent(inout) :: psib
1228 character(*),
optional,
intent(in) :: string
1231 cmplx,
allocatable :: zpsi(:, :)
1232 float,
allocatable :: dpsi(:, :)
1234 character(80) :: string_
1241 safe_allocate(dpsi(1:gr%np, 1:st%d%dim))
1243 safe_allocate(zpsi(1:gr%np, 1:st%d%dim))
1246 do itime = 1, psib%nst
1249 write(
message(1),
'(a,i2,3x,e23.16)')
"Norm state "//trim(string_)//
" ", itime,
dmf_nrm2(gr, st%d%dim, dpsi)
1252 write(
message(1),
'(a,i2,3x,e23.16)')
"Norm state "//trim(string_)//
" ", itime,
zmf_nrm2(gr, st%d%dim, zpsi)
1258 safe_deallocate_a(dpsi)
1260 safe_deallocate_a(zpsi)
1271 type(
clock_t) :: test_clock_a, test_clock_b
1275 test_clock_a =
clock_t(time_step=
m_two, initial_tick=100)
1277 call test_clock_a%print()
1278 call test_clock_b%print()
1280 call test_clock_a%set_time(test_clock_b)
1281 call test_clock_a%print()
1283 call test_clock_a%print()
1285 call test_clock_a%print()
1287 call test_clock_a%print()
1288 call test_clock_a%reset()
1289 call test_clock_a%print()
1291 call test_clock_a%print()
1293 call test_clock_a%print()
1294 message(1) = test_clock_a%print_str()
1297 write(
message(1),
'(A,x,I10.10)') &
1298 'clock_get_tick', test_clock_a%get_tick()
1299 write(
message(2),
'(A,x,F15.10)') &
1300 'clock_time', test_clock_a%time()
1301 write(
message(3),
'(A,x,I1)') &
1302 'clock_is_earlier', abs(transfer(test_clock_a .lt. test_clock_b, 0))
1303 write(
message(4),
'(A,x,I1)') &
1304 'clock_is_equal_or_earlier', abs(transfer(test_clock_a .le. test_clock_b, 0))
1305 write(
message(5),
'(A,x,I1)') &
1306 'clock_is_later', abs(transfer(test_clock_a .gt. test_clock_b, 0))
1307 write(
message(6),
'(A,x,I1)') &
1308 'clock_is_equal_or_later', abs(transfer(test_clock_a .ge. test_clock_b, 0))
1310 'clock_is_equal', abs(transfer(test_clock_a .eq. test_clock_b, 0))
1327 message(1) =
"cgal_polyhedron_point_inside"
1339 integer :: N, ii, jj, N_list(4), i_N
1340 float,
allocatable :: matrix(:, :), eigenvectors(:, :), eigenvalues(:), test(:)
1341 float,
allocatable :: differences(:)
1345 n_list = [15, 32, 100, 500]
1349 safe_allocate(matrix(1:n, 1:n))
1350 safe_allocate(eigenvectors(1:n, 1:n))
1351 safe_allocate(eigenvalues(1:n))
1352 safe_allocate(test(1:n))
1353 safe_allocate(differences(1:n))
1359 matrix(ii, jj) = ii * jj
1364 eigenvectors(1:n, 1:n) = matrix(1:n, 1:n)
1368 test(:) = matmul(matrix, eigenvectors(:, ii)) - eigenvalues(ii) * eigenvectors(:, ii)
1369 differences(ii) = sum(abs(test)) / sum(abs(eigenvectors(:, ii)))
1371 write(
message(1),
"(A, I3, A, E13.6)")
"Parallel solver - N: ", n, &
1372 ", average difference: ", sum(differences)/n
1376 eigenvectors(1:n, 1:n) = matrix(1:n, 1:n)
1380 test(:) = matmul(matrix, eigenvectors(:, ii)) - eigenvalues(ii) * eigenvectors(:, ii)
1381 differences(ii) = sum(abs(test)) / sum(abs(eigenvectors(:, ii)))
1383 write(
message(1),
"(A, I3, A, E13.6)")
"Serial solver - N: ", n, &
1384 ", average difference: ", sum(differences)/n
1387 safe_deallocate_a(matrix)
1388 safe_deallocate_a(eigenvectors)
1389 safe_deallocate_a(eigenvalues)
1390 safe_deallocate_a(test)
1391 safe_deallocate_a(differences)
1398 class(
batch_t),
intent(inout) :: psib
1399 class(
mesh_t),
intent(in) :: mesh
1401 float,
allocatable :: dff(:)
1402 cmplx,
allocatable :: zff(:)
1410 da =
m_one/mesh%box%bounding_box_l(1)
1416 za = da +
m_zi*cnst(0.01)
1418 zc = dc -
m_zi*cnst(50.0)
1420 safe_allocate(zff(1:mesh%np))
1421 do ist = 1, psib%nst_linear
1425 zff(ip) = zb*
exp(-za*sum(mesh%x(ip, :)**2)) + zc
1430 safe_deallocate_a(zff)
1432 safe_allocate(dff(1:mesh%np))
1433 do ist = 1, psib%nst_linear
1437 dff(ip) = db*
exp(-da*sum(mesh%x(ip, :)**2)) + dc
1442 safe_deallocate_a(dff)
1456 call sys%init_parallelization(
mpi_world)
1459 sys%gr%stencil, sys%mc, used_for_preconditioner = .
true.)
1465 safe_deallocate_p(sys)
1481 write(
message(1),*)
'hash[1] :', found,
value
1485 write(
message(1),*)
'hash[2] :', found,
value
1489 write(
message(1),*)
'hash[3] :', found,
value
1501 integer ::
value, sum
1510 write(
message(1),*)
'hash["one"]: ', found,
value
1514 write(
message(1),*)
'hash["two"]: ', found,
value
1518 write(
message(1),*)
'hash["three"]: ', found,
value
1525 do while (it%has_next())
1526 value = it%get_next()
1528 write(
message(1),
'(I3,A,I5)') counter,
': hash[...] = ',
value
1530 counter = counter + 1
1532 write(
message(1),*)
'counter = ', counter
1533 write(
message(2),*)
'sum = ', sum
1552 type(
clock_t),
allocatable :: clock_2
1555 class(*),
pointer :: value
1557 integer :: count_clock, count_space
1559 safe_allocate(clock_2)
1573 write(
message(1),*)
'hash["one"]: ', found,
value%get_tick()
1576 write(
message(1),*)
'hash["one"]: ', found,
value%short_info()
1579 write(
message(1),*)
'wrong type. found = ', found
1586 write(
message(1),*)
'hash["two"]: ', found,
value%get_tick()
1589 write(
message(1),*)
'hash["two"]: ', found,
value%short_info()
1592 write(
message(1),*)
'wrong type. found = ',found
1596 safe_deallocate_a(clock_2)
1601 write(
message(1),*)
'hash["three"]: ', found,
value%get_tick()
1604 write(
message(1),*)
'hash["three"]: ', found,
value%short_info()
1607 write(
message(1),*)
'wrong type. found = ',found
1616 do while (it%has_next())
1617 value => it%get_next()
1620 count_clock = count_clock + 1
1622 count_space = count_space + 1
1626 write(
message(1), *)
'Count_clock = ', count_clock
1627 write(
message(2), *)
'Count_space = ', count_space
1640 float,
allocatable :: ff_a(:), ff_a_reference(:), ff_b(:), ff_b_reference(:), diff_a(:), diff_b(:)
1641 float :: norm_ff, norm_diff
1650 call sysa%init_parallelization(
mpi_world)
1651 call sysb%init_parallelization(
mpi_world)
1654 safe_allocate(ff_a(1:sysa%gr%np))
1655 safe_allocate(ff_a_reference(1:sysa%gr%np))
1656 safe_allocate(diff_a(1:sysa%gr%np))
1657 safe_allocate(ff_b(1:sysb%gr%np))
1658 safe_allocate(ff_b_reference(1:sysb%gr%np))
1659 safe_allocate(diff_b(1:sysb%gr%np))
1661 do ip = 1, sysa%gr%np
1662 ff_a_reference(ip) =
values(sysa%gr%x(ip, :))
1664 do ip = 1, sysb%gr%np
1665 ff_b_reference(ip) =
values(sysb%gr%x(ip, :))
1669 regridding =>
regridding_t(sysb%gr, sysa%gr, sysa%space, sysa%namespace)
1670 call regridding%do_transfer(ff_b, ff_a_reference)
1671 safe_deallocate_p(regridding)
1674 do ip = 1, sysb%gr%np
1675 if (ff_b(ip) ==
m_zero)
then
1676 ff_b_reference(ip) =
m_zero
1679 diff_b(ip) = abs(ff_b_reference(ip) - ff_b(ip))
1682 norm_ff =
dmf_nrm2(sysb%gr, ff_b_reference)
1683 norm_diff =
dmf_nrm2(sysb%gr, diff_b)
1685 write(
message(1),
'(a, E14.6)')
"Forward: difference of reference to mapped function (rel.): ", &
1690 sysb%gr, ff_b_reference,
unit_one, ierr)
1694 sysa%gr, ff_a_reference,
unit_one, ierr)
1697 regridding =>
regridding_t(sysa%gr, sysb%gr, sysb%space, sysb%namespace)
1698 call regridding%do_transfer(ff_a, ff_b_reference)
1699 safe_deallocate_p(regridding)
1701 do ip = 1, sysa%gr%np
1702 if (ff_a(ip) ==
m_zero)
then
1703 ff_a_reference(ip) =
m_zero
1706 diff_a(ip) = abs(ff_a_reference(ip) - ff_a(ip))
1709 norm_ff =
dmf_nrm2(sysa%gr, ff_a_reference)
1710 norm_diff =
dmf_nrm2(sysa%gr, diff_a)
1712 write(
message(1),
'(a, E14.6)')
"Backward: difference of reference to mapped function (rel.): ", &
1717 sysa%gr, ff_a_reference,
unit_one, ierr)
1721 sysb%gr, ff_b_reference,
unit_one, ierr)
1723 safe_deallocate_a(ff_a)
1724 safe_deallocate_a(ff_a_reference)
1725 safe_deallocate_a(ff_b)
1726 safe_deallocate_a(ff_b_reference)
1727 safe_deallocate_a(diff_a)
1728 safe_deallocate_a(diff_b)
1729 safe_deallocate_p(sysa)
1730 safe_deallocate_p(sysb)
1736 float
function values(xx)
1737 float,
intent(in) :: xx(:)
1738 float :: xx0(1:
size(xx, dim=1))
1739 float,
parameter :: aa =
m_half
1740 float,
parameter :: bb =
m_four
1756 class(
maxwell_t),
pointer :: maxwell_system
1758 float,
allocatable :: magnetic_field(:,:)
1759 float,
allocatable :: vector_potential_mag(:,:)
1760 float,
allocatable :: vector_potential_analytical(:,:)
1761 float,
allocatable :: delta(:,:)
1767 integer :: ip, j, ierr, nn
1768 integer(i8) :: out_how
1769 character(len=MAX_PATH_LEN) :: fname, fname2, fname3
1773 sigma = maxwell_system%gr%box%bounding_box_l(1)/cnst(10)
1774 call maxwell_system%init_parallelization(
mpi_world)
1776 safe_allocate(magnetic_field(1:maxwell_system%gr%np_part, 1:3))
1777 safe_allocate(vector_potential_mag(1:maxwell_system%gr%np_part, 1:3))
1778 safe_allocate(vector_potential_analytical(1:maxwell_system%gr%np_part, 1:3))
1779 safe_allocate(delta(1:maxwell_system%gr%np, 1:3))
1792 call parse_variable(namespace,
'TestVectorPotentialType', option__testvectorpotentialtype__bounded, nn)
1795 case (option__testvectorpotentialtype__bounded)
1796 do ip = 1, maxwell_system%gr%np_part
1797 xx = maxwell_system%gr%x(ip, 1)
1798 yy = maxwell_system%gr%x(ip, 2)
1799 zz = maxwell_system%gr%x(ip, 3)
1800 exp_factor =
exp((-xx**2 - yy**2 - zz**2)*1/(2*sigma**2))
1801 magnetic_field(ip, 1) = exp_factor*yy*(1 - (-xx**2 + yy**2)/(3*sigma**2) - zz**2/(3*sigma**2))
1802 magnetic_field(ip, 2) = exp_factor * xx * (1 + (-xx**2 + yy**2)/(3*sigma**2) - zz**2/(3*sigma**2))
1803 magnetic_field(ip, 3) = exp_factor * 2 * xx * yy * zz * 1/(3*sigma**2)
1805 vector_potential_analytical(ip, 1) =
m_third * xx * zz * exp_factor
1806 vector_potential_analytical(ip, 2) = -
m_third * yy * zz * exp_factor
1807 vector_potential_analytical(ip, 3) =
m_third * (-xx**2 + yy**2) * exp_factor
1809 case (option__testvectorpotentialtype__unbounded)
1810 do ip = 1, maxwell_system%gr%np_part
1811 magnetic_field(ip, 1) = maxwell_system%gr%x(ip, 2)
1812 magnetic_field(ip, 2) = maxwell_system%gr%x(ip, 1)
1813 magnetic_field(ip, 3) =
m_zero
1815 vector_potential_analytical(ip, 1) =
m_third * maxwell_system%gr%x(ip, 1) * maxwell_system%gr%x(ip, 3)
1816 vector_potential_analytical(ip, 2) = -
m_third * maxwell_system%gr%x(ip, 2) * maxwell_system%gr%x(ip, 3)
1817 vector_potential_analytical(ip, 3) = -
m_third * (maxwell_system%gr%x(ip, 1)**2 - maxwell_system%gr%x(ip, 2)**2)
1820 call maxwell_system%helmholtz%get_vector_potential(namespace, vector_potential_mag, magnetic_field)
1824 do ip = 1, maxwell_system%gr%np
1825 delta(ip,j) = vector_potential_analytical(ip, j) - vector_potential_mag(ip, j)
1830 write(
message(j),*)
'j, norm2(delta)', j, norm2(delta(:,j))
1834 write(fname,
'(a)')
'deviation_from_analytical_formulation'
1837 write(fname2,
'(a)')
'vector_potential_analytical'
1839 vector_potential_analytical,
unit_one, ierr)
1840 write(fname3,
'(a)')
'vector_potential_mag'
1842 vector_potential_mag,
unit_one, ierr)
1844 safe_deallocate_a(magnetic_field)
1845 safe_deallocate_a(vector_potential_mag)
1846 safe_deallocate_a(vector_potential_analytical)
1847 safe_deallocate_a(delta)
1848 safe_deallocate_p(maxwell_system)
1855 type(
space_t),
intent(in) :: space
1857 float,
allocatable :: guess0(:), res0(:), guess1(:)
1858 type(
mesh_t),
pointer :: mesh0, mesh1
1859 float :: delta, xx(3,2), alpha, beta, rr
1860 integer :: nn, ip, ierr, order
1874 message(1) =
'Info: Testing the grid interpolation.'
1878 mesh0 => mgrid%level(0)%mesh
1879 mesh1 => mgrid%level(1)%mesh
1881 safe_allocate(guess0(1:mesh0%np_part))
1882 safe_allocate(res0(1:mesh0%np))
1883 safe_allocate(guess1(1:mesh1%np_part))
1885 alpha =
m_four*mesh0%spacing(1)
1901 call mesh_r(mesh0, ip, rr, origin = xx(:, nn))
1902 guess0(ip) = guess0(ip) + (-1)**nn * beta*
exp(-(rr/alpha)**2)
1907 space, mesh0, guess0,
unit_one, ierr)
1909 space, mesh0, guess0,
unit_one, ierr)
1911 space, mesh0, guess0,
unit_one, ierr)
1923 space, mesh0, res0,
unit_one, ierr)
1925 space, mesh0, res0,
unit_one, ierr)
1927 space, mesh0, res0,
unit_one, ierr)
1929 delta =
dmf_nrm2(mesh0, guess0(1:mesh0%np)-res0)
1930 write(
message(1),
'(a,e13.6)')
'Interpolation test (abs.) = ', delta
1941 space, mesh0, res0,
unit_one, ierr)
1943 space, mesh0, res0,
unit_one, ierr)
1945 space, mesh0, res0,
unit_one, ierr)
1947 delta =
dmf_nrm2(mesh0, guess0(1:mesh0%np)-res0)
1948 write(
message(2),
'(a,e13.6)')
'Restriction test (abs.) = ', delta
1951 safe_deallocate_a(guess0)
1952 safe_deallocate_a(res0)
1953 safe_deallocate_a(guess1)
1965 character(len=MAX_PATH_LEN) :: fname
1966 integer :: ierr, ip, idir
1967 integer(i8) :: out_how
1968 float,
allocatable :: current_para_ref(:,:), current_dia_ref(:,:), current_mag_ref(:,:), delta(:)
1969 float :: xx(3), rr, a0, mag_curr, sin_thet, sin_phi, cos_phi, vec_pot_slope
1972 sys =>
electrons_t(namespace, generate_epot=.false.)
1973 call sys%init_parallelization(
mpi_world)
1975 alpha = (cnst(0.0), cnst(0.5))
1977 vec_pot_slope = cnst(0.4)
1986 safe_allocate(sys%hm%hm_base%vector_potential(1:3, 1:sys%gr%np))
1988 sys%hm%hm_base%vector_potential =
m_zero
1989 do ip = 1, sys%gr%np
1990 xx = sys%gr%x(ip, 1:3)
1991 sys%hm%hm_base%vector_potential(2, ip) = vec_pot_slope * xx(1) /
p_c
1999 safe_allocate(current_para_ref(1:sys%gr%np,1:3))
2000 safe_allocate(current_dia_ref(1:sys%gr%np,1:3))
2001 safe_allocate(current_mag_ref(1:sys%gr%np,1:3))
2002 safe_allocate(delta(1:sys%gr%np))
2005 current_para_ref(:,:) =
m_zero
2006 do ip = 1, sys%gr%np
2007 call mesh_r(sys%gr, ip, rr)
2008 xx = sys%gr%x(ip, 1:3)
2011 psi_1s(rr, a0) *
dr_psi_2s(rr, a0) ) * imag(alpha) / (1 + abs(alpha)**2) * xx(1:3) / rr
2015 write(fname,
'(a)')
'current_para'
2018 sys%st%current_para(:,:,1),
unit_one, ierr)
2020 write(fname,
'(a)')
'current_para-ref'
2023 current_para_ref(:,:),
unit_one, ierr)
2027 delta(:) = current_para_ref(1:sys%gr%np, idir) - sys%st%current_para(1:sys%gr%np, idir, 1)
2028 write(
message(idir),*)
'idir =',idir,
', norm2(delta paramagnetic)',norm2(delta)
2033 current_dia_ref(:,:) =
m_zero
2034 do ip = 1, sys%gr%np
2035 call mesh_r(sys%gr, ip, rr)
2036 current_dia_ref(ip,1:3) = - sys%hm%hm_base%vector_potential(1:3,ip) *&
2040 write(fname,
'(a)')
'current_dia'
2043 sys%st%current_dia(:,:,1),
unit_one, ierr)
2045 write(fname,
'(a)')
'current_dia-ref'
2048 current_dia_ref(:,:),
unit_one, ierr)
2052 delta(:) = current_dia_ref(1:sys%gr%np, idir) - sys%st%current_dia(1:sys%gr%np, idir, 1)
2053 write(
message(idir),*)
'idir =',idir,
', norm2(delta diamagnetic)',norm2(delta)
2061 current_mag_ref(:,:) =
m_zero
2062 do ip = 1, sys%gr%np
2063 call mesh_r(sys%gr, ip, rr)
2064 xx = sys%gr%x(ip, 1:3)
2066 sin_thet = norm2(xx(1:2)) / rr
2067 sin_phi = xx(2) / norm2(xx(1:2))
2068 cos_phi = xx(1) / norm2(xx(1:2))
2072 current_mag_ref(ip,1) =
m_half * mag_curr * sin_thet * sin_phi / (1+abs(alpha)**2)
2073 current_mag_ref(ip,2) = -
m_half * mag_curr * sin_thet * cos_phi / (1+abs(alpha)**2)
2077 write(fname,
'(a)')
'current_mag'
2080 sys%st%current_mag(:,:,1),
unit_one, ierr)
2082 write(fname,
'(a)')
'current_mag-ref'
2085 current_mag_ref(:,:),
unit_one, ierr)
2089 delta(:) = current_mag_ref(1:sys%gr%np, idir) - sys%st%current_mag(1:sys%gr%np, idir, 1)
2090 write(
message(idir),*)
'idir =',idir,
', norm2(delta magnetization)',norm2(delta)
2094 safe_deallocate_a(current_para_ref)
2095 safe_deallocate_a(current_dia_ref)
2096 safe_deallocate_a(current_mag_ref)
2097 safe_deallocate_a(delta)
2098 safe_deallocate_p(sys)
2104 class(
batch_t),
intent(inout) :: psib
2105 class(
mesh_t),
intent(in) :: mesh
2107 cmplx,
intent(in) :: alpha
2108 float,
intent(in) :: a0
2110 cmplx,
allocatable :: zff(:)
2117 safe_allocate(zff(1:mesh%np))
2120 call mesh_r(mesh, ip, rr)
2124 safe_deallocate_a(zff)
2126 write(
message(1),*)
"States should be complex for the linear combination of hydrogenic states to work"
2134 float,
intent(in) :: a0, rr
2135 cmplx,
intent(in) :: alpha
2141 float
function psi_1s(rr, a0)
2142 float,
intent(in) :: a0, rr
2148 float
function psi_2s(rr, a0)
2149 float,
intent(in) :: a0, rr
2156 float,
intent(in) :: a0, rr
2162 float,
intent(in) :: a0, rr
There are several ways how to call batch_set_state and batch_get_state:
constant times a vector plus a vector
Copies a vector x, to a vector y.
scales a vector by a constant
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
double exp(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
subroutine, public batch_set_zero(this)
Module implementing boundary conditions in Octopus.
Module, implementing a factory for boxes.
This module handles the calculation mode.
subroutine, public calc_mode_par_set_parallelization(par, default)
Add a parallelization strategy to the list of possible ones. Make it default also if default = ....
subroutine, public calc_mode_par_set_scalapack_compat()
Defines that the current run mode requires division of states and domains to be compatible with scala...
subroutine, public calc_mode_par_unset_parallelization(par)
Remove a parallelization strategy from the list of possible ones. It will also be removed from the de...
subroutine, public cgal_polyhedron_init(cgal_poly, fname, verbose)
logical function, public cgal_polyhedron_point_inside(cgal_poly, xq, yq, zq)
subroutine, public cgal_polyhedron_end(cgal_poly)
integer, parameter, public clock_tick
subroutine, public current_calculate_mag(this, namespace, der, hm, st)
Compute magnetization current Note: due to the the numerical curl, the magnetization current could de...
subroutine, public current_calculate(this, namespace, gr, hm, space, st)
Compute total electronic current density.
subroutine, public current_init(this, namespace)
subroutine, public density_calc(st, gr, density, istin)
Computes the density from the orbitals in st.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_test(this, namespace, repetitions, min_blocksize, max_blocksize)
unit test for derivatives
subroutine, public dderivatives_lapl(der, ff, op_ff, ghost_update, set_bc, factor)
apply the Laplacian to a mesh function
subroutine, public zderivatives_test(this, namespace, repetitions, min_blocksize, max_blocksize)
unit test for derivatives
subroutine, public exponential_init(te, namespace)
real(8), parameter, public m_five
real(8), parameter, public m_pi
some mathematical constants
real(8), parameter, public m_two
real(8), parameter, public r_small
real(8), parameter, public p_c
real(8), parameter, public m_one
complex(8), parameter, public m_zi
real(8), parameter, public m_zero
real(8), parameter, public m_half
real(8), parameter, public m_four
real(8), parameter, public m_third
real(8), parameter, public m_three
This module implements the underlying real-space grid.
subroutine, public zhamiltonian_elec_apply_batch(hm, namespace, mesh, psib, hpsib, terms, set_bc)
subroutine, public hamiltonian_elec_epot_generate(this, namespace, space, gr, ions, ext_partners, st, time)
subroutine, public dhamiltonian_elec_apply_batch(hm, namespace, mesh, psib, hpsib, terms, set_bc)
The Helmholtz decomposition is intended to contain "only mathematical" functions and procedures to co...
Test suit for the Helmholtz decomposition module.
subroutine, public gaussian_test(helmholtz, sys_grid, namespace, space)
subroutine, public hertzian_dipole_test(helmholtz, sys_grid, namespace, space)
This module implements a simple hash table for non-negative integer keys and integer values.
subroutine, public iihash_end(h)
Free a hash table.
subroutine, public iihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
integer function, public iihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
subroutine, public iihash_init(h)
Initialize a hash table h.
subroutine, public dio_function_output(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
integer(i8) function, public io_function_fill_how(where)
Use this function to quickly plot functions for debugging purposes: call dio_function_output(io_funct...
subroutine, public ion_interaction_test(space, latt, atom, natoms, pos, lsize, namespace, mc)
This module defines functions over batches of mesh functions.
subroutine, public dmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
subroutine, public dmesh_batch_dotp_self(mesh, aa, dot, reduce)
calculate the overlap matrix of a batch with itself
subroutine, public mesh_batch_nrm2(mesh, aa, nrm2, reduce)
Calculate the norms (norm2, not the square!) of a batch of mesh functions.
subroutine, public zmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
subroutine, public zmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
subroutine, public zmesh_batch_normalize(mesh, psib, norm)
Normalize a batch.
subroutine, public zmesh_batch_dotp_self(mesh, aa, dot, reduce)
calculate the overlap matrix of a batch with itself
subroutine, public dmesh_batch_normalize(mesh, psib, norm)
Normalize a batch.
subroutine, public dmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
This module defines various routines, operating on mesh functions.
class(mesh_t), pointer, public mesh_aux
real(8) function, public dmf_dotp_aux(f1, f2)
dot product between two vectors
subroutine, public mesh_init_mesh_aux(mesh)
subroutine, public zmesh_interpolation_test(mesh)
subroutine, public dmesh_interpolation_test(mesh)
This module defines the meshes, which are used in Octopus.
subroutine, public mesh_r(mesh, ip, rr, origin, coords)
return radial component
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
character(len=512), private msg
subroutine, public push_sub(sub_name)
subroutine, public messages_obsolete_variable(namespace, name, rep)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public pop_sub(sub_name)
type(mpi_grp_t), public mpi_world
subroutine, public test_mpiwrappers
This module handles the communicators for the various parallelization strategies.
integer, parameter, public p_strategy_domains
parallelization in domains
integer, parameter, public p_strategy_kpoints
parallelization in k-points
integer, parameter, public p_strategy_states
parallelization in states
subroutine, public multigrid_init(mgrid, namespace, space, mesh, der, stencil, mc, used_for_preconditioner)
subroutine, public multigrid_end(mgrid)
subroutine, public dmultigrid_fine2coarse(tt, fine_der, coarse_mesh, f_fine, f_coarse, method_p)
integer, parameter, public fullweight
subroutine, public dmultigrid_coarse2fine(tt, coarse_der, fine_mesh, f_coarse, f_fine, order, set_bc)
integer, parameter, public injection
type(namespace_t), public global_namespace
subroutine, public orbitalbasis_end(this)
subroutine, public zorbitalbasis_build(this, namespace, ions, mesh, kpt, ndim, skip_s_orb, use_all_orb, verbose)
This routine is an interface for constructing the orbital basis.
subroutine, public dorbitalbasis_build(this, namespace, ions, mesh, kpt, ndim, skip_s_orb, use_all_orb, verbose)
This routine is an interface for constructing the orbital basis.
subroutine, public orbitalbasis_init(this, namespace, periodic_dim)
subroutine, public dorbitalset_get_coeff_batch(os, ndim, psib, dot)
subroutine, public dorbitalset_add_to_batch(os, ndim, psib, weight)
subroutine, public zorbitalset_add_to_batch(os, ndim, psib, weight)
subroutine, public orbitalset_update_phase(os, dim, kpt, kpoints, spin_polarized, vec_pot, vec_pot_var, kpt_max)
Build the phase correction to the global phase in case the orbital crosses the border of the simulato...
subroutine, public zorbitalset_get_coeff_batch(os, ndim, psib, dot)
subroutine, public poisson_test(this, space, mesh, latt, namespace, repetitions)
This routine checks the Hartree solver selected in the input file by calculating numerically and anal...
subroutine, public preconditioner_end(this)
subroutine, public preconditioner_init(this, namespace, gr, mc, space)
subroutine, public zproject_psi_batch(mesh, bnd, pj, npj, dim, psib, ppsib)
To optimize the application of the non-local operator in parallel, the projectors are applied in step...
Implementation details for regridding.
This module implements a simple hash table for string valued keys and integer values using the C++ ST...
subroutine, public sihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
subroutine, public sihash_init(h)
Initialize a hash table h with size entries. Since we use separate chaining, the number of entries in...
integer function, public sihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
subroutine, public sihash_end(h)
Free a hash table.
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public space_init(this, namespace)
This module implements a simple hash table for string valued keys and integer values using the C++ ST...
subroutine, public sphash_init(h)
Initialize a hash table h with size entries. Since we use separate chaining, the number of entries in...
subroutine, public sphash_insert(h, key, val, clone)
Insert a (key, val) pair into the hash table h. If clone=.true., the object will be copied.
subroutine, public sphash_end(h)
Free a hash table.
class(*) function, pointer, public sphash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
pure logical function, public states_are_real(st)
subroutine, public zstates_elec_calc_orth_test(st, namespace, mesh, kpoints)
subroutine, public dstates_elec_calc_orth_test(st, namespace, mesh, kpoints)
integer, parameter, public spin_polarized
subroutine, public states_elec_deallocate_wfns(st)
Deallocates the KS wavefunctions defined within a states_elec_t structure.
subroutine, public states_elec_allocate_wfns(st, mesh, wfs_type, skip, packed)
Allocates the KS wavefunctions defined within a states_elec_t structure.
subroutine, public states_elec_allocate_current(st, space, mesh)
subroutine, public dsubspace_diag(this, namespace, mesh, st, hm, ik, eigenval, diff, nonortho)
Diagonalises the Hamiltonian in the subspace defined by the states.
subroutine, public zsubspace_diag(this, namespace, mesh, st, hm, ik, eigenval, diff, nonortho)
Diagonalises the Hamiltonian in the subspace defined by the states.
This module implements a unit-test like runmode for Octopus.
subroutine test_helmholtz_decomposition(namespace)
subroutine test_hartree(param, namespace)
subroutine test_derivatives(param, namespace)
subroutine test_subspace_diagonalization(param, namespace)
subroutine, public test_run(namespace)
subroutine test_density_calc(param, namespace)
subroutine test_current_density(namespace)
Here we test the different contributions to the total electronic current density.
subroutine test_batch_set_gaussian(psib, mesh)
complex(8) function lc_hydrogen_state(rr, alpha, a0)
real(8) function psi_2s(rr, a0)
subroutine test_regridding(namespace)
subroutine test_sphash(namespace)
subroutine test_hamiltonian(param, namespace)
subroutine test_dense_eigensolver()
real(8) function psi_1s(rr, a0)
subroutine test_interpolation(param, namespace)
subroutine multigrid_test_interpolation(mgrid, space)
subroutine test_ion_interaction(namespace)
subroutine test_boundaries(param, namespace)
subroutine test_orthogonalization(param, namespace)
subroutine test_batch_ops(param, namespace)
subroutine test_projector(param, namespace)
subroutine test_dft_u(param, namespace)
subroutine test_prints_info_batch(st, gr, psib, string)
real(8) function dr_psi_2s(rr, a0)
subroutine test_linear_solver(namespace)
subroutine test_grid_interpolation()
subroutine set_hydrogen_states(psib, mesh, namespace, alpha, a0)
real(8) function dr_psi_1s(rr, a0)
subroutine test_exponential(param, namespace)
subroutine test_vecpot_analytical(namespace)
Here, analytical formulation for vector potential and B field are used. Ref: Sangita Sen and Erik I....
type(type_t), public type_cmplx
logical pure function, public type_is_complex(this)
This module defines the unit system, used for input and output.
type(unit_t), public unit_one
some special units required for particular quantities
subroutine, public v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval, time, calc_energy, calc_current, use_vxc)
Class defining batches of mesh functions.
class representing derivatives
Class describing the electron system.
Description of the grid, containing information on derivatives, stencil, and symmetries.
Class describing Maxwell systems.
Describes mesh distribution to nodes.
contains the information of the meshes and provides the transfer functions
The states_elec_t class contains all electronic wave funnctions.
batches of electronic states
subroutine laplacian_op(x, hx)
Computes .
subroutine set_der_aux(der)
real(8) function values(xx)