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
71e7f35b
Commit
71e7f35b
authored
3 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Adapt dc0 vector in ParticlDescriptor for multi-layer aggregate case
parent
109e56c4
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/Commons.h
+4
-4
4 additions, 4 deletions
src/include/Commons.h
src/libnptm/Commons.cpp
+18
-12
18 additions, 12 deletions
src/libnptm/Commons.cpp
with
22 additions
and
16 deletions
src/include/Commons.h
+
4
−
4
View file @
71e7f35b
...
...
@@ -80,12 +80,12 @@ protected:
int
_nsph
;
//! \brief Maximum internal field expansion order.
int
_li
;
//! \brief Maximum number of layers in known sphere types.
int
_max_layers
;
//! \brief Number of different sphere types.
int
_num_configurations
;
//! \brief Total number of layers from all sphere types.
int
_num_layers
;
//! \brief Space for different sphere types.
int
_nl
;
//! \brief NHSPO = 2 * MAX(NPNT,NPNTTS) - 1
int
_nhspo
;
//! \brief Number of points for numerical integration in layered spheres.
...
...
@@ -184,12 +184,12 @@ public:
const
int
&
nsph
=
_nsph
;
//! \brief Read-only view of maximum internal field expansion order.
const
int
&
li
=
_li
;
//! \brief Read-only view of the maximum number of layers in types.
const
int
&
max_layers
=
_max_layers
;
//! \brief Read-only view of number of different sphere types.
const
int
&
num_configurations
=
_num_configurations
;
//! \brief Read-only view of total number of layers from all sphere types.
const
int
&
num_layers
=
_num_layers
;
//! \brief Read-only view on the space for different sphere configurations.
const
int
&
nl
=
_nl
;
//! \brief Read-only view of NHSPO.
const
int
&
nhspo
=
_nhspo
;
//! \brief Read-only view on number of points for numerical integration in layered spheres.
...
...
This diff is collapsed.
Click to expand it.
src/libnptm/Commons.cpp
+
18
−
12
View file @
71e7f35b
...
...
@@ -84,7 +84,12 @@ ParticleDescriptor::ParticleDescriptor(GeometryConfiguration *gconf, ScattererCo
gcs
=
0.0
;
_num_configurations
=
sconf
->
configurations
;
_num_layers
=
(
sconf
->
use_external_sphere
)
?
1
:
0
;
for
(
int
nli
=
0
;
nli
<
num_configurations
;
nli
++
)
_num_layers
+=
sconf
->
get_nshl
(
nli
);
_max_layers
=
1
;
for
(
int
nli
=
0
;
nli
<
num_configurations
;
nli
++
)
{
int
nl
=
sconf
->
get_nshl
(
nli
);
_num_layers
+=
nl
;
if
(
nl
>
_max_layers
)
_max_layers
=
nl
;
}
vec_rmi
=
new
dcomplex
[
_li
*
_nsph
]();
rmi
=
new
dcomplex
*
[
_li
];
...
...
@@ -131,12 +136,12 @@ ParticleDescriptor::ParticleDescriptor(GeometryConfiguration *gconf, ScattererCo
_npntts
=
gconf
->
npntts
;
int
max_n
=
(
npnt
>
npntts
)
?
npnt
:
npntts
;
_nhspo
=
2
*
max_n
-
1
;
_nl
=
sconf
->
configurations
;
if
(
_nsph
==
1
&&
_nl
==
1
)
_nl
=
5
;
//
_nl = sconf->configurations;
//
if (_nsph == 1 && _nl == 1) _nl = 5;
ris
=
new
dcomplex
[
_nhspo
]();
dlri
=
new
dcomplex
[
_nhspo
]();
vkt
=
new
dcomplex
[
_nsph
]();
dc0
=
new
dcomplex
[
_
nl
]();
dc0
=
new
dcomplex
[
_
max_layers
+
1
]();
vsz
=
new
double
[
_nsph
]();
// >>> NEEDED BY SPHERE AND CLUSTER <<<
...
...
@@ -219,6 +224,7 @@ ParticleDescriptor::ParticleDescriptor(const ParticleDescriptor &rhs) {
_ndit
=
rhs
.
_ndit
;
_ndm
=
rhs
.
_ndm
;
gcs
=
rhs
.
gcs
;
_max_layers
=
rhs
.
_max_layers
;
_num_configurations
=
rhs
.
_num_configurations
;
_num_layers
=
rhs
.
_num_layers
;
...
...
@@ -271,7 +277,7 @@ ParticleDescriptor::ParticleDescriptor(const ParticleDescriptor &rhs) {
_npnt
=
rhs
.
_npnt
;
_npntts
=
rhs
.
_npntts
;
_nhspo
=
rhs
.
_nhspo
;
_
nl
=
rhs
.
_nl
;
_
max_layers
=
rhs
.
_max_layers
;
ris
=
new
dcomplex
[
_nhspo
]();
dlri
=
new
dcomplex
[
_nhspo
]();
for
(
int
ri
=
0
;
ri
<
_nhspo
;
ri
++
)
{
...
...
@@ -284,8 +290,8 @@ ParticleDescriptor::ParticleDescriptor(const ParticleDescriptor &rhs) {
vkt
[
vi
]
=
rhs
.
vkt
[
vi
];
vsz
[
vi
]
=
rhs
.
vsz
[
vi
];
}
dc0
=
new
dcomplex
[
_
nl
]();
for
(
int
di
=
0
;
di
<
_
nl
;
di
++
)
{
dc0
=
new
dcomplex
[
_
max_layers
]();
for
(
int
di
=
0
;
di
<
_
max_layers
;
di
++
)
{
dc0
[
di
]
=
rhs
.
dc0
[
di
];
}
// >>> NEEDED BY SPHERE AND CLUSTER <<<
...
...
@@ -416,7 +422,7 @@ ParticleDescriptor::ParticleDescriptor(const mixMPI *mpidata) {
MPI_Bcast
(
&
_npnt
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_npntts
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_nhspo
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_
nl
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_
max_layers
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
ris
=
new
dcomplex
[
_nhspo
];
MPI_Bcast
(
ris
,
_nhspo
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
dlri
=
new
dcomplex
[
_nhspo
];
...
...
@@ -425,8 +431,8 @@ ParticleDescriptor::ParticleDescriptor(const mixMPI *mpidata) {
MPI_Bcast
(
vkt
,
_nsph
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
vsz
=
new
double
[
_nsph
];
MPI_Bcast
(
vsz
,
_nsph
,
MPI_DOUBLE
,
0
,
MPI_COMM_WORLD
);
dc0
=
new
dcomplex
[
_
nl
];
MPI_Bcast
(
dc0
,
_
nl
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
dc0
=
new
dcomplex
[
_
max_layers
];
MPI_Bcast
(
dc0
,
_
max_layers
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
}
void
ParticleDescriptor
::
mpibcast
(
const
mixMPI
*
mpidata
)
{
...
...
@@ -466,12 +472,12 @@ void ParticleDescriptor::mpibcast(const mixMPI *mpidata) {
MPI_Bcast
(
&
_npnt
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_npntts
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_nhspo
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_
nl
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
&
_
max_layers
,
1
,
MPI_INT
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
ris
,
_nhspo
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
dlri
,
_nhspo
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
vkt
,
_nsph
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
vsz
,
_nsph
,
MPI_DOUBLE
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
dc0
,
_
nl
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
MPI_Bcast
(
dc0
,
_
max_layers
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
// >>> NEEDED BY SPHERE AND CLUSTER <<< //
if
(
_class_type
==
SPHERE_TYPE
||
_class_type
==
CLUSTER_TYPE
)
{
MPI_Bcast
(
vec_sas
,
4
*
_nsph
,
MPI_C_DOUBLE_COMPLEX
,
0
,
MPI_COMM_WORLD
);
...
...
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