71 #define PLSPATH "/plasma/plasma_1D_XXXXXXXXXX/"
75 f, qid, __FILE__, __LINE__) ) {
return 1;}
77 f, qid, __FILE__, __LINE__) ) {
return 1;}
79 int* q = (
int*) malloc( n_ions *
sizeof(
int) );
80 int* znum = (
int*) malloc( n_ions *
sizeof(
int) );
81 int* anum = (
int*) malloc( n_ions *
sizeof(
int) );
82 real* mass = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
83 real* charge = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
85 f, qid, __FILE__, __LINE__) ) {
return 1;}
87 f, qid, __FILE__, __LINE__) ) {
return 1;}
89 f, qid, __FILE__, __LINE__) ) {
return 1;}
91 f, qid, __FILE__, __LINE__) ) {
return 1;}
93 for(
int i = 0; i < n_ions; i++) {
97 for(
int i = 0; i < n_ions; i++) {
109 f, qid, __FILE__, __LINE__) ) {
return 1;}
111 f, qid, __FILE__, __LINE__) ) {
return 1;}
113 f, qid, __FILE__, __LINE__) ) {
return 1;}
115 f, qid, __FILE__, __LINE__) ) {
return 1;}
117 f, qid, __FILE__, __LINE__) ) {
return 1;}
119 f, qid, __FILE__, __LINE__) ) {
return 1;}
121 for(
int i = 0; i < n_rho; i++) {
126 int err =
plasma_1D_init(data, n_rho, n_ions, rho, anum, znum, mass, charge,
127 Te, Ti, ne, ni, vtor);
151 #define PLSPATH "/plasma/plasma_1Dt_XXXXXXXXXX/"
154 int n_rho, n_time, n_ions;
156 f, qid, __FILE__, __LINE__) ) {
return 1;}
158 f, qid, __FILE__, __LINE__) ) {
return 1;}
160 f, qid, __FILE__, __LINE__) ) {
return 1;}
162 int* q = (
int*) malloc( n_ions *
sizeof(
int) );
163 int* znum = (
int*) malloc( n_ions *
sizeof(
int) );
164 int* anum = (
int*) malloc( n_ions *
sizeof(
int) );
165 real* mass = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
166 real* charge = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
168 f, qid, __FILE__, __LINE__) ) {
return 1;}
170 f, qid, __FILE__, __LINE__) ) {
return 1;}
172 f, qid, __FILE__, __LINE__) ) {
return 1;}
174 f, qid, __FILE__, __LINE__) ) {
return 1;}
176 for(
int i = 0; i < n_ions; i++) {
180 for(
int i = 0; i < n_ions; i++) {
188 f, qid, __FILE__, __LINE__) ) {
return 1;}
190 f, qid, __FILE__, __LINE__) ) {
return 1;}
192 real* vtor = (
real*) malloc( n_time*n_rho*
sizeof(
real) );
196 real* ni = (
real*) malloc( n_time*n_ions*n_rho*
sizeof(
real) );
198 f, qid, __FILE__, __LINE__) ) {
return 1;}
200 f, qid, __FILE__, __LINE__) ) {
return 1;}
202 f, qid, __FILE__, __LINE__) ) {
return 1;}
204 for(
int i_time = 0; i_time < n_time; i_time++) {
205 for(
int i_rho = 0; i_rho < n_rho; i_rho++) {
206 Te[i_time*n_rho+i_rho] *=
CONST_E;
207 Ti[i_time*n_rho+i_rho] *=
CONST_E;
212 f, qid, __FILE__, __LINE__) ) {
return 1;}
214 f, qid, __FILE__, __LINE__) ) {
return 1;}
215 int err =
plasma_1Dt_init(data, n_rho, n_time, n_ions, rho, time, anum,
216 znum, mass, charge, Te, Ti, ne, ni, vtor);
241 #define PLSPATH "/plasma/plasma_1DS_XXXXXXXXXX/"
247 f, qid, __FILE__, __LINE__) ) {
return 1;}
249 f, qid, __FILE__, __LINE__) ) {
return 1;}
251 f, qid, __FILE__, __LINE__) ) {
return 1;}
253 f, qid, __FILE__, __LINE__) ) {
return 1;}
255 int* q = (
int*) malloc( n_ions *
sizeof(
int) );
256 int* znum = (
int*) malloc( n_ions *
sizeof(
int) );
257 int* anum = (
int*) malloc( n_ions *
sizeof(
int) );
258 real* mass = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
259 real* charge = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
261 f, qid, __FILE__, __LINE__) ) {
return 1;}
263 f, qid, __FILE__, __LINE__) ) {
return 1;}
265 f, qid, __FILE__, __LINE__) ) {
return 1;}
267 f, qid, __FILE__, __LINE__) ) {
return 1;}
269 for(
int i = 0; i < n_ions; i++) {
273 for(
int i = 0; i < n_ions; i++) {
284 f, qid, __FILE__, __LINE__) ) {
return 1;}
286 f, qid, __FILE__, __LINE__) ) {
return 1;}
288 f, qid, __FILE__, __LINE__) ) {
return 1;}
290 f, qid, __FILE__, __LINE__) ) {
return 1;}
292 f, qid, __FILE__, __LINE__) ) {
return 1;}
294 for(
int i = 0; i < n_rho; i++) {
299 int err =
plasma_1DS_init(data, n_rho, rhomin, rhomax, n_ions, anum, znum,
300 mass, charge, Te, Ti, ne, ni, vtor);
Main header file for ASCOT5.
Header file containing physical and mathematical constants.
#define CONST_U
Atomic mass unit in kilograms [kg].
#define CONST_M_E
Electron mass [kg].
#define CONST_E
Elementary charge [C].
herr_t hdf5_find_group(hid_t loc, const char *path)
Checks if given group exists within given hdf5 file. Negative value is returned if the group doesn't ...
int hdf5_read_double(const char *var, real *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read double-valued data from ASCOT5 HDF5 file.
char * hdf5_gen_path(const char *original, char *qid, char *path)
Generate a valid path from a given template and qid.
int hdf5_read_int(const char *var, int *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read int-valued data from ASCOT5 HDF5 file.
Header file for hdf5_helpers.h.
int hdf5_plasma_read_1Dt(hid_t f, plasma_1Dt_data *data, char *qid)
Read 1Dt plasma data from HDF5 file.
int hdf5_plasma_read_1D(hid_t f, plasma_1D_data *data, char *qid)
Read 1D plasma data from HDF5 file.
int hdf5_plasma_init(hid_t f, plasma_data *data, char *qid)
Read plasma data from HDF5 file.
int hdf5_plasma_read_1DS(hid_t f, plasma_1DS_data *data, char *qid)
Load plasma data from HDF5 file and prepare parameters.
Header file for hdf5_plasma.c.
Header file for plasma.c.
int plasma_1DS_init(plasma_1DS_data *data, int nrho, real rhomin, real rhomax, int nion, int *anum, int *znum, real *mass, real *charge, real *Te, real *Ti, real *ne, real *ni, real *vtor)
Initialize 1DS plasma data and check inputs.
Header file for plasma_1DS.c.
int plasma_1D_init(plasma_1D_data *data, int nrho, int nion, real *rho, int *anum, int *znum, real *mass, real *charge, real *Te, real *Ti, real *ne, real *ni, real *vtor)
Initialize 1D plasma data and check inputs.
Header file for plasma_1D.c.
int plasma_1Dt_init(plasma_1Dt_data *data, int nrho, int ntime, int nion, real *rho, real *time, int *anum, int *znum, real *mass, real *charge, real *Te, real *Ti, real *ne, real *ni, real *vtor)
Initialize 1Dt plasma data and check inputs.
Header file for plasma_1Dt.c.
1D spline plasma parameters on the target
1D plasma parameters on the target
1D plasma parameters on the target
plasma_1Dt_data plasma_1Dt
plasma_1DS_data plasma_1DS