-
Notifications
You must be signed in to change notification settings - Fork 214
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
Fix #1052 Gaussian Beam Envelope 2D #1090
Fix #1052 Gaussian Beam Envelope 2D #1090
Conversation
844db4b
to
b306394
Compare
@@ -53,9 +53,11 @@ namespace picongpu | |||
//gaussian beam waist in the nearfield: w_y(y=0) == W0 | |||
const float_64 w_y = W0 * sqrt( 1.0 + ( FOCUS_POS / y_R )*( FOCUS_POS / y_R ) ); |
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.
could you cast W0
to float_64
here?
or better
remove W0 * ...
here and float_64( W0 ) / w_y
in both cases below
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.
out of scope for this fix (do not mix refactoring with bug fixes). it should be as minimal as possible, as every bug fix.
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.
I also need to backport it and it is already creating merge conflicts in the current version.
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.
also, it is not necessary to cast W0
. this line does a list of float calculations and casts the result to float_64 for the following operations.
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.
opened in #1095
fun fact: I also did intentionally not update the year since this creates merge conflicts, too. |
float_64 envelope = float_64( AMPLITUDE ); | ||
if( simDim == DIM2 ) | ||
envelope *= math::sqrt( float_64( W0 ) / w_y ); | ||
if( simDim == DIM3 ) |
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.
just to improve readability, please change if
to else if
as used in the rest of the code
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.
thx
b306394
to
79f9dbc
Compare
This fixes the underestimation of the amplitude of the laser implementations for Gaussian Beam (and based on it for pulse front tilted Gaussian Beams) in 2D3V simulations. Calculations of the pre-factor are performed on the host-side and therefore a simple `if` avoids code duplication.
79f9dbc
to
e550bcc
Compare
Fix #1052 Gaussian Beam Envelope 2D
thx for the review! |
[BP] #1090: Gaussian Beam Envelope 2D
Fix #1052 This fixes the underestimation of the amplitude of the laser implementations for Gaussian Beam (and based on it for pulse front tilted Gaussian Beams) in 2D3V simulations.
Calculations of the pre-factor are performed on the host-side and therefore a simple
if
avoids code duplication.Fixed image: