Octopus
eigen_chebyshev.F90
Go to the documentation of this file.
1!! Copyright (C) 2023. A Buccheri.
2!!
3!! This Source Code Form is subject to the terms of the Mozilla Public
4!! License, v. 2.0. If a copy of the MPL was not distributed with this
5!! file, You can obtain one at https://mozilla.org/MPL/2.0/.
6!!
7#include "global.h"
8
10 use batch_oct_m
12 use comm_oct_m
13 use debug_oct_m
16 use global_oct_m
19 use, intrinsic :: iso_fortran_env
21 use loct_oct_m
22 use mesh_oct_m
26 use mpi_oct_m
33
34 implicit none
35 private
36
39 integer :: n_lanczos
40 integer :: degree
41 real(real64) :: bound_mixing
42 ! !< for approximation of the spectral filter''s lower bound:
43 ! !< lower_bound = bm * min(e_approx) + (bm - 1) * max(eig_approx)
44 ! !< such that bm = 0 => lower_bound = max(eig_approx)
45 ! !< bm = 1 => lower_bound = min(eig_approx)
46 integer :: n_iter
47 logical :: optimize_degree
48
49 real(real64), allocatable :: dlanczos_state(:,:,:)
50 ! this converges faster than a random state at each step
51 complex(real64), allocatable :: zlanczos_state(:,:,:)
52 logical :: known_lower_bound = .false.
53 contains
54 final :: finalize
55 end type eigen_chebyshev_t
56
67 type(eigen_chebyshev_t) :: default_chebyshev_params = eigen_chebyshev_t(-1, 15, m_half, 5, .true.)
68
70 private
71 type(wfs_elec_t), pointer :: batch
72 end type batch_pointer_t
73
74 public :: &
76 default_chebyshev_params, &
80
81contains
82
84 subroutine finalize(this)
85 type(eigen_chebyshev_t), intent(inout) :: this
86
87 safe_deallocate_a(this%dlanczos_state)
88 safe_deallocate_a(this%zlanczos_state)
89
90 end subroutine finalize
91
92
93#include "real.F90"
94#include "eigen_chebyshev_inc.F90"
95#include "undef.F90"
96
97#include "complex.F90"
98#include "eigen_chebyshev_inc.F90"
99#include "undef.F90"
100
101end module eigen_chebyshev_oct_m
This module implements batches of mesh functions.
Definition: batch.F90:135
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:118
subroutine finalize(this)
Finalizer.
subroutine, public zchebyshev_filter(namespace, mesh, st, hm, degree, bounds, ik, normalize)
Chebyshev Filter.
subroutine, public zchebyshev_filter_solver(namespace, sdiag, mesh, st, hm, ik, subspace_tol, filter_params, prior_residuals)
Driver for Chebyshev filter-based solver.
subroutine, public dchebyshev_filter(namespace, mesh, st, hm, degree, bounds, ik, normalize)
Chebyshev Filter.
subroutine, public dchebyshev_filter_solver(namespace, sdiag, mesh, st, hm, ik, subspace_tol, filter_params, prior_residuals)
Driver for Chebyshev filter-based solver.
real(real64), parameter, public m_half
Definition: global.F90:197
System information (time, memory, sysname)
Definition: loct.F90:117
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:118
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
int true(void)