Moltemplate Error : There are no atoms in your system.

Hi
I used moltemplate for making Graphene Oxide. I used this package because i want to add functional group’s randomly. I want to Use random command of moltemplate. first i made an script like butane.lt example of moltemplate. i made two molecule . one of them is graphene unitcell and another one was graphene oxide with epoxide functional group. look like the example i made a forcefield file and a mixture file which use random command to make a super cell from those two unitcells. when i tried to run that i faced with this error :

There are no atoms in your system .

then I tried to run moltemplate example(the third example :https://www.moltemplate.org/visual_examples.html ) but again i faced with that error.

what should i do to solve this error? ( I Will attache my scripts with this mail.)

I would highly appropriate any advise or comments.

Regards

Isaac

mixture.lt (310 Bytes)

Epoxide.lt (584 Bytes)

Graphene.lt (407 Bytes)

ForceField.lt (1.89 KB)

Hi Isaac

  I assume you are running moltemplate using "moltemplate
mixtures.lt", since the "mixtures.lt" file contains the "new random"
command. If that is the case, then the problem is that if you enclose
a "new" (or a "new random") command inside the definition of an object
(eg , nothing will happen until somebody eventually makes a copy
(instance) of that object. You have defined an Object (class) of type
"Sheet", but you never told moltemplate to instantiate any copies of
that "Sheet".

You need a line somewhere which resembles this:

sheet = new Sheet

(By convention, lines like this are placed inside a file named
"system.lt", but you can put it in any file as long as you refer to
that file later with an "import" statement. You don't have to have a
file named "system.lt".)

  For a similar example, see the 4th example (the nanotube+water example):
https://www.moltemplate.org/visual_examples.html#nanotube+water
In that example, the "graphene_walls.lt" file defines a "Wall" object
consisting of a single-layer of graphene carbon. After that, there
are two "new" commands to instantiate two different copies of that
wall at different positions:
wall1 = new Wall.move(0, 0, 32.0)
wall2 = new Wall.move(0, 0, 58.26)
Without these commands, you would get the same error message.

Hope that helps.
Cool example.

Andrew
P.S. If you get this example working, I'd love to include it with moltemplate.

‪On Tue, Mar 12, 2019 at 3:46 PM ‫اسحاق خداپرست سیاهمزگی‬‎
<[email protected]> wrote:‬

I have two more comments:

1) Try using the version of the "new random" command described in
section 7.9.1 of the moltemplate manual (p.39). An example of how to
do this is shown below. (If you do it the other way, then the number
of objects of each type (Graphene" and "Epoxide" in your example) will
vary depending on the random seed you used in the "new random" command
("123456" in your example).)

2) In the "mixture.lt" file you posted, you defined a "Sheet" object:

Sheet inherits ForceField {
   cells = new random([Graphene, Epoxide], [7, 2], 123456)
   [3].move(2.4595121467478, 0, 0)
   [3].move(1.2297560733739, 2.13, 0)
}
Keep in mind that once you define your small 3x3 "Sheet" object (or
any moltemplate object, for that matter), his definition is written in
stone. If you are planning to make multiple copies of this "Sheet"
object later on, then keep in mind that they will all identical. For
example if you use:

sheets = new Sheet
   [4].move(7.3785,0,0)
   [4].move(3.68927,6.39,0)

... then each of the 16 (4x4) "Sheet"s in the system will be
identical. (The 3x3 pattern in each Sheet will be the same.)
Presumably, this is not what you want. Presumably you want the
contents of all of the sheets to be random:

If you want to make a large sheet (for example 12x12), then I would
put the entire thing within a single "new random" command:
   cells = new random([Graphene, Epoxide], [115, 29], 123456)
   [12].move(2.4595121467478, 0, 0)
   [12].move(1.2297560733739, 2.13, 0)

I've attached a copy of your "mixture.lt" file with these changes.

‪On Tue, Mar 12, 2019 at 3:46 PM ‫اسحاق خداپرست سیاهمزگی‬‎
> then I tried to run moltemplate example(the third example :https://www.moltemplate.org/visual_examples.html ) but again i faced with that error.

I was unable to reproduce this error with that example. Try compiling
the example using

moltemplate.sh system.lt

P.S. If you get this example working, I'd love to include it with moltemplate.

If you don't feel comfortable sharing that, even just a pretty picture
would be great.

Incidentally, if you haven't read the email I sent earlier in reply to
this post, read that too. (It explains how to get past the error
message that was troubling you. This email was about other issues
which may come up later.)

Cheers

Andrew

mixture.lt (273 Bytes)