Skip to content

Commit

Permalink
moved radius_model infront of radius
Browse files Browse the repository at this point in the history
As radius will be applicable only after changning radius_model, radius_model should be first
  • Loading branch information
subindev-d committed Oct 7, 2024
1 parent a9e6515 commit 5375ebf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
21 changes: 10 additions & 11 deletions lib/atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ double TransitionMatrix::totalRate() {
* @param Z: Atomic number (nuclear charge, can be fractional)
* @param m: Mass of the orbiting particle (e.g. electron)
* @param A: Atomic mass (amus, ignored if -1)
* @param radius: Solid sphere equivalent radius (fm, ignored if -1)
* @param radius_model: Which NuclearRadiusModel to use
* @param radius: Solid sphere equivalent radius (fm, ignored if -1)
* @param fc: Central point of the grid (corresponding to i = 0), as a
* fraction of 1/(Z*mu), the 1s orbital radius for this atom, or of the nuclear
* radius, depending on which one is bigger (default = 1)
* @param dx: Logarithmic step of the grid (default = 0.005)
* @retval
*/
Atom::Atom(int Z, double m, int A, double radius, NuclearRadiusModel radius_model, double fc,
double dx) {
Atom::Atom(int Z, double m, int A, NuclearRadiusModel radius_model,
double radius, double fc, double dx) {
// Set the properties
this->Z = Z;
this->A = A;
Expand Down Expand Up @@ -328,8 +328,8 @@ double Atom::sphereNuclearModel(int Z, int A) {
* @param Z: Atomic number (nuclear charge, can be fractional)
* @param m: Mass of the orbiting particle (e.g. electron)
* @param A: Atomic mass (amus, ignored if -1)
* @param radius: Solid sphere equivalent radius (fm, ignored if -1)
* @param radius_model: Which NuclearRadiusModel to use
* @param radius: Solid sphere equivalent radius (fm, ignored if -1)
* @param fc: Central point of the grid (corresponding to i = 0), as a
* fraction of 1/(Z*mu), the 1s orbital radius for this atom, or of the nuclear
* radius, depending on which one is bigger (default = 1)
Expand All @@ -339,9 +339,9 @@ double Atom::sphereNuclearModel(int Z, int A) {
* (default = -1)
* @retval
*/
DiracAtom::DiracAtom(int Z, double m, int A, double radius, NuclearRadiusModel radius_model,
double fc, double dx, int ideal_minshell)
: Atom(Z, m, A, radius, radius_model, fc, dx) {
DiracAtom::DiracAtom(int Z, double m, int A, NuclearRadiusModel radius_model,
double radius, double fc, double dx, int ideal_minshell)
: Atom(Z, m, A, radius_model, radius, fc, dx) {
restE = mu * pow(Physical::c, 2);
LOG(DEBUG) << "Rest energy = " << restE / Physical::eV << " eV\n";
idshell = ideal_minshell;
Expand Down Expand Up @@ -1049,7 +1049,6 @@ TransitionMatrix DiracAtom::getTransitionProbabilities(int n1, int l1, bool s1,
return tmat;
}

DiracIdealAtom::DiracIdealAtom(int Z, double m, int A, double radius,
NuclearRadiusModel radius_model, double fc,
double dx)
: DiracAtom(Z, m, A, radius, radius_model, fc, dx, 1) {}
DiracIdealAtom::DiracIdealAtom(int Z, double m, int A, NuclearRadiusModel radius_model,
double radius, double fc,double dx)
: DiracAtom(Z, m, A, radius_model, radius, fc, dx, 1) {}
15 changes: 6 additions & 9 deletions lib/atom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ class Atom {
EConfPotential V_econf;

public:
Atom(int Z = 1, double m = 1, int A = -1, double radius = -1,
NuclearRadiusModel radius_model = POINT, double fc = 1.0,
double dx = 0.005);
Atom(int Z = 1, double m = 1, int A = -1, NuclearRadiusModel radius_model = POINT,
double radius = -1, double fc = 1.0,double dx = 0.005);

// Basic getters
double getZ() {
Expand Down Expand Up @@ -188,9 +187,8 @@ class DiracAtom : public Atom {
double in_eps = 1e-5;
int min_n = 1000;

DiracAtom(int Z = 1, double m = 1, int A = -1, double radius = -1,
NuclearRadiusModel radius_model = POINT, double fc = 1.0,
double dx = 0.005, int ideal_minshell = -1);
DiracAtom(int Z = 1, double m = 1, int A = -1, NuclearRadiusModel radius_model = POINT,
double radius = -1, double fc = 1.0, double dx = 0.005, int ideal_minshell = -1);

double getRestE() {
return restE;
Expand Down Expand Up @@ -221,9 +219,8 @@ class DiracAtom : public Atom {
// the analytical hydrogen-like solution
class DiracIdealAtom : public DiracAtom {
public:
DiracIdealAtom(int Z = 1, double m = 1, int A = -1, double radius = -1,
NuclearRadiusModel radius_model = POINT, double fc = 1.0,
double dx = 0.005);
DiracIdealAtom(int Z = 1, double m = 1, int A = -1, NuclearRadiusModel radius_model = POINT,
double radius = -1, double fc = 1.0, double dx = 0.005);
};

#endif
2 changes: 1 addition & 1 deletion lib/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DiracAtom MuDiracInputFile::makeAtom() {

// Prepare the DiracAtom
DiracAtom da;
da = DiracAtom(Z, m, A, radius, nucmodel, fc, dx, idshell);
da = DiracAtom(Z, m, A, nucmodel, radius, fc, dx, idshell);
da.Etol = this->getDoubleValue("energy_tol");
da.Edamp = this->getDoubleValue("energy_damp");
da.max_dE_ratio = this->getDoubleValue("max_dE_ratio");
Expand Down
2 changes: 1 addition & 1 deletion test/test_atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ TEST_CASE("Dirac Atom - transitions", "[DiracAtom]")
REQUIRE(tmat.totalRate() * Physical::s == Approx(1.0775e+07).epsilon(1e-4));

// Iron-like atom
DiracAtom daFe = DiracAtom(26, 1, 56, -1 , NuclearRadiusModel::SPHERE);
DiracAtom daFe = DiracAtom(26, 1, 56, NuclearRadiusModel::SPHERE, -1);

// 3d3/2 => 3p1/2
tmat = daFe.getTransitionProbabilities(3, 2, false, 3, 1, false);
Expand Down
2 changes: 1 addition & 1 deletion test/test_kappaa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char *argv[])
// Now, simulations
for (int i = 0; i < dataZ.size(); ++i)
{
DiracAtom da = DiracAtom(dataZ[i], Physical::m_mu, dataA[i], -1, SPHERE);
DiracAtom da = DiracAtom(dataZ[i], Physical::m_mu, dataA[i], SPHERE);
DiracState p2 = da.getState(2, 1, false);
DiracState s1 = da.getState(1, 0, false);

Expand Down
6 changes: 3 additions & 3 deletions test/test_lines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Table VI
*/

vector<double> energyCorrections(int Z, int n1, int l1, bool s1, int n2, int l2,
bool s2, NuclearRadiusModel rmodel = SPHERE, double radius= -1)
bool s2, NuclearRadiusModel rmodel = SPHERE)
{
vector<double> E_corr;
DiracAtom da_point = DiracAtom(Z, Physical::m_mu, getElementMainIsotope(Z));
DiracAtom da_sphere =
DiracAtom(Z, Physical::m_mu, getElementMainIsotope(Z), radius, rmodel);
DiracAtom(Z, Physical::m_mu, getElementMainIsotope(Z), rmodel);
DiracAtom da_uehling =
DiracAtom(Z, Physical::m_mu, getElementMainIsotope(Z), radius, rmodel);
DiracAtom(Z, Physical::m_mu, getElementMainIsotope(Z), rmodel);
da_uehling.setUehling(true, 100);

double E_point = da_point.getState(n2, l2, s2).E;
Expand Down

0 comments on commit 5375ebf

Please sign in to comment.