votca 2024.2-dev
Loading...
Searching...
No Matches
vxc_potential.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_VXC_POTENTIAL_H
22#define VOTCA_XTP_VXC_POTENTIAL_H
23
24// Third party includes
25#include <xc.h>
26
27// Local VOTCA includes
28#include "grid_containers.h"
29#include "gridbox.h"
30
31#undef LOG
32
33namespace votca {
34namespace xtp {
35
36template <class Grid>
38 public:
39 explicit Vxc_Potential(const Grid& grid) : grid_(grid) {};
41
42 static double getExactExchange(const std::string& functional);
43 void setXCfunctional(const std::string& functional);
44 Mat_p_Energy IntegrateVXC(const Eigen::MatrixXd& density_matrix) const;
45
46 private:
47 struct XC_entry {
48 double f_xc = 0; // E_xc[n] = int{n(r)*eps_xc[n(r)] d3r} = int{ f_xc(r) d3r
49 double df_drho = 0; // v_xc_rho(r) = df/drho
50 double df_dsigma = 0; // df/dsigma ( df/dgrad(rho) = df/dsigma *
51 // dsigma/dgrad(rho) = df/dsigma * 2*grad(rho))
52 };
53
54 XC_entry EvaluateXC(double rho, double sigma) const;
55
56 const Grid grid_;
58 bool setXC_ = false;
61 xc_func_type xfunc; // handle for exchange functional
62 xc_func_type cfunc; // handle for correlation functional
63};
64
65} // namespace xtp
66} // namespace votca
67#endif // VOTCA_XTP_VXC_POTENTIAL_H
XC_entry EvaluateXC(double rho, double sigma) const
Mat_p_Energy IntegrateVXC(const Eigen::MatrixXd &density_matrix) const
void setXCfunctional(const std::string &functional)
Vxc_Potential(const Grid &grid)
static double getExactExchange(const std::string &functional)
base class for all analysis tools
Definition basebead.h:33
double f_xc
double df_dsigma
double df_drho