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

Added the force fields necessary for Calvados2 #189

Merged
merged 13 commits into from
Nov 7, 2024

Conversation

ywitzky
Copy link
Contributor

@ywitzky ywitzky commented Oct 30, 2024

Calvados2 is a strongly coarse grained model for intrinsically disordered proteins (IDP) which requires a yukawa potential, an harmonic potential and a modified Lennard Jones potential.

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 87.80488% with 10 lines in your changes missing coverage. Please review.

Project coverage is 74.49%. Comparing base (9db6db3) to head (3c4f6ac).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
src/interactions/coulomb.jl 84.84% 5 Missing ⚠️
src/interactions/lennard_jones.jl 89.79% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   74.20%   74.49%   +0.28%     
==========================================
  Files          36       36              
  Lines        4943     5038      +95     
==========================================
+ Hits         3668     3753      +85     
- Misses       1275     1285      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jgreener64
Copy link
Collaborator

Looks great. I just merged a major change to master, would you mind rebasing/merging on top of that? It will involve changes to the mixing functions and zero shortcuts, hopefully you can use the changes to LennardJones as a guide.

@ywitzky
Copy link
Contributor Author

ywitzky commented Oct 31, 2024

I should have done the changes you mentioned. Let me know if i forgot something.

Copy link
Collaborator

@jgreener64 jgreener64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just minor stuff, only thing to think about is the cutoff point.

@@ -76,14 +76,15 @@
0.0253410816u"kJ * mol^-1";
atol=1e-9u"kJ * mol^-1",
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add these lines.

atol=1e-9u"kJ * mol^-1 * nm^-1",
)

c2 = SVector(1.28, 1.0, 1.0)u"nm"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use c4 and dr14 here to avoid confusion if more tests are added.



@doc raw"""
AshbaughHatch(; cutoff, α, λ, p, use_neighbors, lorentz_mixing, weight_special,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the arguments.

σ::S =0.0u"nm"
ϵ::E =0.0u"kJ * mol^-1"
λ::L=1.0
solute::Bool = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove solute.

```

```math
V_{\text{AH}}(r_{ij}) =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it stands I think we don't apply the VLJ(rc) term by default? So either remove it in the docstring or add it to the code, in which case probably remove the cutoff option and don't use the cutoff path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it to make the implementation more general.



@doc raw"""
Yukawa(; cutoff, use_neighbors, weight_special, coulomb_const, force_units, energy_units)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update arguments.

use_neighbors::Bool= false
weight_special::W =1
coulomb_const::T = coulomb_const
kappa::D = kappa=1.0*u"nm^-1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repetition.


function force_divr(::Yukawa, r2, invr2, (coulomb_const, qi, qj, kappa))
r = sqrt(r2)
return (coulomb_const * qi * qj) / r^3 *exp(-kappa*r) * (kappa*r+1.0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 rather than +1.0 to avoid promoting Float32 to Float64.

@ywitzky
Copy link
Contributor Author

ywitzky commented Nov 6, 2024

I added the remarks in the code and added some tests for the options "special" and "shortcut".

@jgreener64 jgreener64 merged commit 8de9e89 into JuliaMolSim:master Nov 7, 2024
6 of 9 checks passed
@jgreener64
Copy link
Collaborator

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants