Issue with write_data

Dear all,

I am trying to create a molecule using create_atoms and then testing to see if they were successfully created using write_data command. The write_data file is written successfully but is missing some information. Please see below.

Here is my input script

Dear all,

I am trying to create a molecule using create_atoms and then testing to see
if they were successfully created using write_data command. The write_data
file is written successfully but is missing some information. Please see
below.

it cannot write out your bonds and angles because it doesn't know how
to do it. you have not specified a bond or angle style.

axel

Dear Axel,

Here is my input file. But still the same output. It writes the Bond Coeffs, Pair Coeffs, but no information on topology.

Dear Axel,
Here is my input file. But still the same output. It writes the Bond Coeffs,
Pair Coeffs, but no information on topology.

is that with the same molecule template?

remember for that your special_bonds setting is inconsistent with the
information you provide in the template. i doubt that the code has
been "hardened" against such inconsistencies and thus may produce all
kinds of random information.

the technical issue is that the time where you can use the
create_atoms command is at a point when everything else is already set
up. that is why you need to specify all those "extra" settings and
have to have to provide those (complex) additional sections in the
molecule template. it is too late in the progression of the simulation
initialization for LAMMPS to infer those from the bond topology (and
fix definitions in case of fix shake).

axel.

Dear Axel,

I did not change anything in the code. The only changes I made were few print statements to see which of the 5 mismatches in the molecule.cpp is throwing the error. So, I don’t think the code has been hardened.

--------------molecule.cpp----------------


if (atom->maxspecial < onemol->maxspecial) mismatch = 5;
printf(“Bond Info %d %d\n”,atom->bond_per_atom, onemol->bond_per_atom);
printf(“Angle Info %d %d\n”,atom->angle_per_atom, onemol->angle_per_atom);
printf(“Dihedral Info %d %d\n”,atom->dihedral_per_atom, onemol->dihedral_per_atom);
printf(“Improper Info %d %d\n”,atom->improper_per_atom, onemol->improper_per_atom);
printf(“Max Special %d %d %d\n”, atom->maxspecial, onemol->maxspecial, mismatch);
if (mismatch)
error->all(FLERR,“Molecule toplogy/atom exceeds system topology/atom”);


Dear Axel,

I did not change anything in the code. The only changes I made were few

neither did i expect that you did.

print statements to see which of the 5 mismatches in the molecule.cpp is
throwing the error. So, I don't think the code has been hardened.

which means, that you have to provide consistent input. large parts of
LAMMPS expect that you provide the proper input. in many cases, it is
impossible to detect, whether something is desired or not.

you said that you don't want exclusions in your system and set up your
molecule template accordingly, yet you do stick with the default
special_bonds setting which will require exclusions. i mentioned this
already a couple of times and am now doing it for the last time.

axel.

Dear Axel,

If you did not “expect” me to change anything in the code, why bother doubting it out in the first place.

In any case, many thanks for all your time. I will wait for someone else to answer (if possible) I could understand it better. With respect to your point, I have tried all 4 settings (special_bond inclusion/exclusion in input script times different special bond settings in template molecule (both inclusion and exclusion) and I am getting still getting the same write_data file.

If I don’t get a positive response, I will try to do it in a slightly different way by creating the molecules separately soon.

Best Regards,
Vikas

Dear Axel,

If you did not "expect" me to change anything in the code, why bother
doubting it out in the first place.

i didn't.

Dear Axel,

If you did not "expect" me to change anything in the code, why bother
doubting it out in the first place.

In any case, many thanks for all your time. I will wait for someone else to
answer (if possible) I could understand it better. With respect to your
point, I have tried all 4 settings (special_bond inclusion/exclusion in
input script times different special bond settings in template molecule
(both inclusion and exclusion) and I am getting still getting the same
write_data file.

well, with *that* information at hand, it is more likely that
something not working correctly inside the create_atoms command or
whatever other facility it uses. this is a rather new facility and -
like i already mentioned - i don't see any cases yet, where this
feature would have been thoroughly tested.

Dear Axel,

If you did not "expect" me to change anything in the code, why bother
doubting it out in the first place.

In any case, many thanks for all your time. I will wait for someone else to
answer (if possible) I could understand it better. With respect to your
point, I have tried all 4 settings (special_bond inclusion/exclusion in
input script times different special bond settings in template molecule
(both inclusion and exclusion) and I am getting still getting the same
write_data file.

well, with *that* information at hand, it is more likely that
something not working correctly inside the create_atoms command or
whatever other facility it uses. this is a rather new facility and -
like i already mentioned - i don't see any cases yet, where this
feature would have been thoroughly tested.

please try adding the following modification to create_atoms.cpp

[[email protected]... src]$ git diff HEAD~1 create_atoms.cpp
diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index 9777f23..ef18229 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -800,6 +800,10 @@ void CreateAtoms::add_molecule(double *center)
     n = atom->nlocal - 1;
     atom->add_molecule_atom(onemol,m,n,0);
   }
+ atom->nbonds += onemol->nbonds;
+ atom->nangles += onemol->nangles;
+ atom->ndihedrals += onemol->ndihedrals;
+ atom->nimpropers += onemol->nimpropers;
}

/* ----------------------------------------------------------------------

Dear Axel,

Thanks for your time. Your suggested addition (in create_atoms.cpp) seems to do the work. Now, the write_restart file is printing out all the info including correct impropers and all Bond, Angle and Improper connectivity information.

Many thanks and best regards,

Vikas