Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
18e399ca
Commit
18e399ca
authored
9 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Use ParticleDescriptor in SPHERE
parent
0844ceb9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/sph_subs.h
+18
-18
18 additions, 18 deletions
src/include/sph_subs.h
src/libnptm/sph_subs.cpp
+9
-9
9 additions, 9 deletions
src/libnptm/sph_subs.cpp
src/sphere/sphere.cpp
+1
-1
1 addition, 1 deletion
src/sphere/sphere.cpp
with
28 additions
and
28 deletions
src/include/sph_subs.h
+
18
−
18
View file @
18e399ca
...
@@ -38,11 +38,11 @@
...
@@ -38,11 +38,11 @@
* \param zpv: `double ****` Geometrical asymmetry parameter coefficients matrix.
* \param zpv: `double ****` Geometrical asymmetry parameter coefficients matrix.
* \param li: `int` Maximum field expansion order.
* \param li: `int` Maximum field expansion order.
* \param nsph: `int` Number of spheres.
* \param nsph: `int` Number of spheres.
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
* \param sqk: `double`
* \param sqk: `double`
* \param gaps: `double *` Geometrical asymmetry parameter-corrected cross-section.
* \param gaps: `double *` Geometrical asymmetry parameter-corrected cross-section.
*/
*/
void
aps
(
double
****
zpv
,
int
li
,
int
nsph
,
C1
*
c1
,
double
sqk
,
double
*
gaps
);
void
aps
(
double
****
zpv
,
int
li
,
int
nsph
,
ParticleDescriptor
*
c1
,
double
sqk
,
double
*
gaps
);
/*! \brief Complex Bessel Function.
/*! \brief Complex Bessel Function.
*
*
...
@@ -88,10 +88,10 @@ double cg1(int lmpml, int mu, int l, int m);
...
@@ -88,10 +88,10 @@ double cg1(int lmpml, int mu, int l, int m);
* \param i: `int`
* \param i: `int`
* \param ic: `int`
* \param ic: `int`
* \param vk: `double`
* \param vk: `double`
* \param c1: `
C1 *` Pointer to `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to `ParticleDescriptor
` data structure.
* \param c2: `C2 *` Pointer to `C2` data structure.
* \param c2: `C2 *` Pointer to `C2` data structure.
*/
*/
void
diel
(
int
npntmo
,
int
ns
,
int
i
,
int
ic
,
double
vk
,
C1
*
c1
,
C2
*
c2
);
void
diel
(
int
npntmo
,
int
ns
,
int
i
,
int
ic
,
double
vk
,
ParticleDescriptor
*
c1
,
C2
*
c2
);
/*! \brief Compute Mie scattering coefficients.
/*! \brief Compute Mie scattering coefficients.
*
*
...
@@ -107,7 +107,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2);
...
@@ -107,7 +107,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2);
* \param vk: `double` Wave number in scale units.
* \param vk: `double` Wave number in scale units.
* \param exdc: `double` External medium dielectric constant.
* \param exdc: `double` External medium dielectric constant.
* \param exri: `double` External medium refractive index.
* \param exri: `double` External medium refractive index.
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
* \param c2: `C2 *` Pointer to a `C2` data structure.
* \param c2: `C2 *` Pointer to a `C2` data structure.
* \param jer: `int &` Reference to integer error code variable.
* \param jer: `int &` Reference to integer error code variable.
* \param lcalc: `int &` Reference to integer variable recording the maximum expansion order accounted for.
* \param lcalc: `int &` Reference to integer variable recording the maximum expansion order accounted for.
...
@@ -116,7 +116,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2);
...
@@ -116,7 +116,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2);
*/
*/
void
dme
(
void
dme
(
int
li
,
int
i
,
int
npnt
,
int
npntts
,
double
vk
,
double
exdc
,
double
exri
,
int
li
,
int
i
,
int
npnt
,
int
npntts
,
double
vk
,
double
exdc
,
double
exri
,
C1
*
c1
,
C2
*
c2
,
int
&
jer
,
int
&
lcalc
,
dcomplex
&
arg
,
int
last_conf
=
0
ParticleDescriptor
*
c1
,
C2
*
c2
,
int
&
jer
,
int
&
lcalc
,
dcomplex
&
arg
,
int
last_conf
=
0
);
);
/*! \brief Bessel function calculation control parameters.
/*! \brief Bessel function calculation control parameters.
...
@@ -189,11 +189,11 @@ void orunve(double *u1, double *u2, double *u3, int iorth, double torth);
...
@@ -189,11 +189,11 @@ void orunve(double *u1, double *u2, double *u3, int iorth, double torth);
* \param inpol: `int` Incident field polarization type (0 - linear; 1 - circular).
* \param inpol: `int` Incident field polarization type (0 - linear; 1 - circular).
* \param lw: `int`
* \param lw: `int`
* \param isq: `int`
* \param isq: `int`
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
*/
*/
void
pwma
(
void
pwma
(
double
*
up
,
double
*
un
,
dcomplex
*
ylm
,
int
inpol
,
int
lw
,
double
*
up
,
double
*
un
,
dcomplex
*
ylm
,
int
inpol
,
int
lw
,
int
isq
,
C1
*
c1
int
isq
,
ParticleDescriptor
*
c1
);
);
/*! \brief Compute radiation torques on a single sphere in Cartesian coordinates.
/*! \brief Compute radiation torques on a single sphere in Cartesian coordinates.
...
@@ -205,14 +205,14 @@ void pwma(
...
@@ -205,14 +205,14 @@ void pwma(
* \param inpol: `int` Incident polarization type (0 - linear; 1 - circular)
* \param inpol: `int` Incident polarization type (0 - linear; 1 - circular)
* \param li: `int` Maximum field expansion order.
* \param li: `int` Maximum field expansion order.
* \param nsph: `int` Number of spheres.
* \param nsph: `int` Number of spheres.
* \param c1: `
C1 *` Pointer to `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to `ParticleDescriptor
` data structure.
* \param tqse: `double **`
* \param tqse: `double **`
* \param tqspe: `complex double **`
* \param tqspe: `complex double **`
* \param tqss: `double **`
* \param tqss: `double **`
* \param tqsps: `complex double **`
* \param tqsps: `complex double **`
*/
*/
void
rabas
(
void
rabas
(
int
inpol
,
int
li
,
int
nsph
,
C1
*
c1
,
double
**
tqse
,
dcomplex
**
tqspe
,
int
inpol
,
int
li
,
int
nsph
,
ParticleDescriptor
*
c1
,
double
**
tqse
,
dcomplex
**
tqspe
,
double
**
tqss
,
dcomplex
**
tqsps
double
**
tqss
,
dcomplex
**
tqsps
);
);
...
@@ -308,9 +308,9 @@ void sphar(
...
@@ -308,9 +308,9 @@ void sphar(
* \param lm: `int` Maximum field expansion order.
* \param lm: `int` Maximum field expansion order.
* \param vk: `double` Wave number in scale units.
* \param vk: `double` Wave number in scale units.
* \param exri: `double` External medium refractive index.
* \param exri: `double` External medium refractive index.
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
*/
*/
void
sscr0
(
dcomplex
&
tfsas
,
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
C1
*
c1
);
void
sscr0
(
dcomplex
&
tfsas
,
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
ParticleDescriptor
*
c1
);
/*! \brief C++ Compute the scattering amplitude and the scattered field intensity.
/*! \brief C++ Compute the scattering amplitude and the scattered field intensity.
*
*
...
@@ -321,9 +321,9 @@ void sscr0(dcomplex &tfsas, int nsph, int lm, double vk, double exri, C1 *c1);
...
@@ -321,9 +321,9 @@ void sscr0(dcomplex &tfsas, int nsph, int lm, double vk, double exri, C1 *c1);
* \param lm: `int` Maximum field expansion order.
* \param lm: `int` Maximum field expansion order.
* \param vk: `double` Wave number in scale units.
* \param vk: `double` Wave number in scale units.
* \param exri: `double` External medium refractive index.
* \param exri: `double` External medium refractive index.
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
*/
*/
void
sscr2
(
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
C1
*
c1
);
void
sscr2
(
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
ParticleDescriptor
*
c1
);
/*! \brief Determine the geometrical asymmetry parameter coefficients.
/*! \brief Determine the geometrical asymmetry parameter coefficients.
*
*
...
@@ -409,12 +409,12 @@ void upvsp(
...
@@ -409,12 +409,12 @@ void upvsp(
* \param u: `double *`
* \param u: `double *`
* \param up: `double *`
* \param up: `double *`
* \param un: `double *`
* \param un: `double *`
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
*/
*/
void
wmamp
(
void
wmamp
(
int
iis
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
int
inpol
,
int
iis
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
int
inpol
,
int
lm
,
int
idot
,
int
nsph
,
double
*
arg
,
double
*
u
,
double
*
up
,
int
lm
,
int
idot
,
int
nsph
,
double
*
arg
,
double
*
u
,
double
*
up
,
double
*
un
,
C1
*
c1
double
*
un
,
ParticleDescriptor
*
c1
);
);
/*! \brief Compute the scattering plane-referred geometrical asymmetry parameter coefficients.
/*! \brief Compute the scattering plane-referred geometrical asymmetry parameter coefficients.
...
@@ -445,13 +445,13 @@ void wmamp(
...
@@ -445,13 +445,13 @@ void wmamp(
* \param nsph: `int` Number opf spheres.
* \param nsph: `int` Number opf spheres.
* \param argi: `double *`
* \param argi: `double *`
* \param args: `double *`
* \param args: `double *`
* \param c1: `
C1 *` Pointer to a `C1
` data structure.
* \param c1: `
ParticleDescriptor *` Pointer to a `ParticleDescriptor
` data structure.
*/
*/
void
wmasp
(
void
wmasp
(
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
double
costs
,
double
sints
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
double
costs
,
double
sints
,
double
cosps
,
double
sinps
,
double
*
u
,
double
*
up
,
double
*
un
,
double
*
us
,
double
cosps
,
double
sinps
,
double
*
u
,
double
*
up
,
double
*
un
,
double
*
us
,
double
*
ups
,
double
*
uns
,
int
isq
,
int
ibf
,
int
inpol
,
int
lm
,
int
idot
,
double
*
ups
,
double
*
uns
,
int
isq
,
int
ibf
,
int
inpol
,
int
lm
,
int
idot
,
int
nsph
,
double
*
argi
,
double
*
args
,
C1
*
c1
int
nsph
,
double
*
argi
,
double
*
args
,
ParticleDescriptor
*
c1
);
);
#endif
/* SRC_INCLUDE_SPH_SUBS_H_ */
#endif
/* SRC_INCLUDE_SPH_SUBS_H_ */
This diff is collapsed.
Click to expand it.
src/libnptm/sph_subs.cpp
+
9
−
9
View file @
18e399ca
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include
"../include/sph_subs.h"
#include
"../include/sph_subs.h"
#endif
#endif
void
aps
(
double
****
zpv
,
int
li
,
int
nsph
,
C1
*
c1
,
double
sqk
,
double
*
gaps
)
{
void
aps
(
double
****
zpv
,
int
li
,
int
nsph
,
ParticleDescriptor
*
c1
,
double
sqk
,
double
*
gaps
)
{
dcomplex
cc0
=
0.0
+
0.0
*
I
;
dcomplex
cc0
=
0.0
+
0.0
*
I
;
dcomplex
summ
,
sume
,
suem
,
suee
,
sum
;
dcomplex
summ
,
sume
,
suem
,
suee
,
sum
;
double
half_pi
=
acos
(
0.0
);
double
half_pi
=
acos
(
0.0
);
...
@@ -197,7 +197,7 @@ double cg1(int lmpml, int mu, int l, int m) {
...
@@ -197,7 +197,7 @@ double cg1(int lmpml, int mu, int l, int m) {
return
result
;
return
result
;
}
}
void
diel
(
int
npntmo
,
int
ns
,
int
i
,
int
ic
,
double
vk
,
C1
*
c1
,
C2
*
c2
)
{
void
diel
(
int
npntmo
,
int
ns
,
int
i
,
int
ic
,
double
vk
,
ParticleDescriptor
*
c1
,
C2
*
c2
)
{
const
double
dif
=
c1
->
rc
[
i
-
1
][
ns
]
-
c1
->
rc
[
i
-
1
][
ns
-
1
];
const
double
dif
=
c1
->
rc
[
i
-
1
][
ns
]
-
c1
->
rc
[
i
-
1
][
ns
-
1
];
const
double
half_step
=
0.5
*
dif
/
npntmo
;
const
double
half_step
=
0.5
*
dif
/
npntmo
;
double
rr
=
c1
->
rc
[
i
-
1
][
ns
-
1
];
double
rr
=
c1
->
rc
[
i
-
1
][
ns
-
1
];
...
@@ -218,7 +218,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2) {
...
@@ -218,7 +218,7 @@ void diel(int npntmo, int ns, int i, int ic, double vk, C1 *c1, C2 *c2) {
void
dme
(
void
dme
(
int
li
,
int
i
,
int
npnt
,
int
npntts
,
double
vk
,
double
exdc
,
double
exri
,
int
li
,
int
i
,
int
npnt
,
int
npntts
,
double
vk
,
double
exdc
,
double
exri
,
C1
*
c1
,
C2
*
c2
,
int
&
jer
,
int
&
lcalc
,
dcomplex
&
arg
,
int
last_conf
ParticleDescriptor
*
c1
,
C2
*
c2
,
int
&
jer
,
int
&
lcalc
,
dcomplex
&
arg
,
int
last_conf
)
{
)
{
const
int
lipo
=
li
+
1
;
const
int
lipo
=
li
+
1
;
const
int
lipt
=
li
+
2
;
const
int
lipt
=
li
+
2
;
...
@@ -497,7 +497,7 @@ void orunve(double *u1, double *u2, double *u3, int iorth, double torth) {
...
@@ -497,7 +497,7 @@ void orunve(double *u1, double *u2, double *u3, int iorth, double torth) {
void
pwma
(
void
pwma
(
double
*
up
,
double
*
un
,
dcomplex
*
ylm
,
int
inpol
,
int
lw
,
double
*
up
,
double
*
un
,
dcomplex
*
ylm
,
int
inpol
,
int
lw
,
int
isq
,
C1
*
c1
int
isq
,
ParticleDescriptor
*
c1
)
{
)
{
const
double
four_pi
=
8.0
*
acos
(
0.0
);
const
double
four_pi
=
8.0
*
acos
(
0.0
);
int
is
=
isq
;
int
is
=
isq
;
...
@@ -575,7 +575,7 @@ void pwma(
...
@@ -575,7 +575,7 @@ void pwma(
}
}
void
rabas
(
void
rabas
(
int
inpol
,
int
li
,
int
nsph
,
C1
*
c1
,
double
**
tqse
,
dcomplex
**
tqspe
,
int
inpol
,
int
li
,
int
nsph
,
ParticleDescriptor
*
c1
,
double
**
tqse
,
dcomplex
**
tqspe
,
double
**
tqss
,
dcomplex
**
tqsps
double
**
tqss
,
dcomplex
**
tqsps
)
{
)
{
dcomplex
cc0
=
0.0
+
0.0
*
I
;
dcomplex
cc0
=
0.0
+
0.0
*
I
;
...
@@ -894,7 +894,7 @@ void sphar(
...
@@ -894,7 +894,7 @@ void sphar(
goto
label40
;
goto
label40
;
}
}
void
sscr0
(
dcomplex
&
tfsas
,
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
C1
*
c1
)
{
void
sscr0
(
dcomplex
&
tfsas
,
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
ParticleDescriptor
*
c1
)
{
dcomplex
sum21
,
rm
,
re
,
csam
;
dcomplex
sum21
,
rm
,
re
,
csam
;
const
dcomplex
cc0
=
0.0
+
0.0
*
I
;
const
dcomplex
cc0
=
0.0
+
0.0
*
I
;
const
double
exdc
=
exri
*
exri
;
const
double
exdc
=
exri
*
exri
;
...
@@ -935,7 +935,7 @@ void sscr0(dcomplex &tfsas, int nsph, int lm, double vk, double exri, C1 *c1) {
...
@@ -935,7 +935,7 @@ void sscr0(dcomplex &tfsas, int nsph, int lm, double vk, double exri, C1 *c1) {
}
}
}
}
void
sscr2
(
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
C1
*
c1
)
{
void
sscr2
(
int
nsph
,
int
lm
,
double
vk
,
double
exri
,
ParticleDescriptor
*
c1
)
{
dcomplex
s11
,
s21
,
s12
,
s22
,
rm
,
re
,
csam
,
cc
;
dcomplex
s11
,
s21
,
s12
,
s22
,
rm
,
re
,
csam
,
cc
;
const
dcomplex
cc0
=
0.0
+
0.0
*
I
;
const
dcomplex
cc0
=
0.0
+
0.0
*
I
;
double
ccs
=
1.0
/
(
vk
*
vk
);
double
ccs
=
1.0
/
(
vk
*
vk
);
...
@@ -1121,7 +1121,7 @@ void upvsp(
...
@@ -1121,7 +1121,7 @@ void upvsp(
void
wmamp
(
void
wmamp
(
int
iis
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
int
inpol
,
int
iis
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
int
inpol
,
int
lm
,
int
idot
,
int
nsph
,
double
*
arg
,
double
*
u
,
double
*
up
,
int
lm
,
int
idot
,
int
nsph
,
double
*
arg
,
double
*
u
,
double
*
up
,
double
*
un
,
C1
*
c1
double
*
un
,
ParticleDescriptor
*
c1
)
{
)
{
const
int
ylm_size
=
(
lm
+
1
)
*
(
lm
+
1
)
+
1
;
const
int
ylm_size
=
(
lm
+
1
)
*
(
lm
+
1
)
+
1
;
dcomplex
*
ylm
=
new
dcomplex
[
ylm_size
];
dcomplex
*
ylm
=
new
dcomplex
[
ylm_size
];
...
@@ -1150,7 +1150,7 @@ void wmasp(
...
@@ -1150,7 +1150,7 @@ void wmasp(
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
double
costs
,
double
sints
,
double
cost
,
double
sint
,
double
cosp
,
double
sinp
,
double
costs
,
double
sints
,
double
cosps
,
double
sinps
,
double
*
u
,
double
*
up
,
double
*
un
,
double
*
us
,
double
cosps
,
double
sinps
,
double
*
u
,
double
*
up
,
double
*
un
,
double
*
us
,
double
*
ups
,
double
*
uns
,
int
isq
,
int
ibf
,
int
inpol
,
int
lm
,
int
idot
,
double
*
ups
,
double
*
uns
,
int
isq
,
int
ibf
,
int
inpol
,
int
lm
,
int
idot
,
int
nsph
,
double
*
argi
,
double
*
args
,
C1
*
c1
int
nsph
,
double
*
argi
,
double
*
args
,
ParticleDescriptor
*
c1
)
{
)
{
const
int
ylm_size
=
(
lm
+
1
)
*
(
lm
+
1
)
+
1
;
const
int
ylm_size
=
(
lm
+
1
)
*
(
lm
+
1
)
+
1
;
dcomplex
*
ylm
=
new
dcomplex
[
ylm_size
];
dcomplex
*
ylm
=
new
dcomplex
[
ylm_size
];
...
...
This diff is collapsed.
Click to expand it.
src/sphere/sphere.cpp
+
1
−
1
View file @
18e399ca
...
@@ -129,7 +129,7 @@ void sphere(const string& config_file, const string& data_file, const string& ou
...
@@ -129,7 +129,7 @@ void sphere(const string& config_file, const string& data_file, const string& ou
double
cfmp
,
cfsp
,
sfmp
,
sfsp
;
double
cfmp
,
cfsp
,
sfmp
,
sfsp
;
int
jw
;
int
jw
;
int
l_max
=
gconf
->
l_max
;
int
l_max
=
gconf
->
l_max
;
C1
*
c1
=
new
C1
(
gconf
,
sconf
);
ParticleDescriptor
*
c1
=
new
ParticleDescriptorSphere
(
gconf
,
sconf
);
int
npnt
=
gconf
->
npnt
;
int
npnt
=
gconf
->
npnt
;
int
npntts
=
gconf
->
npntts
;
int
npntts
=
gconf
->
npntts
;
int
in_pol
=
gconf
->
in_pol
;
int
in_pol
=
gconf
->
in_pol
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment