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++) {
108 f, qid, __FILE__, __LINE__) ) {
return 1;}
110 f, qid, __FILE__, __LINE__) ) {
return 1;}
112 f, qid, __FILE__, __LINE__) ) {
return 1;}
114 f, qid, __FILE__, __LINE__) ) {
return 1;}
116 f, qid, __FILE__, __LINE__) ) {
return 1;}
118 for(
int i = 0; i < n_rho; i++) {
123 int err =
plasma_1D_init(data, n_rho, n_ions, rho, anum, znum, mass, charge,
147 #define PLSPATH "/plasma/plasma_1Dt_XXXXXXXXXX/"
150 int n_rho, n_time, n_ions;
152 f, qid, __FILE__, __LINE__) ) {
return 1;}
154 f, qid, __FILE__, __LINE__) ) {
return 1;}
156 f, qid, __FILE__, __LINE__) ) {
return 1;}
158 int* q = (
int*) malloc( n_ions *
sizeof(
int) );
159 int* znum = (
int*) malloc( n_ions *
sizeof(
int) );
160 int* anum = (
int*) malloc( n_ions *
sizeof(
int) );
161 real* mass = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
162 real* charge = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
164 f, qid, __FILE__, __LINE__) ) {
return 1;}
166 f, qid, __FILE__, __LINE__) ) {
return 1;}
168 f, qid, __FILE__, __LINE__) ) {
return 1;}
170 f, qid, __FILE__, __LINE__) ) {
return 1;}
172 for(
int i = 0; i < n_ions; i++) {
176 for(
int i = 0; i < n_ions; i++) {
184 f, qid, __FILE__, __LINE__) ) {
return 1;}
186 f, qid, __FILE__, __LINE__) ) {
return 1;}
191 real* ni = (
real*) malloc( n_time*n_ions*n_rho*
sizeof(
real) );
193 f, qid, __FILE__, __LINE__) ) {
return 1;}
195 f, qid, __FILE__, __LINE__) ) {
return 1;}
197 for(
int i_time = 0; i_time < n_time; i_time++) {
198 for(
int i_rho = 0; i_rho < n_rho; i_rho++) {
199 Te[i_time*n_rho+i_rho] *=
CONST_E;
200 Ti[i_time*n_rho+i_rho] *=
CONST_E;
205 f, qid, __FILE__, __LINE__) ) {
return 1;}
207 f, qid, __FILE__, __LINE__) ) {
return 1;}
208 int err =
plasma_1Dt_init(data, n_rho, n_time, n_ions, rho, time, anum,
209 znum, mass, charge, Te, Ti, ne, ni);
233 #define PLSPATH "/plasma/plasma_1DS_XXXXXXXXXX/"
239 f, qid, __FILE__, __LINE__) ) {
return 1;}
241 f, qid, __FILE__, __LINE__) ) {
return 1;}
243 f, qid, __FILE__, __LINE__) ) {
return 1;}
245 f, qid, __FILE__, __LINE__) ) {
return 1;}
247 int* q = (
int*) malloc( n_ions *
sizeof(
int) );
248 int* znum = (
int*) malloc( n_ions *
sizeof(
int) );
249 int* anum = (
int*) malloc( n_ions *
sizeof(
int) );
250 real* mass = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
251 real* charge = (
real*) malloc( ( n_ions + 1 ) *
sizeof(
real) );
253 f, qid, __FILE__, __LINE__) ) {
return 1;}
255 f, qid, __FILE__, __LINE__) ) {
return 1;}
257 f, qid, __FILE__, __LINE__) ) {
return 1;}
259 f, qid, __FILE__, __LINE__) ) {
return 1;}
261 for(
int i = 0; i < n_ions; i++) {
265 for(
int i = 0; i < n_ions; i++) {
275 f, qid, __FILE__, __LINE__) ) {
return 1;}
277 f, qid, __FILE__, __LINE__) ) {
return 1;}
279 f, qid, __FILE__, __LINE__) ) {
return 1;}
281 f, qid, __FILE__, __LINE__) ) {
return 1;}
283 for(
int i = 0; i < n_rho; i++) {
288 int err =
plasma_1DS_init(data, n_rho, rhomin, rhomax, n_ions, anum, znum,
289 mass, charge, Te, Ti, ne, ni);
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)
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)
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)
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