264 if (fread (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
286 if (i < tmp_fmol ->
atoms-1)
298 for (i=0; i<
tmp_fmol -> shells; i++)
301 if (i < tmp_fmol -> shells - 1)
312 tmp_fmol -> first_constraint = g_malloc0(
sizeof*
tmp_fmol -> first_constraint);
314 for (i=0; i<
tmp_fmol -> constraints; i++)
317 if (i < tmp_fmol -> constraints - 1)
333 if (i < tmp_fmol -> pmfs - 1)
346 for (i=0; i<
tmp_fmol -> rigids; i++)
349 if (i < tmp_fmol -> rigids - 1)
362 for (i=0; i<
tmp_fmol -> tethered; i++)
365 if (i < tmp_fmol -> tethered - 1)
378 tmp_fmol -> first_struct[i] = g_malloc0(
sizeof*
tmp_fmol -> first_struct[i]);
380 for (j=0; j<
tmp_fmol -> nstruct[i]; j++)
383 if (j < tmp_fmol -> nstruct[i]-1)
462 int i, j, k, l, m, n;
463 if (fread (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
465 this_proj -> force_field[0] = g_malloc0(
sizeof*this_proj -> force_field[0]);
468 this_proj -> force_field[0] -> io_opts =
allocdouble (23);
469 this_proj -> force_field[0] -> ana_opts =
allocdouble (17);
470 this_proj -> force_field[0] -> elec_opts =
allocdouble (11);
471 this_proj -> force_field[0] -> vdw_opts =
allocdouble (6);
472 this_proj -> force_field[0] -> met_opts =
allocdouble (2);
473 this_proj -> force_field[0] -> equi_opts =
allocdouble (17);
474 this_proj -> force_field[0] -> thermo_opts=
allocdouble (10);
475 this_proj -> force_field[0] -> md_opts =
allocdouble (20);
476 this_proj -> force_field[0] -> out_opts =
allocdouble (31);
478 if (fread (this_proj -> force_field[0] ->
sys_opts,
sizeof(
double), 17,
fp) != 17)
return ERROR_RW;
479 if (fread (this_proj -> force_field[0] -> io_opts,
sizeof(
double), 23,
fp) != 23)
return ERROR_RW;
480 if (fread (this_proj -> force_field[0] -> ana_opts,
sizeof(
double), 17,
fp) != 17)
return ERROR_RW;
481 if (fread (this_proj -> force_field[0] -> elec_opts,
sizeof(
double), 11,
fp) != 11)
return ERROR_RW;
482 if (fread (this_proj -> force_field[0] -> vdw_opts,
sizeof(
double), 6,
fp) != 6)
return ERROR_RW;
483 if (fread (this_proj -> force_field[0] -> met_opts,
sizeof(
double), 2,
fp) != 2)
return ERROR_RW;
484 if (fread (this_proj -> force_field[0] -> equi_opts,
sizeof(
double), 17,
fp) != 17)
return ERROR_RW;
485 if (fread (& this_proj -> force_field[0] -> ensemble,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
486 if (fread (& this_proj -> force_field[0] ->
thermostat,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
487 if (fread (this_proj -> force_field[0] -> thermo_opts,
sizeof(
double), 10,
fp) != 10)
return ERROR_RW;
488 if (fread (this_proj -> force_field[0] -> md_opts,
sizeof(
double), 20,
fp) != 20)
return ERROR_RW;
489 if (fread (this_proj -> force_field[0] -> out_opts,
sizeof(
double), 31,
fp) != 31)
return ERROR_RW;
491 if (fread (this_proj -> force_field[0] -> prepare_file,
sizeof(gboolean), 2,
fp) != 2)
return ERROR_RW;
493 if (fread (& this_proj -> force_field[0] -> type,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
494 if (fread (& this_proj -> force_field[0] -> energy_unit,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
495 if (fread (& this_proj -> force_field[0] ->
atom_init,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
496 if (fread (& this_proj -> force_field[0] ->
molecules,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
498 this_proj -> force_field[0] -> first_molecule = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_molecule);
499 tmp_fmol = this_proj -> force_field[0] -> first_molecule;
500 for (i=0; i<this_proj -> force_field[0] ->
molecules; i++)
513 this_proj ->
atoms[0][n].fid = j;
514 this_proj ->
atoms[0][n].faid = l;
517 if (i < this_proj -> force_field[0] ->
molecules-1)
523 if (fread (this_proj -> force_field[0] -> nbody,
sizeof(
int), 5,
fp) != 5)
return ERROR_RW;
526 if (this_proj -> force_field[0] -> nbody[i])
528 this_proj -> force_field[0] -> first_body[i] = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_body[i]);
529 tmp_fbody = this_proj -> force_field[0] -> first_body[i];
530 for (j=0; j<this_proj -> force_field[0] -> nbody[i]; j++)
533 if (j < this_proj -> force_field[0] -> nbody[i]-1)
542 if (fread (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
545 j = this_proj -> force_field[0] -> nbody[2] * (this_proj -> force_field[0] -> nbody[2] - 1) / 2;
546 this_proj -> force_field[0] ->
cross = g_malloc0(j*
sizeof*this_proj -> force_field[0] ->
cross);
549 this_proj -> force_field[0] ->
cross[k] = g_malloc0(3*
sizeof*this_proj -> force_field[0] ->
cross[k]);
550 if (fread (& this_proj -> force_field[0] ->
cross[k],
sizeof(
double), 3,
fp) != 3)
return ERROR_RW;
553 if (fread (& this_proj -> force_field[0] -> extern_fields,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
554 if (this_proj -> force_field[0] -> extern_fields)
556 this_proj -> force_field[0] -> first_external = g_malloc0(
sizeof*this_proj -> force_field[0] -> first_external);
557 tmp_fext = this_proj -> force_field[0] -> first_external;
558 for (i=0; i<this_proj -> force_field[0] -> extern_fields; i++)
561 if (i < this_proj -> force_field[0] -> extern_fields-1)