Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open file "Data Atoms.template" for reading. #94

Open
luizpzidoi opened this issue Oct 17, 2023 · 6 comments
Open

Unable to open file "Data Atoms.template" for reading. #94

luizpzidoi opened this issue Oct 17, 2023 · 6 comments

Comments

@luizpzidoi
Copy link

Hi! I hope you are doing well!

I'm trying to run moltemplate.sh but I always get the following message:
########################################################

WARNING: atom_style unspecified

--> "Data Atoms" column data has an unknown format

Assuming atom_style = "full"

########################################################

And this happens if I try to run moltemplate.sh both for some example of the code and for some system I created. At the end of execution the following message is displayed:
lttree_postprocess.py v0.6.2 2021-4-20

Error(lttree_postprocess.py): Unable to open file
"Data Atoms.template"
for reading. (Do your files lack a "Data Atoms" section?)
(To override this error, run moltemplate using the "-nocheck" argument.)

Thank you!

@luizpzidoi luizpzidoi changed the title Problema running moltemplate.sh Problem running moltemplate.sh Oct 17, 2023
@hothello
Copy link
Contributor

The first warning is to inform the user that the atom_style full structure is assumed in your Data Atoms section. To get rid of this warning, set the style explicitly with: moltemplate.sh -atomstyle full yourscript.lt.

For the second error, it is impossible to say what is wrong without you sharing your input files.

@luizpzidoi
Copy link
Author

Hi @hothello. I hope you are doing well.

Thank you so much for reply.
The first warning was caused by "atomstyle" parameter.
Thus the second, the error was in the input file, in the coordinates of the atoms. In moltemplate, the atoms name will be diferent. This error was happening because, for example, all carbon atoms was "C" and the correct is "C1, C2, etc".

@jewettaij jewettaij changed the title Problem running moltemplate.sh Unable to open file "Data Atoms.template" for reading. Dec 4, 2024
@JShake7227
Copy link

Hi all,

I'm experiencing the second error mentioned above. It is not working with my system. Can anyone point me in the right direction of where I'm going wrong that doesn't permit a Data Atoms to be written?

Code

import "oplsaa.lt"
PEEK inherits OPLSAA {
create_var {$mol} # Force all monomers to share the same molecule-ID

atom-id mol-id atom-type charge x y z

write('Data Atoms') {
$atom:c11 $mol @atom:90 0.0 -6.354 0.347 -0.027 #1_ester_benzene
$atom:c12 $mol @atom:90 0.0 -6.172 1.723 0.175
$atom:c13 $mol @atom:90 0.0-4.906 2.333 0.186
$atom:c14 $mol @atom:90 0.0 -3.739 1.588 -0.023
$atom:c15 $mol @atom:90 0.0 -3.888 0.231 -0.288
$atom:c16 $mol @atom:90 0.0 -5.166 -0.366 -0.26
$atom:h12 $mol @atom:91 0.0 -7.053 2.345 0.33
$atom:h13 $mol @atom:91 0.0 -4.86 3.405 0.33
$atom:h15 $mol @atom:91 0.0 -3.062 -0.415 -0.546
$atom:h16 $mol @atom:91 0.0 -5.249 -1.438 -0.44
$atom:o11 $mol @atom:119 0.0 -7.499 -0.208 -0.012
$atom:c21 $mol @atom:222 0.0 -2.441 2.335 0.009 #2_Ketone
$atom:o21 $mol @atom:223 0.0 -2.493 3.574 0.03
$atom:c31 $mol @atom:90 0.0 -0.737 0.463 0.43 	#3_ester_benzene"
$atom:c32 $mol @atom:90 0.0 -1.067 1.752 0.013
$atom:c33 $mol @atom:90 0.0 -0.004 2.593 -0.386
$atom:c34 $mol @atom:90 0.0 1.33 2.156 -0.413
$atom:c35 $mol @atom:90 0.0 1.652 0.877 0.006
$atom:c36 $mol @atom:90 0.0 0.6 0.033 0.404
$atom:h31 $mol @atom:91 0.0 -1.484 -0.23 0.807
$atom:h33 $mol @atom:91 0.0 -0.227 3.618 -0.688
$atom:h34 $mol @atom:91 0.0 2.07 2.848 -0.796
$atom:h36 $mol @atom:91 0.0 0.828 -0.994 0.699
$atom:o31 $mol @atom:119 0.0 2.87 0.259 0.01
$atom:c41 $mol @atom:90 0.0 4.106 0.841 0.017 #4_non_terminal_benzene
$atom:c42 $mol @atom:90 0.0 4.453 2.169 0.234
$atom:c43 $mol @atom:90 0.0 5.8 2.565 0.204
$atom:c44 $mol @atom:90 0.0 6.815 1.627 0.014
$atom:c45 $mol @atom:90 0.0 6.484 0.286 -0.148
$atom:c46 $mol @atom:90 0.0 5.14 -0.096 -0.154
$atom:h42 $mol @atom:91 0.0 3.721 2.932 0.453
$atom:h43 $mol @atom:91 0.0 6.064 3.611 0.345
$atom:h44 $mol @atom:91 0.0 7.859 1.934 0.009
$atom:h45 $mol @atom:91 0.0 7.265 -0.465 -0.267
$atom:h46 $mol @atom:91 0.0 4.892 -1.149 -0.278

}

Data Bond List

write('Data Bond List') {
$bond:c12  $atom:c11 $atom:c12 # 1_ester_benzene
$bond:c23  $atom:c12 $atom:c13
$bond:c34  $atom:c13 $atom:c14
$bond:c45  $atom:c14 $atom:c15
$bond:c56  $atom:c15 $atom:c16
$bond:c61  $atom:c16 $atom:c11
$bond:c11o11 $atom:c11 $atom:o11 
$bond:c2h1 $atom:c12 $atom:h12
$bond:c3h3 $atom:c13 $atom:h13
$bond:c5h5 $atom:c15 $atom:h15
$bond:c6h6 $atom:c16 $atom:h16	
$bond:c21o21 $atom:c21 $atom:o21 #2_Ketone
$bond:c3132  $atom:c31 $atom:c32 #3_ester_benzene
$bond:c3233  $atom:c32 $atom:c33
$bond:c3334  $atom:c33 $atom:c34
$bond:c3435  $atom:c34 $atom:c35
$bond:c3536  $atom:c35 $atom:c36
$bond:c3631  $atom:c36 $atom:c31
$bond:c31h31 $atom:c31 $atom:h31
$bond:c33h33 $atom:c33 $atom:h33
$bond:c34h34 $atom:c34 $atom:h34
$bond:c35o31 $atom:c35 $atom:o31
$bond:c36h36 $atom:c36 $atom:h36
$bond:c4142  $atom:c41 $atom:c42 #4_non_terminal_benzene Start C1 Cation
$bond:c4243  $atom:c42 $atom:c43
$bond:c4344  $atom:c43 $atom:c44
$bond:c4445  $atom:c44 $atom:c45
$bond:c4546  $atom:c45 $atom:c46
$bond:c4641  $atom:c46 $atom:c41
$bond:c42h42 $atom:c42 $atom:h42
$bond:c43h43 $atom:c43 $atom:h43
$bond:c45h45 $atom:c45 $atom:h45
$bond:c46h46 $atom:c46 $atom:h46
$bond:b1 $atom:c14 $atom:c21	#Monomer Bonds
$bond:b2 $atom:c21 $atom:c32
$bond:b3 $atom:o31 $atom:c41

}
} # PEEK

Thank you and much appreciated.

@hothello
Copy link
Contributor

hothello commented Feb 4, 2025

Hi @JShake7227,
What you have shared is the definition of a molecule called PEEK. I suspect you compiled this script with moltemplate, which of course ends with an error because there isn't any statement to create a data file, such as:

sample = new PEEK[5].move(5,0,0)

Please take a look at the LAMMPS manual, Section 8.6.4: Moltemplate Tutorial. You need to create a master file that imports the OPLS-AA force field file and the PEEK molecule definition file and contains all the relevant sections to create a valid input deck for LAMMPS.

@JShake7227
Copy link

Hi @hothello,

Thank you for the guidance! That was the crux of my issue.

@jewettaij
Copy link
Owner

jewettaij commented Feb 5, 2025

Yes, once you have defined a molecule, you need to specify how many copies of the molecule you want (and, perhaps also where you want them to go). (Otherwise a "Data Atoms.template" file will not be created.) That's what the "new" command does. (By convention, the "new" command(s) normally goes in the "system.lt" file, but you can name this file anything you want.)

As Otello mentioned, section 8.4 of the moltemplate manual explains how to arrange molecules in a rectangular grid.

(Separate issue: If you don't want to arrange your molecules in a 3-D grid, you can try using PACKMOL and run moltemplate.sh with the -xyz command line argument. Also see section. 8.9.1 of the moltemplate manual, for an alternative strategy to mix arbitrary numbers of different molecules together that doesn't require PACKMOL.)

But I'd start with the introductory chapter (chapter 4). It's really short.

And thank you again, Otello!
(Very much appreciated!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@jewettaij @hothello @luizpzidoi @JShake7227 and others