QMCPACK
ScalarEstimatorInputs.cpp
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: EstimatorManagerNew.cpp
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #include "ScalarEstimatorInputs.h"
13 #include "InputSection.h"
14 #include "EstimatorInput.h"
15 #include "ModernStringUtils.hpp"
16 
17 namespace qmcplusplus
18 {
19 /** make input class state consistent with legacy ignoring the distinction
20  * between the name and type of estimator for scalar estimators.
21  *
22  * \param [in] input_section_ naming here is to allow reuse of LAMBDA_setIfInInput macro
23  * \param [inout] name output param but assumed to be unset
24  * \param [inout] type output param but assumed to be unset
25  */
26 void readNameTypeLikeLegacy(InputSection& input_section_, std::string& name, std::string& type)
27 {
28  auto setIfInInput = LAMBDA_setIfInInput;
29  setIfInInput(type, "type");
30  setIfInInput(name, "name");
31  if (name.empty())
32  name = type;
33  if (type.empty())
34  type = name;
35 }
36 
38 {
41  auto setIfInInput = LAMBDA_setIfInInput;
42  setIfInInput(use_hdf5_, "hdf5");
43  if (lowerCase(type_) == "elocal")
44  type_ = "localenergy";
45 }
46 
48 {
51  auto setIfInInput = LAMBDA_setIfInInput;
52  setIfInInput(n_psi_, "npsi");
53 }
54 
56 {
59  auto setIfInInput = LAMBDA_setIfInInput;
60  setIfInInput(n_obs_, "nobs");
61 }
62 
63 } // namespace qmcplusplus
This file contains the input classes for the supported "main estimator" classes derived from ScalarEs...
CSLocalEnergyInputSection input_section_
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void readNameTypeLikeLegacy(InputSection &input_section_, std::string &name, std::string &type)
make input class state consistent with legacy ignoring the distinction between the name and type of e...
LocalEnergyInputSection input_section_
RMCLocalEnergyInputSection input_section_
#define LAMBDA_setIfInInput
If tag is present in input_secution set its variable.
void readXML(xmlNodePtr cur)
Read variable values (initialize) from XML input, call checkValid.
std::string lowerCase(const std::string_view s)
++17
Input section provides basic parsing and a uniform method of access to the raw parsed input...
Definition: InputSection.h:37