-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathimpl.hpp
More file actions
143 lines (100 loc) · 4.26 KB
/
impl.hpp
File metadata and controls
143 lines (100 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/**
* GauXC Copyright (c) 2020-2023, The Regents of the University of California,
* through Lawrence Berkeley National Laboratory (subject to receipt of
* any required approvals from the U.S. Dept. of Energy). All rights reserved.
*
* See LICENSE.txt for details
*/
#pragma once
#include <gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp>
#include <gauxc/exceptions.hpp>
// Implementations of ReplicatedXCIntegrator public API
namespace GauXC {
namespace detail {
template <typename MatrixType>
ReplicatedXCIntegrator<MatrixType>::
ReplicatedXCIntegrator( std::unique_ptr<pimpl_type>&& pimpl ) :
pimpl_(std::move(pimpl)){ }
template <typename MatrixType>
ReplicatedXCIntegrator<MatrixType>::ReplicatedXCIntegrator():
ReplicatedXCIntegrator(nullptr){ }
template <typename MatrixType>
ReplicatedXCIntegrator<MatrixType>::~ReplicatedXCIntegrator() noexcept = default;
template <typename MatrixType>
ReplicatedXCIntegrator<MatrixType>::
ReplicatedXCIntegrator(ReplicatedXCIntegrator&&) noexcept = default;
template <typename MatrixType>
const util::Timer& ReplicatedXCIntegrator<MatrixType>::get_timings_() const {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->get_timings();
}
template <typename MatrixType>
const LoadBalancer& ReplicatedXCIntegrator<MatrixType>::get_load_balancer_() const {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->get_load_balancer();
}
template <typename MatrixType>
LoadBalancer& ReplicatedXCIntegrator<MatrixType>::get_load_balancer_() {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->get_load_balancer();
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::value_type
ReplicatedXCIntegrator<MatrixType>::integrate_den_( const MatrixType& P ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
value_type N_EL;
pimpl_->integrate_den( P.rows(), P.cols(), P.data(), P.rows(), &N_EL );
return N_EL;
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exc_vxc_type_rks
ReplicatedXCIntegrator<MatrixType>::eval_exc_vxc_( const MatrixType& P ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
matrix_type VXC( P.rows(), P.cols() );
value_type EXC;
pimpl_->eval_exc_vxc( P.rows(), P.cols(), P.data(), P.rows(),
VXC.data(), VXC.rows(), &EXC );
return std::make_tuple( EXC, VXC );
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exc_vxc_type_uks
ReplicatedXCIntegrator<MatrixType>::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() );
matrix_type VXCz( Pz.rows(), Pz.cols() );
value_type EXC;
pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(),
Pz.data(), Pz.rows(),
VXCscalar.data(), VXCscalar.rows(),
VXCz.data(), VXCz.rows(), &EXC );
return std::make_tuple( EXC, VXCscalar, VXCz );
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exc_grad_type
ReplicatedXCIntegrator<MatrixType>::eval_exc_grad_( const MatrixType& P ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
std::vector<value_type> EXC_GRAD( 3*pimpl_->load_balancer().molecule().natoms() );
pimpl_->eval_exc_grad( P.rows(), P.cols(), P.data(), P.rows(),
EXC_GRAD.data() );
return EXC_GRAD;
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exx_type
ReplicatedXCIntegrator<MatrixType>::eval_exx_( const MatrixType& P, const IntegratorSettingsEXX& settings ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
matrix_type K( P.rows(), P.cols() );
pimpl_->eval_exx( P.rows(), P.cols(), P.data(), P.rows(),
K.data(), K.rows(), settings );
return K;
}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::atomic_overlap_type
ReplicatedXCIntegrator<MatrixType>::eval_atomic_overlap_( int64_t iAtom ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
const size_t nbf = get_load_balancer_().basis().nbf();
matrix_type S( nbf, nbf );
pimpl_->eval_atomic_overlap( iAtom, nbf, nbf, S.data(), nbf );
return S;
}
}
}