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 blas_oct_m
13 use comm_oct_m
14 use debug_oct_m
17 use global_oct_m
20 use, intrinsic :: iso_fortran_env
22 use loct_oct_m
23 use mesh_oct_m
27 use mpi_oct_m
33 use types_oct_m
35
36 implicit none
37 private
38
41 integer :: n_lanczos
42 integer :: degree
43 real(real64) :: bound_mixing
44 ! !< for approximation of the spectral filter''s lower bound:
45 ! !< lower_bound = bm * min(e_approx) + (bm - 1) * max(eig_approx)
46 ! !< such that bm = 0 => lower_bound = max(eig_approx)
47 ! !< bm = 1 => lower_bound = min(eig_approx)
48 integer :: n_iter
49 logical :: optimize_degree
50
51 real(real64), allocatable :: dlanczos_state(:,:,:)
52 ! this converges faster than a random state at each step
53 complex(real64), allocatable :: zlanczos_state(:,:,:)
54 logical :: known_lower_bound = .false.
55 contains
56 final :: finalize
57 end type eigen_chebyshev_t
58
69 type(eigen_chebyshev_t) :: default_chebyshev_params = eigen_chebyshev_t(-1, 15, m_half, 5, .true.)
70
72 private
73 type(wfs_elec_t), pointer :: batch
74 end type batch_pointer_t
75
76 public :: &
78 default_chebyshev_params, &
82
83contains
84
86 subroutine finalize(this)
87 type(eigen_chebyshev_t), intent(inout) :: this
88
89 safe_deallocate_a(this%dlanczos_state)
90 safe_deallocate_a(this%zlanczos_state)
91
92 end subroutine finalize
93
94
95#include "real.F90"
96#include "eigen_chebyshev_inc.F90"
97#include "undef.F90"
98
99#include "complex.F90"
100#include "eigen_chebyshev_inc.F90"
101#include "undef.F90"
102
103end module eigen_chebyshev_oct_m
This module implements batches of mesh functions.
Definition: batch.F90:112
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:95
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:97
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:179
System information (time, memory, sysname)
Definition: loct.F90:94
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:95
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:97
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
int true(void)