Skip to content

Commit

Permalink
Add handling of ghost atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Apr 28, 2023
1 parent 3ec87b8 commit 76dd2be
Show file tree
Hide file tree
Showing 29 changed files with 1,357 additions and 769 deletions.
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files.associations": {
"functional": "cpp",
"cmath": "cpp",
"complex": "cpp",
"iostream": "cpp",
"new": "cpp"
}
}
3 changes: 3 additions & 0 deletions include/damping/atm.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace dftd4 {

extern int get_atm_dispersion(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const double s9,
Expand All @@ -47,6 +48,7 @@ extern int get_atm_dispersion(

extern int get_atm_dispersion_energy(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const double s9,
Expand All @@ -59,6 +61,7 @@ extern int get_atm_dispersion_energy(

extern int get_atm_dispersion_derivs(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const double s9,
Expand Down
4 changes: 4 additions & 0 deletions include/damping/rational.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern inline double fdmprdr_bj(const int n, const double r, const double c);

extern int get_dispersion2(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const dparam &par,
Expand All @@ -46,6 +47,7 @@ extern int get_dispersion2(

extern int get_dispersion3(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const dparam &par,
Expand All @@ -63,6 +65,7 @@ extern int get_dispersion3(

extern int get_dispersion2_energy(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const dparam &par,
Expand All @@ -72,6 +75,7 @@ extern int get_dispersion2_energy(

extern int get_dispersion2_derivs(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const double cutoff,
const dparam &par,
Expand Down
2 changes: 2 additions & 0 deletions include/dftd_dispersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class dparam {
* @brief Wrapper to handle the evaluation of dispersion energy and derivatives.
*
* @param mol Molecular geometry.
* @param realIdx List for real atoms excluding ghost/non atoms
* @param charge Molecular charge.
* @param par DFT-D4 parameters.
* @param d4 Base D4 dispersion model.
Expand All @@ -52,6 +53,7 @@ class dparam {
*/
extern int get_dispersion(
const TMolecule &mol,
const TIVector &realIdx,
const int charge,
const TD4Model &d4,
const dparam &par,
Expand Down
5 changes: 5 additions & 0 deletions include/dftd_eeq.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace dftd4 {

extern int get_charges(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const int charge,
const double cutoff,
Expand All @@ -39,6 +40,7 @@ extern int get_charges(

extern int get_vrhs(
const TMolecule &mol,
const TIVector &realIdx,
const int &charge,
const TVector<double> &cn,
TVector<double> &Xvec,
Expand All @@ -48,12 +50,14 @@ extern int get_vrhs(

extern int get_amat_0d(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
TMatrix<double> &Amat
);

extern int get_damat_0d(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const TVector<double> &q,
const TMatrix<double> &Amat,
Expand All @@ -63,6 +67,7 @@ extern int get_damat_0d(

extern int eeq_chrgeq(
const TMolecule &mol,
const TIVector &realIdx,
const TMatrix<double> &dist,
const int &charge,
const TVector<double> &cn,
Expand Down
12 changes: 6 additions & 6 deletions include/dftd_geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ namespace dftd4 {
class TMolecule {
public:
int NAtoms;
TMatrix<double> xyz; // Cartesian Coordinates: (NAtoms x 3)-matrix
TVector<int> at; // atomic numbers
TMatrix<double> CC; // Cartesian Coordinates: (NAtoms x 3)-matrix
TVector<int> ATNO; // atomic numbers

TMolecule() { NAtoms = 0; }
~TMolecule() { FreeMemory(); }

void GetMemory(int NumAt_) {
FreeMemory();
NAtoms = NumAt_;
xyz.New(NAtoms, 3);
at.New(NAtoms);
CC.New(NAtoms, 3);
ATNO.New(NAtoms);
}

void FreeMemory(void) {
xyz.Delete();
at.Delete();
CC.Delete();
ATNO.Delete();
}
};

Expand Down
Loading

0 comments on commit 76dd2be

Please sign in to comment.