QMCPACK
SpinDensityInput.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) 2022 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // Some code refactored from: SpinDensity.h
10 //////////////////////////////////////////////////////////////////////////////////////
11 #ifndef QMCPLUSPLUS_SPINDENSITYINPUT_H
12 #define QMCPLUSPLUS_SPINDENSITYINPUT_H
13 
14 #include "Configuration.h"
15 #include "OhmmsData/ParameterSet.h"
17 
18 namespace qmcplusplus
19 {
20 
21 class SpinDensityNew;
22 
23 /** Native representation for Spin Density Estimators inputs
24  *
25  * This class servers three purposes all related to properly handling
26  * and verifying the spin density input.
27  * 1. An immutable representation of actual user input
28  * 2. Parse the xml node of SpinDensityNew input.
29  * 3. Hold the logic of calculating derived parameters.
30  *
31  */
33 {
34 public:
40  static constexpr int DIM = QMCTraits::DIM;
41 
42 public:
43  SpinDensityInput(xmlNodePtr node);
44  /** default copy constructor
45  * This is required due to SDI being part of a variant used as a vector element.
46  */
47  SpinDensityInput(const SpinDensityInput&) = default;
48  Lattice get_cell() const { return cell_; }
49  PosType get_corner() const { return corner_; }
50  TinyVector<int, DIM> get_grid() const { return grid_; }
51  int get_npoints() const { return npoints_; }
52  bool get_write_report() const { return write_report_; }
53  bool get_save_memory() const { return save_memory_; }
54 
56  {
60  size_t npoints;
61  };
62 
63  /** Derived parameters of SpinDensity
64  *
65  * These require the cell the SpinDensity is evaluated over,
66  * the caller (SpinDensityNew) either gets this from the input and
67  * passes it back or passes in the cell from the relevant ParticleSet.
68  *
69  */
71 
72 private:
73  void readXML(xmlNodePtr cur);
74 
75  ///name of this Estimator
76  std::string myName_;
77 
83  int npoints_;
86  /** these are necessary for calculateDerivedParameters
87  *
88  * If we are going to later write out a canonical input for
89  * this input then they are needed as well.
90  */
91  bool have_dr_ = false;
92  bool have_grid_ = false;
93  bool have_center_ = false;
94  bool have_corner_ = false;
95  bool have_cell_ = false;
96 };
97 
98 } // namespace qmcplusplus
99 #endif /* SPINDENSITYINPUT_H */
a class that defines a supercell in D-dimensional Euclean space.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
if(!okay) throw std xmlNodePtr node
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
Definition: Configuration.h:79
std::string myName_
name of this Estimator
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
SpinDensityNew(std::move(sdi), species_set)
TinyVector< int, DIM > get_grid() const
bool have_dr_
these are necessary for calculateDerivedParameters
QTBase::PosType PosType
Definition: Configuration.h:61
Native representation for Spin Density Estimators inputs.
TinyVector< int, DIM > grid_
Particle traits to use UniformGridLayout for the ParticleLayout.
Definition: Configuration.h:77
Class that collects density per species of particle.
DerivedParameters calculateDerivedParameters(const Lattice &lattice) const
Derived parameters of SpinDensity.