1 /* Copyright (c) 2015 Gerald Knizia 2 * 3 * This file is part of the IboView program (see: http://www.iboview.org) 4 * 5 * IboView is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, version 3. 8 * 9 * IboView is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with bfint (LICENSE). If not, see http://www.gnu.org/licenses/ 16 * 17 * Please see IboView documentation in README.txt for: 18 * -- A list of included external software and their licenses. The included 19 * external software's copyright is not touched by this agreement. 20 * -- Notes on re-distribution and contributions to/further development of 21 * the IboView software 22 */ 23 24 #ifndef _CT8K_DFT_FUNCTIONAL_H 25 #define _CT8K_DFT_FUNCTIONAL_H 26 27 #include "Ir.h" 28 #include "CxTypes.h" 29 #include <string> 30 #include <boost/intrusive_ptr.hpp> 31 32 namespace ct { 33 34 struct FXcFunctionalImpl; 35 36 37 38 struct FXcFunctional : public FIntrusivePtrDest 39 { 40 FXcFunctional(std::string const &Name); 41 ~FXcFunctional(); 42 43 bool NeedSigma() const; // GGA? 44 bool NeedTau() const; // tau-style m-GGA? 45 46 // input: rhoc, rhoo, sigmacc, sigmaco, sigmaoo49 47 // output: zk, vrhoc, vrhoo, vsigmacc, vsigmaco, vsigmaoo (case nDiff == 1) 48 // output: zk only (case nDiff == 0) 49 void Eval(double *pOut, size_t nOutSt, double const *pIn, size_t nInSt, size_t nPts, size_t nDiff); 50 // return derivative order: 51 // 0 == LDA, 1 == GGA or m-GGA (tau-style), 2 == m-GGA (upsilon-style) 52 uint nOrder() const; 53 NameFXcFunctional54 std::string const &Name() const { return m_Name; }; 55 std::string Desc() const; 56 private: 57 FXcFunctionalImpl 58 *p; 59 std::string 60 m_Name; 61 62 FXcFunctional( FXcFunctional const &other ); // not implemented. 63 void operator = ( FXcFunctional const &other ); // not implemented. 64 }; 65 66 typedef boost::intrusive_ptr<FXcFunctional> 67 FXcFunctionalPtr; 68 69 // typedef std::pair<FXcFunctionalPtr, FScalar> 70 // // maps a dft functional to its prefactor. 71 // FXcFunctionalSet; 72 73 74 75 } // namespace ct 76 77 #endif // DFT_FUNCTIONAL_H 78