ITM AMNS: User Interface  \$Id: Doxyfile 502 2015-10-15 12:23:45Z dpc $
amns_interface.h
Go to the documentation of this file.
1 
29 #include <ctype.h>
30 #include <string.h>
31 #include <stdbool.h>
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include "itm_constants.h"
35 
36 #ifndef AMNS_INTERFACE_H
37 #define AMNS_INTERFACE_H
38 
39 
40 // TODO: these should be uppercase...
41 #define version_length 32
42 #define set_length 32
43 #define reaction_length 16
44 #define query_length 16
45 #define answer_length 128
46 #define amns_max_length 128
47 
48 char *strcpy_f2c(char *fsrc, int flen, char **cdest);
49 char *strcpy_c2f(char *csrc, char *fdest, int flen);
50 
55 typedef struct {
56  char string[version_length];
57  int number;
61 
66 typedef struct {
67  char *string;
68  int number;
69  char *backend;
70  char *user;
72 
73 const amns_version_type DEFAULT_AMNS_VERSION_TYPE = { "", 0, "", "" };
75 
80 }
81 
83  strcpy_f2c(ftype.string, version_length, &((*ctype).string));
84  ctype->number = ftype.number;
85  strcpy_f2c(ftype.backend, version_length, &(ctype->backend));
86  strcpy_f2c(ftype.user, version_length, &(ctype->user));
87 }
88 
90  strcpy_c2f(ctype.string, ftype->string, version_length);
91  ftype->number = ctype.number;
92  strcpy_c2f(ctype.backend, ftype->backend, version_length);
93  strcpy_c2f(ctype.user, ftype->user, version_length);
94 }
95 
100 typedef struct {
101  double ZN;
102  double ZA;
103  double MI;
104  int LR;
105  double real_specifier;
108 
110 
111 const amns_reactant_type DEFAULT_AMNS_REACTANT_TYPE = { 0.0, 0.0, 0.0, 0, ITM_INVALID_FLOAT, ITM_INVALID_INT };
112 const amns_c_reactant_type DEFAULT_AMNS_C_REACTANT_TYPE = { 0.0, 0.0, 0.0, 0, ITM_INVALID_FLOAT, ITM_INVALID_INT };
113 
118 }
119 
124 typedef struct {
125  bool flag;
126  char string[answer_length];
128 
133 typedef struct {
134  bool flag;
135  char *string;
137 
140 
145 }
146 
148  strcpy_f2c(ftype.string, answer_length, &(ctype->string));
149  ctype->flag = ftype.flag;
150 }
151 
153  strcpy_c2f(ctype.string, ftype->string, answer_length);
154  ftype->flag = ctype.flag;
155 }
156 
161 typedef struct {
162  char string[reaction_length];
165 
170 typedef struct {
171  char *string;
174 
177 
182 }
183 
185  strcpy_f2c(ftype.string, reaction_length, &(ctype->string));
186  ctype->isotope_resolved = ftype.isotope_resolved;
187 }
188 
190  strcpy_c2f(ctype.string, ftype->string, reaction_length);
191  ftype->isotope_resolved = ctype.isotope_resolved;
192 }
193 
198 typedef struct {
199  char string[set_length];
200 } amns_set_type;
201 
206 typedef struct {
207  char *string;
209 
212 
214  strcpy_f2c(ftype.string, set_length, &(ctype->string));
215 }
216 
218  strcpy_c2f(ctype.string, ftype->string, set_length);
219 }
220 
225 typedef struct {
226  char string[query_length];
228 
233 typedef struct {
234  char *string;
236 
239 
241  strcpy_f2c(ftype.string, query_length, &(ctype->string));
242 }
243 
245  strcpy_c2f(ctype.string, ftype->string, query_length);
246 }
247 
252 typedef struct {
253  char string[answer_length];
254  int number;
256 
261 typedef struct {
262  char *string;
263  int number;
265 
268 
270  strcpy_f2c(ftype.string, answer_length, &(ctype->string));
271  ctype->number = ftype.number;
272 }
273 
275  strcpy_c2f(ctype.string, ftype->string, answer_length);
276  ftype->number = ctype.number;
277 }
278 
279 // Function prototypes for the Fortran functions
280 
281 #ifdef __cplusplus
282 extern "C" {
283 #endif
284 void ITM_AMNS_C_SETUP(void **handle_out, amns_error_type *error_status);
286 void ITM_AMNS_C_FINISH(void **handle_inout, amns_error_type *error_status);
287 void ITM_AMNS_C_FINISH_TABLE(void **handle_rx_inout, amns_error_type *error_status);
288 void ITM_AMNS_C_SET(void *handle_in, amns_set_type *set, amns_error_type *error_status);
290 
291 void ITM_AMNS_C_SETUP_TABLE(void *handle_in, amns_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_error_type *error_status);
293 void ITM_AMNS_C_SET_TABLE(void *handle_rx_in, amns_set_type *set, amns_error_type *error_status);
294 
295 void ITM_AMNS_C_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_error_type *error_status);
296 void ITM_AMNS_C_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_error_type *error_status);
297 void ITM_AMNS_C_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_error_type *error_status);
298 
299 void ITM_AMNS_C_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_error_type *error_status);
300 void ITM_AMNS_C_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_error_type *error_status);
301 void ITM_AMNS_C_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status);
302 
303 void ITM_AMNS_C_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_error_type *error_status);
304 void ITM_AMNS_C_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_error_type *error_status);
305 void ITM_AMNS_C_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status);
306 
307 void ITM_AMNS_C_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_error_type *error_status);
308 void ITM_AMNS_C_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_error_type *error_status);
309 void ITM_AMNS_C_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status);
310 
311 void ITM_AMNS_C_SETUP_REACTANTS(void **reactants_handle_out, char string_in[reaction_length], int index_in, int n_reactants);
312 void ITM_AMNS_C_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_in);
313 void ITM_AMNS_C_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_out);
314 void ITM_AMNS_C_FINISH_REACTANTS(void **reactants_handle_inout);
315 
316 #ifdef __cplusplus
317 }
318 #endif
319 
320 
321 // Routines for C / Fortran string conversion
322 
323 /* Return the length of a Fortran string, not counting trailing whitespace */
324 int fstrlen(char *fstr, int flen) {
325  char *end;
326  end = fstr + flen - 1;
327  while(end >= fstr && isspace(*end)) end--;
328  return end - fstr + 1;
329 }
330 
331 /* Copy fixed-length Fortran string to C, omitting trailing whitespace
332  and allocating memory as needed. If the Fortran string contains only
333  whitespace (i.e., is empty), the C string is allocated but of zero length
334  (i.e. only contains the \0 termination character).*/
335 char *strcpy_f2c(char *fsrc, int flen, char **cdest) {
336  int trimlen = fstrlen(fsrc, flen);
337  if (((*cdest) = malloc(trimlen+1)) != NULL) {
338  memcpy(*cdest, fsrc, trimlen);
339  *(*cdest + trimlen) = 0;
340  }
341  return *cdest;
342 }
343 
344 /* Copy zero-terminated C string into fixed-length Fortran string, ensuring
345  that the allowed string length is not exceeded. The Fortran string
346  fdest is assumed to be allocated to the length flen. If the C string
347  is unassociated (NULL), the Fortran string is returned empty (i.e., filled with
348  whitespace/spaces) */
349 char *strcpy_c2f(char *csrc, char *fdest, int flen) {
350  memset(fdest, ' ', flen);
351  if (csrc != NULL) {
352  int clen = strlen(csrc);
353  if (clen > flen) {
354  printf("strcpy_c2f: WARNING: C string exceeds size of target Fortran string. Truncating.");
355  clen = flen;
356  }
357  memcpy(fdest, csrc, clen);
358  }
359  return fdest;
360 }
361 
362 
363 // Convenience versions of the ITM_AMNS_C_* routines using the amns_c_* variants
364 // of the AMNS structures. These routines transparently handle conversion between
365 // zero-terminated C strings and fixed length Fortran strings
366 //
367 // Notation: CC = "C Convenience"
368 //
369 // Note: the routines below contain calls to copy routines in both directions
370 // for all arguments of C convenience type. In the Fortran code, the
371 // arguments are specified to be intent in, out or inout. Thus some
372 // copy calls are unnecessary, and commented out in the below code.
373 //
374 // TODO: for some routines, the convenience routines are missing (commented below)
375 
376 
378  amns_error_type f_error_status;
379  //amns_error_type_c2f(*error_status, &f_error_status);
380  ITM_AMNS_C_SETUP(handle_out, &f_error_status);
381  amns_error_type_f2c(f_error_status, error_status);
382 }
383 
385  amns_error_type f_error_status;
386  amns_version_type f_version;
387  //amns_error_type_c2f(*error_status, &f_error_status);
388  amns_version_type_c2f(*version, &f_version);
389  ITM_AMNS_C_SETUP_VERSION(handle_in, &f_version, &f_error_status);
390  amns_error_type_f2c(f_error_status, error_status);
391  //amns_version_type_f2c(f_version, version);
392 }
393 
394 void ITM_AMNS_CC_FINISH(void **handle_inout, amns_c_error_type *error_status) {
395  amns_error_type f_error_status;
396  //amns_error_type_c2f(*error_status, &f_error_status);
397  ITM_AMNS_C_FINISH(handle_inout, &f_error_status);
398  amns_error_type_f2c(f_error_status, error_status);
399 }
400 
402  amns_error_type f_error_status;
403  //amns_error_type_c2f(*error_status, &f_error_status);
404  ITM_AMNS_C_FINISH_TABLE(handle_rx_inout, &f_error_status);
405  amns_error_type_f2c(f_error_status, error_status);
406 }
407 
409  amns_error_type f_error_status;
410  amns_set_type f_set;
411  //amns_error_type_c2f(*error_status, &f_error_status);
412  amns_set_type_c2f(*set, &f_set);
413  ITM_AMNS_C_SET(handle_in, &f_set, &f_error_status);
414  amns_error_type_f2c(f_error_status, error_status);
415  //amns_set_type_f2c(f_set, set);
416 }
417 
419  amns_error_type f_error_status;
420  amns_answer_type f_answer;
421  amns_query_type f_query;
422  //amns_error_type_c2f(*error_status, &f_error_status);
423  //amns_answer_type_c2f(*answer, &f_answer);
424  amns_query_type_c2f(*query, &f_query);
425  ITM_AMNS_C_QUERY(handle_in, &f_query, &f_answer, &f_error_status);
426  amns_error_type_f2c(f_error_status, error_status);
427  amns_answer_type_f2c(f_answer, answer);
428  //amns_query_type_f2c(f_query, query);
429 }
430 
431 void ITM_AMNS_CC_SETUP_TABLE(void *handle_in, amns_c_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_c_error_type *error_status) {
432  amns_error_type f_error_status;
433  amns_reaction_type f_reaction;
434  //amns_error_type_c2f(*error_status, &f_error_status);
435  amns_reaction_type_c2f(*reaction_type, &f_reaction);
436  ITM_AMNS_C_SETUP_TABLE(handle_in, &f_reaction, reactant_handle_in, handle_rx_out, &f_error_status);
437  amns_error_type_f2c(f_error_status, error_status);
438  //amns_reaction_type_f2c(f_reaction, reaction_type);
439 }
440 
442  amns_error_type f_error_status;
443  amns_query_type f_query;
444  amns_answer_type f_answer;
445  //amns_error_type_c2f(*error_status, &f_error_status);
446  amns_query_type_c2f(*query, &f_query);
447  //amns_answer_type_c2f(*answer, &f_answer);
448  ITM_AMNS_C_QUERY_TABLE(handle_rx_in, &f_query, &f_answer, &f_error_status);
449  amns_error_type_f2c(f_error_status, error_status);
450  //amns_query_type_f2c(f_query, query);
451  amns_answer_type_f2c(f_answer, answer);
452 }
453 
455  amns_error_type f_error_status;
456  amns_set_type f_set;
457  //amns_error_type_c2f(*error_status, &f_error_status);
458  amns_set_type_c2f(*set, &f_set);
459  ITM_AMNS_C_SET_TABLE(handle_rx_in, &f_set, &f_error_status);
460  amns_error_type_f2c(f_error_status, error_status);
461  //amns_set_type_f2c(f_set, set);
462 }
463 
464 void ITM_AMNS_CC_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_c_error_type *error_status) {
465  amns_error_type f_error_status;
466  //amns_error_type_c2f(*error_status, &f_error_status);
467  ITM_AMNS_C_RX_0_A(handle_rx_in, out, arg1, &f_error_status);
468  amns_error_type_f2c(f_error_status, error_status);
469 }
470 
471 void ITM_AMNS_CC_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_c_error_type *error_status) {
472  amns_error_type f_error_status;
473  //amns_error_type_c2f(*error_status, &f_error_status);
474  ITM_AMNS_C_RX_0_B(handle_rx_in, out, arg1, arg2, &f_error_status);
475  amns_error_type_f2c(f_error_status, error_status);
476 }
477 
478 void ITM_AMNS_CC_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_c_error_type *error_status) {
479  amns_error_type f_error_status;
480  //amns_error_type_c2f(*error_status, &f_error_status);
481  ITM_AMNS_C_RX_0_C(handle_rx_in, out, arg1, arg2, arg3, &f_error_status);
482  amns_error_type_f2c(f_error_status, error_status);
483 }
484 
485 void ITM_AMNS_CC_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_c_error_type *error_status) {
486  amns_error_type f_error_status;
487  //amns_error_type_c2f(*error_status, &f_error_status);
488  ITM_AMNS_C_RX_1_A(handle_rx_in, nx, out, arg1, &f_error_status);
489  amns_error_type_f2c(f_error_status, error_status);
490 }
491 
492 void ITM_AMNS_CC_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_c_error_type *error_status) {
493  amns_error_type f_error_status;
494  //amns_error_type_c2f(*error_status, &f_error_status);
495  ITM_AMNS_C_RX_1_B(handle_rx_in, nx, out, arg1, arg2, &f_error_status);
496  amns_error_type_f2c(f_error_status, error_status);
497 }
498 
499 void ITM_AMNS_CC_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status) {
500  amns_error_type f_error_status;
501  //amns_error_type_c2f(*error_status, &f_error_status);
502  ITM_AMNS_C_RX_1_C(handle_rx_in, nx, out, arg1, arg2, arg3, &f_error_status);
503  amns_error_type_f2c(f_error_status, error_status);
504 }
505 
506 void ITM_AMNS_CC_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_c_error_type *error_status) {
507  amns_error_type f_error_status;
508  //amns_error_type_c2f(*error_status, &f_error_status);
509  ITM_AMNS_C_RX_2_A(handle_rx_in, nx, ny, out, arg1, &f_error_status);
510  amns_error_type_f2c(f_error_status, error_status);
511 }
512 
513 void ITM_AMNS_CC_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_c_error_type *error_status) {
514  amns_error_type f_error_status;
515  //amns_error_type_c2f(*error_status, &f_error_status);
516  ITM_AMNS_C_RX_2_B(handle_rx_in, nx, ny, out, arg1, arg2, &f_error_status);
517  amns_error_type_f2c(f_error_status, error_status);
518 }
519 
520 void ITM_AMNS_CC_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status) {
521  amns_error_type f_error_status;
522  //amns_error_type_c2f(*error_status, &f_error_status);
523  ITM_AMNS_C_RX_2_C(handle_rx_in, nx, ny, out, arg1, arg2, arg3, &f_error_status);
524  amns_error_type_f2c(f_error_status, error_status);
525 }
526 
527 void ITM_AMNS_CC_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_c_error_type *error_status) {
528  amns_error_type f_error_status;
529  //amns_error_type_c2f(*error_status, &f_error_status);
530  ITM_AMNS_C_RX_3_A(handle_rx_in, nx, ny, nz, out, arg1, &f_error_status);
531  amns_error_type_f2c(f_error_status, error_status);
532 }
533 
534 void ITM_AMNS_CC_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_c_error_type *error_status) {
535  amns_error_type f_error_status;
536  //amns_error_type_c2f(*error_status, &f_error_status);
537  ITM_AMNS_C_RX_3_B(handle_rx_in, nx, ny, nz, out, arg1, arg2, &f_error_status);
538  amns_error_type_f2c(f_error_status, error_status);
539 }
540 
541 void ITM_AMNS_CC_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status) {
542  amns_error_type f_error_status;
543  //amns_error_type_c2f(*error_status, &f_error_status);
544  ITM_AMNS_C_RX_3_C(handle_rx_in, nx, ny, nz, out, arg1, arg2, arg3, &f_error_status);
545  amns_error_type_f2c(f_error_status, error_status);
546 }
547 
548 void ITM_AMNS_CC_SETUP_REACTANTS(void **reactants_handle_out, char *string_in, int index_in, int n_reactants) {
549  char f_string_in[reaction_length];
550  strcpy_c2f(string_in, f_string_in, reaction_length);
551  ITM_AMNS_C_SETUP_REACTANTS(reactants_handle_out, f_string_in, index_in, n_reactants);
552  //strcpy_f2c(f_string_inchar, reaction_length, string_in) {
553 }
554 
555 void ITM_AMNS_CC_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_in) {
556  // amns_c_reactant_type and amns_reactant_type are the same
557  ITM_AMNS_C_SET_REACTANT(reactants_handle_in, reactant_index, (amns_reactant_type*)reactant_in);
558 }
559 
560 void ITM_AMNS_CC_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_out) {
561  ITM_AMNS_C_GET_REACTANT(reactants_handle_in, reactant_index, (amns_reactant_type*)reactant_out);
562 }
563 
564 void ITM_AMNS_CC_FINISH_REACTANTS(void **reactants_handle_inout) {
565  ITM_AMNS_C_FINISH_REACTANTS(reactants_handle_inout);
566 }
567 
568 #endif
569 
570 
void amns_reaction_type_f2c(amns_reaction_type ftype, amns_c_reaction_type *ctype)
void ITM_AMNS_CC_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_error_type *error_status)
void amns_answer_type_c2f(amns_c_answer_type ctype, amns_answer_type *ftype)
void ITM_AMNS_C_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_error_type *error_status)
void ITM_AMNS_C_SET(void *handle_in, amns_set_type *set, amns_error_type *error_status)
void ITM_AMNS_C_SETUP_VERSION(void **handle_in, amns_version_type *version, amns_error_type *error_status)
#define version_length
char * string
string version of the answer to a query
int fstrlen(char *fstr, int flen)
void ITM_AMNS_CC_SET_TABLE(void *handle_rx_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
Type for specifying the AMNS version (&quot;interoperable&quot; version)
void ITM_AMNS_CC_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
const amns_version_type DEFAULT_AMNS_VERSION_TYPE
amns_c_error_type get_default_amns_c_error_type(void)
prototype
const amns_error_type DEFAULT_AMNS_ERROR_TYPE
amns_c_reaction_type get_default_amns_c_reaction_type(void)
prototype
void ITM_AMNS_CC_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
int number
integer version of the answer to a query
void amns_error_type_c2f(amns_c_error_type ctype, amns_error_type *ftype)
char * string
used to pass a change in the settings
Type for error returns from the AMNS interface (&quot;C&quot; version)
Type for querying parameters in the AMNS package (&quot;C&quot; version)
void amns_query_type_c2f(amns_c_query_type ctype, amns_query_type *ftype)
if error_status & query
Definition: amns.pyx:11
const amns_c_set_type DEFAULT_AMNS_C_SET_TYPE
bool flag
True if an error occurred.
amns_c_version_type get_default_amns_c_version_type(void)
prototype
void ITM_AMNS_C_SETUP_TABLE(void *handle_in, amns_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_error_type *error_status)
#define reaction_length
const amns_reaction_type DEFAULT_AMNS_REACTION_TYPE
const amns_c_error_type DEFAULT_AMNS_C_ERROR_TYPE
if error_status & answer
Definition: amns.pyx:11
void amns_error_type_f2c(amns_error_type ftype, amns_c_error_type *ctype)
amns_c_reactant_type get_default_amns_c_reactant_type(void)
prototype
void ITM_AMNS_C_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_out)
const amns_c_reactant_type DEFAULT_AMNS_C_REACTANT_TYPE
#define query_length
double MI
Atomic mass.
void ITM_AMNS_C_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_error_type *error_status)
Type for answers from queries in the AMNS package (&quot;C&quot; version)
const amns_c_answer_type DEFAULT_AMNS_C_ANSWER_TYPE
void ITM_AMNS_CC_FINISH_TABLE(void **handle_rx_inout, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
Type used for specifying reactions when using the AMNS interface (&quot;C&quot; version)
char * string
name of the reaction (e.g. RC)
char backend[version_length]
specify the backend to be used to access the CPOs
char * strcpy_c2f(char *csrc, char *fdest, int flen)
void ITM_AMNS_CC_FINISH_REACTANTS(void **reactants_handle_inout)
void ITM_AMNS_C_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_in)
Type for answers from queries in the AMNS package (&quot;interoperable&quot; version)
void ITM_AMNS_C_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_error_type *error_status)
Type for error returns from the AMNS interface (&quot;interoperable&quot; version)
char string[answer_length]
text describing the error if flag was True
void ITM_AMNS_C_FINISH_REACTANTS(void **reactants_handle_inout)
int isotope_resolved
if the reaction is different for different isotopes, isotope_resolved shoukld be set to 1 ...
const amns_answer_type DEFAULT_AMNS_ANSWER_TYPE
char * strcpy_f2c(char *fsrc, int flen, char **cdest)
double real_specifier
a place holder to specify an optional real further characterising a reactant/product ...
void ITM_AMNS_CC_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
Type for setting parameters in the AMNS package (&quot;C&quot; version)
void ITM_AMNS_C_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_error_type *error_status)
void ITM_AMNS_CC_QUERY_TABLE(void *handle_rx_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
void ITM_AMNS_CC_FINISH(void **handle_inout, amns_c_error_type *error_status)
void ITM_AMNS_C_SET_TABLE(void *handle_rx_in, amns_set_type *set, amns_error_type *error_status)
char string[set_length]
used to pass a change in the settings
const amns_c_version_type DEFAULT_AMNS_C_VERSION_TYPE
Type for specifying the AMNS version (&quot;C&quot; version)
char * backend
specify the backend to be used to access the CPOs
void ITM_AMNS_C_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
char string[version_length]
ascii specification of the version
amns_reactant_type amns_c_reactant_type
char string[query_length]
used to pass a query about settings
void ITM_AMNS_C_FINISH_TABLE(void **handle_rx_inout, amns_error_type *error_status)
char * string
ascii specification of the version
char string[reaction_length]
name of the reaction (e.g. RC)
#define answer_length
const amns_reactant_type DEFAULT_AMNS_REACTANT_TYPE
int number
integer specification of the version number (primary specification at the moment) ...
void ITM_AMNS_CC_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_out)
char user[version_length]
specify the username of the data to be obtained (defaults to tghe person running the code) ...
void ITM_AMNS_C_SETUP(void **handle_out, amns_error_type *error_status)
version
Definition: setup.py:45
int isotope_resolved
if the reaction is different for different isotopes, isotope_resolved shoukld be set to 1 ...
char * user
specify the username of the data to be obtained (defaults to tghe person running the code) ...
const amns_c_reaction_type DEFAULT_AMNS_C_REACTION_TYPE
void ITM_AMNS_C_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_error_type *error_status)
void ITM_AMNS_C_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_error_type *error_status)
int number
integer specification of the version number (primary specification at the moment) ...
void ITM_AMNS_CC_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_REACTANTS(void **reactants_handle_out, char *string_in, int index_in, int n_reactants)
void ITM_AMNS_CC_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_c_error_type *error_status)
Type used for specifying reactions when using the AMNS interface (&quot;interoperable&quot; version) ...
void ITM_AMNS_CC_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_in)
double ZA
Atomic charge.
void ITM_AMNS_CC_SET(void *handle_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_CC_QUERY(void *handle_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
void ITM_AMNS_C_QUERY_TABLE(void *handle_rx_in, amns_query_type *query, amns_answer_type *answer, amns_error_type *error_status)
void amns_version_type_f2c(amns_version_type ftype, amns_c_version_type *ctype)
int number
integer version of the answer to a query
bool flag
True if an error occurred.
void amns_set_type_f2c(amns_set_type ftype, amns_c_set_type *ctype)
void amns_version_type_c2f(amns_c_version_type ctype, amns_version_type *ftype)
void ITM_AMNS_CC_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_error_type *error_status)
const amns_c_query_type DEFAULT_AMNS_C_QUERY_TYPE
void ITM_AMNS_C_FINISH(void **handle_inout, amns_error_type *error_status)
void ITM_AMNS_C_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_error_type *error_status)
double ZN
Nuclear charge.
void ITM_AMNS_C_SETUP_REACTANTS(void **reactants_handle_out, char string_in[reaction_length], int index_in, int n_reactants)
Type for querying parameters in the AMNS package (&quot;interoperable&quot; version)
#define set_length
Type for indicating a single reactant or product when using the AMNS interface.
Type for setting parameters in the AMNS package (&quot;interoperable&quot; version)
void amns_reaction_type_c2f(amns_c_reaction_type ctype, amns_reaction_type *ftype)
char string[answer_length]
string version of the answer to a query
if error_status & error_status
Definition: amns.pyx:11
void ITM_AMNS_C_QUERY(void *handle_in, amns_query_type *query, amns_answer_type *answer, amns_error_type *error_status)
void ITM_AMNS_CC_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_TABLE(void *handle_in, amns_c_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_c_error_type *error_status)
char * string
text describing the error if flag was True
int int_specifier
a place holder to specify an optional integer further characterising a reactant/product ...
const amns_query_type DEFAULT_AMNS_QUERY_TYPE
void amns_answer_type_f2c(amns_answer_type ftype, amns_c_answer_type *ctype)
char * string
used to pass a query about settings
int LR
reactant (LR=0) or product (LR=1)
void ITM_AMNS_CC_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_c_error_type *error_status)
void amns_set_type_c2f(amns_c_set_type ctype, amns_set_type *ftype)
void ITM_AMNS_CC_SETUP(void **handle_out, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_VERSION(void **handle_in, amns_c_version_type *version, amns_c_error_type *error_status)
void amns_query_type_f2c(amns_query_type ftype, amns_c_query_type *ctype)
const amns_set_type DEFAULT_AMNS_SET_TYPE