JDFTx  1.2.0
IdealGasPomega.h
1 /*-------------------------------------------------------------------
2 Copyright 2012 Ravishankar Sundararaman
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_IDEALGASPOMEGA_H
21 #define JDFTX_FLUID_IDEALGASPOMEGA_H
22 
23 #include <fluid/IdealGas.h>
24 #include <fluid/SO3quad.h>
26 #include <core/VectorField.h>
27 
30 class IdealGasPomega : public IdealGas
31 {
32 public:
35  IdealGasPomega(const FluidMixture*, const FluidComponent*, const SO3quad& quad, const TranslationOperator& trans, unsigned nIndepOverride=0);
36 
37  void initState(const ScalarField* Vex, ScalarField* indep, double scale, double Elo, double Ehi) const;
38  void getDensities(const ScalarField* indep, ScalarField* N, vector3<>& P0) const;
39  double compute(const ScalarField* indep, const ScalarField* N, ScalarField* Phi_N, const double Nscale, double& Phi_Nscale) const;
40  void convertGradients(const ScalarField* indep, const ScalarField* N, const ScalarField* Phi_N, const vector3<>& Phi_P0, ScalarField* Phi_indep, const double Nscale) const;
41 
42 protected:
43  const SO3quad& quad;
46  int oStart, oStop;
47 
48  virtual string representationName() const;
49 
50  //These functions are called once for each orientation:
51  virtual void initState_o(int o, const matrix3<>& rot, double scale, const ScalarField& Eo, ScalarField* state) const;
52  virtual void getDensities_o(int o, const matrix3<>& rot, const ScalarField* state, ScalarField& logPomega_o) const;
53  virtual void convertGradients_o(int o, const matrix3<>& rot, const ScalarField& Phi_logPomega_o, ScalarField* Phi_state) const;
54 
55 private:
56  double S;
57  double Ecorr; VectorField Ecorr_P;
58 };
59 
60 #endif // JDFTX_FLUID_IDEALGASPOMEGA_H
void convertGradients(const ScalarField *indep, const ScalarField *N, const ScalarField *Phi_N, const vector3<> &Phi_P0, ScalarField *Phi_indep, const double Nscale) const
Abstract base class for an IdealGas evaluator.
Definition: IdealGas.h:29
void getDensities(const ScalarField *indep, ScalarField *N, vector3<> &P0) const
Given the independent variables indep, compute the site densities N and G=0 component of polarization...
const TranslationOperator & trans
translation operator for orientation integral
Definition: IdealGasPomega.h:44
Quadratures for SO(3)
Mixture of fluids that provides the total free energy functional for minimization Constructing Fex an...
Definition: FluidMixture.h:32
vector3 pMol
molecule dipole moment in reference frame
Definition: IdealGasPomega.h:45
Definition: IdealGasPomega.h:30
double compute(const ScalarField *indep, const ScalarField *N, ScalarField *Phi_N, const double Nscale, double &Phi_Nscale) const
int oStop
portion of orientation loop handled by current process
Definition: IdealGasPomega.h:46
const SO3quad & quad
quadrature for orientation integral
Definition: IdealGasPomega.h:43
IdealGasPomega(const FluidMixture *, const FluidComponent *, const SO3quad &quad, const TranslationOperator &trans, unsigned nIndepOverride=0)
Abstract base class for translation operators.
Definition: TranslationOperator.h:30
Named fluid components for which bulk properties / geometries / excess functionals are available...
Definition: FluidComponent.h:27
Generic multiplet of data arrays (and specialized to triplets for vector fields in real/reciprocal sp...
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41
void initState(const ScalarField *Vex, ScalarField *indep, double scale, double Elo, double Ehi) const
Quadrature for SO(3)
Definition: SO3quad.h:34