hi everyone,
I would like to have some help with the declaration of the subroutine lamps_extract_compute in the libfwrapper.c
void lammps_extract_compute_vect_(int64_t *ptr,char *id,int *style,int *type,double *data, int *n, int string_len)
{
int i;
void *obj;
obj = (void *) *ptr;
char *cpy;
double *cdata;
cpy =(char *) calloc (string_len + 1, sizeof(char));
memcpy(cpy,id,string_len);
printf("cpy= %s\n",cpy);
printf("*style = %d\n", *style);
printf("*type = %d\n", *type);
cdata = lammps_extract_compute(obj,cpy, *style, *type);
if (cdata == NULL) {
printf("NULL");
exit(1);
}
printf("*n=%d\n",*n);
for (i=0; i<*n; i++) {
printf("i=%d\n",i);
printf("cdata=%e\n",cdata[i]);
// data[i]= cdata[i];
}
free(cpy);
}
Thanks for the help