QMCPACK
StressPBC.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) 2020 QMCPACK developers
6 //
7 // File developed by: Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
8 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
9 // Yubo Paul Yang, yyang173@illinois.edu, University of Illinois Urbana-Champaign
10 //
11 // File created by: Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_STRESSPBC_HAMILTONIAN_H
16 #define QMCPLUSPLUS_STRESSPBC_HAMILTONIAN_H
20 #include "OhmmsPETE/SymTensor.h"
21 
22 namespace qmcplusplus
23 {
24 struct StressPBC : public OperatorBase, public ForceBase
25 {
27 
30 
31  // need wave function for kinetic stress
33 
34  ///source particle set
37  ///long-range Handler
38  std::unique_ptr<LRHandlerType> AA;
39  ///locator of the distance table
40  const int ei_table_index;
41  /// e-e table ID
42  const int ee_table_index;
43  const int ii_table_index;
44  ///number of species of A particle set
46  ///number of species of B particle set
48  ///number of particles of A (classical, e.g. ions)
49  int NptclA;
50  ///number of particles of B (quantum, e.g. electrons)
51  int NptclB;
52 
53  ///number of particles per species of A
54  std::vector<int> NofSpeciesA;
55  ///number of particles per species of B
56  std::vector<int> NofSpeciesB;
57  ///Zat[iat] charge for the iat-th particle of A
58  std::vector<RealType> Zat;
59  ///Qat[iat] charge for the iat-th particle of B
60  std::vector<RealType> Qat;
61  ///Zspec[spec] charge for the spec-th species of A
62  std::vector<RealType> Zspec;
63  ///Qspec[spec] charge for the spec-th species of B
64  std::vector<RealType> Qspec;
65  //Constructor
68 
69  std::string getClassName() const override { return "StressPBC"; }
70 
71  Return_t evaluate(ParticleSet& P) override;
72 
73  void initBreakup(ParticleSet& P);
74 
81 
83 
84  void registerObservables(std::vector<ObservableHelper>& h5list, hdf_archive& file) const override
85  {
86  registerObservablesF(h5list, file);
87  }
88 
89  void addObservables(PropertySetType& plist, BufferType& collectables) override { addObservablesStress(plist); }
90 
91  void setObservables(PropertySetType& plist) override { setObservablesStress(plist); }
92 
93  void resetTargetParticleSet(ParticleSet& P) override {}
94 
95  void setParticlePropertyList(PropertySetType& plist, int offset) override { setParticleSetStress(plist, offset); }
96  std::unique_ptr<OperatorBase> makeClone(ParticleSet& qp, TrialWaveFunction& psi) final;
97  bool put(xmlNodePtr cur) override;
98 
99  bool get(std::ostream& os) const override
100  {
101  os << "Ceperley Force Estimator Hamiltonian: " << pair_name_;
102  return true;
103  }
104 
106  {
110  }
111 };
112 
113 } // namespace qmcplusplus
114 #endif
void addObservables(PropertySetType &plist, BufferType &collectables) override
named values to the property list Default implementaton uses addValue(plist_)
Definition: StressPBC.h:89
void setObservablesStress(QMCTraits::PropertySetType &plist)
Definition: ForceBase.cpp:99
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Definition: StressPBC.cpp:322
void setObservables(PropertySetType &plist) override
Set the values evaluated by this object to plist Default implementation is to assign Value which is u...
Definition: StressPBC.h:91
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
int NumSpeciesB
number of species of B particle set
Definition: StressPBC.h:47
SymTensor< RealType, OHMMS_DIM > evaluateSR_AB(ParticleSet &P_target)
Definition: StressPBC.cpp:113
void registerObservables(std::vector< ObservableHelper > &h5list, hdf_archive &file) const override
add to observable descriptor for hdf5 The default implementation is to register a scalar for this->va...
Definition: StressPBC.h:84
Declaration of OperatorBase.
std::vector< int > NofSpeciesA
number of particles per species of A
Definition: StressPBC.h:54
SymTensor< RealType, OHMMS_DIM > evaluateKineticSymTensor(ParticleSet &P)
Definition: StressPBC.cpp:288
SymTensor< RealType, OHMMS_DIM > stress_eI_const
Definition: StressPBC.h:29
int NptclA
number of particles of A (classical, e.g. ions)
Definition: StressPBC.h:49
class to handle hdf file
Definition: hdf_archive.h:51
Vectorized record engine for scalar properties.
void registerObservablesF(std::vector< ObservableHelper > &h5list, hdf_archive &file) const
Definition: ForceBase.cpp:75
SymTensor< RealType, OHMMS_DIM > stress_ee_const
Definition: StressPBC.h:28
int NumSpeciesA
number of species of A particle set
Definition: StressPBC.h:45
std::vector< RealType > Zat
Zat[iat] charge for the iat-th particle of A.
Definition: StressPBC.h:58
void addObservablesStress(QMCTraits::PropertySetType &plist)
Definition: ForceBase.cpp:62
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
const int ii_table_index
Definition: StressPBC.h:43
void setParticleSetStress(QMCTraits::PropertySetType &plist, int offset)
Definition: ForceBase.cpp:126
ParticleSet & PtclA
Definition: StressPBC.h:36
std::string getClassName() const override
return class name
Definition: StressPBC.h:69
std::vector< RealType > Qat
Qat[iat] charge for the iat-th particle of B.
Definition: StressPBC.h:60
std::vector< RealType > Zspec
Zspec[spec] charge for the spec-th species of A.
Definition: StressPBC.h:62
std::unique_ptr< LRHandlerType > AA
long-range Handler
Definition: StressPBC.h:38
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Definition: StressPBC.h:93
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Definition: StressPBC.cpp:262
ParticleSet & PtclTarg
source particle set
Definition: StressPBC.h:35
TrialWaveFunction & Psi
Definition: StressPBC.h:32
void initBreakup(ParticleSet &P)
Definition: StressPBC.cpp:56
SymTensor< RealType, OHMMS_DIM > evaluateSR_AA(ParticleSet &P, int itabSelf)
Definition: StressPBC.cpp:131
SymTensor< RealType, OHMMS_DIM > evaluateLR_AB(ParticleSet &P)
Definition: StressPBC.cpp:93
std::vector< RealType > Qspec
Qspec[spec] charge for the spec-th species of B.
Definition: StressPBC.h:64
StressPBC(ParticleSet &ions, ParticleSet &elns, TrialWaveFunction &Psi)
Definition: StressPBC.cpp:28
bool put(xmlNodePtr cur) override
Read the input parameter.
Definition: StressPBC.cpp:310
SymTensor< RealType, OHMMS_DIM > evalConsts_AB()
Definition: StressPBC.cpp:187
std::vector< int > NofSpeciesB
number of particles per species of B
Definition: StressPBC.h:56
std::string pair_name_
Definition: ForceBase.h:97
An abstract class for Local Energy operators.
Definition: OperatorBase.h:59
Class to represent a many-body trial wave function.
void setParticlePropertyList(PropertySetType &plist, int offset) override
Definition: StressPBC.h:95
SymTensor< Real, OHMMS_DIM > stress_ion_ion_
Definition: ForceBase.h:90
Define a LRHandler with two template parameters.
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
Definition: LRHandlerBase.h:30
int NptclB
number of particles of B (quantum, e.g. electrons)
Definition: StressPBC.h:51
SymTensor< RealType, OHMMS_DIM > evaluateLR_AA(ParticleSet &P)
Definition: StressPBC.cpp:151
void CalculateIonIonStress()
Definition: StressPBC.h:105
const int ee_table_index
e-e table ID
Definition: StressPBC.h:42
SymTensor< RealType, OHMMS_DIM > evalConsts_AA(ParticleSet &P)
Definition: StressPBC.cpp:215
BareKineticEnergy::Return_t Return_t
const int ei_table_index
locator of the distance table
Definition: StressPBC.h:40