Skip to content

Commit 449f42c

Browse files
committed
Changed 'dipole' to 'voxel' in most of the code comments, help and error messages.
Standard output and command line options are kept intact for now.
1 parent e72d6e3 commit 449f42c

File tree

22 files changed

+190
-189
lines changed

22 files changed

+190
-189
lines changed

misc/near_field/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
The NearField program allows to compute the near-field on an arbitrary (i.e. not related to the grid used for the dipole) set of points, using dipoles stored by ADDA.
1+
The NearField program allows to compute the near-field on an arbitrary (i.e. not related to the voxel grid used for the simulations) set of points, using polarizations stored by ADDA.
22

33
Compilation and usage are described in [nearfield_manual.txt](nearfield_manual.txt). 64-bit Windows executables are available in the corresponding [ADDA package](https://github.com/adda-team/adda/releases).

misc/pip/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ pip [<grid> [<filename>]]
1010
```
1111

1212
Executable is named `pip`, it accepts up tp two command line parameters:
13-
- `<grid>` - maximum shape size (number of dipoles) along the largest dimension that is determined automatically. If omitted, the default value of 80 is used (and further arguments cannot be used).
13+
- `<grid>` - maximum shape size (number of voxels) along the largest dimension that is determined automatically. If omitted, the default value of 80 is used (and further arguments cannot be used).
1414
- `<filename>`. Input shape is read from `<filename>.obj` and DDSCAT7 shape is saved into `<filename>.dat`. If omitted, PIP will use the default filename `shape` (read `shape.obj` and save `shape.dat`). If `<filename>` includes extension, then it will be used for input file (instead of `.obj`).
1515

16-
It should be possible to read other 3D formats, which are supported by routines in `ivread_wr.f90` - see comments in the source files. However, only `.obj` format is sufficiently tested. Also limited testing has been performed for `.dxf`, `.stl`, and `.wrl` formats. Multiple materials in input files (at least, for `.obj` and `.wrl` formats) are transformed into multiple domains in the output file. Should work for very large number of dipoles (limited only by memory and computational time).
16+
It should be possible to read other 3D formats, which are supported by routines in `ivread_wr.f90` - see comments in the source files. However, only `.obj` format is sufficiently tested. Also limited testing has been performed for `.dxf`, `.stl`, and `.wrl` formats. Multiple materials in input files (at least, for `.obj` and `.wrl` formats) are transformed into multiple domains in the output file. Should work for very large number of voxels (limited only by memory and computational time).
1717

1818
Existing limitations:
1919
* For poorly tested input formats, it is potentially possible that the materials will not be properly recognized, leading to too much materials and errors in voxelization. Then there is a backup option to produce single-domain output file. For that change the value of `logical, parameter :: ignore_mat` in `FEM-Geo-Wr.f90` to `.true.`.

src/ADDAmain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc,char **argv)
7878
ParseParameters(argc,argv);
7979
D("Reading command line finished");
8080
VariablesInterconnect(); // also initializes beam
81-
// Initialize box's; get number of dipoles; set some variables
81+
// Initialize box's; get number of voxels; set some variables
8282
InitShape();
8383
D("Initialization of shape finished");
8484
FinalizeSymmetry(); // finalize symmetries and check for possible conflicts of symmetries with other options

src/CalculateE.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static void CalcScatPlane(const enum incpol which,const enum Eftype type)
627627
static void StoreFields(const enum incpol which,doublecomplex * restrict cmplxF,
628628
double * restrict realF,const char * restrict fname_preffix,const char * restrict tmpl UOIP,
629629
const char * restrict field_name,const char * restrict fullname)
630-
/* Write any fields on each dipole to file (internal fields, incident beam, polarization, etc.). Accepts both complex
630+
/* Write any fields at each voxel to file (internal fields, incident beam, polarization, etc.). Accepts both complex
631631
* and real fields. Processes the one, which is not null.
632632
*
633633
* All processors should write the 'field' to temporary file. These files are named by template 'tmpl' and afterwards
@@ -706,11 +706,11 @@ static void ParticleToBeamRF(double vec[static restrict 3])
706706
//======================================================================================================================
707707

708708
static void CalcIntegralScatQuantities(const enum incpol which)
709-
/* calculates all the scattering cross sections, normalized and unnormalized asymmetry parameter, and force on the'
710-
* particle and each dipole. Cext and Cabs are averaged over orientation, if needed.
709+
/* calculates all the scattering cross sections, normalized and unnormalized asymmetry parameter, and force on the
710+
* particle and each voxel. Cext and Cabs are averaged over orientation, if needed.
711711
*/
712712
{
713-
// Scattering force, extinction force and radiation pressure per dipole
713+
// Scattering force, extinction force and radiation pressure per voxel
714714
double * restrict Frp;
715715
double Cext,Cabs,Csca,Cdec, // Cross sections
716716
dummy[3], // asymmetry parameter*Csca
@@ -841,7 +841,7 @@ static void CalcIntegralScatQuantities(const enum incpol which)
841841
//======================================================================================================================
842842

843843
static void StoreIntFields(const enum incpol which)
844-
// Write actual internal fields (not exciting) on each dipole to file
844+
// Write actual internal fields (not exciting) at each voxel to file
845845
{
846846
// calculate fields; e_field=P/(V*chi)=chi_inv*P; for anisotropic - by components
847847
nMult_mat(xvec,pvec,chi_inv);
@@ -882,7 +882,7 @@ int CalculateE(const enum incpol which,const enum Eftype type)
882882
if (scat_grid) CalcScatGrid(which);
883883
// Calculate integral scattering quantities (cross sections, asymmetry parameter, electric forces)
884884
if (calc_Cext || calc_Cabs || calc_Csca || calc_asym || calc_mat_force) CalcIntegralScatQuantities(which);
885-
// saves internal fields and/or dipole polarizations to text file
885+
// saves internal fields and/or dipole (voxel) polarizations to text file
886886
if (store_int_field) StoreIntFields(which);
887887
if (store_dip_pol) StoreFields(which,pvec,NULL,F_DIPPOL,F_DIPPOL_TMP,"P","Dipole polarizations");
888888
return 0;

src/GenerateB.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void InitBeam(void)
312312

313313
void GenerateB (const enum incpol which, // x - or y polarized incident light
314314
doublecomplex *restrict b) // the b vector for the incident field
315-
// generates incident beam at every dipole
315+
// generates incident beam at every voxel center
316316
{
317317
size_t i,j;
318318
doublecomplex psi0,Q,Q2;
@@ -456,7 +456,7 @@ void GenerateB (const enum incpol which, // x - or y polarized incident light
456456
* interaction it is expected to be singular, so we use an explicit formula for point dipole:
457457
* C0=(8pi/3)*k^4*|p0|^2. Thus we discard the choice of "-int ...", but still the used value should be
458458
* correct for most formulations, e.g. poi, fcd, fcd_st, igt_so. Moreover, it is also logical, since the
459-
* exciting dipole is really point one, in contrast to the dipoles composing the particle.
459+
* exciting dipole is really point one, in contrast to the voxels composing the particle.
460460
*/
461461
double temp=p0*WaveNum*WaveNum; // in principle, t1=1/k, but we keep a general formula
462462
C0dipole=2*FOUR_PI_OVER_THREE*temp*temp;
@@ -651,8 +651,8 @@ void GenerateB (const enum incpol which, // x - or y polarized incident light
651651
/* TO ADD NEW BEAM
652652
* add a case above. Identifier ('B_...') should be defined inside 'enum beam' in const.h. This case should set
653653
* complex vector 'b', describing the incident field in the particle reference frame. It is set inside the cycle for
654-
* each dipole of the particle and is calculated using
655-
* 1) 'DipoleCoord' - array of dipole coordinates;
654+
* each voxel of the particle and is calculated using
655+
* 1) 'DipoleCoord' - array of dipole (voxel) coordinates;
656656
* 2) 'prop' - propagation direction of the incident field;
657657
* 3) 'ex' - direction of incident polarization;
658658
* 4) 'ey' - complementary unity vector of polarization (orthogonal to both 'prop' and 'ex');

src/calculator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ doublecomplex * restrict Avecbuffer; // used to hold the result of matrix-vector
7272
doublecomplex * restrict vec1,* restrict vec2,* restrict vec3,* restrict vec4;
7373
// used in matvec.c
7474
#ifdef SPARSE
75-
doublecomplex * restrict arg_full; // vector to hold argvec for all dipoles
75+
doublecomplex * restrict arg_full; // vector to hold argvec for all voxels
7676
#endif
7777

7878
// LOCAL VARIABLES
@@ -472,7 +472,7 @@ static void CoupleConstant(doublecomplex *mrel,const enum incpol which,doublecom
472472
//see B.T. Draine 'Propagation of Electromagnetic Waves on a Rectangular Lattice of Polarizable Points'
473473
// Eq number noted for some lines of code
474474
res[i]=3*(mrel[0]*mrel[0]-1)/(mrel[0]*mrel[0]+2); // CM
475-
// Eq.(55), corrected value CM for rectangular dipole
475+
// Eq.(55), corrected value CM for rectangular voxel
476476
res[i]=res[i]/(1+res[i]*draine_precalc_data_array[draine_precalc_data_index].R0[i]);
477477
res[i]*=dipvol/FOUR_PI;
478478
if (PolRelation==POL_CLDR) {
@@ -525,7 +525,7 @@ static void CoupleConstant(doublecomplex *mrel,const enum incpol which,doublecom
525525
res[i]=polMplusRR(2*ONE_THIRD*kd2*(2+kd*INV_PI*log((PI-kd)/(PI+kd))),mrel[i]);
526526
break;
527527
case POL_IGT_SO: res[i]=polMplusRR(SO_B1*kd2,mrel[i]); break;
528-
case POL_LAK: // M=(8pi/3)[(1-ika)exp(ika)-1], a - radius of volume-equivalent (to cubical dipole) sphere
528+
case POL_LAK: // M=(8pi/3)[(1-ika)exp(ika)-1], a - radius of volume-equivalent (to a cube) sphere
529529
ka=LAK_C*kd;
530530
res[i]=polM(2*FOUR_PI_OVER_THREE*((1-I*ka)*imExp(ka)-1),mrel[i]);
531531
break;

src/cmplx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ static inline doublecomplex imExpM1(const double arg)
107107
/* exp(i*arg) - 1 (should be used for small argument to avoid precision loss
108108
* We employ special code only for small arguments, ignoring the case when arg is close to 2piN. The latter can,
109109
* in principle, be handled by preliminary range reduction as in imExpTable. We do not implement it here, because such
110-
* case is a "coincidence" - may happen for a single dipole (or a plane of dipoles), while the case of small arg may
111-
* happen for all dipoles. In the latter case loss of precision affects all computed quantities.
110+
* case is a "coincidence" - may happen for a single voxel (or a plane of voxels), while the case of small arg may
111+
* happen for all voxels. In the latter case loss of precision affects all computed quantities.
112112
* The used expression through tan(arg/2) follows from general expression for cexpm1 below.
113113
*/
114114
{

src/comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ void ParSetup(void)
528528
local_x1=gridX;
529529
# endif
530530
if (local_z1_coer<=local_z0) {
531-
LogWarning(EC_INFO,ALL_POS,"No real dipoles are assigned");
531+
LogWarning(EC_INFO,ALL_POS,"No real voxels are assigned");
532532
local_z1_coer=local_z0;
533533
}
534534
local_Nz=local_z1-local_z0;
@@ -607,7 +607,7 @@ void ReadField(const char * restrict fname,doublecomplex *restrict field)
607607
}
608608
else if (i==nvoid_Ndip) { // tests that file doesn't contains extra data rows
609609
if (sscanf(linebuf,test_form)!=EOF) LogError(ALL_POS,"Field file %s contains more data rows than number of "
610-
"dipoles (%zu) in the particle",fname,nvoid_Ndip);
610+
"voxels (%zu) in the particle",fname,nvoid_Ndip);
611611
}
612612
else { // here local_nvoid_d0 <= i < local_nvoid_d1
613613
scanned=sscanf(linebuf,format,buf,buf+1,buf+2,buf+3,buf+4,buf+5);

src/const.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ enum sh { // shape types
177177
SH_CYLINDER, // cylinder
178178
SH_EGG, // egg
179179
SH_ELLIPSOID, // general ellipsoid
180-
SH_LINE, // line with width of one dipole
180+
SH_LINE, // line with width of one voxel
181181
SH_ONION, // multilayered concentric sphere
182182
SH_ONION_ELL, // multilayered concentric ellipsoid
183183
SH_PLATE, // plate
@@ -212,7 +212,7 @@ enum pol { // which way to calculate coupleconstant
212212

213213
enum scat { // how to calculate scattering quantities
214214
SQ_DRAINE, // classical, as Draine
215-
SQ_FINDIP, /* Same as Draine, but with correction of radiation energy of a _finite_ dipole when calculating
215+
SQ_FINDIP, /* Same as Draine, but with correction of radiation energy of a _finite_ dipole (voxel) when calculating
216216
absorption cross section */
217217
SQ_IGT_SO // Integration of Green's tensor (approximation of second order in kd)
218218
};
@@ -230,7 +230,7 @@ enum inter { // how to calculate interaction term
230230
* add an identifier starting with 'G_' and a descriptive comment to this list in the alphabetical order.
231231
*/
232232
};
233-
enum refl { // how to calculate interaction of dipoles through the nearby surface (reflected G)
233+
enum refl { // how to calculate interaction of voxels through the nearby surface (reflected G)
234234
GR_IMG, // approximate expression based on a single image dipole
235235
GR_SOM // direct evaluation of Sommerfeld integrals
236236
/* TO ADD NEW REFLECTION FORMULATION

0 commit comments

Comments
 (0)