return block;
}
-void write_index(const char *outf, t_blocka *b, char **gnames)
+void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms)
{
FILE *out;
int i, j, k;
}
fprintf(out, "\n");
}
+
+ /* Duplicate copy, useful for computational electrophysiology double-layer setups */
+ if (bDuplicate)
+ {
+ fprintf(stderr, "Duplicating the whole system with an atom offset of %d atoms.\n", natoms);
+ for (i = 0; (i < b->nr); i++)
+ {
+ fprintf(out, "[ %s_copy ]\n", gnames[i]);
+ for (k = 0, j = b->index[i]; j < b->index[i+1]; j++, k++)
+ {
+ fprintf(out, "%4d ", b->a[j]+1 + natoms );
+ if ((k % 15) == 14)
+ {
+ fprintf(out, "\n");
+ }
+ }
+ fprintf(out, "\n");
+ }
+ }
+
gmx_fio_fclose(out);
}