Open amirhs1 opened 2 years ago
Sure, Moltemplate is agnostic to the commands that you pass to LAMMPS. You only need to protect the variables that are not ment to be processed by Moltemplate. Therefore, the line that goes in your forcefield.lt script is:
variable cutoff11 equal \$\{sig1\}*1.12246205
Thanks for your response. Since I am new to Moltemplate, can I continue asking questions in this issue as I encounter difficulties in designing my system? Or it is better to open new issues for new (and possibly trivial) questions?
Thanks Otello!
Actually Otello recently supplied an file which demonstrates how to do this. See below:
https://github.com/jewettaij/moltemplate/blob/master/tests/test_molc_files/system.lt
Yes, the \ is necessary before the $ and {} characters, because those characters have special meanings in moltemplate.
(If you put "${sign1}" instead of "\$\{sign1\}" in your LT file, I'm not sure what will happen. Moltemplate will probably assume you are referring to an $atom:, $bond:, $angle:,... integer counter (or some type of new user-defined counter category named "sign1"), and then print out some incomprehensible error message. (Is that what happened?))
If you have additional questions, I suggest starting new issues in the github issue tracker (instead of burying them here in this thread). It may be a few days before I reply to them, but I do notice it when new issues appear on the moltemplate github page. (I'm vain enough to check that page regularly.)
This question was fine. If your future questions are really specific to what you are working on and unlikely to be something that anyone else would care about, then I suggest emailing them to me instead (jewett.aij -at- gmail.com).
Oh, and if you are creating a force-field and want other people to use it, great! Please send it to us, along with an example. (We like examples...)
Another good place where to discuss force field development is the LAMMPS section of https://matsci.org/, which will soon replace the historic mailing list.
I think I'll leave this open for a little while in case anyone else has the same question. (Reopening this issue...)
Hi,
I am new to moltemplate, so I am sorry if I asking a (trivial) question here. I wanna create forcefield.lt. Can I use LAMMPS
variable
command in my script? I would like then use this forcefield.lt as a template and produce a collection of LAMMPS input files by bash scripts.For instance I want to have the following command in my LAMMPS script
variable cutoff11 equal ${sig1}*1.12246205
where
sig1
is then given to LAMMPS as an argument with the command-line optionlmp_serial -var sig1 VALUE
.Please see the part of the input file that I want to use
variable
command in.example.txt
Thanks
Amir