JDFTx  1.2.0
ConvCoupling.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman, Kendra Letchworth Weaver
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 
21 #ifndef JDFTX_ELECTRONIC_CONVCOUPLING_H
22 #define JDFTX_ELECTRONIC_CONVCOUPLING_H
23 
24 #include <fluid/Fmix.h>
25 #include <fluid/Molecule.h>
26 #include <fluid/FluidMixture.h>
27 #include <electronic/common.h>
28 
30 class ConvCoupling : public Fmix
31 {
32 public:
33  ConvCoupling(FluidMixture* fluidMixture, const ExCorr& exCorr);
34 
37  void setExplicit(const ScalarFieldTilde& nCavityTilde);
38 
40  double energyAndGrad(const ScalarFieldTildeArray& Ntilde, ScalarFieldTildeArray* Phi_Ntilde=0, ScalarFieldTilde* Phi_nCavityTilde=0) const;
41 
42  //Interface to fluid side (virtual functions from Fmix):
43  double computeUniform(const std::vector<double>& N, std::vector<double>& Phi_N) const;
44  double compute(const ScalarFieldTildeArray& Ntilde, ScalarFieldTildeArray& Phi_Ntilde) const;
45  string getName() const;
46  double Vxc_bulk;
47  const ExCorr& exCorr;
48 
49 private:
50  const std::vector<const FluidComponent*>& component;
51  ScalarField nCavity;
52 };
53 
54 #endif // JDFTX_ELECTRONIC_CONVCOUPLING_H
double compute(const ScalarFieldTildeArray &Ntilde, ScalarFieldTildeArray &Phi_Ntilde) const
Mixture of fluids that provides the total free energy functional for minimization Constructing Fex an...
Definition: FluidMixture.h:32
std::shared_ptr< ScalarFieldTildeData > ScalarFieldTilde
A smart reference-counting pointer to ScalarFieldTildeData.
Definition: ScalarField.h:45
double energyAndGrad(const ScalarFieldTildeArray &Ntilde, ScalarFieldTildeArray *Phi_Ntilde=0, ScalarFieldTilde *Phi_nCavityTilde=0) const
Main energy and gradients function.
Abstract base class for mixing functionals: interactions between fluids (beyond hard sphere and scale...
Definition: Fmix.h:29
Convolution coupling between electrons and fluids.
Definition: ConvCoupling.h:30
Definition: ExCorr.h:72
string getName() const
A string identifier for this mixing functional (used in EnergyComponent label)
void setExplicit(const ScalarFieldTilde &nCavityTilde)
double computeUniform(const std::vector< double > &N, std::vector< double > &Phi_N) const
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41
std::vector< ScalarFieldTilde > ScalarFieldTildeArray
dynamic size collection of reciprocal space scalar fields
Definition: ScalarFieldArray.h:33