82extern gboolean
in_bond (
int at,
int bd[2]);
107 for (i=0; i< fat -> num; i++)
109 if (at == fat -> list[i])
return tmp_fmol -> id;
132 int a,
c, i, j, k, l, m, n, o, p;
135 gboolean same_atom = FALSE;
136 gboolean * already_done;
143 for (i=0; i<
tmp_fat -> num; i++)
147 if (same_atom) already_done[
a] = TRUE;
164 if (p != j && p != l &&
tmp_proj ->
atoms[0][p].faid ==
tmp_fdt ->
id && (! same_atom || (same_atom && ! already_done[
c])))
172 str = g_strdup_printf (
"%5d %5d %10d %10d %10d %10d\n", did+1, tp_prop -> pid, j+1, l+1, n+1, p+1);
185 if (same_atom) g_free (already_done);
201 int i, j, k, l, m, o, p, q;
205 gboolean same_atom = FALSE;
206 gboolean * already_done;
213 for (i=0; i<
tmp_fat -> num; i++)
217 if (same_atom) already_done[k] = TRUE;
228 if (p != j &&
tmp_proj ->
atoms[0][p].faid ==
tmp_fct ->
id && (! same_atom || (same_atom && ! already_done[q])))
236 str = g_strdup_printf (
"%5d %5d %10d %10d %10d\n", aid+1, tp_prop -> pid, j+1, m+1, p+1);
247 if (same_atom) g_free (already_done);
263 int i, j, k, l, m, n;
267 gboolean same_atom = FALSE;
268 gboolean * already_done;
274 for (i=0; i<
tmp_fat -> num; i++)
277 k = ids[0] =
tmp_fat -> list_id[i];
278 if (same_atom) already_done[k] = TRUE;
283 if (
tmp_proj ->
atoms[0][m].faid ==
tmp_fbt ->
id && (! same_atom || (same_atom && ! already_done[n])))
291 str = g_strdup_printf (
"%5d %5d %10d %10d\n", bid+1, tp_prop -> pid, j+1, m+1);
300 if (same_atom) g_free (already_done);
316 gboolean add_prop = TRUE;
324 else if (tmp_pr -> next)
326 tmp_pr = tmp_pr -> next;
336 tmp_pr -> next -> pid = tmp_pr -> pid + 1;
338 return (add_prop) ? 1 : 0;
352 tmp_fstr = tfmol -> first_struct[sid];
404 if (g_strcmp0(at -> name, bt -> name) != 0)
return TRUE;
405 if (at -> sp != bt -> sp)
return TRUE;
406 if (at -> mass != bt -> mass)
return TRUE;
407 if (at -> charge != bt -> charge)
return TRUE;
475 str = g_strdup_printf (
"\t%d\t%f\n",
tmp_fat ->
id,
tmp_fat -> mass);
495 for (i=0; i<
tmp_fat -> num; i++)
516 gchar * pos, * atid, * atype;
519 for (i=0; i<
tmp_proj -> natomes; i++)
521 atid = g_strdup_printf (
"%10d", i+1);
525 atype = g_strdup_printf (
"%5d", la_ats ->
id);
538 str = g_strdup_printf (
"%s\t%s\t%s\n", atid, atype, pos);
627 gtk_text_buffer_get_start_iter (buf, & bStart);
628 gtk_text_buffer_get_end_iter (buf, & bEnd);
629 gtk_text_buffer_delete (buf, & bStart, & bEnd);
634 print_info (
"LAMMPS Atom File\n\n", NULL, buf);
635 str = g_strdup_printf (
"%12d",
tmp_proj -> natomes);
640 gchar * str_title[4] = {
" bond",
" angle",
" dihedral",
" improper"};
656 str = g_strdup_printf (
"%12d", j);
665 str = g_strdup_printf (
"%12d", numat);
686 str = g_strdup_printf (
"%12d", ntypes[i]);
708 if (
tmp_proj -> cell.box[0].param[1][i] != 90.0) j=1;
714 lx =
tmp_proj -> cell.box[0].param[0][0];
715 xy =
tmp_proj -> cell.box[0].param[0][1] * cos(
tmp_proj -> cell.box[0].param[1][2]*
pi/180.0);
716 xz =
tmp_proj -> cell.box[0].param[0][2] * cos(
tmp_proj -> cell.box[0].param[1][1]*
pi/180.0);
717 ly = sqrt(
tmp_proj -> cell.box[0].param[0][1]*
tmp_proj -> cell.box[0].param[0][1] -xy*xy);
718 yz = (
tmp_proj -> cell.box[0].param[0][1]*(
tmp_proj -> cell.box[0].param[0][2]*cos(
tmp_proj -> cell.box[0].param[1][0]*
pi/180.0)) - xy*xz) / ly;
719 lz = sqrt(
tmp_proj -> cell.box[0].param[0][2]*
tmp_proj -> cell.box[0].param[0][2] - xz*xz - yz*yz);
720 str = g_strdup_printf (
"%f %f %f\n", lx, ly, lz);
733 gchar * coeffs[13]={
"Pair",
"Bond",
"Angle",
"Dihedral",
"Improper",
"BondBond",
"BondAngle",
"MiddleBondTorsion",
734 "EndBondTorsion",
"AngleTorsion",
"AngleAngleTorsion",
"BondBond13",
"AngleAngle"};
769 str = g_strdup_printf (
"\n%s Coeffs\n\n", coeffs[i+1]);
775 str = g_strdup_printf (
" %5d",
tmp_fprop -> pid);
780 str = g_strdup_printf (
" %15.10f",
tmp_fprop ->
val[j]);
798 str = g_strdup_printf (
"\n%ss\n\n", coeffs[i+1]);
field_prop * get_active_prop_using_atoms(struct field_prop *pr, int ti, int *ids)
retrieve field molecule structural property using atoms
field_atom * get_active_atom(int a, int b)
retrieve field atom
field_prop * duplicate_field_prop(field_prop *old_prop, int ti)
create a copy of a field property
field_atom * duplicate_field_atom(field_atom *old_fat)
create copy of a field atom data structure
field_molecule * tmp_fmol
classical_field * tmp_field
Variable declarations for the creation of the DL_POLY input file(s)
field_molecule * to_remove
gboolean * allocbool(int val)
allocate a gboolean * pointer
int * allocint(int val)
allocate an int * pointer
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Messaging function declarations.
field_prop * print_prop[8]
void print_lammps_mass(GtkTextBuffer *buf)
pritn LAMMPS atomic masses
int is_this_new_prop(int sid, field_prop *init, field_prop *to_check)
check if field property exists, if not add it
int print_lammps_bond(int bid, int bi, GtkTextBuffer *buf, field_struct *bd)
print LAMMPS bond
field_atom * get_print_atom(int aid)
get LAMMPS field atom
int get_mol_id_from_model_id(int at)
get field molecule id using atom id
int get_type_struct_to_print(field_molecule *tfmol, int sid)
build the list of 'sid' type structural property(ies) to print
int get_different_atoms()
create the list of all different field atoms
gboolean are_identical_prop(int ti, int ai, field_prop *pro_a, field_prop *pro_b)
are the 2 field property identicals ?
int print_lammps_angle(int aid, int ai, GtkTextBuffer *buf, field_struct *an)
print LAMMPS angle
int get_num_vdw_max()
Get the number of field shell interactions.
void merging_atoms(field_atom *to_merge, field_atom *to_remove, gboolean upda)
merge the field atom to remove with already other field atom
void print_lammps_atom_file(GtkTextBuffer *buf)
print LAMMPS atom file
int get_num_struct_to_print(field_molecule *fmol, int sid)
find the number of structural element(s) to print
gboolean are_different_field_atoms(field_atom *at, field_atom *bt)
check if two field atoms are different
gboolean in_bond(int at, int bd[2])
is atom at in bond bd
void print_lammps_atoms(GtkTextBuffer *buf)
print LAMMPS atoms
int print_lammps_dihedral(int did, int di, GtkTextBuffer *buf, field_struct *dh)
print LAMMPS dihedral
gchar * get_body_element_name(field_nth_body *body, int aid, int nbd)
get field body potential element name
gboolean append(atom_search *asearch, project *this_proj, int i, int j)
test if the atom 'i' of species 'j' must be added to the tree store or not