DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dftd.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2018 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16//
17
18#include <headers.h>
19#include "dftParameters.h"
20#ifdef DFTFE_WITH_DFTD3
21# include <dftd3.h>
22#endif
23#ifdef DFTFE_WITH_DFTD4
24# include <dftd4.h>
25#endif
26
27#ifndef dispersionCorrection_H_
28# define dispersionCorrection_H_
29namespace dftfe
30{
31 /**
32 * @brief Calculates dispersion correction to energy, force and stress
33 *
34 * @author Nikhil Kodali
35 */
37 {
38 public:
39 /**
40 * @brief Constructor
41 *
42 */
43 dispersionCorrection(const MPI_Comm & mpi_comm_parent,
44 const MPI_Comm & mpi_comm_domain,
45 const MPI_Comm & interpool_comm,
46 const MPI_Comm & interBandGroupComm,
47 const dftParameters &dftParams);
48
49 /**
50 * Wrapper function for various dispersion corrections to energy, force and
51 * stress.
52 *
53 * @param atomLocations
54 * @param d_domainBoundingVectors
55 */
56 void
58 const std::vector<std::vector<double>> &atomLocations,
59 const std::vector<std::vector<double>> &d_domainBoundingVectors);
60
61 double
63
64 double
65 getForceCorrection(int atomNo, int dim) const;
66
67 double
68 getStressCorrection(int dim1, int dim2) const;
69
70 private:
73 std::vector<double> d_forceDispersion;
74 std::array<double, 9> d_stressDispersion;
75 std::vector<double> d_atomCoordinates;
76 std::vector<int> d_atomicNumbers;
77 std::array<double, 9> d_latticeVectors;
78
79
82 const MPI_Comm interpoolcomm;
83 const MPI_Comm interBandGroupComm;
85
86 // initialize the variables needed for dispersion correction calculations
87 void
89 const std::vector<std::vector<double>> &atomLocations,
90 const std::vector<std::vector<double>> &d_domainBoundingVectors);
91
92
93 // Compute D3/4 correction
94 void
96
97
98 // Compute TS correction, placeholder
99 };
100} // namespace dftfe
101#endif // dispersionCorrection_H_
Namespace which declares the input parameters and the functions to parse them from the input paramete...
Definition dftParameters.h:35
int d_natoms
Definition dftd.h:71
const dftParameters & d_dftParams
Definition dftd.h:84
double getEnergyCorrection() const
double getStressCorrection(int dim1, int dim2) const
const MPI_Comm mpi_communicator_global
Definition dftd.h:80
double getForceCorrection(int atomNo, int dim) const
std::vector< double > d_forceDispersion
Definition dftd.h:73
double d_energyDispersion
Definition dftd.h:72
std::array< double, 9 > d_latticeVectors
Definition dftd.h:77
const MPI_Comm mpi_communicator_domain
Definition dftd.h:81
dispersionCorrection(const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain, const MPI_Comm &interpool_comm, const MPI_Comm &interBandGroupComm, const dftParameters &dftParams)
Constructor.
std::array< double, 9 > d_stressDispersion
Definition dftd.h:74
std::vector< int > d_atomicNumbers
Definition dftd.h:76
std::vector< double > d_atomCoordinates
Definition dftd.h:75
const MPI_Comm interBandGroupComm
Definition dftd.h:83
void computeDispresionCorrection(const std::vector< std::vector< double > > &atomLocations, const std::vector< std::vector< double > > &d_domainBoundingVectors)
void initDispersionCorrection(const std::vector< std::vector< double > > &atomLocations, const std::vector< std::vector< double > > &d_domainBoundingVectors)
const MPI_Comm interpoolcomm
Definition dftd.h:82
Definition pseudoPotentialToDftfeConverter.cc:34