HARM
harm and utilities
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
Pages
set_arrays_perpoint_perline.c
Go to the documentation of this file.
1
6
#include "decs.h"
7
8
9
13
void
set_arrays_perpoint_perline()
14
{
15
int
dissloop;
16
extern
int
init_selfgrav(
void
);
17
18
19
20
interporder
= (int (*)) (&(
a_interporder
[
NUMNEGINTERPS
]));
21
usedqarray
= (int (*)) (&(
a_usedqarray
[NUMNEGINTERPS]));
22
23
24
25
#if(DOLUMVSR)
26
// yes, for each cpu
27
lumvsr
=(
SFTYPE
*)malloc(
ncpux1
*
N1
*
sizeof
(
SFTYPE
));
28
if
(
lumvsr
==NULL){
29
dualfprintf(
fail_file
,
"Couldn't open lumvsr memory\n"
);
30
myexit(1);
31
}
32
33
lumvsr_tot
=(
SFTYPE
*)malloc(
ncpux1
*
N1
*
sizeof
(
SFTYPE
));
34
if
(
lumvsr_tot
==NULL){
35
dualfprintf(
fail_file
,
"Couldn't open lumvsr_tot memory\n"
);
36
myexit(1);
37
}
38
#endif
39
40
#if(DODISSVSR)
41
for
(dissloop=0;dissloop<
NUMDISSVERSIONS
;dissloop++){
42
// yes, for each cpu
43
dissvsr
[dissloop]=(
SFTYPE
*)malloc(
ncpux1
*
N1
*
sizeof
(
SFTYPE
));
44
if
(
dissvsr
[dissloop]==NULL){
45
dualfprintf(
fail_file
,
"Couldn't open dissvsr memory: %d\n"
,dissloop);
46
myexit(1);
47
}
48
49
dissvsr_tot
[dissloop]=(
SFTYPE
*)malloc(
ncpux1
*
N1
*
sizeof
(
SFTYPE
));
50
if
(
dissvsr_tot
[dissloop]==NULL){
51
dualfprintf(
fail_file
,
"Couldn't open dissvsr_tot memory: %d\n"
,dissloop);
52
myexit(1);
53
}
54
}
55
//for(ii=0;ii<ncpux1*N1;ii++) dissvsr[ii]=0;
56
//for(ii=0;ii<ncpux1*N1;ii++) dissvsr_tot[ii]=0;
57
#endif
58
59
#if(DOSELFGRAVVSR)
60
// yes, for each cpu
61
dMvsr
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
62
dMvsr
+=
N1BND
;
63
if
(
dMvsr
==NULL){
64
dualfprintf(
fail_file
,
"Couldn't open dMvsr memory\n"
);
65
myexit(1);
66
}
67
68
dMvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
69
dMvsr_tot
+=
N1BND
;
70
if
(
dMvsr_tot
==NULL){
71
dualfprintf(
fail_file
,
"Couldn't open dMvsr_tot memory\n"
);
72
myexit(1);
73
}
74
75
dVvsr
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
76
dVvsr
+=
N1BND
;
77
if
(
dVvsr
==NULL){
78
dualfprintf(
fail_file
,
"Couldn't open dVvsr memory\n"
);
79
myexit(1);
80
}
81
82
dVvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
83
dVvsr_tot
+=
N1BND
;
84
if
(
dVvsr_tot
==NULL){
85
dualfprintf(
fail_file
,
"Couldn't open dVvsr_tot memory\n"
);
86
myexit(1);
87
}
88
89
vrsqvsr
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
90
vrsqvsr
+=
N1BND
;
91
if
(
vrsqvsr
==NULL){
92
dualfprintf(
fail_file
,
"Couldn't open vrsqvsr memory\n"
);
93
myexit(1);
94
}
95
96
vrsqvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
97
vrsqvsr_tot
+=
N1BND
;
98
if
(
vrsqvsr_tot
==NULL){
99
dualfprintf(
fail_file
,
"Couldn't open vrsqvsr_tot memory\n"
);
100
myexit(1);
101
}
102
103
// yes, for each cpu
104
dTrrvsr
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
105
dTrrvsr
+=
N1BND
;
106
if
(
dTrrvsr
==NULL){
107
dualfprintf(
fail_file
,
"Couldn't open dTrrvsr memory\n"
);
108
myexit(1);
109
}
110
111
dTrrvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
112
dTrrvsr_tot
+=
N1BND
;
113
if
(
dTrrvsr_tot
==NULL){
114
dualfprintf(
fail_file
,
"Couldn't open dTrrvsr_tot memory\n"
);
115
myexit(1);
116
}
117
118
Mvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
119
Mvsr_tot
+=
N1BND
;
120
if
(
Mvsr_tot
==NULL){
121
dualfprintf(
fail_file
,
"Couldn't open Mvsr_tot memory\n"
);
122
myexit(1);
123
}
124
125
Mvsrface1_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
126
Mvsrface1_tot
+=
N1BND
;
127
if
(
Mvsrface1_tot
==NULL){
128
dualfprintf(
fail_file
,
"Couldn't open Mvsrface1_tot memory\n"
);
129
myexit(1);
130
}
131
132
MOrvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
133
MOrvsr_tot
+=
N1BND
;
134
if
(
MOrvsr_tot
==NULL){
135
dualfprintf(
fail_file
,
"Couldn't open MOrvsr_tot memory\n"
);
136
myexit(1);
137
}
138
139
// the potentials are located in ghost cells so outer boundary CPUs have sufficient data
140
// +1 corresponds to last outer face, so not used for center phi but allocated to keep arrays same size
141
phivsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
142
phivsr_tot
+=
N1BND
;
143
if
(
phivsr_tot
==NULL){
144
dualfprintf(
fail_file
,
"Couldn't open phivsr_tot memory\n"
);
145
myexit(1);
146
}
147
148
rcent
=(
FTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
FTYPE
));
149
rcent
+=
N1BND
;
150
if
(
rcent
==NULL){
151
dualfprintf(
fail_file
,
"Couldn't open rcent memory\n"
);
152
myexit(1);
153
}
154
155
rcent_tot
=(
FTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
FTYPE
));
156
rcent_tot
+=
N1BND
;
157
if
(
rcent_tot
==NULL){
158
dualfprintf(
fail_file
,
"Couldn't open rcent_tot memory\n"
);
159
myexit(1);
160
}
161
162
163
// yes, for each cpu
164
dJvsr
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
165
dJvsr
+=
N1BND
;
166
if
(
dJvsr
==NULL){
167
dualfprintf(
fail_file
,
"Couldn't open dJvsr memory\n"
);
168
myexit(1);
169
}
170
171
dJvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
172
dJvsr_tot
+=
N1BND
;
173
if
(
dJvsr_tot
==NULL){
174
dualfprintf(
fail_file
,
"Couldn't open dJvsr_tot memory\n"
);
175
myexit(1);
176
}
177
178
Jvsr_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
179
Jvsr_tot
+=
N1BND
;
180
if
(
Jvsr_tot
==NULL){
181
dualfprintf(
fail_file
,
"Couldn't open Jvsr_tot memory\n"
);
182
myexit(1);
183
}
184
185
Jvsrface1_tot
=(
SFTYPE
*)malloc(
NUMGRAVPOS
*
sizeof
(
SFTYPE
));
186
Jvsrface1_tot
+=
N1BND
;
187
if
(
Jvsrface1_tot
==NULL){
188
dualfprintf(
fail_file
,
"Couldn't open Jvsrface1_tot memory\n"
);
189
myexit(1);
190
}
191
192
193
#endif
194
195
if
(
DOSELFGRAVVSR
){
196
// initialize self-gravity functions since not set yet and will otherwise be used to set first metric
197
init_selfgrav();
198
}
199
200
}
Generated on Fri May 20 2016 15:52:35 for HARM by
1.8.3.1