QMCPACK
PosUnit.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) 2020 QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory
9 //
10 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #ifndef QMCPLUSPLUS_POSUNIT_H
15 #define QMCPLUSPLUS_POSUNIT_H
16 
17 namespace qmcplusplus
18 {
19 /** enum class to assist copy and unit conversion operations on position vectors
20 */
21 enum class PosUnit
22 {
23  Cartesian = 0, /*!< indicates that the values are in Cartesian units*/
24  Lattice /*!< indicates that the values are in Lattice units*/
25 };
26 /** write unit type in human readable format
27  *
28  * This could break tools if they rely on parsing log.
29  */
30 inline std::ostream& operator<<(std::ostream& o_stream, PosUnit pos_unit)
31 {
32  switch (pos_unit)
33  {
34  case PosUnit::Cartesian:
35  o_stream << "Cartesian";
36  break;
37  case PosUnit::Lattice:
38  o_stream << "Lattice";
39  break;
40  }
41  return o_stream;
42 }
43 
44 /** Read unit type recorded in int
45  *
46  * This should really be human readable
47  * TODO: support both until going to string only.
48  */
49 inline std::istream& operator>>(std::istream& i_stream, PosUnit& pos_unit)
50 {
51  int unit_read;
52  i_stream >> unit_read;
53  pos_unit = static_cast<PosUnit>(unit_read);
54  return i_stream;
55 }
56 
57 } // namespace qmcplusplus
58 #endif
a class that defines a supercell in D-dimensional Euclean space.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::ostream & operator<<(std::ostream &out, const AntiSymTensor< T, D > &rhs)
PosUnit
enum class to assist copy and unit conversion operations on position vectors
Definition: PosUnit.h:21
std::istream & operator>>(std::istream &is, Matrix< T, Alloc > &rhs)
Definition: OhmmsMatrix.h:427