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 // for cal_orbs_ccp()
36 template<typename T>
37 std::vector<T> operator*(const T &s, const std::vector<T> &v_in)
38 {
39 std::vector<T> v(v_in.size());
40 for(std::size_t i=0; i<v.size(); ++i)
41 { v[i] = s * v_in[i]; }
42 return v;
43 }
44 template<typename T>
45 std::vector<T> operator+ (const std::vector<T> &v1, const std::vector<T> &v2)
46 {
47 assert(v1.size()==v2.size());
48 std::vector<T> v(v1.size());
49 for(std::size_t i=0; i<v.size(); ++i)
50 { v[i] = v1[i] + v2[i]; }
51 return v;
52 }
53}
54
55#endif
#define T
Definition exp.cpp:237
Definition conv_coulomb_pot_k.cpp:8
std::vector< T > operator*(const T &s, const std::vector< T > &v_in)
Definition conv_coulomb_pot_k.hpp:37
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:151
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:45