Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions integration_tests/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,47 @@
*****************************************************************************
"""

from pathlib import Path

import numpy as np

from PQAnalysis.io import read_trajectory, EnergyFileReader


def check_pq_output(base_name, folder_name, ref_folder="ref_data"):
def check_pq_output(
base_name,
folder_name,
ref_folder="ref_data",
):

ref_path = "../" + folder_name + "/" + ref_folder + "/"
ref_path = Path("..") / folder_name / ref_folder

traj = read_trajectory(base_name + ".xyz")
ref_traj = read_trajectory(ref_path + base_name + ".xyz")
ref_traj = read_trajectory(str(ref_path / (base_name + ".xyz")))

assert traj.isclose(ref_traj)

traj = read_trajectory(base_name + ".vel", traj_format="vel")
ref_traj = read_trajectory(
ref_path + base_name + ".vel", traj_format="vel")
str(ref_path / (base_name + ".vel")), traj_format="vel")

assert traj.isclose(ref_traj)

traj = read_trajectory(base_name + ".force", traj_format="force")
ref_traj = read_trajectory(
ref_path + base_name + ".force", traj_format="force")
str(ref_path / (base_name + ".force")), traj_format="force")

assert traj.isclose(ref_traj)

traj = read_trajectory(base_name + ".chrg", traj_format="charge")
ref_traj = read_trajectory(
ref_path + base_name + ".chrg", traj_format="charge")
str(ref_path / (base_name + ".chrg")), traj_format="charge")

assert traj.isclose(ref_traj)

reader = EnergyFileReader(base_name + ".en")
ref_reader = EnergyFileReader(
ref_path + base_name + ".en")
str(ref_path / (base_name + ".en")))

energy = reader.read()
ref_energy = ref_reader.read()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Geometry = GenFormat {
<<< "geom.gen"
}



Driver = {}

Hamiltonian = DFTB {
charge = __CHARGE__
SCC = Yes
SCCTolerance = 1.0e-5
MaxSccIterations = 100
ThirdOrderFull = Yes

__GUESS__

HCorrection = Damping { Exponent = 4.00 }

#HalogenXCorr = Yes

HubbardDerivs {
H = -0.1857
O = -0.1575
K = -0.0339
}

Dispersion = DftD3 {
Damping = BeckeJohnson {
a1 = 0.746
a2 = 4.191
}
s6 = 1.0
s8 = 3.209
}

MaxAngularMomentum {
H = "s"
O = "p"
K = "p"
}

SlaterKosterFiles = Type2FileNames {
Prefix = "../../build/external/slakos/3ob/skfiles/"
Separator = "-"
Suffix = ".skf"
LowerCaseTypeName = No
}

ElectricField = {
PointCharges = {
CoordsAndCharges [Angstrom] = DirectRead {
Records = __N_PC__
File = "pointcharges"
}
}
}


Filling = Fermi {
Temperature [Kelvin] = 0.0
}
}

Options {}

Analysis = {
MullikenAnalysis = Yes
PrintForces = Yes
}

ParserOptions {
ParserVersion = 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# moltype_A;atomtype_A;moltype_B;atomtype_B;rnoncoulomb;guffcoeff[0];guffcoeff[1];guffcoeff[2];guffcoeff[3];guffcoeff[4];guffcoeff[5];guffcoeff[6];guffcoeff[7];guffcoeff[8];guffcoeff[9];guffcoeff[10];guffcoeff[11];guffcoeff[12];guffcoeff[13];guffcoeff[14];guffcoeff[15];guffcoeff[16];guffcoeff[17];guffcoeff[18];guffcoeff[19];guffcoeff[20];guffcoeff[21];guffcoeff[22];
# First Trial for guff coefficients
# H2O H2O
# Note: physical units MUST be:
#
# 'kcal/mol' for energies
# 'Angstroem' for distances
#
# guffcoeff[0] denotes for Coulombic interactions:
# conversion factor: 332.0640694675 * q(i) *q(j)
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

################################
##### WATER - Moltype 1 #####
################################

# SPC/Fw
1;0;1;0;-1.0;223.27988030994698;-625.502467657;6.0;629358.4725833069183;12.0;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;
1;0;1;1;0.100000;-111.63994015497349;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;
1;1;1;1;0.100000;55.819970077486744;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;


# SPC/Fw water - K(I)
# K(I)
# q(K)=1.0e; rm=3.75Ang; eps=0.075 kcal/mol
1;0;2;0;-1.0;-272.29253696335;-417.137145996;6.0;580011.328566;12.0;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;
1;1;2;0;0.1;136.146268481675;0.0000000000000000000;0.0;0.0000000000000000000;0.0;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;



# Copied dummy values for K(I) - K(I) interaction
2;0;2;0;0.1;332.0640694675;70.0000000000000000000;0.0;0.0000000000000000000;0.0;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;0.000000;






Loading
Loading