QMCPACK
test_OneBodyDensityMatricesInput.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: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
18 #include "EstimatorTesting.h"
19 #include "ParticleSet.h"
20 #include "OhmmsData/Libxml2Doc.h"
22 
23 #include <iostream>
24 
25 namespace qmcplusplus
26 {
27 TEST_CASE("OneBodyDensityMatricesInput::from_xml", "[estimators]")
28 {
29  using POLT = PtclOnLatticeTraits;
32  for (auto input_xml : valid_input::xml)
33  {
35  bool okay = doc.parseFromString(input_xml);
36  REQUIRE(okay);
37  xmlNodePtr node = doc.getRoot();
39  }
40 
41  using invalid_input = testing::InvalidOneBodyDensityMatricesInput;
42  for (auto input_xml : invalid_input::xml)
43  {
45  bool okay = doc.parseFromString(input_xml);
46  REQUIRE(okay);
47  xmlNodePtr node = doc.getRoot();
48 
50  }
51 }
52 
53 TEST_CASE("OneBodyDensityMatricesInput::copy_construction", "[estimators]")
54 {
57  bool okay = doc.parseFromString(Input::xml[Input::valid::SCALE]);
58  xmlNodePtr node = doc.getRoot();
60  static_assert(std::is_copy_constructible_v<OneBodyDensityMatricesInput>);
61 }
62 
63 } // namespace qmcplusplus
a class that defines a supercell in D-dimensional Euclean space.
class that handles xmlDoc
Definition: Libxml2Doc.h:76
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
if(!okay) throw std xmlNodePtr node
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
Definition: Configuration.h:79
TEST_CASE("complex_helper", "[type_traits]")
xmlNodePtr getRoot()
Definition: Libxml2Doc.h:88
Native representation for DensityMatrices1B Estimator&#39;s inputs.
REQUIRE(std::filesystem::exists(filename))
This a subclass for runtime errors that will occur on all ranks.
OneBodyDensityMatricesInput obdmi(node)
Particle traits to use UniformGridLayout for the ParticleLayout.
Definition: Configuration.h:77
bool parseFromString(const std::string_view data)
Definition: Libxml2Doc.cpp:204