298 if (i < tmp_fmol ->
atoms-1)
310 for (i=0; i<
tmp_fmol -> shells; i++)
317 if (i < tmp_fmol -> shells - 1)
328 tmp_fmol -> first_constraint = g_malloc0(
sizeof*
tmp_fmol -> first_constraint);
330 for (i=0; i<
tmp_fmol -> constraints; i++)
337 if (i < tmp_fmol -> constraints - 1)
357 if (i < tmp_fmol -> pmfs - 1)
370 for (i=0; i<
tmp_fmol -> rigids; i++)
377 if (i < tmp_fmol -> rigids - 1)
390 for (i=0; i<
tmp_fmol -> tethered; i++)
397 if (i < tmp_fmol -> tethered - 1)
410 tmp_fmol -> first_struct[i] = g_malloc0(
sizeof*
tmp_fmol -> first_struct[i]);
412 for (j=0; j<
tmp_fmol -> nstruct[i]; j++)
419 if (j < tmp_fmol -> nstruct[i]-1)
498 int i, j, k, l, m, n;
501 this_proj -> force_field[0] = g_malloc0(
sizeof*this_proj -> force_field[0]);
504 this_proj -> force_field[0] -> io_opts =
allocdouble (23);
505 this_proj -> force_field[0] -> ana_opts =
allocdouble (17);
506 this_proj -> force_field[0] -> elec_opts =
allocdouble (11);
507 this_proj -> force_field[0] -> vdw_opts =
allocdouble (6);
508 this_proj -> force_field[0] -> met_opts =
allocdouble (2);
509 this_proj -> force_field[0] -> equi_opts =
allocdouble (17);
510 this_proj -> force_field[0] -> thermo_opts=
allocdouble (10);
511 this_proj -> force_field[0] -> md_opts =
allocdouble (20);
512 this_proj -> force_field[0] -> out_opts =
allocdouble (31);
515 if (fread (this_proj -> force_field[0] -> io_opts,
sizeof(
double), 23,
fp) != 23)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
516 if (fread (this_proj -> force_field[0] -> ana_opts,
sizeof(
double), 17,
fp) != 17)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
517 if (fread (this_proj -> force_field[0] -> elec_opts,
sizeof(
double), 11,
fp) != 11)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
518 if (fread (this_proj -> force_field[0] -> vdw_opts,
sizeof(
double), 6,
fp) != 6)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
519 if (fread (this_proj -> force_field[0] -> met_opts,
sizeof(
double), 2,
fp) != 2)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
520 if (fread (this_proj -> force_field[0] -> equi_opts,
sizeof(
double), 17,
fp) != 17)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
521 if (fread (& this_proj -> force_field[0] -> ensemble,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
523 if (fread (this_proj -> force_field[0] -> thermo_opts,
sizeof(
double), 10,
fp) != 10)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
524 if (fread (this_proj -> force_field[0] -> md_opts,
sizeof(
double), 20,
fp) != 20)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
525 if (fread (this_proj -> force_field[0] -> out_opts,
sizeof(
double), 31,
fp) != 31)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
527 if (fread (this_proj -> force_field[0] -> prepare_file,
sizeof(gboolean), 2,
fp) != 2)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
529 if (fread (& this_proj -> force_field[0] -> type,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
530 if (fread (& this_proj -> force_field[0] -> energy_unit,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
534 this_proj -> force_field[0] -> first_molecule = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_molecule);
535 tmp_fmol = this_proj -> force_field[0] -> first_molecule;
536 for (i=0; i<this_proj -> force_field[0] ->
molecules; i++)
553 this_proj ->
atoms[0][n].fid = j;
554 this_proj ->
atoms[0][n].faid = l;
557 if (i < this_proj -> force_field[0] ->
molecules-1)
563 if (fread (this_proj -> force_field[0] -> nbody,
sizeof(
int), 5,
fp) != 5)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
566 if (this_proj -> force_field[0] -> nbody[i])
568 this_proj -> force_field[0] -> first_body[i] = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_body[i]);
569 tmp_fbody = this_proj -> force_field[0] -> first_body[i];
570 for (j=0; j<this_proj -> force_field[0] -> nbody[i]; j++)
577 if (j < this_proj -> force_field[0] -> nbody[i]-1)
589 j = this_proj -> force_field[0] -> nbody[2] * (this_proj -> force_field[0] -> nbody[2] - 1) / 2;
590 this_proj -> force_field[0] ->
cross = g_malloc0(j*
sizeof*this_proj -> force_field[0] ->
cross);
593 this_proj -> force_field[0] ->
cross[k] = g_malloc0(3*
sizeof*this_proj -> force_field[0] ->
cross[k]);
594 if (fread (& this_proj -> force_field[0] ->
cross[k],
sizeof(
double), 3,
fp) != 3)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
597 if (fread (& this_proj -> force_field[0] -> extern_fields,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_FIELD);
598 if (this_proj -> force_field[0] -> extern_fields)
600 this_proj -> force_field[0] -> first_external = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_external);
601 tmp_fext = this_proj -> force_field[0] -> first_external;
602 for (i=0; i<this_proj -> force_field[0] -> extern_fields; i++)
609 if (i < this_proj -> force_field[0] -> extern_fields-1)