More than one molecule template file in a single simulation

how can I simulate a mixture of two types of molecules in atom style template using 2 different molecule template file

Something like this should work:

molecule twomols one.mol two.mol
atom_style template twomols

Or just use atom style full. To benefit from atom style template some rather uncommon conditions are required.

Actually I need to use create atom command with both the template.
and I also need the template information of both the molecules

You can do that with atom style full. There is no requirement of using atom style template for that.

Nothing stops you from using the molecule command multiple times.

molecule small ring40.txt
molecule big bigring.txt offset 4 1 2 0 0

atom_style template small
atom_style template big


create_atoms 0 single 0 0 0 mol small 41523 rotate 315 0 0 1
create_atoms 0 single 0 0 0 mol big 42541 rotate 315 0 0 1

I have used the above command then it gives the following error
ERROR on proc 0: Bond atom missing in image check (src/domain.cpp:794) at timestep 0

But when I used the atomstyle full
It did not give any error

The second atom style command here will wipe out the first.

I need both the template
what should I do

I already told you. You are not paying attention.

In atom style full LAMMPS does not store the template information
which I need

So what?

For what?

Please note that I made two suggestions.

I have my own fix which need template information in order to work

In this case the create atoms command only use the first molecule file but I need both

I see the following options:

  • you modify the code for the create_atoms command so you can select which of the multiple molecules is created (if you are successful with this, please consider submitting the change together with an updated documentation on github)
  • you use a data file instead of create_atoms with molecule files, you can assign the template index in the Atoms section see the documentation of the read_data command
  • you use atom style full and individual molecule commands. then you change your custom fix to use a different property to identify the molecule index, e.g. the molecule ID (just reset it to 0 or 1 for all affected atoms). If you don’t want to use the molecule ID, you could also define a new per-atom integer property with fix property/atom and set, look up, and use that in your fix.

@akohlmey is there anything else i should know which is not documented in the template paragraphs at https://docs.lammps.org/atom_style.html ?

" When using the template style with a molecule template that contains multiple molecules, you should ensure the atom types, bond types, angle_types, etc in all the molecules are consistent. E.g. if one molecule represents H2O and another CO2, then you probably do not want each molecule file to define 2 atom types and a single bond type, because they will conflict with each other when a mixture system of H2O and CO2 molecules is defined, e.g. by the read_data command. Rather the H2O molecule should define atom types 1 and 2, and bond type 1. And the CO2 molecule should define atom types 3 and 4 (or atom types 3 and 2 if a single oxygen type is desired), and bond type 2."

and

" When using the hybrid style, you cannot combine the template style with another molecular style that stores bond, angle, etc info on a per-atom basis."

I don’t think anybody seriously uses atom style template unless there is a large benefit in speed (usually there isn’t) or memory savings that matter (most machines have lots of RAM these days). Given that LAMMPS can scale well, usually it is much less effort to apply for more CPU time and save the headaches of modifying and debugging inputs.

continued as a new topic instead since this is no longer relevant to this one.