QMCPACK
test_SoaDistanceTableAA.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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
8 //
9 // File created by: Mark Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
15 #include <vector>
16 #include <iostream>
17 #include "ParticleSet.h"
19 #include "SoaDistanceTableAA.h"
20 
21 namespace qmcplusplus
22 {
23 TEST_CASE("SoaDistanceTableAA compute_size", "[distance_table]")
24 {
25  const SimulationCell simulation_cell;
26  ParticleSet elec(simulation_cell);
27 
28  elec.setName("e");
29  elec.create({6, 4});
30 
31  // using open BC
33 
34  const size_t Alignment = getAlignment<OHMMS_PRECISION>();
35 
36  // create reference values
37  assert(elec.getTotalNum() == 10);
38  std::vector<int> ref_results(10);
39  if (Alignment == 4)
40  ref_results = {0, 4, 8, 12, 16, 24, 32, 40, 48, 60};
41  else if (Alignment == 8)
42  ref_results = {0, 8, 16, 24, 32, 40, 48, 56, 64, 80};
43 
44  // run checks
45  if (Alignment == 4 || Alignment == 8)
46  {
47  std::cout << "testing Alignment = " << Alignment << std::endl;
48  for (int i = 0; i < ref_results.size(); i++)
49  CHECK(dt_ee.compute_size(i) == ref_results[i]);
50  }
51 }
52 } // namespace qmcplusplus
void setName(const std::string &aname)
Definition: ParticleSet.h:237
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
size_t getTotalNum() const
Definition: ParticleSet.h:493
TEST_CASE("complex_helper", "[type_traits]")
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
A derived classe from DistacneTableData, specialized for dense case.
void create(const std::vector< int > &agroup)
create grouped particles
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))