-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefinitions.h
142 lines (129 loc) · 6.51 KB
/
definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* Written by James Mc Donald 2006
[Antispam: email in reverse] ei.yawlagiun.ti@semaj
External definitions header file
dft_interaction_matrix_flag: Flag for the DFT of the 6 independent tensor components
polarisations: The number of incident polarisations
1 - Just specified polarisation is used
2 - Calculations are also performed for the orthonormal state
polarisation_state: The current polarisation state
0 - Main specified incident polarisation
1 - Orthonormal polarisation state
DBLP: Number of significant digits for the program output for type double
LDBLP: Number of significant digits for the program output for type long double
interaction_matrix[6][Ka*Ja*Pa],
dipole_polarisation[3][K*J*P],
incident_E_field[3][K*J*P]: Stores the 6 independent tensor components of the
interaction matrix, the unknown polarisation vector and the
incident electric field components for the linear system Ax=b
i.e., interaction_matrix*dipole_polarisation=incident_E_field
zero_padded_vector[3][Kp*Jp*Pp]: Stores the zero-padded vector components for
the multiplication and acts as a scratch space for
the FD multiplications
interaction_matrix_diagonal: Stores the polarisability tensors i.e. self-induction
terms for the Nd occupied lattice sites
zero: zero=0.0+0.0i
one: one=1.0+0.0i
onei: onei=0.0+1.0i
two: two=2.0+0.0i
minusone: minusone=-1.0+0.0i
xdft,zdft: Since the 3D DFT of the 6 independent tensor components
of the interaction matrix are performed as ensembles
of 1D transforms and due to the storage saving techniques
employed, these 2 arrays are needed as scratch spaces to
perform the DFTs
xzscratch: Scratch array for the xdft, zdft, xidft & zidft of the three zero-padded
vector components and the simultaneous Fourier domain multiplication
plan_vcxdft,
plan_vcydft,
plan_vczdft: FFTW plans for the DFT of the 3 zero-padded vector components
in dftmatvec_MPI, zero_padded_vector[3][K*Jpp*P]
plan_vcxdfti,
plan_vcydfti,
plan_vczdfti: FFTW plans for the iDFT of the 3 zero-padded vector components
in dftmatvec_MPI, zero_padded_vector[3][K*Jpp*P]
plan_tcxdft,
plan_tcydft,
plan_tczdft: FFTW plans for the DFT of the 6 tensor components in dftmatvec_MPI
interaction_matrix[6][Ka*Ja*Pa]
ldpi: PI
degree: the degree of the polynomials for the interpolating function,
the default is cubic i.e. degree=3 to preserve the accuracy of a
3rd-degree polynomial, however, higher degree polynomials, which
can reduce undulations, can be used at the expense of the 3rd-order
accuracy. Should be used prudently and sparingly.
size_parameter: size_parameter~wavenumber*effective_radius
=[2*PI*effective_radius]/wavelength
where the effective radius is the radius of a sphere of equal volume
wavenumber: (2*PI)/wavelength
wavenumber_previous: The 1st column of the interaction matrix only needs to be
recalculated if the wavenumber changes so this stores the
previous value for comparison
wavelength,
radius,
euler_phi,
euler_theta,
euler_psi,
phi,
theta: Control structures for the quantities
Defined in attributes_type.h
iterative: Control structure for the iterative scheme
Defined in attributes_type.h
refractive_index: Control structure for the complex refractive index
Defined in attributes_type.h
target: Control structure for the target description
Defined in attributes_type.h
output: Control structure for data output
Defined in attributes_type.h
incident_LF,
incident_TF: Control structure for incident polarisation in the lab
frame and target frame, respectively.
Defined in attributes_type.h
scattering_LF,
scattering_TF: Control structure for scattering vectors in the lab
frame and target frame, respectively.
Defined in attributes_type.h
cross_section: Control structure for the cross sections
Defined in attributes_type.h
efficiency: Control structure for effeciencies
Defined in attributes_type.h
timing: Control structure for timing
Defined in attributes_type.h
parallel: Control structure for control of the parallel
aspects of the code execution
Defined in attributes_type.h
Copyright (C) 2006 James Mc Donald,
Computational Astrophysics Laboratory,
National University of Ireland, Galway
This code is covered by the GNU General Public License */
#ifndef _OPENDDA_DEFS_
#define _OPENDDA_DEFS_
#include <fftw3.h>
#include "attributes_type.h"
#include "ldcomplex_type.h"
#define ldpi 3.14159265358979323846264338327950288419716939937510L
extern int wl,er,f0,t0,p0,degree,dft_interaction_matrix_flag;
extern int polarisation_state,polarisations,DBLP,LDBLP;
extern long double size_parameter,wavenumber,wavenumber_previous;
extern ldcomplex *dipole_polarisation,*incident_E_field,*zero_padded_vector;
extern ldcomplex *interaction_matrix,*interaction_matrix_diagonal,*point_jacobi,*xdft,*zdft;
extern ldcomplex *xzscratch,two,one,onei,zero,minusone;
extern fftwl_plan plan_vcxdft,plan_vcydft,plan_vczdft,plan_vcxdfti,plan_vcydfti,plan_vczdfti;
extern fftwl_plan plan_tcxdft,plan_tcydft,plan_tczdft;
extern attributes_general wavelength,radius,euler_phi,euler_theta,euler_psi,phi,theta;
extern attributes_refractive_index refractive_index;
extern attributes_iterative iterative;
extern attributes_target target;
extern attributes_output output;
extern attributes_incident_polarisation incident_LF,incident_TF;
extern attributes_scattering_vectors scattering_LF,scattering_TF;
extern attributes_cross_sections cross_section;
extern attributes_efficiency efficiency;
extern attributes_timing timing;
extern attributes_parallel parallel;
extern MPI_Op add_ldcomplex; /* User-defined MPI function to add complex_numbers */
/* Iterative vectors */
extern ldcomplex *c,*d,*g,*gam,*gamp,*gampp,*gtilde,*omega,*omegatilde,*p,*pold,*ptilde,*q;
extern ldcomplex *r,*rtilde,*s,*sigma,**tau,*u,*utilde,*v,*vtilde,*ya,*yb,*zd,*zg,*zomega;
/* For SIMD oriented Fast Mersenne Twister RNG initialisation */
extern unsigned int *init;
#endif