-
Notifications
You must be signed in to change notification settings - Fork 5
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
Input radius and skin thickness #31
Input radius and skin thickness #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi looks good to me, there are few formatting needed .
You may format the code using astyle
which can be installed using sudo apt install astyle
in Ubuntu
for this project, the code can be formatted by running astyle src/*.cpp src/*.hpp lib/*.cpp lib/*.hpp --style=google -s2 -S -n
command in the source code directory.
Once that's done I can implement the limits for the thickness and radius as mentioned in #32
lib/atom.cpp
Outdated
@@ -112,24 +112,35 @@ Atom::Atom(int Z, double m, int A, NuclearRadiusModel radius_model, double fc, | |||
// Define radius | |||
if (A == -1) { | |||
R = -1; | |||
} else { | |||
} else if (radius < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelHeines , could you please explain this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something Frederik put in and I slightly tweaked. If I'm not mistaken, this check tells you whether or not an input radius is given. If it isn't given, radius = -1, which defaults to the standard methods from mudirac. I suppose one could also rewrite this as else if (radius == -1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be good to write it as radius == -1, less confusing.
} else if (radius < 0) { | |
} else if (radius == -1) { |
lib/atom.cpp
Outdated
} | ||
|
||
if (radius_model == FERMI2) { | ||
V_coulomb = new CoulombFermi2Potential(Z, R, A); | ||
} else { | ||
} else if (radius_model == SPHERE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currrenlty if the radiusl_model == 'POINT' case is ignored, It would be cause error if the keyword nuclear_model: POINT
.
} else if (radius_model == SPHERE) { | |
} else { |
lib/atom.cpp
Outdated
@@ -83,7 +83,7 @@ double TransitionMatrix::totalRate() { | |||
* @param dx: Logarithmic step of the grid (default = 0.005) | |||
* @retval | |||
*/ | |||
Atom::Atom(int Z, double m, int A, NuclearRadiusModel radius_model, double fc, | |||
Atom::Atom(int Z, double m, int A, double radius, NuclearRadiusModel radius_model, double fc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation comment @param radius:
missing for the new parameter
reference
lib/atom.cpp
Outdated
@@ -112,24 +112,35 @@ Atom::Atom(int Z, double m, int A, NuclearRadiusModel radius_model, double fc, | |||
// Define radius | |||
if (A == -1) { | |||
R = -1; | |||
} else { | |||
} else if (radius < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be good to write it as radius == -1, less confusing.
} else if (radius < 0) { | |
} else if (radius == -1) { |
lib/atom.cpp
Outdated
@@ -325,9 +337,9 @@ double Atom::sphereNuclearModel(int Z, int A) { | |||
* (default = -1) | |||
* @retval | |||
*/ | |||
DiracAtom::DiracAtom(int Z, double m, int A, NuclearRadiusModel radius_model, | |||
DiracAtom::DiracAtom(int Z, double m, int A, double R, NuclearRadiusModel radius_model, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comments for the documentation @param R:
I've added the changes you requested. Besides that, I changed around some R to radius for clarity of use throughout the code. Let me know if there's anything else |
Hi currently some tests are failing, you may run the tests by |
introudcing the the newparmeter radius breaks the test_lines
I'm trying to figure out why things are different. In principle they shouldn't be. I don't see any cases that would be treated differently with these changes here. Would you mind having a look? |
It was becasue earlier there was only |
As radius will be applicable only after changning radius_model, radius_model should be first
5375ebf
to
15c89d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I agree optional parameters would be useful if any other parameters need to added or changed.
22cf900
into
muon-spectroscopy-computational-project:dev
I've implemented basic changes such that you can give input values for the size/shape of the nucleus. The radius keyword takes the solid sphere equivalent radius (as was happening internally before) and the skin thickness changes 't' in the Fermi2 model.
These changes are mainly useful for the nuclear/particle physics side of the muonic atom community. With the radius, one can evaluate how precise one needs to determine the transition energy for a certain experimental radius precision. With the skin thickness, it's also possible to evaluate what systematics are induced by changes in the nuclear shape.