70 new_fat = g_malloc0 (
sizeof*new_fat);
71 new_fat ->
id = old_fat -> id;
72 new_fat -> fid = old_fat -> fid;
73 new_fat -> afid = old_fat -> afid;
74 new_fat -> name = g_strdup_printf (
"%s", old_fat -> name);
75 new_fat -> num = old_fat -> num;
76 new_fat -> sp = old_fat -> sp;
77 new_fat -> type = old_fat -> type;
78 new_fat -> mass = old_fat -> mass;
79 new_fat -> charge = old_fat -> charge;
80 new_fat -> frozen = old_fat -> frozen;
81 new_fat -> show = FALSE;
82 new_fat -> list =
duplicate_int (old_fat -> num, old_fat -> list);
87 new_fat -> list_id =
duplicate_int (old_fat -> num, old_fat -> list_id);
88 new_fat -> frozen_id =
duplicate_bool (old_fat -> num, old_fat -> frozen_id);
89 new_fat -> prev = NULL;
90 new_fat -> next = NULL;
104 new_shell = g_malloc0 (
sizeof*new_shell);
105 new_shell ->
id = old_shell -> id;
106 new_shell -> ia[0] = old_shell -> ia[0];
107 new_shell -> ia[1] = old_shell -> ia[1];
108 new_shell -> m = old_shell -> m;
109 new_shell ->
z = old_shell ->
z;
110 new_shell -> k2 = old_shell -> k2;
111 new_shell -> k4 = old_shell -> k4;
112 new_shell -> vdw = old_shell -> vdw;
113 new_shell -> use = old_shell -> use;
114 new_shell -> show = old_shell -> show;
115 new_shell -> prev = NULL;
116 new_shell -> next = NULL;
130 new_cons = g_malloc0 (
sizeof*new_cons);
131 new_cons ->
id = old_cons -> id;
132 new_cons -> ia[0] = old_cons -> ia[0];
133 new_cons -> ia[1] = old_cons -> ia[1];
134 new_cons -> length = old_cons -> length;
135 new_cons -> use = old_cons -> use;
136 new_cons -> show = old_cons -> show;
137 new_cons -> prev = NULL;
138 new_cons -> next = NULL;
152 new_pmf = g_malloc0 (
sizeof*new_pmf);
153 new_pmf ->
id = old_pmf -> id;
154 new_pmf -> length = old_pmf -> length;
158 new_pmf -> num[i] = old_pmf -> num[i];
159 new_pmf -> list[i] =
duplicate_int (old_pmf -> num[i], old_pmf -> list[i]);
160 new_pmf -> weight[i] =
duplicate_float (old_pmf -> num[i], old_pmf -> weight[i]);
162 new_pmf -> show = old_pmf -> show;
163 new_pmf -> use = old_pmf -> use;
164 new_pmf -> next = NULL;
165 new_pmf -> prev = NULL;
179 new_rig = g_malloc0 (
sizeof*new_rig);
180 new_rig ->
id = old_rig -> id;
181 new_rig -> num = old_rig -> num;
182 new_rig -> list =
duplicate_int (old_rig -> num, old_rig -> list);
183 new_rig -> show = old_rig -> show;
184 new_rig -> use = old_rig -> use;
185 new_rig -> next = NULL;
186 new_rig -> prev = NULL;
200 new_tet = g_malloc0 (
sizeof*new_tet);
201 new_tet ->
id = old_tet -> id;
202 new_tet -> num = old_tet -> num;
203 new_tet -> show = old_tet -> show;
204 new_tet -> use = old_tet -> use;
205 new_tet -> next = NULL;
206 new_tet -> prev = NULL;
221 new_prop = g_malloc0 (
sizeof*new_prop);
223 new_prop -> key = old_prop -> key;
224 new_prop -> pid = old_prop -> pid;
225 new_prop -> fpid = old_prop -> fpid;
226 new_prop ->
val = NULL;
231 new_prop -> show = old_prop -> show;
232 new_prop -> use = old_prop -> use;
233 new_prop -> next = NULL;
234 new_prop -> prev = NULL;
252 for (i=0; i<nat; i++)
278 if (new_fstr -> other)
281 tmp_new = tmp_new -> next;
286 tmp_new = new_fstr -> other;
289 tmp_old = tmp_old -> next;
303 new_fstr = g_malloc0 (
sizeof*new_fstr);
304 new_fstr -> st = old_fstr -> st;
305 new_fstr ->
id = old_fstr -> id;
306 new_fstr -> num = old_fstr -> num;
308 new_fstr -> av = old_fstr -> av;
310 new_fstr -> other = NULL;
312 new_fstr -> prev = NULL;
313 new_fstr -> next = NULL;
328 if (init) str_list -> def -> use = FALSE;
331 while (tmp_fst -> next)
334 tmp_str -> next -> prev = tmp_str;
335 if (init) tmp_str -> next -> def -> use = FALSE;
336 tmp_str = tmp_str -> next;
337 tmp_fst = tmp_fst -> next;
352 new_fbody -> key = old_fbody -> key;
354 new_fbody -> show = old_fbody -> show;
355 new_fbody -> use = old_fbody -> use;
369 new_fbody = g_malloc0 (
sizeof*new_fbody);
370 new_fbody ->
id = old_fbody -> id;
371 new_fbody -> bd = old_fbody -> bd;
372 if (old_fbody -> fpid) new_fbody -> fpid =
duplicate_int (2, old_fbody -> fpid);
375 new_fbody -> ma = NULL;
376 new_fbody -> ma = g_malloc (j*
sizeof*new_fbody -> ma);
377 new_fbody ->
a = NULL;
378 new_fbody ->
a = g_malloc (j*
sizeof*new_fbody ->
a);
382 if (old_fbody -> ma[i] != NULL)
384 new_fbody -> ma[i] =
duplicate_int (old_fbody -> na[i], old_fbody -> ma[i]);
388 new_fbody -> ma[i] = NULL;
390 if (old_fbody ->
a[i] != NULL)
392 new_fbody ->
a[i] =
duplicate_int (old_fbody -> na[i], old_fbody ->
a[i]);
396 new_fbody ->
a[i] = NULL;
400 new_fbody -> prev = NULL;
401 new_fbody -> next = NULL;
415 new_fext = g_malloc0 (
sizeof*new_fext);
416 new_fext ->
id = old_fext -> id;
417 new_fext -> key = old_fext -> key;
418 new_fext ->
val = NULL;
419 if (old_fext ->
val != NULL)
423 new_fext -> use = old_fext -> use;
424 new_fext -> next = NULL;
425 new_fext -> prev = NULL;
440 new_fmol = g_malloc0 (
sizeof*new_fmol);
441 new_fmol ->
id = old_fmol -> id;
443 new_fmol -> name = g_strdup_printf (
"%s", old_fmol -> name);
444 new_fmol -> show = old_fmol -> show;
445 new_fmol -> show_id = old_fmol -> show_id;
447 new_fmol -> first_atom = NULL;
448 new_fmol -> tethered = old_fmol -> tethered;
449 new_fmol -> first_tethered = NULL;
450 new_fmol -> rigids = old_fmol -> rigids;
451 new_fmol -> first_rigid = NULL;
452 new_fmol -> pmfs = old_fmol -> pmfs;
453 new_fmol -> first_pmf = NULL;
454 new_fmol -> first_constraint = NULL;
455 new_fmol -> constraints = old_fmol -> constraints;
456 new_fmol -> first_shell = NULL;
457 new_fmol -> shells = old_fmol -> shells;
458 new_fmol ->
mol = g_malloc0 (
sizeof*new_fmol ->
mol);
459 new_fmol ->
mol = &
tmp_proj -> modelfc -> mols[0][old_fmol ->
mol -> id];
461 new_fmol -> fragments = NULL;
463 for (i=0; i<new_fmol ->
multi; i++) new_fmol -> fragments[i] = old_fmol -> fragments[i];
469 for (i=1; i<new_fmol ->
atoms; i++)
474 tmp_fa = tmp_fa -> next;
478 for (i=0; i<new_fmol ->
mol -> natoms; i++)
481 for (j=0; j<new_fmol ->
multi; j++)
491 new_fmol -> nstruct[i] = old_fmol -> nstruct[i];
492 new_fmol -> first_struct[i] = NULL;
493 if (old_fmol -> nstruct[i] > 0)
498 for (j=1; j<new_fmol -> nstruct[i]; j++)
501 tmp_str -> next -> prev = tmp_str;
502 tmp_str = tmp_str -> next;
503 tmp_fst = tmp_fst -> next;
507 new_fmol -> next = NULL;
508 new_fmol -> prev = NULL;
522 new_field = g_malloc (
sizeof*new_field);
528 for (i=0; i<2; i++) new_field -> prepare_file[i] = init_field -> prepare_file[i];
531 new_field -> ensemble = init_field -> ensemble;
534 for (i=0; i<23; i++) new_field -> io_opts[i] = init_field -> io_opts[i];
535 for (i=0; i<17; i++) new_field -> ana_opts[i] = init_field -> ana_opts[i];
536 for (i=0; i<11; i++) new_field -> elec_opts[i] = init_field -> elec_opts[i];
537 for (i=0; i<6; i++) new_field -> vdw_opts[i] = init_field -> vdw_opts[i];
538 for (i=0; i<2; i++) new_field -> met_opts[i] = init_field -> met_opts[i];
539 for (i=0; i<17; i++) new_field -> equi_opts[i] = init_field -> equi_opts[i];
540 for (i=0; i<10; i++) new_field -> thermo_opts[i] = init_field -> thermo_opts[i];
541 for (i=0; i<20; i++) new_field -> md_opts[i] = init_field -> md_opts[i];
542 for (i=0; i<31; i++) new_field -> out_opts[i] = init_field -> out_opts[i];
545 new_field -> energy_unit = init_field -> energy_unit;
553 fmol = new_field -> first_molecule;
554 tmp_fmol = init_field -> first_molecule;
555 for (i=1; i<init_field ->
molecules; i++)
558 fmol -> next -> prev = fmol;
566 new_field -> first_body[i] = NULL;
567 new_field -> nbody[i] = init_field -> nbody[i];
568 if (init_field -> nbody[i] > 0)
573 for (j=1; j<new_field -> nbody[i]; j++)
576 tmp_fbod -> next -> prev = tmp_fbod;
577 tmp_fbod = tmp_fbod -> next;
578 tmp_fbo = tmp_fbo -> next;
583 new_field ->
cross = NULL;
584 if (init_field ->
cross != NULL)
595 new_field -> first_external = NULL;
596 new_field -> extern_fields = init_field -> extern_fields;
597 if (init_field -> extern_fields > 0)
602 for (i=1; i<new_field -> extern_fields; i++)
607 tmp_ftxt = tmp_ftxt -> next;
field_molecule * duplicate_field_molecule(field_molecule *old_fmol)
create copy of a field molecule
field_nth_body * duplicate_field_nth_body(field_nth_body *old_fbody)
create copy of a field body property
void print_all_field_struct(field_molecule *mol, int str)
print all field structural element(s)
field_pmf * duplicate_field_pmf(field_pmf *old_pmf)
create copy of a field PMF data structure
field_prop * duplicate_field_prop(field_prop *old_prop, int ti)
create a copy of a field property
void duplicate_nbody_params(field_nth_body *new_fbody, field_nth_body *old_fbody)
copy field body parameter list
gboolean check_this_other_prop(int oid, int nat, field_prop *other)
check if field atom already in field property
field_tethered * duplicate_field_tethered(field_tethered *old_tet)
create copy of a field tethered data structure
void duplicate_other_prop(int oid, field_struct *old_fstr, field_struct *new_fstr)
create copy of a field property 'other' list
field_external * duplicate_field_external(field_external *old_fext)
create copy of a field external property
classical_field * duplicate_classical_field(classical_field *init_field)
create copy of a force field
field_constraint * duplicate_field_constraint(field_constraint *old_cons)
create copy of a field constraint data structure
field_atom * duplicate_field_atom(field_atom *old_fat)
create copy of a field atom data structure
field_shell * duplicate_field_shell(field_shell *old_shell)
create copy of a field shell data structure
field_struct * duplicate_field_struct(field_struct *old_fstr)
create copy of a field structural element
field_rigid * duplicate_field_rigid(field_rigid *old_rig)
create copy of a field rigid data structure
field_struct * duplicate_field_struct_list(field_struct *list_str, gboolean init)
create copy of list of field structural element(s)
int body_at(int b)
find the number of atom(s) in a non bonded interaction
field_external * tmp_fext
int struct_id(int f)
number of atoms in a structural element
field_molecule * tmp_fmol
classical_field * tmp_field
Variable declarations for the creation of the DL_POLY input file(s)
int * duplicate_int(int num, int *old_val)
copy a list of int
float * duplicate_float(int num, float *old_val)
copy a list of float
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
double * duplicate_double(int num, double *old_val)
copy a list of double
int * allocint(int val)
allocate an int * pointer
Global variable declarations Global convenience function declarations Global data structure defin...
struct thermostat thermostat
#define MAXDATC
Number of tabs for the description of the classical calculation.
#define MAXDATA
Number of tabs for the description of the classical force field.
integer(kind=c_int) function molecules(frag_and_mol, allbonds)