Assistance with Creating Geometry Files for Arbitrary Particle Shapes in ADDA

83 views
Skip to first unread message

Koide Manato

unread,
Apr 17, 2025, 2:09:16 AMApr 17
to adda-d...@googlegroups.com
Hello all,

I hope this email finds you well.
I am writing to seek your assistance with creating files for using arbitrary particle shapes in ADDA calculations.
 I have read section §B.5 of the manual, but I am having difficulty understanding the process.
 Could you please provide a detailed explanation?
 It would be very helpful if you could illustrate the process with an example of a hemisphere.

I look forward to your response.
Thank you very much for your support.

Sincerely yours,
 Manato Koide

Maxim Yurkin

unread,
Apr 22, 2025, 10:31:53 AMApr 22
to adda-d...@googlegroups.com
Dear Manato,

Sorry for the delay with answer. §B.5 of the manual describes not the process, but the required format. To understand it
better, see some .geom files in tests/2exec or produce the files yourself by
./adda -shape ... -grid ... -save_geom -prognosis

Any process that results in the same format will be fine. In principal, you should go over the computational grid voxel
by voxel, test whether it belongs to the shape, and then save the position of the fitting voxel to file. However, for
simple modifications of existing shapes quick hacks can be possible. For example, (if you have a terminal with awk) the
following should produce the hemisphere with 16 dipoles per diameter with a flat surface facing the positive direction
of the z-axis:

./adda -shape sphere -grid 16 -save_geom -prognosis -dir test
awk '$3 < 8' test/sphere.geom > test/hemisphere.geom

Replace 16 by any other even number of voxels per sphere diameter and 8 by its half. To change facing direction to the
x- or y-axis, replace $3 by $1 or $2, respectively. To face the negative direction of any axis, replace < by >=.

Let me know, if you need more explanation,
Maxim.

Claudia M

unread,
Apr 23, 2025, 10:13:32 AMApr 23
to ADDA questions and answers
Hi! 

When I did this, I used Wolfram Mathematica to make a point cloud of all my dipoles. I iterated through points in X,Y,Z and for every point that was inside my desired geometry, I recorded that point's coordinates. I did this for spheres and ellipsoids to verify with ADDA that I got the same answer as with the library shapes, and then moved on to more complicated geometries. All I needed was the file from Mathematica of the coordinates. I used Mathematica because it was fast and easy to visualize if my clouds were off. 

Claudia Morello

Reply all
Reply to author
Forward
0 new messages