Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of Ewald summation policies and Energy class #247

Merged
merged 6 commits into from
Feb 11, 2020
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
6 changes: 3 additions & 3 deletions docs/_docs/energy.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ self energies are automatically added to the Hamiltonian, activating additional
--------------------- | ---------------------------------------------------------------------
`kcutoff` | Reciprocal-space cutoff
`epss=0` | Dielectric constant of surroundings, $\varepsilon_{surf}$ (0=tinfoil)
`ipbc=false` | Use isotropic periodic boundary conditions, [IPBC](http://doi.org/css8). Holds also for Yukawa-type interactions.
`ewaldscheme=PBC` | Periodic (`PBC`) or isotropic periodic ([`IPBC`](http://doi.org/css8)) boundary conditions
`spherical_sum=true` | Spherical/ellipsoidal summation in reciprocal space; cubic if `false`.
`debyelength=`$\infty$| Debye length (Å)

Expand All @@ -266,12 +266,12 @@ $$
$$

$$
A_k = \frac{e^{-( k^2 + \kappa^2 )/4\alpha^2}}{k^2}
A\_k = \frac{e^{-( k^2 + \kappa^2 )/4\alpha^2}}{k^2}
\quad \quad Q^{q\mu} = Q^{q} + Q^{\mu}
$$

$$
Q^{q} = \sum_{j}q_je^{i({\bf k}\cdot {\bf r}_j)} \quad Q^{\mu} = \sum_{j}i({\boldsymbol{\mu}}_j\cdot {\bf k}) e^{i({\bf k}\cdot {\bf r}_j)}
Q^{q} = \sum_{j}q\_je^{i({\bf k}\cdot {\bf r}\_j)} \quad Q^{\mu} = \sum_{j}i({\boldsymbol{\mu}}\_j\cdot {\bf k}) e^{i({\bf k}\cdot {\bf r}\_j)}
$$

$$
Expand Down
1 change: 1 addition & 0 deletions docs/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ properties:
alpha: {type: number}
kcutoff: {type: number}
ipbc: {type: boolean, default: false}
ewaldscheme: {type: string, enum: [PBC, PBCEigen, IPBC], default: PBCEigen}
required: [cutoff, epss, alpha, kcutoff]

mixing_rule:
Expand Down
40 changes: 40 additions & 0 deletions examples/water/ewald.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env yason.py
temperature: 300
random: {seed: fixed}
geometry: {type: cuboid, length: 18.6}
mcloop: {macro: 5, micro: 50}

atomlist:
- OW: {q: -0.8476, sigma: 3.166, eps: 0.650, mw: 15.999}
- HW: {q: 0.4238, sigma: 2, eps: 0, mw: 1.007}

moleculelist:
- water:
structure:
- OW: [2.30, 6.28, 1.13]
- HW: [ 1.37,6.26, 1.50]
- HW: [2.31, 5.89, 0.21]

insertmolecules:
- water: {N: 256}

energy:
- isobaric: {P/atm: 1}
- nonbonded_coulomblj:
lennardjones: {mixing: LB}
coulomb: {type: ewald, epsr: 1, cutoff: 9, kcutoff: 7.3, epss: 0, alpha: 0.2, ewaldscheme: PBCEigen}
cutoff_g2g: 10

moves:
- moltransrot: {molecule: water, dp: 0.4, dprot: 0.4, repeat: N}
- volume: {dV: 0.03, method: isotropic}

analysis:
- sanity: {nstep: 100}
- savestate: {file: confout.pqr}
- savestate: {file: state.ubj}
#- atomrdf: {file: rdf.dat, nstep: 10, dr: 0.15, name1: OW, name2: OW}
#- systemenergy: {file: energy.dat, nstep: 50}
#- xtcfile: {file: traj.xtc, nstep: 10}
#- density: {nstep: 50}

5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ add_test(
&& ${PYTHON_EXECUTABLE} ${JSON_COMPARE} speciation.out.json out.json --tol 0.02"
WORKING_DIRECTORY ${EXAMPLES_DIR}/speciation)

add_test(
NAME water-ewald-NOCHECKS
COMMAND sh -c "${PYTHON_EXECUTABLE} ${YASON} ewald.yml | $<TARGET_FILE:faunus>"
WORKING_DIRECTORY ${EXAMPLES_DIR}/water)

add_test(
NAME phosphate
COMMAND sh -c "${PYTHON_EXECUTABLE} ${YASON} phosphate.yml\
Expand Down
Loading