ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
conv_coulomb_pot_k.hpp
Go to the documentation of this file.
1#ifndef CONV_COULOMB_POT_K_HPP
2#define CONV_COULOMB_POT_K_HPP
3
6#include <cmath>
7#include <cassert>
8
9namespace Conv_Coulomb_Pot_K
10{
11
12 template< typename T >
13 std::vector<T> cal_orbs_ccp(
14 const std::vector<T> & orbs,
15 const std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> &coulomb_param,
16 const double rmesh_times)
17 {
18 std::vector<T> orbs_ccp(orbs.size());
19 for( size_t i=0; i!=orbs.size(); ++i )
20 orbs_ccp[i] = cal_orbs_ccp(orbs[i], coulomb_param, rmesh_times);
21 return orbs_ccp;
22 }
23
24 template< typename T >
26 const std::vector<T> & orbs,
27 const double psi_threshold)
28 {
29 double rmesh_proportion=0;
30 for( const auto &orb : orbs )
31 rmesh_proportion = std::max(rmesh_proportion, get_rmesh_proportion(orb,psi_threshold));
32 return rmesh_proportion;
33 }
34
35 template< typename T >
36 std::vector<T> cal_orbs_ccp_spencer(
37 const std::vector<T> & orbs,
38 const std::map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> &coulomb_param,
39 const double rmesh_times)
40 {
41 std::vector<T> orbs_ccp(orbs.size());
42 for( size_t i=0; i!=orbs.size(); ++i )
43 orbs_ccp[i] = cal_orbs_ccp_spencer(orbs[i], coulomb_param, rmesh_times);
44 return orbs_ccp;
45 }
46
47 // for cal_orbs_ccp()
48 template<typename T>
49 std::vector<T> operator*(const T &s, const std::vector<T> &v_in)
50 {
51 std::vector<T> v(v_in.size());
52 for(std::size_t i=0; i<v.size(); ++i)
53 { v[i] = s * v_in[i]; }
54 return v;
55 }
56 template<typename T>
57 std::vector<T> operator+ (const std::vector<T> &v1, const std::vector<T> &v2)
58 {
59 assert(v1.size()==v2.size());
60 std::vector<T> v(v1.size());
61 for(std::size_t i=0; i<v.size(); ++i)
62 { v[i] = v1[i] + v2[i]; }
63 return v;
64 }
65}
66
67#endif
const std::complex< double > i
Definition cal_pLpR.cpp:46
#define T
Definition exp.cpp:237
Definition conv_coulomb_pot_k.cpp:7
std::vector< T > operator*(const T &s, const std::vector< T > &v_in)
Definition conv_coulomb_pot_k.hpp:49
Coulomb_Type
Definition conv_coulomb_pot_k.h:10
double get_rmesh_proportion(const Numerical_Orbital_Lm &orbs, const double psi_threshold)
Definition conv_coulomb_pot_k.cpp:254
T cal_orbs_ccp_spencer(const T &orbs, const std::map< Conv_Coulomb_Pot_K::Coulomb_Type, std::vector< std::map< std::string, std::string > > > &coulomb_param, const double rmesh_times)
T cal_orbs_ccp(const T &orbs, const std::map< Conv_Coulomb_Pot_K::Coulomb_Type, std::vector< std::map< std::string, std::string > > > &coulomb_param, const double rmesh_times)
std::vector< T > operator+(const std::vector< T > &v1, const std::vector< T > &v2)
Definition conv_coulomb_pot_k.hpp:57