-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypes.cuh
More file actions
148 lines (128 loc) · 3.06 KB
/
Copy pathDataTypes.cuh
File metadata and controls
148 lines (128 loc) · 3.06 KB
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
143
144
145
146
147
148
#include <cufft.h>
#ifndef _DATATYPES_CUH_
#define _DATATYPES_CUH_
typedef double fftw_complex[2];
typedef struct jacobian {
double J[3][3];
}Jacobian; /*Stores evaluated Jacobian elements*/
typedef struct jacobian* JAC;
typedef struct field {
double* H_m;
double* H_ex;
double* H_ext;
double* H_anis;
double* H_eff;
double* H_stage;
double* H_stage_1;
double* H_STT;
}Field;
typedef struct field* FIELD;
typedef struct magnetisation {
double* M;
int* Mat;
int* Bd;
JAC J;
int* Pivot;
int* NUMCELLS;
}Magnetisation;
typedef struct magnetisation* MAG;
typedef struct fftplans {
cufftHandle MxPlan;
cufftHandle MyPlan;
cufftHandle MzPlan;
cufftHandle HxPlan;
cufftHandle HyPlan;
cufftHandle HzPlan;
}FFTPlans;
typedef struct fftplans* PLANS;
typedef struct vector {
double X[3];
}Vector; /*Vector for LU solver output*/
typedef Vector(*ExtFieldFunctionPtr)(double t, double x, double y, double z);
typedef struct jacobian_rk2 {
double J[6][6];
}Jacobian_rk2; /*Stores evaluated Jacobian elements*/
typedef struct jacobian_rk2* JAC_RK2;
typedef struct dataptr {
fftw_complex* kxx;
fftw_complex* kxy;
fftw_complex* kyy;
fftw_complex* kyz;
fftw_complex* kzz;
fftw_complex* kxz;
double* Nxx;
double* Nxy;
double* Nyy;
double* Nyz;
double* Nzz;
double* Nxz;
//Double Precision
fftw_complex* xFFT;
fftw_complex* yFFT;
fftw_complex* zFFT;
double* Outx_d;
double* Outy_d;
double* Outz_d;
//Single Precision
cufftComplex* xFFT_s;
cufftComplex* yFFT_s;
cufftComplex* zFFT_s;
float* Outx;
float* Outy;
float* Outz;
double* xReduction;
double* yReduction;
double* zReduction;
double* MaxTorqueReduction;
double* StepReduction;
double* dE_Reduction;
int* NewtonStepsReduction;
}Dataptr;
typedef struct dataptr* MEMDATA;
typedef struct devicestructofpointers
{
MEMDATA DATA;
MAG M;
FIELD H;
PLANS P;
}DeviceStructOfPointers;
typedef struct regions {
int x[2]; //lower[0], upper[1]
int y[2];
int z[2];
}Region;
typedef struct outputs {
int xrange[2];
int yrange[2];
int zrange[2];
bool m_unit;
bool B_demag;
bool B_full;
bool B_exch;
}OutputFormat;
typedef struct material{
double Ms;
double Aex;
double damping;
double Ku;
Vector Bext;
char ExcitationType;
}MaterialProperties;
typedef int MaterialHandle;
typedef struct excitationparameters{
MaterialHandle Handle;
int ExcitationType;
Vector Direction;
Vector SpatialOffset;
double Amplitude;
double Frequency;
double Wavenumber;
}ExcitationParameters;
//zhang-li spin-transfer torque
typedef struct sttparams{
MaterialHandle handle;
double J[3]; //current density
double P; //polarisation rate
double Xi; // dimensionless non-adiabaticity
}STTParameters;
#endif // !_DATATYPES_CUH_