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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
c31575c9
Commit
c31575c9
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Enable configuration of clusters of spheres
parent
cd28a78e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/Configuration.h
+17
-2
17 additions, 2 deletions
src/include/Configuration.h
src/libnptm/Configuration.cpp
+32
-16
32 additions, 16 deletions
src/libnptm/Configuration.cpp
with
49 additions
and
18 deletions
src/include/Configuration.h
+
17
−
2
View file @
c31575c9
...
...
@@ -64,13 +64,22 @@ public:
* fields and their polarization properties.
*/
class
GeometryConfiguration
{
//! Temporary work-around to allow sphere() peeking in.
//! Temporary work-around to allow cluster() and sphere() peeking in.
friend
void
cluster
();
friend
void
sphere
();
protected:
//! \brief Number of spherical components.
int
number_of_spheres
;
//! \brief Maximum expansion order of angular momentum.
int
l_max
;
//! \brief QUESTION: definition?
int
li
;
//! \brief QUESTION: definition?
int
le
;
//! \brief QUESTION: definition?
int
mxndm
;
//! \brief QUESTION: definition?
int
iavm
;
//! \brief Incident field polarization status (0 - linear, 1 - circular).
int
in_pol
;
//! \brief Number of transition points. QUESTION: correct?
...
...
@@ -124,6 +133,10 @@ public:
* for incident angles, 0 if determined by incidence and observation, =1
* accross z-axis for incidence and observation, >1 across z-axis as a
* function of incidence angles for fixed scattering).
* \param li: `int`
* \param le: `int`
* \param mxndm: `int`
* \param iavm: `int`
* \param x: `double*` Vector of spherical components X coordinates.
* \param y: `double*` Vector of spherical components Y coordinates.
* \param z: `double*` Vector of spherical components Z coordinates.
...
...
@@ -143,6 +156,7 @@ public:
*/
GeometryConfiguration
(
int
nsph
,
int
lm
,
int
in_pol
,
int
npnt
,
int
npntts
,
int
meridional_type
,
int
li
,
int
le
,
int
mxndm
,
int
iavm
,
double
*
x
,
double
*
y
,
double
*
z
,
double
in_th_start
,
double
in_th_step
,
double
in_th_end
,
double
sc_th_start
,
double
sc_th_step
,
double
sc_th_end
,
...
...
@@ -176,7 +190,8 @@ public:
* data to describe the scatterer properties.
*/
class
ScattererConfiguration
{
//! Temporary work-around to allow sphere() peeking in.
//! Temporary work-around to allow cluster() and sphere() peeking in.
friend
void
cluster
();
friend
void
sphere
();
protected:
//! \brief Matrix of dielectric parameters with size [NON_TRANS_LAYERS x N_SPHERES x LAYERS].
...
...
This diff is collapsed.
Click to expand it.
src/libnptm/Configuration.cpp
+
32
−
16
View file @
c31575c9
...
...
@@ -12,7 +12,8 @@
using
namespace
std
;
GeometryConfiguration
::
GeometryConfiguration
(
int
nsph
,
int
lm
,
int
_in_pol
,
int
_npnt
,
int
_npntts
,
int
isam
,
int
_nsph
,
int
_lm
,
int
_in_pol
,
int
_npnt
,
int
_npntts
,
int
_isam
,
int
_li
,
int
_le
,
int
_mxndm
,
int
_iavm
,
double
*
x
,
double
*
y
,
double
*
z
,
double
in_th_start
,
double
in_th_step
,
double
in_th_end
,
double
sc_th_start
,
double
sc_th_step
,
double
sc_th_end
,
...
...
@@ -20,12 +21,16 @@ GeometryConfiguration::GeometryConfiguration(
double
sc_ph_start
,
double
sc_ph_step
,
double
sc_ph_end
,
int
_jwtm
)
{
number_of_spheres
=
nsph
;
l_max
=
lm
;
number_of_spheres
=
_
nsph
;
l_max
=
_
lm
;
in_pol
=
_in_pol
;
npnt
=
_npnt
;
npntts
=
_npntts
;
meridional_type
=
isam
;
meridional_type
=
_isam
;
li
=
_li
;
le
=
_le
;
mxndm
=
_mxndm
;
iavm
=
_iavm
;
in_theta_start
=
in_th_start
;
in_theta_step
=
in_th_step
;
in_theta_end
=
in_th_end
;
...
...
@@ -59,22 +64,32 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(string file_name) {
}
catch
(
exception
&
ex
)
{
throw
OpenConfigurationFileException
(
file_name
);
}
int
nsph
,
lm
,
_in_pol
,
_npnt
,
_npntts
,
isam
;
int
_nsph
=
0
,
_lm
=
0
,
_in_pol
=
0
,
_npnt
=
0
,
_npntts
=
0
,
_isam
=
0
;
int
_li
=
0
,
_le
=
0
,
_mxndm
=
0
,
_iavm
=
0
;
sscanf
(
file_lines
[
last_read_line
].
c_str
(),
" %d"
,
&
_nsph
);
if
(
_nsph
==
1
)
{
sscanf
(
file_lines
[
last_read_line
++
].
c_str
(),
" %d %d %d %d %d %d"
,
&
nsph
,
&
lm
,
&
_in_pol
,
&
_npnt
,
&
_npntts
,
&
isam
" %
*
d %d %d %d %d %d"
,
&
_
lm
,
&
_in_pol
,
&
_npnt
,
&
_npntts
,
&
_
isam
);
}
else
{
sscanf
(
file_lines
[
last_read_line
++
].
c_str
(),
" %*d %d %d %d %d %d %d %d %d"
,
&
_li
,
&
_le
,
&
_mxndm
,
&
_in_pol
,
&
_npnt
,
&
_npntts
,
&
_iavm
,
&
_isam
);
}
double
*
x
,
*
y
,
*
z
;
x
=
new
double
[
nsph
];
y
=
new
double
[
nsph
];
z
=
new
double
[
nsph
];
if
(
nsph
==
1
)
{
x
=
new
double
[
_
nsph
];
y
=
new
double
[
_
nsph
];
z
=
new
double
[
_
nsph
];
if
(
_
nsph
==
1
)
{
x
[
0
]
=
0.0
;
y
[
0
]
=
0.0
;
z
[
0
]
=
0.0
;
}
else
{
for
(
int
i
=
0
;
i
<
nsph
;
i
++
)
{
for
(
int
i
=
0
;
i
<
_
nsph
;
i
++
)
{
double
sph_x
,
sph_y
,
sph_z
;
int
sph_x_exp
,
sph_y_exp
,
sph_z_exp
;
sscanf
(
...
...
@@ -126,7 +141,8 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(string file_name) {
int
_jwtm
;
sscanf
(
file_lines
[
last_read_line
++
].
c_str
(),
" %d"
,
&
_jwtm
);
GeometryConfiguration
*
conf
=
new
GeometryConfiguration
(
nsph
,
lm
,
_in_pol
,
_npnt
,
_npntts
,
isam
,
_nsph
,
_lm
,
_in_pol
,
_npnt
,
_npntts
,
_isam
,
_li
,
_le
,
_mxndm
,
_iavm
,
x
,
y
,
z
,
in_th_start
,
in_th_step
,
in_th_end
,
sc_th_start
,
sc_th_step
,
sc_th_end
,
...
...
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