Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96288101
compute_variable.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Dec 24, 14:39
Size
1 KB
Mime Type
text/html
Expires
Thu, Dec 26, 14:39 (2 d)
Engine
blob
Format
Raw Data
Handle
23150288
Attached To
rLAMMPS lammps
compute_variable.html
View Options
<HTML>
<CENTER><A
HREF =
"http://lammps.sandia.gov"
>
LAMMPS WWW Site
</A>
-
<A
HREF =
"Manual.html"
>
LAMMPS Documentation
</A>
-
<A
HREF =
"Section_commands.html#comm"
>
LAMMPS Commands
</A>
</CENTER>
<HR>
<H3>
compute variable command
</H3>
<P><B>
Syntax:
</B>
</P>
<PRE>
compute ID group-ID variable name
</PRE>
<UL><LI>
ID, group-ID are documented in
<A
HREF =
"compute.html"
>
compute
</A>
command
<LI>
variable/atom = style name of this compute command
<LI>
name = variable name to invoke to compute a scalar quantity
</UL>
<P><B>
Examples:
</B>
</P>
<PRE>
compute 1 all variable myTemp
</PRE>
<P><B>
Description:
</B>
</P>
<P>
Define a computation that calculates a formula that returns a scalar
quantity. This quantity can be time averaged and output via the
<A
HREF =
"fix_ave_time.html"
>
fix
ave/time
</A>
command. It could also be output via the
<A
HREF =
"thermo_style.html"
>
thermo_style custom
</A>
command, although it makes
more sense to access the variable directly in this case.
</P>
<P>
The formula is defined by the
<A
HREF =
"variable.html"
>
variable equal
</A>
command.
A variable of style
<I>
equal
</I>
can access properties of the system, such
as volume or temperature, and also reference individual atom
attributes, such as its coordinates or velocity.
</P>
<P>
For example, these 3 commands would time average the system density
(assuming the volume fluctuates) temperature and output the average
value periodically to the file den.profile:
</P>
<PRE>
variable den equal div(atoms,vol)
compute density all variable den
fix 1 all ave/time 1 1000 density 0 den.profile
</PRE>
<P><B>
Restrictions:
</B>
none
</P>
<P><B>
Related commands:
</B>
</P>
<P><A
HREF =
"fix_ave_time.html"
>
fix ave/time
</A>
,
<A
HREF =
"variable.html"
>
variable
</A>
</P>
<P><B>
Default:
</B>
none
</P>
</HTML>
Event Timeline
Log In to Comment