LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Calculate Atom Positions - Invalid Thermo Keyword in Variable Formula
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Calculate Atom Positions - Invalid Thermo Keyword in Variable Formula

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Mon, 6 Nov 2017 09:47:33 -0500

On Mon, Nov 6, 2017 at 9:38 AM, Julien Guénolé <julien.guenole@...4839...> wrote:
On 04/11/17 18:22, Terry Price wrote:

I'm trying to calculate the position of the atoms in the simulation at the bottom of the email.

I have the line 
compute abc all property/atom xs

Which I expect to be assigned to the variable 'pos' with the line
variable pos equal "abc"
it should be:
variable pos equal c_abc

​only that you cannot assign a per-atom property to an equal style variable.



and printed with the line
print "position is ${pos};"

however, when I run this, I get the error

ERROR: Invalid thermo keyword in variable formula (../variable.cpp:2037)
Last command: position is ${pos

I tried using the -echo screen switch to find out what line it's having a problem at.  It looks like it's my print line.

After looking at the print command documentation, I removed the curly braces and tried the line

print "position is $pos"

However, this gave me the error

instead of my original position print line.

ERROR on proc 0: Substitution for illegal variable (../input.cpp:533)
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD 
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.

any clues as to how I can go about resolving this?

# Find minimum energy fcc configuration
# Mark Tschopp, 2010

# ---------- Initialize Simulation ---------------------
units metal
dimension 3
boundary p p p
atom_style atomic
atom_modify map array

# ---------- Create Atoms ---------------------
lattice fcc 4
region box block 0 1 0 1 0 1 units lattice
create_box 1 box

lattice fcc 4 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
create_atoms 1 box
replicate 1 1 1

# ---------- Define Interatomic Potential ---------------------
pair_style eam/alloy
pair_coeff * * Al99.eam.alloy Al
neighbor 2.0 bin
neigh_modify delay 10 check yes

# ---------- Define Settings ---------------------
compute engr all pe/atom
compute eatoms all reduce sum c_engr
compute abc all property/atom xs

# ---------- Run Minimization ---------------------
reset_timestep 0
fix 1 all box/relax iso 0.0 vmax 0.001
thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms
min_style cg
minimize 1e-25 1e-25 5000 10000

variable pos equal "abc"
variable natoms equal "count(all)"
variable teng equal "c_eatoms"
variable length equal "lx"
variable ecoh equal "v_teng/v_natoms"

dump d0 all image 1 dump.*.jpg type type

print " "
print "----BEGIN PRINT----"
print "position is ${pos};"
print "Total energy (eV) = ${teng};"
print "Number of atoms = ${natoms};"
print "Lattice constant (Angstoms) = ${length};"
print "Cohesive energy (eV) = ${ecoh};"
print "----END PRINT----"
print " "

print "All done!"

Dr. Julien GUÉNOLÉ
Postdoctoral researcher
Department of Materials Science & Engineering
Institute 1: General Material Properties
Friedrich-Alexander-University Erlangen-Nürnberg
Martensstr. 5, 91058 Erlangen, Germany
-----------------------  Office 3.40
Phone [office] (+49) 91 31 85 27 486
Email          julien.guenole@...4839...
Twitter        @nanouayeur

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Dr. Axel Kohlmeyer  akohlmey@...12...24...
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.