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

Add force support for HarmonicTorsion #363

Merged
merged 28 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions cmake/ExternalTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ endif()

FetchContent_Declare(
eigen
URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz"
URL_HASH MD5=9e30f67e8531477de4117506fe44669b)
URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz"
URL_HASH MD5=609286804b0f79be622ccf7f9ff2b660)
FetchContent_GetProperties(eigen)
if(NOT eigen_POPULATED)
FetchContent_Populate(eigen)
Expand Down
11 changes: 11 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ add_test(
&& ${PYTHON_EXECUTABLE} ${JSON_COMPARE} minimal.out.json out.json --tol 0.02"
WORKING_DIRECTORY ${EXAMPLES_DIR}/minimal)

add_test(
NAME bend
COMMAND sh -c "${PYTHON_EXECUTABLE} ${YASON} bend.yml\
| $<TARGET_FILE:faunus> --nobar\
&& ${PYTHON_EXECUTABLE} ${JSON_COMPARE} bend.out.json out.json --tol 0.03"
WORKING_DIRECTORY ${EXAMPLES_DIR}/bend)


add_test(
NAME chain
COMMAND sh -c "${PYTHON_EXECUTABLE} ${YASON} chain.yml\
Expand Down Expand Up @@ -236,6 +244,9 @@ install(FILES
${EXAMPLES_DIR}/minimal/minimal.yml
${EXAMPLES_DIR}/minimal/minimal.out.json
${EXAMPLES_DIR}/minimal/minimal.state.json
${EXAMPLES_DIR}/bend/bend.yml
${EXAMPLES_DIR}/bend/bend.out.json
${EXAMPLES_DIR}/bend/mc_vs_md.agr
${EXAMPLES_DIR}/penalty/penalty.yml
${EXAMPLES_DIR}/penalty/penalty.ipynb
${EXAMPLES_DIR}/multipole/multipole.yml
Expand Down
162 changes: 162 additions & 0 deletions examples/bend/bend.out.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"analysis": [
{
"systemenergy": {
"file": "energy.dat",
"final": [
1.773122609062241
],
"init": 1.4933,
"nskip": 1,
"nstep": 100,
"samples": 2000
}
},
{
"reactioncoordinate": {
"average": 1.990380828288927,
"dir": [
1.0,
1.0,
1.0
],
"file": "distance.dat.gz",
"index": 0,
"indexes": [
0,
2
],
"nskip": 10,
"nstep": 1,
"property": "atomatom",
"samples": 199990,
"type": "molecule"
}
},
{
"atomrdf": {
"dim": 1,
"dr": 0.1,
"file": "rdf.dat",
"name1": "bead",
"name2": "bead",
"nskip": 1,
"nstep": 1,
"samples": 199999,
"slicedir": [
0,
0,
0
],
"thickness": 0.0
}
}
],
"compiler": "10.2.1 20201220",
"energy": [
{
"hamiltonian": [
{
"bonded": {
"bondlist-intramolecular": [
{
"harmonic": {
"index": [
0,
1
],
"k": 10.0,
"req": 1.0
}
},
{
"harmonic": {
"index": [
1,
2
],
"k": 10.0,
"req": 1.0
}
},
{
"harmonic_torsion": {
"aeq": 90.0,
"index": [
0,
1,
2
],
"k": 10.0
}
}
],
"relative time": 0.05504322236267151
}
}
]
}
],
"geometry": {
"length": [
20.0,
20.0,
20.0
],
"type": "cuboid"
},
"git revision": "d3ce821d (2021-05-04)",
"groups": [
{
"threebody": {
"compressible": false,
"index": [
0,
2
],
"size": 3
}
}
],
"montecarlo": {
"average potential energy (kT)": 1.796037325037313,
"last move": "langevin_dynamics"
},
"moves": [
{
"langevin_dynamics": {
"acceptance": 1.0,
"integrator": {
"friction": 5.0,
"time_step": 0.005
},
"moves": 200259,
"nsteps": 10,
"relative time": 0.713,
"relative time (without energy calc)": 0.663,
"repeat": 1
}
},
{
"transrot": {
"acceptance": 0.21,
"dir": [
1.0,
1.0,
1.0
],
"molecule": "threebody",
"molid": 0,
"moves": 599741,
"relative time": 0.236,
"relative time (without energy calc)": 0.108,
"repeat": 3,
"√⟨r²⟩": 0.539
}
}
],
"number of groups": 1,
"number of particles": 3,
"reactionlist": null,
"temperature": 298.15
}
57 changes: 57 additions & 0 deletions examples/bend/bend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env yason.py
#
# Combined MC and MD moves on a three-bead molecule
# with two harmonic bonds and a harmonic bond angle
#
# You may disable either MD or MC to verify that they
# individually give the same bead<->bead distribution
#
energy:
- bonded: {}

atomlist:
- middle_bead: {mw: 1, dp: 5}
- bead: {mw: 1, dp: 5}

moleculelist:
- threebody:
atomic: false
atoms: [bead, middle_bead, bead]
structure:
- bead: [-1.14, -4.98, 8.99]
- middle_bead: [0.039, -6.39, 9.10]
- bead: [-0.82, -7.13, 9.42]
bondlist:
- harmonic: {k: 10, req: 1, index: [0,1]}
- harmonic: {k: 10, req: 1, index: [1,2]}
- harmonic_torsion: {k: 10, aeq: 90, index: [0,1,2]}

insertmolecules:
- threebody: {N: 1}

moves:
- langevin_dynamics: # Langevin dynamics
nsteps: 10
integrator: {time_step: 0.005, friction: 5}
- transrot: # Monte Carlo
molecule: threebody

analysis:
- systemenergy: {file: energy.dat, nstep: 100, nskip: 1}
- reactioncoordinate:
file: distance.dat.gz
nstep: 1
nskip: 10
type: molecule
index: 0
property: atomatom
indexes: [0,2]
dir: [1,1,1]
- atomrdf: {file: rdf.dat, nstep: 1, dr: 0.1, name1: bead, name2: bead, nskip: 1, dim: 1}
- savestate: {file: state.json}

geometry: {type: cuboid, length: 20}
mcloop: {macro: 1, micro: 200000}
temperature: 298.15
random: { seed: fixed }

Loading