QMCPACK
createDistanceTable.h
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: Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 //
10 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #ifndef QMCPLUSPLUS_DISTANCETABLE_H
15 #define QMCPLUSPLUS_DISTANCETABLE_H
16 
17 #include "Particle/ParticleSet.h"
18 
19 namespace qmcplusplus
20 {
21 /** Class to manage multiple DistanceTable objects.
22  *
23  * \date 2008-09-19
24  * static data members are removed. DistanceTable::add functions
25  * are kept for compatibility only. New codes should use a member function
26  * of ParticleSet to add a distance table
27  * int ParticleSet::addTable(const ParticleSet& source)
28  *
29  * \deprecated There is only one instance of the data memebers of
30  * DistanceTable in an application and the data are shared by many objects.
31  * Note that static data members and functions are used
32  * (based on singleton and factory patterns).
33  *\todo DistanceTable should work as a factory, as well, to instantiate DistanceTable
34  * subject to different boundary conditions.
35  * Lattice/CrystalLattice.h and Lattice/CrystalLattice.cpp can be owned by DistanceTable
36  * to generically control the crystalline structure.
37  */
38 
39 ///free function to create a distable table of s-s
40 std::unique_ptr<DistanceTable> createDistanceTableAA(ParticleSet& s, std::ostream& description);
41 std::unique_ptr<DistanceTable> createDistanceTableAAOMPTarget(ParticleSet& s, std::ostream& description);
42 
43 inline std::unique_ptr<DistanceTable> createDistanceTable(ParticleSet& s, std::ostream& description)
44 {
45  // during P-by-P move, the cost of single particle evaluation of distance tables
46  // is determined by the number of source particles.
47  // Thus the implementation selection is determined by the source particle set.
48  if (s.getCoordinates().getKind() == DynamicCoordinateKind::DC_POS_OFFLOAD)
49  return createDistanceTableAAOMPTarget(s, description);
50  else
51  return createDistanceTableAA(s, description);
52 }
53 
54 ///free function create a distable table of s-t
55 std::unique_ptr<DistanceTable> createDistanceTableAB(const ParticleSet& s, ParticleSet& t, std::ostream& description);
56 std::unique_ptr<DistanceTable> createDistanceTableABOMPTarget(const ParticleSet& s,
57  ParticleSet& t,
58  std::ostream& description);
59 
60 inline std::unique_ptr<DistanceTable> createDistanceTable(const ParticleSet& s,
61  ParticleSet& t,
62  std::ostream& description)
63 {
64  // during P-by-P move, the cost of single particle evaluation of distance tables
65  // is determined by the number of source particles.
66  // Thus the implementation selection is determined by the source particle set.
67  if (s.getCoordinates().getKind() == DynamicCoordinateKind::DC_POS_OFFLOAD)
68  return createDistanceTableABOMPTarget(s, t, description);
69  else
70  return createDistanceTableAB(s, t, description);
71 }
72 
73 } // namespace qmcplusplus
74 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::unique_ptr< DistanceTable > createDistanceTableAA(ParticleSet &s, std::ostream &description)
Class to manage multiple DistanceTable objects.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::unique_ptr< DistanceTable > createDistanceTableAAOMPTarget(ParticleSet &s, std::ostream &description)
Adding SymmetricDTD to the list, e.g., el-el distance table.
std::unique_ptr< DistanceTable > createDistanceTableAB(const ParticleSet &s, ParticleSet &t, std::ostream &description)
free function create a distable table of s-t
std::unique_ptr< DistanceTable > createDistanceTableABOMPTarget(const ParticleSet &s, ParticleSet &t, std::ostream &description)
Adding AsymmetricDTD to the list, e.g., el-el distance table.
std::unique_ptr< DistanceTable > createDistanceTable(ParticleSet &s, std::ostream &description)