QMCPACK
createDistanceTableABOMPTarget.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: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
11 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
18 #include "Particle/DistanceTable.h"
20 
21 namespace qmcplusplus
22 {
23 /** Adding AsymmetricDTD to the list, e.g., el-el distance table
24  *\param s source/target particle set
25  *\return index of the distance table with the name
26  */
27 std::unique_ptr<DistanceTable> createDistanceTableABOMPTarget(const ParticleSet& s,
28  ParticleSet& t,
29  std::ostream& description)
30 {
32  enum
33  {
34  DIM = OHMMS_DIM
35  };
36  const int sc = t.getLattice().SuperCellEnum;
37  std::unique_ptr<DistanceTable> dt;
38  std::ostringstream o;
39  o << " Distance table for dissimilar particles (A-B):" << std::endl;
40  o << " source: " << s.getName() << " target: " << t.getName() << std::endl;
41  o << " Using structure-of-arrays (SoA) data layout and OpenMP offload" << std::endl;
42 
43  if (sc == SUPERCELL_BULK)
44  {
45  if (s.getLattice().DiagonalOnly)
46  {
47  o << " Distance computations use orthorhombic periodic cell in 3D." << std::endl;
48  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPPO + SOA_OFFSET>>(s, t);
49  }
50  else
51  {
52  if (s.getLattice().WignerSeitzRadius > s.getLattice().SimulationCellRadius)
53  {
54  o << " Distance computations use general periodic cell in 3D with corner image checks." << std::endl;
55  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPPG + SOA_OFFSET>>(s, t);
56  }
57  else
58  {
59  o << " Distance computations use general periodic cell in 3D without corner image checks." << std::endl;
60  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPPS + SOA_OFFSET>>(s, t);
61  }
62  }
63  }
64  else if (sc == SUPERCELL_SLAB)
65  {
66  if (s.getLattice().DiagonalOnly)
67  {
68  o << " Distance computations use orthorhombic code for periodic cell in 2D." << std::endl;
69  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPNO + SOA_OFFSET>>(s, t);
70  }
71  else
72  {
73  if (s.getLattice().WignerSeitzRadius > s.getLattice().SimulationCellRadius)
74  {
75  o << " Distance computations use general periodic cell in 2D with corner image checks." << std::endl;
76  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPNG + SOA_OFFSET>>(s, t);
77  }
78  else
79  {
80  o << " Distance computations use general periodic cell in 2D without corner image checks." << std::endl;
81  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, PPNS + SOA_OFFSET>>(s, t);
82  }
83  }
84  }
85  else if (sc == SUPERCELL_WIRE)
86  {
87  o << " Distance computations use periodic cell in one dimension." << std::endl;
88  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, SUPERCELL_WIRE + SOA_OFFSET>>(s, t);
89  }
90  else //open boundary condition
91  {
92  o << " Distance computations use open boundary conditions in 3D." << std::endl;
93  dt = std::make_unique<SoaDistanceTableABOMPTarget<RealType, DIM, SUPERCELL_OPEN + SOA_OFFSET>>(s, t);
94  }
95 
96  description << o.str() << std::endl;
97  return dt;
98 }
99 
100 
101 } //namespace qmcplusplus
const std::string & getName() const
return the name
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
#define OHMMS_DIM
Definition: config.h:64
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::unique_ptr< DistanceTable > createDistanceTableABOMPTarget(const ParticleSet &s, ParticleSet &t, std::ostream &description)
Adding AsymmetricDTD to the list, e.g., el-el distance table.
const auto & getLattice() const
Definition: ParticleSet.h:251