QMCPACK
Pressure.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_BAREPRESSURE_H
16 #define QMCPLUSPLUS_BAREPRESSURE_H
17 #include "Particle/ParticleSet.h"
21 #include "OhmmsData/ParameterSet.h"
22 
23 
24 namespace qmcplusplus
25 {
26 /** @ingroup hamiltonian
27  @brief Evaluate the Bare Pressure.
28  P=/frac{2T+V}{d* /Omega}
29  where d is the dimension of space and /Omega is the volume.
30 **/
31 
32 struct Pressure : public OperatorBase
33 {
35  double pNorm;
36  // bool ZV;
37  // bool ZB;
38 
39  /** constructor
40  *
41  * Pressure operators need to be re-evaluated during optimization.
42  */
44  {
45  update_mode_.set(OPTIMIZABLE, 1);
46  pNorm = 1.0 / (P.getLattice().DIM * P.getLattice().Volume);
47  }
48  ///destructor
49  ~Pressure() override {}
50 
51  bool dependsOnWaveFunction() const override { return true; }
52  std::string getClassName() const override { return "Pressure"; }
53  void resetTargetParticleSet(ParticleSet& P) override { pNorm = 1.0 / (P.getLattice().DIM * P.getLattice().Volume); }
54 
55  inline Return_t evaluate(ParticleSet& P) override
56  {
57  value_ = 2.0 * P.PropertyList[WP::LOCALENERGY] - P.PropertyList[WP::LOCALPOTENTIAL];
58  value_ *= pNorm;
59  return 0.0;
60  }
61 
62  /** implements the virtual function.
63  *
64  * Nothing is done but should check the mass
65  */
66 
67  bool put(xmlNodePtr cur) override { return true; }
68 
69  // bool put(xmlNodePtr cur, ParticleSet& P, QMCHamiltonian* H) {
70  // xmlNodePtr tcur = cur->children;
71  //
72  // double RPAKCut= -1.0;
73  // std::string RPAPCorr("ZB");
74  // std::string RPAPfunc("RPA_LR");
75  // ParameterSet nattrib;
76  // OhmmsAttributeSet attrib;
77  // attrib.add(RPAPCorr,"etype" );
78  // attrib.add(RPAPfunc,"functor" );
79  // attrib.put(cur);
80  // nattrib.add(RPAKCut,"kc");
81  // nattrib.put(cur);
82 
83  // if (RPAPCorr=="ZB"){
84  // ZB=true;
85  // ZV=false;
86  // bpcorr = new RPAPressureCorrection(P);
87  // bpcorr-> put(cur, P);
88  // H->addOperator(bpcorr,"ZVterm");
89  // }
90  // else if (RPAPCorr=="ZVZB"){
91  // ZB=true;
92  // ZV=true;
93  // bpcorr = new RPAPressureCorrection(P);
94  // wfderivE = new RPADerivEnergy(P);
95  // wfderivE2 = new RPADerivEnergy2(P);
96  // wfEP = new RPAEnergyPressure(P);
97  // bpcorr-> put(cur, P);
98  // wfderiv = new RPADeriv(P);
99  // wfderiv -> put(cur, bpcorr);
100  // wfderivE -> put(cur, bpcorr, H);
101  // wfderivE2 -> put(cur, bpcorr, H);
102  // wfEP -> put(cur, bpcorr, H);
103  // potkin = new RPAPotKin(P);
104  // H->addOperator(potkin,"PotKin");
105  // H->addOperator(wfEP,"EPterm");
106  // H->addOperator(bpcorr,"ZVterm");
107  // H->addOperator(wfderiv,"dpsi");
108  // H->addOperator(wfderivE,"Edpsi");
109  // H->addOperator(wfderivE2,"Tdpsi");
110  // }
111  // else if (RPAPCorr=="ZV"){
112  // ZV=true;
113  // ZB=false;
114  // bpcorr = new RPAPressureCorrection(P);
115  // bpcorr-> put(cur, P);
116  // H->addOperator(bpcorr,"ZVterm");
117  // }
118  // else if (RPAPCorr=="none"){
119  // ZV=false;
120  // ZB=false;
121  // app_log() <<" using bare estimator "<< std::endl;;
122  // }
123 
124  // return true;
125  // }
126 
127  bool get(std::ostream& os) const override
128  {
129  os << "Pressure";
130  return true;
131  }
132 
133  std::unique_ptr<OperatorBase> makeClone(ParticleSet& qp, TrialWaveFunction& psi) final
134  {
135  return std::make_unique<Pressure>(qp);
136  }
137 };
138 } // namespace qmcplusplus
139 #endif
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Definition: Pressure.h:133
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Definition: Pressure.h:53
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
bool dependsOnWaveFunction() const override
return true if this operator depends on a wavefunction
Definition: Pressure.h:51
Declaration of OperatorBase.
std::string getClassName() const override
return class name
Definition: Pressure.h:52
PropertySetType PropertyList
name-value map of Walker Properties
Definition: ParticleSet.h:112
Pressure(ParticleSet &P)
constructor
Definition: Pressure.h:43
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
Evaluate the Bare Pressure.
Definition: Pressure.h:32
An abstract class for Local Energy operators.
Definition: OperatorBase.h:59
FullPrecRealType Return_t
type of return value of evaluate
Definition: OperatorBase.h:64
Class to represent a many-body trial wave function.
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Definition: Pressure.h:55
Return_t value_
current value
Definition: OperatorBase.h:524
Indexes
an enum denoting index of physical properties
Declaraton of ParticleAttrib<T>
const auto & getLattice() const
Definition: ParticleSet.h:251
~Pressure() override
destructor
Definition: Pressure.h:49
std::bitset< 8 > update_mode_
set the current update mode
Definition: OperatorBase.h:521
bool put(xmlNodePtr cur) override
implements the virtual function.
Definition: Pressure.h:67