LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] IF command documentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] IF command documentation


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Thu, 26 Oct 2017 17:00:58 -0400

On Thu, Oct 26, 2017 at 1:56 PM, Jatin Kashyap <jk435@...6426...> wrote:
> Hello LAMMPS users & Developers,
>
> I’m writing this email about documentation page of “if" command. I think, in
> the docs it will be more user friendly by explicitly mentioning about
> putting Boolean expression within quotes. I can see that for commands to be
> executed later on but for the Boolean expression it’s only given in the
> examples, not mentioned in the syntax of the commend. Just thought it will
> be helpful to new users like me.

near that statement, it says that the syntax of the booleans is
explained below. and further down you'll see:

Note that each expression is a single argument within the if command.
Thus if you want to include spaces in the expression for clarity, you
must enclose the entire expression in quotes.

so actually quotes are *not* required, only if there are spaces in the
boolean expression. thus this will work, too.

if 2==1 then "variable t equal 5" else "variable t equal 10"
print "$t"
10


as with all kinds of documentation. the answer is often there, but it
may require that you look at it with more care or check it multiple
times.




>
> Thank you.
>
>
> ——
> Jatin Kashyap (https://web.njit.edu/~jk435/)
> Ph.D. Student
> DDLab Group
> Department of Mechanical and Industrial Engineering
> New Jersey Institute of Technology (NJIT)
> Newark, NJ 07102
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>



-- 
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.