QMCPACK
SimulationCell.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: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "SimulationCell.h"
14 
15 namespace qmcplusplus
16 {
17 
19 
21  : lattice_(lattice)
22 {
23  resetLRBox();
24 }
25 
27 {
29  {
30  lattice_.SetLRCutoffs(lattice_.Rv);
31  LRBox_ = lattice_;
32  bool changed = false;
34  {
35  LRBox_.R(2, 0) *= lattice_.VacuumScale;
36  LRBox_.R(2, 1) *= lattice_.VacuumScale;
37  LRBox_.R(2, 2) *= lattice_.VacuumScale;
38  changed = true;
39  }
41  {
42  LRBox_.R(1, 0) *= lattice_.VacuumScale;
43  LRBox_.R(1, 1) *= lattice_.VacuumScale;
44  LRBox_.R(1, 2) *= lattice_.VacuumScale;
45  LRBox_.R(2, 0) *= lattice_.VacuumScale;
46  LRBox_.R(2, 1) *= lattice_.VacuumScale;
47  LRBox_.R(2, 2) *= lattice_.VacuumScale;
48  changed = true;
49  }
50  LRBox_.reset();
51  LRBox_.SetLRCutoffs(LRBox_.Rv);
52  LRBox_.printCutoffs(app_log());
53 
54  if (changed)
55  {
56  app_summary() << " Simulation box changed by vacuum supercell conditions" << std::endl;
57  app_log() << "--------------------------------------- " << std::endl;
58  LRBox_.print(app_log());
59  app_log() << "--------------------------------------- " << std::endl;
60  }
61 
63  }
64 }
65 }
a class that defines a supercell in D-dimensional Euclean space.
int SuperCellEnum
supercell enumeration
void reset()
Evaluate the reciprocal vectors, volume and metric tensor.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::ostream & app_log()
Definition: OutputManager.h:65
std::ostream & app_summary()
Definition: OutputManager.h:63
T VacuumScale
The scale factor for adding vacuum.
void print(std::ostream &, int level=2) const
Print out CrystalLattice Data.
TinyVector< SingleParticlePos, D > Rv
Real-space unit vectors.
Lattice lattice_
simulation cell lattice
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
Lattice LRBox_
long-range box
void updateKLists(const ParticleLayout &lattice, RealType kc, unsigned ndim, const PosType &twist=PosType(), bool useSphere=true)
k points sorted by the |k| excluding |k|=0
Definition: KContainer.cpp:24
KContainer k_lists_
K-Vector List.
Tensor_t R
Real-space unit vectors. R(i,j) i=vector and j=x,y,z.