Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3372bc2
Add files via upload
stefaniagl Jun 8, 2019
8e74216
Merge pull request #1 from stefanyagl/stefanyagl-patch-1
stefaniagl Jun 11, 2019
5292e62
Added other BB types (not tested)
stefaniagl Mar 25, 2020
4ee2f85
Merge pull request #2 from stefanyagl/bessel_1
stefaniagl Mar 25, 2020
b5e2eb0
Log file parameters have been changed a bit for BBs
stefaniagl Apr 1, 2020
0a7ff48
1
stefaniagl Jun 10, 2020
f7238e1
Examined Bessel beams
stefaniagl Jun 10, 2020
51bfec3
Added Generalized BB
stefaniagl Sep 11, 2020
2958bf9
cleaning
stefaniagl Dec 23, 2020
7dffe17
fixing Makefiles
stefaniagl Dec 23, 2020
8b49f8d
Merge remote-tracking branch 'upstream/master'
stefaniagl Dec 23, 2020
15d3f60
merging from upstream
stefaniagl Dec 23, 2020
bb4f787
Removed ASD code
stefaniagl Dec 24, 2020
597fd7f
Fixed beam description
stefaniagl Mar 24, 2021
21b201d
Merge remote-tracking branch 'upstream/master'
stefaniagl Mar 31, 2021
3fcc7c6
Fixed besselGen initialization
stefaniagl Apr 7, 2021
61e931e
Changed besselGen -> besselM
stefaniagl Apr 15, 2021
97852cd
minor fixes
stefaniagl Jun 28, 2021
1016574
Merge branch 'master' of https://github.com/stefaniagl/adda
stefaniagl Jun 28, 2021
25b9461
Added CS' type
stefaniagl Jun 29, 2021
88f15bc
Improved field expressions
stefaniagl Jun 29, 2021
44cd648
Merge branch 'master' of https://github.com/stefaniagl/adda
stefaniagl Jun 29, 2021
d515d92
Fixed some problems
stefaniagl Jul 1, 2021
505dd45
Fixed some bugs
stefaniagl Jul 8, 2021
93df21c
Command line changes
stefaniagl Jul 20, 2021
1df9ca2
Added -beam center
stefaniagl Aug 25, 2021
99523db
Added vortex phase + minor changes
stefaniagl Sep 30, 2021
899eeb6
minor changes
stefaniagl Nov 9, 2021
1e58292
Added negative orders of BBs
stefaniagl Nov 11, 2021
bc2963d
Extracted bessel ASD
stefaniagl Nov 11, 2021
2cc046f
Deleted misc files
stefaniagl Nov 12, 2021
945f7a7
trying to remove .DS_Store
stefaniagl Nov 12, 2021
0f2143d
Delete .DS_Store
stefaniagl Nov 12, 2021
84297f0
minor changes
stefaniagl Nov 22, 2021
836fa5c
minor changes
stefaniagl Dec 5, 2021
9b87dd4
minor changes
stefaniagl Dec 5, 2021
3401982
minor changes
stefaniagl Dec 5, 2021
bad2a81
minor changes
stefaniagl Dec 5, 2021
736010c
minor changes
stefaniagl Dec 5, 2021
e0887a4
minor changes
stefaniagl Dec 5, 2021
9d2dc6e
Delete githash.h
stefaniagl Dec 5, 2021
b2a40b0
minor changes
stefaniagl Dec 5, 2021
bede24c
minor changes
stefaniagl Dec 5, 2021
1c4323e
minor changes
stefaniagl Dec 5, 2021
c66f195
visible changes:
myurkin Dec 7, 2021
192db9b
minor changes
stefaniagl Dec 11, 2021
f59da27
minor changes
stefaniagl Dec 15, 2021
4ea4e1a
minor changes
stefaniagl Dec 15, 2021
5791530
minor changes
stefaniagl Dec 15, 2021
de78d36
minor changes
stefaniagl Dec 15, 2021
51aac9e
minor changes
stefaniagl Dec 15, 2021
20ee6df
- corrects additional phase factor for Y-polarization of incident Bes…
myurkin Dec 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# This is currently empty. If you need some ignores, which are specific to your workflow (e.g. IDE), consider
# If you need some ignores, which are specific to your workflow (e.g. IDE), consider
# including them into $GIT_DIR/info/exclude (in this repository) or globally into $XDG_CONFIG_HOME/git/ignore
# See https://git-scm.com/docs/gitignore

# for MacOS
.DS_Store

# for Eclipse
.сproject
.project
36 changes: 25 additions & 11 deletions src/CalculateE.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extern const Parms_1D phi_sg;
extern const double ezLab[3],exSP[3];
// defined and initialized in GenerateB.c
extern const double C0dipole,C0dipole_refl;
extern int vorticity;
// defined and initialized in param.c
extern const bool store_int_field,store_dip_pol,store_beam,store_scat_grid,calc_Cext,calc_Cabs,
calc_Csca,calc_vec,calc_asym,calc_mat_force,store_force,store_ampl;
Expand Down Expand Up @@ -172,6 +173,7 @@ void MuellerMatrix(void)
double matrix[4][4];
double theta,phi,ph,max_err,max_err_c2,max_err_s2,max_err_c4,max_err_s4;
doublecomplex s1,s2,s3,s4;
doublecomplex vort;
char fname[MAX_FNAME];
int i;
size_t index,index1,k_or,j,n,ind;
Expand All @@ -197,6 +199,11 @@ void MuellerMatrix(void)
si=sin(alph);
for (i=0;i<nTheta;i++) {
// transform amplitude matrix, multiplying by rotation matrix (-alpha)
/* Note, that amplitude matrix for vortex beams (e.g., Bessel ones) have to be additionally
* multiplied by the phase factor exp(-I*vorticity*alpha) and additional factor I^vorticity for
* scat_plane (see below). However, it does not change the Mueller matrix and we do not save the
* amplitude matrix here. Hence, these phase factors are ignored for orientation averaging.
*/
if (yzplane) { // here the default (alpha=0) is yz-plane, so par=Y, per=X
s2 = co*ampl_alphaY[index+1] + si*ampl_alphaX[index+1]; // s2 = co*s20 + si*s30
s3 = -si*ampl_alphaY[index+1] + co*ampl_alphaX[index+1]; // s3 = -si*s20 + co*s30
Expand Down Expand Up @@ -243,15 +250,19 @@ void MuellerMatrix(void)
FCloseErr(mueller,F_MUEL,ONE_POS);
}
}
if (scat_plane) { // par=X, per=-Y
if (scat_plane) { // par=X*i^n, per=-Y*i^n (n - vorticity)
if (store_ampl) {
SnprintfErr(ONE_POS,fname,MAX_FNAME,"%s/"F_AMPL,directory);
ampl=FOpenErr(fname,"w",ONE_POS);
fprintf(ampl,THETA_HEADER" "AMPL_HEADER"\n");
vort=cpow(I,vorticity);
for (i=0;i<nTheta;i++) {
theta=i*dtheta_deg;
fprintf(ampl,ANGLE_FORMAT" "AMPL_FORMAT"\n",theta,REIM(-EplaneY[2*i]),REIM(EplaneX[2*i+1]),
REIM(-EplaneY[2*i+1]),REIM(EplaneX[2*i]));
s1=-EplaneY[2*i]*vort;
s2=EplaneX[2*i+1]*vort;
s3=-EplaneY[2*i+1]*vort;
s4=EplaneX[2*i]*vort;
fprintf(ampl,ANGLE_FORMAT" "AMPL_FORMAT"\n",theta,REIM(s1),REIM(s2),REIM(s3),REIM(s4));
}
FCloseErr(ampl,F_AMPL,ONE_POS);
}
Expand All @@ -261,6 +272,7 @@ void MuellerMatrix(void)
fprintf(mueller,THETA_HEADER" "MUEL_HEADER"\n");
for (i=0;i<nTheta;i++) {
theta=i*dtheta_deg;
// here we ignore common phase factor in the amplitude matrix (vort above)
ComputeMuellerMatrix(matrix,-EplaneY[2*i],EplaneX[2*i+1],-EplaneY[2*i+1],EplaneX[2*i],theta);
fprintf(mueller,ANGLE_FORMAT" "MUEL_FORMAT"\n",theta,COMP44M(matrix));
}
Expand All @@ -272,10 +284,11 @@ void MuellerMatrix(void)
/* compute Mueller Matrix in full space angle.
* E-fields are stored in arrays EgridX and EgridY for incoming X and Y polarized light.
* It is converted to the scattering matrix elements (see e.g Bohren and Huffman) :
* s2 = cos(phi)E'X'par + sin(phi)E'Y'par
* s3 = sin(phi)E'X'par - cos(phi)E'Y'par
* s4 = cos(phi)E'X'per + sin(phi)E'Y'per
* s1 = sin(phi)E'X'per - cos(phi)E'Y'per
* s2 = vort*(cos(phi)E'X'par + sin(phi)E'Y'par)
* s3 = vort*(sin(phi)E'X'par - cos(phi)E'Y'par)
* s4 = vort*(cos(phi)E'X'per + sin(phi)E'Y'per)
* s1 = vort*(sin(phi)E'X'per - cos(phi)E'Y'per)
* where additional phase factor vort=exp(I*vorticity*(PI_OVER_TWO-ph)) is for vortex beams;
* from these the mueller matrix elements are computed
*/
// open files for writing
Expand Down Expand Up @@ -330,15 +343,16 @@ void MuellerMatrix(void)
if (angles.type==SG_GRID) phi=angles.phi.val[j];
else phi=angles.phi.val[ind]; // angles.type==SG_PAIRS
ph=Deg2Rad(phi);
vort=imExp(vorticity*(PI_OVER_TWO-ph));
// rather complicated (but general) approach to determine rotation angle from XY to scattering plane
SetScatPlane(cthet,sthet,ph,tmp3,incPolper);
co=-DotProd(incPolper,incPolY);
si=DotProd(incPolper,incPolX);
// transform the amplitude matrix, multiplying by rotation matrix from per-par to X-Y
s2 = co*EgridX[index+1] + si*EgridY[index+1]; // s2 = co*s20 + si*s30
s3 = si*EgridX[index+1] - co*EgridY[index+1]; // s3 = si*s20 - co*s30
s4 = co*EgridX[index] + si*EgridY[index]; // s4 = co*s40 + si*s10
s1 = si*EgridX[index] - co*EgridY[index]; // s1 = si*s40 - co*s10
s2 = vort*(co*EgridX[index+1] + si*EgridY[index+1]); // s2 = co*s20 + si*s30
s3 = vort*(si*EgridX[index+1] - co*EgridY[index+1]); // s3 = si*s20 - co*s30
s4 = vort*(co*EgridX[index] + si*EgridY[index]); // s4 = co*s40 + si*s10
s1 = vort*(si*EgridX[index] - co*EgridY[index]); // s1 = si*s40 - co*s10
index+=2;

if (store_mueller) ComputeMuellerMatrix(matrix,s1,s2,s3,s4,theta);
Expand Down
Loading