QMCPACK
WFOptDriverInput.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) 2021 QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "WFOptDriverInput.h"
15 
16 
17 namespace qmcplusplus
18 {
19 void WFOptDriverInput::readXML(xmlNodePtr xml_input)
20 {
21  ParameterSet parameter_set;
22  parameter_set.add(opt_crowd_size_, "opt_crowd_size");
23  parameter_set.add(opt_num_crowds_, "opt_num_crowds");
24  parameter_set.put(xml_input);
25 
26  opt_xml_node_ = xml_input->children;
27 
28  xmlNodePtr cur = xml_input->children;
29  while (cur != NULL)
30  {
31  std::string cname((const char*)(cur->name));
32  if (cname.find("optimize") < cname.size())
33  {
34  const std::string att(getXMLAttributeValue(cur, "method"));
35  if (!att.empty())
36  opt_method_ = att;
37  opt_xml_node_ = cur;
38  }
39  cur = cur->next;
40  }
41 }
42 
43 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
A collection of put/get functions to read from or write to a xmlNode defined in libxml2.
bool put(std::istream &is) override
read from std::istream
Definition: ParameterSet.h:42
class to handle a set of parameters
Definition: ParameterSet.h:27
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
void readXML(xmlNodePtr xml_input)