JDFTx  1.2.0
Fex_LJ.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------
2 Copyright 2014 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 #ifndef JDFTX_FLUID_FEX_LJ_H
21 #define JDFTX_FLUID_FEX_LJ_H
22 
25 
26 #include <fluid/Fex.h>
27 #include <fluid/Fmix.h>
28 
30 void setLJatt(RadialFunctionG& kernel, const GridInfo& gInfo, double eps, double sigma);
31 
32 
34 class Fex_LJ : public Fex
35 {
36 public:
37 
40  Fex_LJ(const FluidMixture*, const FluidComponent*, double eps, double sigmaOverride = 0.0);
41  virtual ~Fex_LJ();
42 
43  double compute(const ScalarFieldTilde* Ntilde, ScalarFieldTilde* Phi_Ntilde) const;
44  double computeUniform(const double* N, double* Phi_N) const;
45 private:
46  friend class Fmix_LJ; //allow Fmix_LJ to peek at eps and sigma to select coupling parameters
47  double sigma;
48  RadialFunctionG ljatt;
49 };
50 
52 class Fmix_LJ : public Fmix
53 {
54 public:
57  Fmix_LJ(FluidMixture*, std::shared_ptr<FluidComponent> fluid1, std::shared_ptr<FluidComponent> fluid2, double eps, double sigma);
58  virtual ~Fmix_LJ();
59  string getName() const;
60 
61  double compute(const ScalarFieldTildeArray& Ntilde, ScalarFieldTildeArray& Phi_Ntilde) const;
62  double computeUniform(const std::vector<double>& N, std::vector<double>& Phi_N) const;
63 private:
64  std::shared_ptr<FluidComponent> fluid1, fluid2;
65  RadialFunctionG ljatt;
66 };
67 
69 class Fmix_GaussianKernel : public Fmix
70 {
71 public:
75  Fmix_GaussianKernel(FluidMixture*, std::shared_ptr<FluidComponent> fluid1, std::shared_ptr<FluidComponent> fluid2, double Esolv, double Rsolv);
76  virtual ~Fmix_GaussianKernel();
77  string getName() const;
78 
79  double compute(const ScalarFieldTildeArray& Ntilde, ScalarFieldTildeArray& Phi_Ntilde) const;
80  double computeUniform(const std::vector<double>& N, std::vector<double>& Phi_N) const;
81 private:
82  std::shared_ptr<FluidComponent> fluid1, fluid2;
83  RadialFunctionG Ksolv; //shape function for interaction
84  double Kmul; //prefactor to interaction
85 
86 };
87 
88 #endif // JDFTX_FLUID_FEX_LJ_H
Gaussian Kernel interaction functional.
Definition: Fex_LJ.h:69
Simulation grid descriptor.
Definition: GridInfo.h:45
double computeUniform(const double *N, double *Phi_N) 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
Abstract base class for mixing functionals: interactions between fluids (beyond hard sphere and scale...
Definition: Fmix.h:29
Abstract base class for excess functionals.
Definition: Fex.h:29
double compute(const ScalarFieldTilde *Ntilde, ScalarFieldTilde *Phi_Ntilde) const
Lennard-Jones interaction functional.
Definition: Fex_LJ.h:52
void setLJatt(RadialFunctionG &kernel, const GridInfo &gInfo, double eps, double sigma)
Initialize kernel to the attarctive part of a Lennard-Jones potential.
Fex_LJ(const FluidMixture *, const FluidComponent *, double eps, double sigmaOverride=0.0)
Named fluid components for which bulk properties / geometries / excess functionals are available...
Definition: FluidComponent.h:27
G-space radial function stored on a uniform grid (of |G|)
Definition: RadialFunction.h:28
std::vector< ScalarFieldTilde > ScalarFieldTildeArray
dynamic size collection of reciprocal space scalar fields
Definition: ScalarFieldArray.h:33
Lennard Jones fluid treated as a mean field perturbation about a soft FMT core.
Definition: Fex_LJ.h:34