Question of input parameter

27 views
Skip to first unread message

Jaekak Yoo

unread,
Aug 25, 2025, 4:56:51 AMAug 25
to ADDA questions and answers
Hi, 
I am trying to simulate the cross-section of extinction an absorption of Au sphere (30 nm radius) using ADDA. (I just started to simulate using adda, and I am very newbie of this simulation)

        mpirun -np 40 $ADDA_BIN/mpi/adda_mpi \
            -shape read $HOME/dataset/adda/str/sphere_30nm.shape \
            -pol ldr \
            -lambda $(echo "scale=3; $LAMBDA/1000" | bc) \
            -m $REAL_100_VAL $IMG_100_VAL \
            -maxiter 10000000 \
            -dir $RESULT_BASE_DIR1/$LAMBDA_DIR \
            -eps 5 \
            -size 0.09 \
            -grid 90 90 90

To get the spectrum of extinction and absorption, I simulated by changing the wavelengths from 400 nm to 700 nm with 10 nm steps. My "sphere_30nm.shape" file contains 31 x 31 x 31 voxels with sphere shape.
Additionally, to ignore the inter-particle interaction, I wanted to employ 60 nm distance between the particles -- so I used -size 0.09 -grid 90 90 90.

However, I got wrong results -- as you can see the below spectrum, the spectrum shape is weird!!
스크린샷 2025-08-24 030359.png

Can you let me know how to resolve this situation?
I also attached my .shape file for your information.

Thank you so much!
Jaekak
sphere_30nm.shape

Maxim Yurkin

unread,
Aug 26, 2025, 5:07:19 AMAug 26
to Jaekak Yoo, ADDA questions and answers
Dear Jaekak,

Sorry for the delay with answer. First, there are a few questions about your simulations. 

1) Do you want to simulate 1 or several spheres? If one, then you do not need to extend the computational grid. You should either specify the grid and shape in the command line (like -grid 32 -shape sphere), or only the shape file (which will automatically determine grid). ADDA simulates single particles in vacuum (or homogeneous host medium), so there is no inter-particle interaction. If you decrease grid, I also recommend to decrease number of MPI processes to 32 or 16. Extending the grid shouldn't change the result, but will waste computational resources. The only use case, that I am aware of, when extending grid can be reasonable, is for simulating near-fields in a box around the particle. 

2) Which refractive index do you use for simulations? Please double check that it is properly processed in your scripts.

Second, for further debugging I propose to choose one wavelength, which seems strange. Since the peak of Qext for Au spheres should be at wavelength > 500 nm, we may consider 450 nm as a first test case. So please consider the above, modify your command line if needed, and if the strange results persist, send us the output of simulation for 450 nm (at least, log and CrossSec-Y).

Maxim.

P.S. This answer has been forwarded to your e-mail address for your convenience. However, if you want to continue the discussion please reply to the group's e-mail. You are also advised to check the corresponding discussion thread at http://groups.google.com/group/adda-discuss and/or subscribe to it to receive automatic notifications, since other answers/comments will not be necessarily forwarded to your e-mail. 

Jaekak Yoo

unread,
Aug 31, 2025, 12:21:20 PMAug 31
to ADDA questions and answers
Dear Maxim,

Thank you for you kind answer!
I successfully done with single Au nanosphere simulation.
 
Afterwards, I would like to simulate the optical cross sections of absorption, extinction, and scattering at Au/Ag core-shell nanocube dimer system.
To this end, do I need to set the -grid and -size different with the single structure?

 Additionally, when I simulate the 50 nm of AuNC dimer with the gap of 3 nm, I got weird results, such as negative scattering, unmatched with experimental results.
 g.png
Here is my input script.

        $MPI_EXEC 40 $ADDA_BIN/mpi/adda_mpi \
            -shape read $MY_DATA \
            -pol igt_so \
            -int igt_so \

            -lambda $(echo "scale=3; $LAMBDA/1000" | bc) \
            -m $n_100_VAL $k_100_VAL \ 

            -maxiter 10000000 \
            -dir $RESULT_BASE_DIR1/$LAMBDA_DIR \
            -eps 5 \
            -size 0.103 \
            -rect_dip 2.06 1 1 \
            -store_dip_pol \
            -store_int_field

Could you give me any advises to resolve this situation as well as improve my results? 
Thanks in advances.

Jaekak Yoo
2025년 8월 26일 화요일 오전 4시 7분 19초 UTC-5에 yur...@gmail.com님이 작성:

Maxim Yurkin

unread,
Aug 31, 2025, 4:01:49 PMAug 31
to adda-d...@googlegroups.com

> Afterwards, I would like to simulate the optical cross sections of absorption, extinction, and scattering at Au/Ag
> core-shell nanocube dimer system.
> To this end, do I need to set the -grid and -size different with the single structure?

Yes, your shape file should contain all the parts that comprise the total scatterer and `-size ...` sets its total
length along the x-axis. Usually, you should not specify the `-grid ...`, since it is determined by the shape file.
Predefined shape bicoated  can be used for quick tests, but it is not exactly the one that you want (coated spheres
insted of coated cubes).


>  Additionally, when I simulate the 50 nm of AuNC dimer with the gap of 3 nm, I got weird results, such as negative
> scattering, unmatched with experimental results.Here is my input script.
>
> Could you give me any advises to resolve this situation as well as improve my results?

Indeed, negative scattering is strange. However, the shape of graphs for cross section and efficiencies is different -
that is even more strange (as they should differ only by a constant, independent of the wavelength). The script seems
fine, but please share the `log` and `CrossSec-Y` files for the wavelength, where Csca is negative.

It would also be helpful to visualize the shape file to be sure, that it is the intended one. See
https://github.com/adda-team/adda/wiki/FAQ#how-to-visualize-shape-files-of-adda

Maxim.


Jaekak Yoo

unread,
Sep 1, 2025, 12:48:51 AMSep 1
to ADDA questions and answers
Dear Maxim, 

I found some mistake from my calculation (size changed from 50 nm to 47 nm AuNC), so I did my simulation again and attached the CrossSec-X, CrossSec-X, and log for the wavelength, where Csca and Qsca are negative.
Also, I will try to visualize my shapes using LiteBil as you recommended.

Thank you so much!
Jaekak Yoo

2025년 8월 31일 일요일 오후 3시 1분 49초 UTC-5에 yur...@gmail.com님이 작성:
dimer_Au_g3.sh
question_adda.zip

Maxim Yurkin

unread,
Sep 1, 2025, 5:25:36 AMSep 1
to adda-d...@googlegroups.com
Dear Jaekak,

I believe in all the output that you provided Qext > Qabs (or Cext > Cabs), hence, Qsca is always positive. So it might
be some error in your post processing.

As I said, I recommend to do all the processing by hand for one or several test cases to test your scripts.

Moreover, I have now realized that you're using '-rect_dip ...'. It should not break the simulation, but it is not
expected to help for your shapes, so better to avoid it.

Maxim.


Jaekak Yoo

unread,
Sep 1, 2025, 1:29:41 PMSep 1
to ADDA questions and answers
Dear Maxim,

Thank you for your kind advises.
I will check the postprocess by my hand prior to automation.

Can I have one more question?
The reason why I used -rect_dip was that I wanted to simulate my rectangle dimer system. 
My .shape file contains 47 nm size of two nanocube with roundness of 2 nm. (Actually, since the .shape does not contain size information, so I just made voxel file with 1 nm distance)
If I proceed my simulation without -rect_dip option, meaning just set -size option, the simulation automatically considers my system for rectangle when I put rectangle system as a .shape file?
For example, If I put rectangle .shape file (101 x 50 x 50 voxels) and set the size value as -size 0.101, I am curious that the system automatically set the y and z axis size as a 50 nm.

Thank you so much again!

Best regards,
Jaekak Yoo
2025년 9월 1일 월요일 오전 4시 25분 36초 UTC-5에 yur...@gmail.com님이 작성:

Maxim Yurkin

unread,
Sep 1, 2025, 4:42:28 PMSep 1
to adda-d...@googlegroups.com
> Can I have one more question?
> The reason why I used -rect_dip was that I wanted to simulate my rectangle dimer system.
> My .shape file contains 47 nm size of two nanocube with roundness of 2 nm. (Actually, since the .shape does not
> contain size information, so I just made voxel file with 1 nm distance)
> If I proceed my simulation without -rect_dip option, meaning just set -size option, the simulation automatically
> considers my system for rectangle when I put rectangle system as a .shape file?
> For example, If I put rectangle .shape file (101 x 50 x 50 voxels) and set the size value as -size 0.101, I am curious
> that the system automatically set the y and z axis size as a 50 nm.

Yes, the aspect ratios of the shape are determined by the shape file, thus, a single size (ADDA uses the size along the
x-axis) is sufficient to determine all dimensions. More specifically, the size of a cubical voxel is determined from
size and gridX, and these voxels are propagated on the grid, specified by the shape file.

-rect_dip is not for aspect ratios of the whole system, but rather for aspect ratios of a single voxel (dipole). It can
be beneficial when one or two particle dimensions are much smaller than both the other ones and the wavelength (which is
not your case). If rectangular dipoles are used with predefined shapes (so that ADDA builds the voxel grid), then the
final simulated system is determined independently of '-rect_dip' and the results will be similar. However, if you
specify the voxel grid externally, -rect_dip changes each voxel in the grid without changing the grid (relative
positions of the voxels). Then the whole shape will stretch accordingly - most probably that is not the intended behavior.

Maxim.


Reply all
Reply to author
Forward
0 new messages