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

Read laser profile from parser #1122

Merged
merged 45 commits into from
Jul 2, 2024

Conversation

huixingjian
Copy link
Contributor

@huixingjian huixingjian commented May 30, 2024

With this PR, the laser profile can be initialised through parser, with lasers.laser_real(x,y,z)=" " for real part and lasers.laser_imag(x,y,z)=" " for imaginary part separately.

@huixingjian huixingjian changed the title [WIP]Read laser profile from parse Read laser profile from parse May 31, 2024
@huixingjian huixingjian changed the title Read laser profile from parse Read laser profile from parser May 31, 2024
@huixingjian huixingjian changed the title Read laser profile from parser [WIP]Read laser profile from parser Jun 3, 2024
@huixingjian huixingjian changed the title [WIP]Read laser profile from parser Read laser profile from parser Jun 7, 2024
@huixingjian huixingjian changed the title Read laser profile from parser [WIP]Read laser profile from parser Jun 7, 2024
@huixingjian huixingjian changed the title [WIP]Read laser profile from parser Read laser profile from parser Jun 7, 2024
@huixingjian
Copy link
Contributor Author

huixingjian commented Jun 7, 2024

use

lasers.laser_real(x,y,z)="2*exp(-(x^2+y^2)/W0^2-z^2/(2*clight^2*tau^2))*cos(-(6.28*z/800e-9))*
                          if(abs(z)<5e-7 and y >0,
                               if(y<(2.25*sqrt(abs(-(abs(z*1e6)-0.5)*(abs(z*1e6)+0.5))/(-(abs(z*1e6)-0.5)*(abs(z*1e6)+0.5))))/1e6,0,1),1)*
                          if(abs(z)>5e-7 and abs(z)<7.5e-7 and y >0,
                               if(y<(3*abs(z*1e6)+0.75*sqrt(abs(-(abs(z*1e6)-0.5)*(abs(z*1e6)-0.75))/(-(abs(1e6*z)-0.5)*(abs(z*1e6)-0.75))))/1e6,0,1),1)*
                          if(abs(z)>7.5e-7 and abs(z)< 1e-6 and y >0,
                               if(y<(9*sqrt(abs(-(abs(z*1e6)-1)*(abs(z*1e6)-0.75))/(-(abs(1e6*z)-1)*(abs(z*1e6)-0.75)))-8*abs(z*1e6))/1e6,0,1),1)*
                          if(abs(z)>1e-6 and abs(z)< 3e-6 and y >0,
                               if(y<(6*sqrt(10)/7+(1.5-0.5*abs(z*1e6))*sqrt(abs(abs(z*1e6)-1)/(abs(z*1e6)-1))-6*sqrt(10)*sqrt(4-(abs(1e6*z)-1)**2)/14)/1e6,0,1),1)*
                          if(abs(z)>3e-6 and abs(z) < 7e-6 and y>0,
                               if(y <(3*sqrt(1-(z*1e6/7)**2)*sqrt(abs(abs(z*1e6)-3)/(abs(z*1e6)-3)))/1e6,0,1),1)*
                          if(abs(z)>4e-6 and abs(z)<7e-6 and y<0,
                               if(y >(-3*sqrt(1-(z*1e6/7)**2)*sqrt(abs(abs(z*1e6)-4)/(abs(z*1e6)-4)))/1e6,0,1),1)*
                          if(abs(z)< 4e-6 and y <0,
                                if(y > (abs(z*1e6/2)-(3*sqrt(33)-7)*(z*1e6)**2/122-3.1+sqrt(1-(abs(abs(z*1e6)-2)-1)**2))/1e6,0,1),1)"
lasers.laser_imag(x,y,z)="2*exp(-(x^2+y^2)/W0^2-z^2/(2*clight^2*tau^2))*sin(-(6.28*z/800e-9))*
                          if(abs(z)<5e-7 and y >0,
                               if(y<(2.25*sqrt(abs(-(abs(z*1e6)-0.5)*(abs(z*1e6)+0.5))/(-(abs(z*1e6)-0.5)*(abs(z*1e6)+0.5))))/1e6,0,1),1)*
                          if(abs(z)>5e-7 and abs(z)<7.5e-7 and y >0,
                               if(y<(3*abs(z*1e6)+0.75*sqrt(abs(-(abs(z*1e6)-0.5)*(abs(z*1e6)-0.75))/(-(abs(1e6*z)-0.5)*(abs(z*1e6)-0.75))))/1e6,0,1),1)*
                          if(abs(z)>7.5e-7 and abs(z)< 1e-6 and y >0,
                               if(y<(9*sqrt(abs(-(abs(z*1e6)-1)*(abs(z*1e6)-0.75))/(-(abs(1e6*z)-1)*(abs(z*1e6)-0.75)))-8*abs(z*1e6))/1e6,0,1),1)*
                          if(abs(z)>1e-6 and abs(z)< 3e-6 and y >0,
                               if(y<(6*sqrt(10)/7+(1.5-0.5*abs(z*1e6))*sqrt(abs(abs(z*1e6)-1)/(abs(z*1e6)-1))-6*sqrt(10)*sqrt(4-(abs(1e6*z)-1)**2)/14)/1e6,0,1),1)*
                          if(abs(z)>3e-6 and abs(z) < 7e-6 and y>0,
                               if(y <(3*sqrt(1-(z*1e6/7)**2)*sqrt(abs(abs(z*1e6)-3)/(abs(z*1e6)-3)))/1e6,0,1),1)*
                          if(abs(z)>4e-6 and abs(z)<7e-6 and y<0,
                               if(y >(-3*sqrt(1-(z*1e6/7)**2)*sqrt(abs(abs(z*1e6)-4)/(abs(z*1e6)-4)))/1e6,0,1),1)*
                          if(abs(z)< 4e-6 and y <0,
                                if(y > (abs(z*1e6/2)-(3*sqrt(33)-7)*(z*1e6)**2/122-3.1+sqrt(1-(abs(abs(z*1e6)-2)-1)**2))/1e6,0,1),1)"

a batman pulse could be generated.

Screenshot 2024-06-08 at 02 29 01

Copy link
Member

@AlexanderSinn AlexanderSinn left a comment

Choose a reason for hiding this comment

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

I found two more places where the documentation is formatted wrong.

src/laser/Laser.H Outdated Show resolved Hide resolved
src/laser/Laser.H Outdated Show resolved Hide resolved
@AlexanderSinn AlexanderSinn added the component: laser envelope About the laser envelope solver label Jun 26, 2024
huixingjian and others added 2 commits June 30, 2024 13:43
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
@AlexanderSinn AlexanderSinn merged commit b57d5f8 into Hi-PACE:development Jul 2, 2024
10 checks passed
@huixingjian huixingjian deleted the laser_parser branch October 14, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: laser envelope About the laser envelope solver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants