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

Specialize ADK for linear or circular laser polarization #1541

Conversation

n01r
Copy link
Member

@n01r n01r commented Aug 2, 2016

The ADK model has been updated so that now the user is given the choice between the linear and circular polarization case, according to Delone, Krainov 1998 Phys.-Usp. 41 469.

@n01r
Copy link
Member Author

n01r commented Aug 2, 2016

Compiles and runs.
Checking against experiments when I find the time. ^^;

@bussmann
Copy link
Member

bussmann commented Aug 2, 2016

+1

@PrometheusPi
Copy link
Member

Could you check laserProfile::Polarisation to decide for whether one should use

  • linear laserProfile::Polarisation<=2u or
  • circular laserProfile::Polarisation==4u?

@n01r
Copy link
Member Author

n01r commented Aug 3, 2016

Sadly not all laser profiles are using this enum type, yet. Until then I thought it's better to have two independent realizations of ADK.

@PrometheusPi
Copy link
Member

you mix British and American english in ionization/ionisation and polarization/polarisation.

@n01r
Copy link
Member Author

n01r commented Aug 3, 2016

my apologies 🙇 ... it's an internal conflict
will fix that

float_X dFromADK = math::pow(dBase,nEff);

/* factor from averaging over one laser cycle with LINEAR polarization */
float_X polarizationFactor = math::sqrt(float_X(3.0) * util::cube(nEff) * eInAU / (pi * util::cube(protonNumber)));
Copy link
Member

Choose a reason for hiding this comment

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

since this line is the only difference between AlgorithmADKCircPoland AlgorithmADKLinPol, but the code for AlgorithmADKLinPol takes about 120 additional lines, could you create a AlgorithmADKPol<...>that takes a template argument to switch between both cases? That would reduce the code duplication dramatically.

@PrometheusPi PrometheusPi self-assigned this Aug 3, 2016
@n01r n01r force-pushed the topic-addIonModelADKForCircPol branch from bddcab1 to ec81d7a Compare August 4, 2016 15:16
@n01r
Copy link
Member Author

n01r commented Aug 4, 2016

I now pass a boolean value as a template parameter that activates the calculation of the additional polarization factor for linear polarization or leaves it out for circular polarization. As we discussed offline before: we cannot just check for the polarization so easily because the laser could be initialized via an HDF5 input file.

@@ -82,8 +85,21 @@ namespace ionization
float_X dBase = float_X(4.0) * util::cube(protonNumber) / (eInAU * util::quad(nEff)) ;
float_X dFromADK = math::pow(dBase,nEff);

float_X polarizationFactor;
/* set up the polarization factor */
if(T_linPol)
Copy link
Member

Choose a reason for hiding this comment

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

This is still a run-time decision thus is not as efficient as possible.
Just use:

float_X polarizationFactor = TEMPLATE_PARAM::polarizationFactor;

with a struct containing the value not just a bool.

Copy link
Member Author

@n01r n01r Aug 5, 2016

Choose a reason for hiding this comment

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

The value is not const so I cannot just calculate it during compile time (it depends on the ionization potential and the electric field strength). Nevertheless, it is known if the bool is true or false during compile time. Therefore the compiler should optimize the code in such a way that the unnecessary code vanishes.

Copy link
Member Author

Choose a reason for hiding this comment

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

@psychocoderHPC
your verdict?

Copy link
Member

Choose a reason for hiding this comment

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

@PrometheusPi Your suggestion is not possible because like @n01r said the factor is only known at runtime.

A possible solution would be to add a functor for the factor calculation but it is a little bit complicated because of the needed input values.

My suggestion: (small design change)

/* ionization rate */
float_X rateADK = polarizationFactor \
                * eInAU * util::square(dFromADK) / (float_X(8.0) * pi * protonNumber) \
                * math::exp(float_X(-2.0) * util::cube(protonNumber) / (float_X(3.0) * util::cube(nEff) * eInAU));

if(T_linPol)
{
    /* factor from averaging over one laser cycle with LINEAR polarization */
    const float_X polarizationFactor = math::sqrt(float_X(3.0) * util::cube(nEff) * eInAU / (pi * util::cube(protonNumber)));
    rateADK *= polarizationFactor;
}

Then the code is better readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Yep, looks good to me. I think it's okay to stay away from overcomplicating things and not introduce a new functor for this.

@n01r n01r force-pushed the topic-addIonModelADKForCircPol branch from ec81d7a to bf007af Compare August 5, 2016 11:28
@@ -82,11 +85,23 @@ namespace ionization
float_X dBase = float_X(4.0) * util::cube(protonNumber) / (eInAU * util::quad(nEff)) ;
float_X dFromADK = math::pow(dBase,nEff);

/* factor for CIRCULAR polarization */
float_X polarizationFactor = float_X(1.);
Copy link
Member

Choose a reason for hiding this comment

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

please remove this line as discussed offline

@PrometheusPi
Copy link
Member

physics looks OK to me 👍

@n01r n01r force-pushed the topic-addIonModelADKForCircPol branch from bf007af to d2aae33 Compare August 9, 2016 13:13
Added a boolean value that activates an additional polarization factor for
linear polarization in `AlgorithmADK.hpp`.
@n01r n01r force-pushed the topic-addIonModelADKForCircPol branch from d2aae33 to 71e3265 Compare August 9, 2016 13:23
@PrometheusPi PrometheusPi merged commit f5b0753 into ComputationalRadiationPhysics:dev Aug 9, 2016
@n01r n01r deleted the topic-addIonModelADKForCircPol branch August 9, 2016 14:06
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.

4 participants