-
Notifications
You must be signed in to change notification settings - Fork 294
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
Resolution function and PARAMETERS for SANS #972
Conversation
@@ -433,7 +464,7 @@ | |||
parse("SOLVATION_CORRECTION", correction); | |||
rho_corr=rho-correction; | |||
if(onebead) log.printf(" Solvation density contribution: %lf\n", correction); | |||
if((atomistic||martini)&&(rho_corr!=rho)) log.printf(" Solvation density contribution is taken into account in ONEBEAD only\n"); | |||
if((atomistic||martini||fromfile)&&(rho_corr!=rho)) log.printf(" Solvation density contribution is taken into account in ONEBEAD only\n"); |
Check notice
Code scanning / CodeQL
Equality test on floating-point values
std::vector<Vector> old_deriv(deriv); | ||
memset(&deriv[0][0], 0.0, deriv.size() * sizeof deriv[0]); | ||
|
||
unsigned nt=OpenMP::getNumThreads(); |
Check notice
Code scanning / CodeQL
Declaration hides variable
std::vector<Vector> old_deriv(deriv); | ||
memset(&deriv[0][0], 0.0, deriv.size() * sizeof deriv[0]); | ||
|
||
unsigned nt=OpenMP::getNumThreads(); |
Check notice
Code scanning / CodeQL
Unused local variable
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #972 +/- ##
==========================================
- Coverage 85.11% 85.09% -0.02%
==========================================
Files 601 601
Lines 55609 55758 +149
==========================================
+ Hits 47331 47448 +117
- Misses 8278 8310 +32
☔ View full report in Codecov by Sentry. |
@hmcezar thanks! I will look into the pull request and the i0 intensity issue possibly next week. |
No problem! Let me know if you need anything from my side. |
merging! @hmcezar could you send me a working example with the Iq0 normalisation issue? something that can be run with plumed driver would be great |
Description
This PR contains the implementation of a resolution function for the SAS spectra and enables using user-provided
PARAMETERS
for computing SANS.I also implemented an option called
PARAMETERSFILE
, that can be used to provide a text file containing all thePARAMETERS
instead of including them in the main input (when you have to specify thePARAMETERS
for thousands of beads, this makes the input more readable).To avoid increasing the computational cost too much when using the resolution function, splines are used to get the intensities and derivatives for
q
not provided by the user.A description of the resolution function implementation and on how one can use the
PARAMETERS
in case of CG simulations can be seen in this paper.A bit of context in the paper and implementation:
Last summer (before you pushed the SANS implementation in
SAXS.cpp
and reworked the code for theONEBEAD
implementation) I needed to perform metainference simulations biasing the SANS spectrum for a collaboration.I implemented it in my sans branch and have been using it ever since.
The difference between what is implemented in
SANS.cpp
in that branch and this PR is basically the normalization, which used to setI(q_0) = 1
, withq_0
being the lowestq
, and now uses the same normalization you are using.About the normalization, I performed a couple of tests, and it seems that in some cases, even when the spectra is flat for low q, the calculated curve is not set to 1 at
q=0
.Instead, one has to use a reasonably large
SCALE
with metainference (around 25 for one of my systems) to get a good match between the experimental curve withI(q=0)=1
and the computed curve.This is true for both SAXS and SANS, so this is not something that comes from my implementation.
However, if you use a reasonable value for the
SCALE
, the curves match and everything works as it should.Anyways, let me know if you need anything else regarding this PR.
Target release
I would like my code to appear in release 2.9
Type of contribution
Copyright
Tests