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

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


From: Terry Price <terry.price@...7194...>
Date: Sat, 4 Nov 2017 13:22:42 -0400

Hi,

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"

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 ---------------------
clear
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!"




--
-Terry J. Price
Nuclear Engineering Student
E-Mail: Terry.price@...12...7195...
Note:  Terry.Price@...1064...196... no longer works as of January 2016.