From 47b87458b0b45e74513941e6edcecf3199069da1 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 9 Feb 2007 21:37:30 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@281 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Manual.html | 16 +- doc/Manual.txt | 12 +- doc/Section_commands.html | 155 +++++---- doc/Section_commands.txt | 306 +++++++++-------- doc/Section_errors.html | 4 +- doc/Section_errors.txt | 4 +- doc/Section_howto.html | 94 +++--- doc/Section_howto.txt | 94 +++--- doc/Section_modify.html | 678 ++++++++++++++++++++------------------ doc/Section_modify.txt | 611 +++++++++++++++++----------------- doc/Section_start.html | 276 +++++++++------- doc/Section_start.txt | 272 ++++++++------- doc/angle_coeff.html | 14 +- doc/angle_coeff.txt | 14 +- doc/angle_style.html | 14 +- doc/angle_style.txt | 14 +- doc/atom_style.html | 16 +- doc/atom_style.txt | 14 +- doc/bond_coeff.html | 18 +- doc/bond_coeff.txt | 18 +- doc/bond_style.html | 18 +- doc/bond_style.txt | 18 +- doc/dihedral_coeff.html | 16 +- doc/dihedral_coeff.txt | 16 +- doc/dihedral_style.html | 16 +- doc/dihedral_style.txt | 16 +- doc/dump.html | 165 +++++----- doc/dump.txt | 162 ++++----- doc/fix_indent.html | 12 +- doc/fix_indent.txt | 12 +- doc/fix_modify.html | 56 ++-- doc/fix_modify.txt | 56 ++-- doc/fix_nph.html | 74 +++-- doc/fix_nph.txt | 71 ++-- doc/fix_npt.html | 67 ++-- doc/fix_npt.txt | 64 ++-- doc/fix_nvt.html | 42 ++- doc/fix_nvt.txt | 42 ++- doc/fix_orient_fcc.html | 10 +- doc/fix_orient_fcc.txt | 10 +- doc/fix_print.html | 33 +- doc/fix_print.txt | 33 +- doc/fix_temp_rescale.html | 93 +++--- doc/fix_temp_rescale.txt | 86 ++--- doc/fix_wall_lj126.html | 11 +- doc/fix_wall_lj126.txt | 11 +- doc/fix_wall_lj93.html | 11 +- doc/fix_wall_lj93.txt | 11 +- doc/improper_coeff.html | 10 +- doc/improper_coeff.txt | 10 +- doc/improper_style.html | 10 +- doc/improper_style.txt | 10 +- doc/log.html | 2 +- doc/log.txt | 2 +- doc/neighbor.html | 2 +- doc/neighbor.txt | 2 +- doc/next.html | 2 +- doc/next.txt | 2 +- doc/pair_coeff.html | 65 ++-- doc/pair_coeff.txt | 65 ++-- doc/pair_style.html | 92 +++--- doc/pair_style.txt | 92 +++--- doc/print.html | 25 +- doc/print.txt | 25 +- doc/processors.html | 2 +- doc/processors.txt | 2 +- doc/read_data.html | 76 ++--- doc/read_data.txt | 74 ++--- doc/temper.html | 2 +- doc/temper.txt | 2 +- doc/thermo.html | 12 +- doc/thermo.txt | 12 +- doc/thermo_modify.html | 95 ++++-- doc/thermo_modify.txt | 91 +++-- doc/thermo_style.html | 186 ++++++++--- doc/thermo_style.txt | 184 ++++++++--- doc/variable.html | 210 ++++++++---- doc/variable.txt | 217 +++++++----- 78 files changed, 3062 insertions(+), 2395 deletions(-) diff --git a/doc/Manual.html b/doc/Manual.html index 98558dd568..d5d8ee5714 100644 --- a/doc/Manual.html +++ b/doc/Manual.html @@ -59,13 +59,17 @@ we can improve the LAMMPS documentation.
2.2 Making LAMMPS
- 2.3 Running LAMMPS + 2.3 Making LAMMPS with optional packages
- 2.4 Command-line options + 2.4 Building LAMMPS as a library
- 2.5 Screen output + 2.5 Running LAMMPS
- 2.6 Tips for users of previous versions + 2.6 Command-line options +
+ 2.7 Screen output +
+ 2.8 Tips for users of previous versions
  • Commands @@ -182,6 +186,10 @@ we can improve the LAMMPS documentation. + + + + diff --git a/doc/Manual.txt b/doc/Manual.txt index 2606c35138..c5d140d9b5 100644 --- a/doc/Manual.txt +++ b/doc/Manual.txt @@ -47,10 +47,12 @@ we can improve the LAMMPS documentation. "Getting started"_Section_start.html :l 2.1 "What's in the LAMMPS distribution"_2_1 :ulb,b 2.2 "Making LAMMPS"_2_2 :b - 2.3 "Running LAMMPS"_2_3 :b - 2.4 "Command-line options"_2_4 :b - 2.5 "Screen output"_2_5 :b - 2.6 "Tips for users of previous versions"_2_6 :ule,b + 2.3 "Making LAMMPS with optional packages"_#2_3 :b + 2.4 "Building LAMMPS as a library"_#2_4 :b + 2.5 "Running LAMMPS"_2_5 :b + 2.6 "Command-line options"_2_6 :b + 2.7 "Screen output"_2_7 :b + 2.8 "Tips for users of previous versions"_2_8 :ule,b "Commands"_Section_commands.html :l 3.1 "LAMMPS input script"_3_1 :ulb,b 3.2 "Parsing rules"_3_2 :b @@ -93,6 +95,8 @@ we can improve the LAMMPS documentation. :link(2_4,Section_start.html#2_4) :link(2_5,Section_start.html#2_5) :link(2_6,Section_start.html#2_6) +:link(2_7,Section_start.html#2_7) +:link(2_8,Section_start.html#2_8) :link(3_1,Section_commands.html#3_1) :link(3_2,Section_commands.html#3_2) diff --git a/doc/Section_commands.html b/doc/Section_commands.html index ba27ef7aaa..beddd7c494 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -181,7 +181,6 @@ set in the read-in files): pair_coeff, special_bonds.

    Various simulation parameters are set by these commands: -temperature, temp_modify, neighbor, neigh_modify, group, timestep, reset_timestep, run_style, @@ -190,8 +189,13 @@ set in the read-in files): pair_coeff,

    Fixes impose a variety of boundary conditions, time integration, and diagnostic options. The fix command comes in many flavors.

    -

    Output options are set by these commands: thermo, -dump, restart. +

    Various computations can be specified for execution during a +simulation using the compute, +compute_modify, and variable +commands. +

    +

    Output options are set by the thermo, dump, +and restart commands.

    (4) Run a simulation

    @@ -245,14 +249,17 @@ in the command's documentation. min_modify, min_style, neigh_modify, neighbor, reset_timestep, run_style, -set, temp_modify, -temperature, timestep, -velocity +set, timestep, velocity

    Fixes:

    fix, fix_modify, unfix

    +

    Computes: +

    +

    compute, compute_modify, +uncompute +

    Output:

    dump, dump_modify, @@ -288,83 +295,109 @@ in the command's documentation.

    - - - - - - - - - - - + + + + + + + + + +
    angle_coeffangle_styleatom_modifyatom_stylebond_coeffbond_style
    boundaryclearcreate_atomscreate_boxdelete_atomsdelete_bonds
    dielectricdihedral_coeffdihedral_styledimensiondipoledisplace_atoms
    dumpdump_modifyechofixfix_modifygroup
    improper_coeffimproper_styleincludejumpkspace_modifykspace_style
    labellatticelogmassminimizemin_modify
    min_styleneigh_modifyneighbornewtonnextpair_coeff
    pair_modifypair_stylepair_writeprintprocessorsread_data
    read_restartregionreplicatereset_timesteprestartrun
    run_stylesetshellspecial_bondstemp_modifytemper
    temperaturethermothermo_modifythermo_styletimestepundump
    unfixunitsvariablevelocitywrite_restart +
    boundaryclearcomputecompute_modifycreate_atomscreate_box
    delete_atomsdelete_bondsdielectricdihedral_coeffdihedral_styledimension
    dipoledisplace_atomsdumpdump_modifyechofix
    fix_modifygroupimproper_coeffimproper_styleincludejump
    kspace_modifykspace_stylelabellatticelogmass
    minimizemin_modifymin_styleneigh_modifyneighbornewton
    nextpair_coeffpair_modifypair_stylepair_writeprint
    processorsread_dataread_restartregionreplicatereset_timestep
    restartrunrun_stylesetshellspecial_bonds
    temperthermothermo_modifythermo_styletimestepuncompute
    undumpunfixunitsvariablevelocitywrite_restart
    -

    Fix styles. See the fix command for one-line descriptions -or click on the command itself for a full description: -

    -
    - - - - - - - -
    fix addforcefix aveforcefix comfix depositfix dragfix efield
    fix enforce2dfix freezefix gran/diagfix gravityfix gyrationfix indent
    fix langevinfix lineforcefix msdfix momentumfix nphfix npt
    fix nvefix nve/granfix nvtfix orient/fccfix planeforcefix poems
    fix pourfix printfix rdffix recenterfix rigidfix setforce
    fix shakefix springfix spring/rgfix spring/selffix temp/rescalefix tmd
    fix uniaxialfix vcmfix viscousfix volume/rescalefix wall/granfix wall/lj93
    fix wall/lj126fix wall/reflectfix wiggle -
    +
    -

    Pair styles. See the pair_style command for an -overview of pair potentials. Click on the style itself for a full +

    Fix commands. See the fix command for one-line +descriptions of each style or click on the style itself for a full description:

    - - - - - - - - + + + + +
    nonehybridbuckbuck/coul/cut
    buck/coul/longdpdeameam/alloy
    eam/fsgran/hertziangran/historygran/no_history
    lj/charmm/coul/charmmlj/charmm/coul/charmm/implicitlj/charmm/coul/longlj/class2
    lj/class2/coul/cutlj/class2/coul/longlj/cutlj/cut/coul/cut
    lj/cut/coul/debyelj/cut/coul/longlj/cut/coul/long/tip4plj/expand
    lj/smoothmeammorsesoft
    swtabletersoffyukawa +
    addforceaveforcecomdepositdragefieldenforce2dfreeze
    gran/diaggravitygyrationindentlangevinlineforcemsdmomentum
    nphnptnvenve/grannvtorient/fccplaneforcepoems
    pourprintrdfrecenterrigidsetforceshakespring
    spring/rgspring/selftemp/rescaletmduniaxialvcmviscousvolume/rescale
    wall/granwall/lj93wall/lj126wall/reflectwiggle
    -

    Bond styles. See the bond_style command for an -overview of bond potentials. Click on the style itself for a full +


    + +

    Compute commands. See the compute command for one-line +descriptions of each style or click on the style itself for a full description:

    - - - +
    nonehybridclass2fene
    fene/expandharmonicmorsenonlinear
    quartic +
    centro/atomepair/atometotal/atomke/atompressurerotate/dipole
    rotate/granstress/atomtemptemp/partialtemp/ramptemp/region
    -

    Angle styles. See the angle_style command for an -overview of angle potentials. Click on the style itself for a full +


    + +

    Pair_style potentials. See the pair_style command +for an overview of pair potentials. Click on the style itself for a +full description: +

    +
    + + + + + + + + + +
    nonehybridbuckbuck/coul/cut
    buck/coul/longdpdeameam/opt
    eam/alloyeam/alloy/opteam/fseam/fs/opt
    gran/hertziangran/historygran/no_historylj/charmm/coul/charmm
    lj/charmm/coul/charmm/implicitlj/charmm/coul/longlj/charmm/coul/long/optlj/class2
    lj/class2/coul/cutlj/class2/coul/longlj/cutlj/cut/opt
    lj/cut/coul/cutlj/cut/coul/debyelj/cut/coul/longlj/cut/coul/long/tip4p
    lj/expandlj/smoothmeammorse
    morse/optsoftswtable
    tersoffyukawa +
    + +
    + +

    Bond_style potentials. See the bond_style command +for an overview of bond potentials. Click on the style itself for a +full description: +

    +
    + + +
    nonehybridclass2fene
    fene/expandharmonicmorsenonlinear
    quartic +
    + +
    + +

    Angle_style potentials. See the angle_style +command for an overview of angle potentials. Click on the style +itself for a full description: +

    +
    + +
    nonehybridcharmmclass2
    cosinecosine/squaredharmonic +
    + +
    + +

    Dihedral_style potentials. See the +dihedral_style command for an overview of +dihedral potentials. Click on the style itself for a full description:

    - - +
    nonehybridcharmmclass2cosinecosine/squared
    harmonic +
    nonehybridcharmmclass2
    harmonichelixmulti/harmonicopls
    -

    Dihedral styles. See the dihedral_style command -for an overview of dihedral potentials. Click on the style itself for -a full description: -

    -
    - -
    nonehybridcharmmclass2harmonichelixmulti/harmonic
    opls -
    +
    -

    Improper styles. See the improper_style command for an -overview of improper potentials. Click on the style itself for a full +

    Improper_style potentials. See the +improper_style command for an overview of +improper potentials. Click on the style itself for a full description:

    - - +
    nonehybridclass2cvff
    harmonic +
    nonehybridclass2cvff
    harmonic
    diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index f2eb2a32bb..7c2028efcd 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -178,7 +178,6 @@ set in the read-in files): "pair_coeff"_pair_coeff.html, "special_bonds"_special_bonds.html. Various simulation parameters are set by these commands: -"temperature"_temperature.html, "temp_modify"_temp_modify.html, "neighbor"_neighbor.html, "neigh_modify"_neigh_modify.html, "group"_group.html, "timestep"_timestep.html, "reset_timestep"_reset_timestep.html, "run_style"_run_style.html, @@ -187,8 +186,13 @@ Various simulation parameters are set by these commands: Fixes impose a variety of boundary conditions, time integration, and diagnostic options. The "fix"_fix.html command comes in many flavors. -Output options are set by these commands: "thermo"_thermo.html, -"dump"_dump.html, "restart"_restart.html. +Various computations can be specified for execution during a +simulation using the "compute"_compute.html, +"compute_modify"_compute_modify.html, and "variable"_variable.html +commands. + +Output options are set by the "thermo"_thermo.html, "dump"_dump.html, +and "restart"_restart.html commands. (4) Run a simulation @@ -242,14 +246,17 @@ Settings: "min_modify"_min_modify.html, "min_style"_min_style.html, "neigh_modify"_neigh_modify.html, "neighbor"_neighbor.html, "reset_timestep"_reset_timestep.html, "run_style"_run_style.html, -"set"_set.html, "temp_modify"_temp_modify.html, -"temperature"_temperature.html, "timestep"_timestep.html, -"velocity"_velocity.html +"set"_set.html, "timestep"_timestep.html, "velocity"_velocity.html Fixes: "fix"_fix.html, "fix_modify"_fix_modify.html, "unfix"_unfix.html +Computes: + +"compute"_compute.html, "compute_modify"_compute_modify.html, +"uncompute"_uncompute.html + Output: "dump"_dump.html, "dump_modify"_dump_modify.html, @@ -291,6 +298,8 @@ in the command's documentation. "bond_style"_bond_style.html, "boundary"_boundary.html, "clear"_clear.html, +"compute"_compute.html, +"compute_modify"_compute_modify.html, "create_atoms"_create_atoms.html, "create_box"_create_box.html, "delete_atoms"_delete_atoms.html, @@ -341,13 +350,12 @@ in the command's documentation. "set"_set.html, "shell"_shell.html, "special_bonds"_special_bonds.html, -"temp_modify"_temp_modify.html, "temper"_temper.html, -"temperature"_temperature.html, "thermo"_thermo.html, "thermo_modify"_thermo_modify.html, "thermo_style"_thermo_style.html, "timestep"_timestep.html, +"uncompute"_uncompute.html, "undump"_undump.html, "unfix"_unfix.html, "units"_units.html, @@ -355,137 +363,177 @@ in the command's documentation. "velocity"_velocity.html, "write_restart"_write_restart.html :tb(c=6,ea=c) -Fix styles. See the "fix"_fix.html command for one-line descriptions -or click on the command itself for a full description: +:line -"fix addforce"_fix_addforce.html, -"fix aveforce"_fix_aveforce.html, -"fix com"_fix_com.html, -"fix deposit"_fix_deposit.html, -"fix drag"_fix_drag.html, -"fix efield"_fix_efield.html, -"fix enforce2d"_fix_enforce2d.html, -"fix freeze"_fix_freeze.html, -"fix gran/diag"_fix_gran_diag.html, -"fix gravity"_fix_gravity.html, -"fix gyration"_fix_gyration.html, -"fix indent"_fix_indent.html, -"fix langevin"_fix_langevin.html, -"fix lineforce"_fix_lineforce.html, -"fix msd"_fix_msd.html, -"fix momentum"_fix_momentum.html, -"fix nph"_fix_nph.html, -"fix npt"_fix_npt.html, -"fix nve"_fix_nve.html, -"fix nve/gran"_fix_nve_gran.html, -"fix nvt"_fix_nvt.html, -"fix orient/fcc"_fix_orient_fcc.html, -"fix planeforce"_fix_planeforce.html, -"fix poems"_fix_poems.html, -"fix pour"_fix_pour.html, -"fix print"_fix_print.html, -"fix rdf"_fix_rdf.html, -"fix recenter"_fix_recenter.html, -"fix rigid"_fix_rigid.html, -"fix setforce"_fix_setforce.html, -"fix shake"_fix_shake.html, -"fix spring"_fix_spring.html, -"fix spring/rg"_fix_spring_rg.html, -"fix spring/self"_fix_spring_self.html, -"fix temp/rescale"_fix_temp_rescale.html, -"fix tmd"_fix_tmd.html, -"fix uniaxial"_fix_uniaxial.html, -"fix vcm"_fix_vcm.html, -"fix viscous"_fix_viscous.html, -"fix volume/rescale"_fix_volume_rescale.html, -"fix wall/gran"_fix_wall_gran.html, -"fix wall/lj93"_fix_wall_lj93.html, -"fix wall/lj126"_fix_wall_lj126.html, -"fix wall/reflect"_fix_wall_reflect.html, -"fix wiggle"_fix_wiggle.html :tb(c=6,ea=c) - -Pair styles. See the "pair_style"_pair_style.html command for an -overview of pair potentials. Click on the style itself for a full +Fix commands. See the "fix"_fix.html command for one-line +descriptions of each style or click on the style itself for a full description: -"none"_pair_style_none.html, -"hybrid"_pair_style_hybrid.html, -"buck"_pair_style_buck.html, -"buck/coul/cut"_pair_style_buck.html, -"buck/coul/long"_pair_style_buck.html, -"dpd"_pair_style_dpd.html, -"eam"_pair_style_eam.html, -"eam/alloy"_pair_style_eam.html, -"eam/fs"_pair_style_eam.html, -"gran/hertzian"_pair_style_gran.html, -"gran/history"_pair_style_gran.html, -"gran/no_history"_pair_style_gran.html, -"lj/charmm/coul/charmm"_pair_style_charmm.html, -"lj/charmm/coul/charmm/implicit"_pair_style_charmm.html, -"lj/charmm/coul/long"_pair_style_charmm.html, -"lj/class2"_pair_style_class2.html, -"lj/class2/coul/cut"_pair_style_class2.html, -"lj/class2/coul/long"_pair_style_class2.html, -"lj/cut"_pair_style_lj.html, -"lj/cut/coul/cut"_pair_style_lj.html, -"lj/cut/coul/debye"_pair_style_lj.html, -"lj/cut/coul/long"_pair_style_lj.html, -"lj/cut/coul/long/tip4p"_pair_style_lj.html, -"lj/expand"_pair_style_lj_expand.html, -"lj/smooth"_pair_style_lj_smooth.html, -"meam"_pair_style_meam.html, -"morse"_pair_style_morse.html, -"soft"_pair_style_soft.html, -"sw"_pair_style_sw.html, -"table"_pair_style_table.html, -"tersoff"_pair_style_tersoff.html, -"yukawa"_pair_style_yukawa.html :tb(c=4,ea=c) +"addforce"_fix_addforce.html, +"aveforce"_fix_aveforce.html, +"com"_fix_com.html, +"deposit"_fix_deposit.html, +"drag"_fix_drag.html, +"efield"_fix_efield.html, +"enforce2d"_fix_enforce2d.html, +"freeze"_fix_freeze.html, +"gran/diag"_fix_gran_diag.html, +"gravity"_fix_gravity.html, +"gyration"_fix_gyration.html, +"indent"_fix_indent.html, +"langevin"_fix_langevin.html, +"lineforce"_fix_lineforce.html, +"msd"_fix_msd.html, +"momentum"_fix_momentum.html, +"nph"_fix_nph.html, +"npt"_fix_npt.html, +"nve"_fix_nve.html, +"nve/gran"_fix_nve_gran.html, +"nvt"_fix_nvt.html, +"orient/fcc"_fix_orient_fcc.html, +"planeforce"_fix_planeforce.html, +"poems"_fix_poems.html, +"pour"_fix_pour.html, +"print"_fix_print.html, +"rdf"_fix_rdf.html, +"recenter"_fix_recenter.html, +"rigid"_fix_rigid.html, +"setforce"_fix_setforce.html, +"shake"_fix_shake.html, +"spring"_fix_spring.html, +"spring/rg"_fix_spring_rg.html, +"spring/self"_fix_spring_self.html, +"temp/rescale"_fix_temp_rescale.html, +"tmd"_fix_tmd.html, +"uniaxial"_fix_uniaxial.html, +"vcm"_fix_vcm.html, +"viscous"_fix_viscous.html, +"volume/rescale"_fix_volume_rescale.html, +"wall/gran"_fix_wall_gran.html, +"wall/lj93"_fix_wall_lj93.html, +"wall/lj126"_fix_wall_lj126.html, +"wall/reflect"_fix_wall_reflect.html, +"wiggle"_fix_wiggle.html :tb(c=8,ea=c) -Bond styles. See the "bond_style"_bond_style.html command for an -overview of bond potentials. Click on the style itself for a full +:line + +Compute commands. See the "compute"_compute.html command for one-line +descriptions of each style or click on the style itself for a full description: -"none"_bond_style_none.html, -"hybrid"_bond_style_hybrid.html, -"class2"_bond_style_class2.html, -"fene"_bond_style_fene.html, -"fene/expand"_bond_style_fene_expand.html, -"harmonic"_bond_style_harmonic.html, -"morse"_bond_style_morse.html, -"nonlinear"_bond_style_nonlinear.html, -"quartic"_bond_style_quartic.html :tb(c=4,ea=c,w=100) +"centro/atom"_compute_centro_atom.html, +"epair/atom"_compute_epair_atom.html, +"etotal/atom"_compute_etotal_atom.html, +"ke/atom"_compute_ke_atom.html, +"pressure"_compute_pressure.html, +"rotate/dipole"_compute_rotate_dipole.html, +"rotate/gran"_compute_rotate_gran.html, +"stress/atom"_compute_stress_atom.html, +"temp"_compute_temp.html, +"temp/partial"_compute_temp_partial.html, +"temp/ramp"_compute_temp_ramp.html, +"temp/region"_compute_temp_region.html :tb(c=6,ea=c) -Angle styles. See the "angle_style"_angle_style.html command for an -overview of angle potentials. Click on the style itself for a full +:line + +Pair_style potentials. See the "pair_style"_pair_style.html command +for an overview of pair potentials. Click on the style itself for a +full description: + +"none"_pair_none.html, +"hybrid"_pair_hybrid.html, +"buck"_pair_buck.html, +"buck/coul/cut"_pair_buck.html, +"buck/coul/long"_pair_buck.html, +"dpd"_pair_dpd.html, +"eam"_pair_eam.html, +"eam/opt"_pair_eam.html, +"eam/alloy"_pair_eam.html, +"eam/alloy/opt"_pair_eam.html, +"eam/fs"_pair_eam.html, +"eam/fs/opt"_pair_eam.html, +"gran/hertzian"_pair_gran.html, +"gran/history"_pair_gran.html, +"gran/no_history"_pair_gran.html, +"lj/charmm/coul/charmm"_pair_charmm.html, +"lj/charmm/coul/charmm/implicit"_pair_charmm.html, +"lj/charmm/coul/long"_pair_charmm.html, +"lj/charmm/coul/long/opt"_pair_charmm.html, +"lj/class2"_pair_class2.html, +"lj/class2/coul/cut"_pair_class2.html, +"lj/class2/coul/long"_pair_class2.html, +"lj/cut"_pair_lj.html, +"lj/cut/opt"_pair_lj.html, +"lj/cut/coul/cut"_pair_lj.html, +"lj/cut/coul/debye"_pair_lj.html, +"lj/cut/coul/long"_pair_lj.html, +"lj/cut/coul/long/tip4p"_pair_lj.html, +"lj/expand"_pair_lj_expand.html, +"lj/smooth"_pair_lj_smooth.html, +"meam"_pair_meam.html, +"morse"_pair_morse.html, +"morse/opt"_pair_morse.html, +"soft"_pair_soft.html, +"sw"_pair_sw.html, +"table"_pair_table.html, +"tersoff"_pair_tersoff.html, +"yukawa"_pair_yukawa.html :tb(c=4,ea=c) + +:line + +Bond_style potentials. See the "bond_style"_bond_style.html command +for an overview of bond potentials. Click on the style itself for a +full description: + +"none"_bond_none.html, +"hybrid"_bond_hybrid.html, +"class2"_bond_class2.html, +"fene"_bond_fene.html, +"fene/expand"_bond_fene_expand.html, +"harmonic"_bond_harmonic.html, +"morse"_bond_morse.html, +"nonlinear"_bond_nonlinear.html, +"quartic"_bond_quartic.html :tb(c=4,ea=c,w=100) + +:line + +Angle_style potentials. See the "angle_style"_angle_style.html +command for an overview of angle potentials. Click on the style +itself for a full description: + +"none"_angle_none.html, +"hybrid"_angle_hybrid.html, +"charmm"_angle_charmm.html, +"class2"_angle_class2.html, +"cosine"_angle_cosine.html, +"cosine/squared"_angle_cosine_squared.html, +"harmonic"_angle_harmonic.html :tb(c=4,ea=c,w=100) + +:line + +Dihedral_style potentials. See the +"dihedral_style"_dihedral_style.html command for an overview of +dihedral potentials. Click on the style itself for a full description: -"none"_angle_style_none.html, -"hybrid"_angle_style_hybrid.html, -"charmm"_angle_style_charmm.html, -"class2"_angle_style_class2.html, -"cosine"_angle_style_cosine.html, -"cosine/squared"_angle_style_cosine_squared.html, -"harmonic"_angle_style_harmonic.html :tb(c=6,ea=c,w=100) +"none"_dihedral_none.html, +"hybrid"_dihedral_hybrid.html, +"charmm"_dihedral_charmm.html, +"class2"_dihedral_class2.html, +"harmonic"_dihedral_harmonic.html, +"helix"_dihedral_helix.html, +"multi/harmonic"_dihedral_multi_harmonic.html, +"opls"_dihedral_opls.html :tb(c=4,ea=c,w=100) -Dihedral styles. See the "dihedral_style"_dihedral_style.html command -for an overview of dihedral potentials. Click on the style itself for -a full description: +:line -"none"_dihedral_style_none.html, -"hybrid"_dihedral_style_hybrid.html, -"charmm"_dihedral_style_charmm.html, -"class2"_dihedral_style_class2.html, -"harmonic"_dihedral_style_harmonic.html, -"helix"_dihedral_style_helix.html, -"multi/harmonic"_dihedral_style_multi_harmonic.html, -"opls"_dihedral_style_opls.html :tb(c=7,ea=c,w=100) - -Improper styles. See the "improper_style"_improper_style.html command for an -overview of improper potentials. Click on the style itself for a full +Improper_style potentials. See the +"improper_style"_improper_style.html command for an overview of +improper potentials. Click on the style itself for a full description: -"none"_improper_style_none.html, -"hybrid"_improper_style_hybrid.html, -"class2"_improper_style_class2.html, -"cvff"_improper_style_cvff.html, -"harmonic"_improper_style_harmonic.html :tb(c=4,ea=c,w=100) +"none"_improper_none.html, +"hybrid"_improper_hybrid.html, +"class2"_improper_class2.html, +"cvff"_improper_cvff.html, +"harmonic"_improper_harmonic.html :tb(c=4,ea=c,w=100) diff --git a/doc/Section_errors.html b/doc/Section_errors.html index 9add21922f..a27f2b6065 100644 --- a/doc/Section_errors.html +++ b/doc/Section_errors.html @@ -1,5 +1,7 @@ -
    Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section +
    Previous Section - LAMMPS WWW Site - +LAMMPS Documentation - LAMMPS Commands - Next +Section
    diff --git a/doc/Section_errors.txt b/doc/Section_errors.txt index f49e855ea7..991c37036b 100644 --- a/doc/Section_errors.txt +++ b/doc/Section_errors.txt @@ -1,4 +1,6 @@ -"Previous Section"_Section_modify.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_history.html :c +"Previous Section"_Section_modify.html - "LAMMPS WWW Site"_lws - +"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next +Section"_Section_history.html :c :link(lws,http://lammps.sandia.gov) :link(ld,Manual.html) diff --git a/doc/Section_howto.html b/doc/Section_howto.html index c53aa907f9..0f8ae2da8e 100644 --- a/doc/Section_howto.html +++ b/doc/Section_howto.html @@ -263,7 +263,7 @@ jump in.polymer

    All of the above examples work whether you are running on 1 or multiple processors, but assumed you are running LAMMPS on a single partition of processors. LAMMPS can be run on multiple partitions via -the "-partition" command-line switch as described in this +the "-partition" command-line switch as described in this section of the manual.

    In the last 2 examples, if LAMMPS were run on 3 partitions, the same @@ -287,7 +287,7 @@ simulation are run at different temperatures on different sets of processors, and Monte Carlo temperature swaps are performed between pairs of copies.

    -

    Use the -procs and -in command-line switches +

    Use the -procs and -in command-line switches to launch LAMMPS on multiple partitions.

    In your input script, define a set of temperatures, one for each @@ -409,10 +409,12 @@ This site M is located at a fixed distance away from the oxygen along the bisector of the HOH bond angle. A bond style of harmonic and an angle style of harmonic or charmm should also be used.

    -

    Two different four-point models (cutoff and long-range Coulombics) can -be implemented using LAMMPS pair styles with tip4p in their style -name. For both models, the bond lengths and bond angles should be -held fixed using the fix shake command. +

    Currently, only a four-point model for long-range Coulombics is +implemented via the LAMMPS pair style +lj/cut/coul/long/tip4p. We plan to add a cutoff +version in the future. For both models, the bond lengths and bond +angles should be held fixed using the fix shake +command.

    These are the additional parameters (in real units) to set for O and H atoms and the water molecule to run a rigid TIP4P model with a cutoff @@ -510,16 +512,16 @@ a new fix to LAMMPS.

    (2) Define a new LAMMPS command that calls the other code. This is conceptually similar to method (1), but in this case LAMMPS and the -other code are on a more equal footing. Note that now the other -code is not called during the timesteps of a LAMMPS run, but between +other code are on a more equal footing. Note that now the other code +is not called during the timestepping of a LAMMPS run, but between runs. The LAMMPS input script can be used to alternate LAMMPS runs with calls to the other code, invoked via the new command. The run command facilitates this with its every option, which makes it easy to run a few steps, invoke the command, run a few steps, invoke the command, etc.

    -

    In this scenario, the other code can be a library, called by the -command, or it could be a stand-alone code, invoked by a system() call +

    In this scenario, the other code can be called as a library, as in +(1), or it could be a stand-alone code, invoked by a system() call made by the command (assuming your parallel machine allows one or more processors to start up another program). In the latter case the stand-alone code could communicate with LAMMPS thru files that the @@ -535,49 +537,55 @@ Again, the run command has options that allow it to be invoked with minimal overhead (no setup or clean-up) if you wish to do multiple short runs, driven by another program.

    -

    This section of the documentation describes -how to build LAMMPS as a library. Once this is done, you can interface -with LAMMPS either via C++, C, or Fortran (or any other language that -supports a vanilla C-like interface, e.g. a scripting language). For -example, from C++ you could create an "instance" of LAMMPS, and -initialize it, pass it an input script to process, or execute +

    This section of the documentation describes +how to build LAMMPS as a library. Once this is done, you can +interface with LAMMPS either via C++, C, or Fortran (or any other +language that supports a vanilla C-like interface, e.g. a scripting +language). For example, from C++ you could create one (or more) +"instances" of LAMMPS, pass it an input script to process, or execute individual commands, all by invoking the correct class methods in -LAMMPS. From C or Fortran you would make function calls to do the -same things. Library.cpp and library.h contain such a C interface -that illustrates this with the functions: +LAMMPS. From C or Fortran you can make function calls to do the same +things. Library.cpp and library.h contain such a C interface with the +functions:

    -
    void lammps_open(int, char **, MPI_Comm);
    -void lammps_close();
    -void lammps_file(char *);
    -char *lammps_command(char *); 
    +
    void lammps_open(int, char **, MPI_Comm, void **);
    +void lammps_close(void *);
    +void lammps_file(void *, char *);
    +char *lammps_command(doivd *, char *); 
     
    -

    The functions contain the C++ code you would need to put in a C++ -application that was invoking LAMMPS directly. +

    The functions contain C++ code you could write in a C++ application +that was invoking LAMMPS directly. Note that LAMMPS classes are +defined wihin a LAMMPS namespace (LAMMPS_NS) if you use them +from another C++ application.

    Two of the routines in library.cpp are of particular note. The lammps_open() function initiates LAMMPS and takes an MPI communicator -as an argument. LAMMPS will run on the set of processors in the -communicator. This means the calling code can run LAMMPS on all or a -subset of processors. For example, a wrapper script might decide to -alternate between LAMMPS and another code, allowing them both to run -on all the processors. Or it might allocate half the processors to -LAMMPS and half to the other code and run both codes simultaneously -before syncing them up periodically. +as an argument. It returns a pointer to a LAMMPS "object". As with +C++, the lammps_open() function can be called mutliple times, to +create multiple instances of LAMMPS.

    -

    Library.cpp also contains a lammps_command() function to which the -caller passes a single LAMMPS command (a string). Thus the calling -code can read or generate a series of LAMMPS commands (e.g. an input -script) one line at a time and pass it thru the library interface to -setup a problem and then run it. +

    LAMMPS will run on the set of processors in the communicator. This +means the calling code can run LAMMPS on all or a subset of +processors. For example, a wrapper script might decide to alternate +between LAMMPS and another code, allowing them both to run on all the +processors. Or it might allocate half the processors to LAMMPS and +half to the other code and run both codes simultaneously before +syncing them up periodically.

    -

    A few other sample routines are included in library.cpp, but the key -idea is that you can write any routines you wish to define an +

    Library.cpp contains a lammps_command() function to which the caller +passes a single LAMMPS command (a string). Thus the calling code can +read or generate a series of LAMMPS commands (e.g. an input script) +one line at a time and pass it thru the library interface to setup a +problem and then run it. +

    +

    A few other sample functions are included in library.cpp, but the key +idea is that you can write any functions you wish to define an interface for how your code talks to LAMMPS and add them to library.cpp and library.h. The routines you add can access any LAMMPS -data. The umbrella.cpp code in examples/couple is a simple example of -how a stand-alone code can link LAMMPS as a library, run LAMMPS on a -subset of processors, grab data from LAMMPS, change it, and put it -back into LAMMPS. +data. The examples/couple directory has example C++ and C codes which +show how a stand-alone code can link LAMMPS as a library, run LAMMPS +on a subset of processors, grab data from LAMMPS, change it, and put +it back into LAMMPS.


    diff --git a/doc/Section_howto.txt b/doc/Section_howto.txt index a65c4163c4..009593e1a6 100644 --- a/doc/Section_howto.txt +++ b/doc/Section_howto.txt @@ -260,7 +260,7 @@ All of the above examples work whether you are running on 1 or multiple processors, but assumed you are running LAMMPS on a single partition of processors. LAMMPS can be run on multiple partitions via the "-partition" command-line switch as described in "this -section"_Section_start.html#2_4 of the manual. +section"_Section_start.html#2_6 of the manual. In the last 2 examples, if LAMMPS were run on 3 partitions, the same scripts could be used if the "index" and "loop" variables were @@ -283,7 +283,7 @@ simulation are run at different temperatures on different sets of processors, and Monte Carlo temperature swaps are performed between pairs of copies. -Use the -procs and -in "command-line switches"_Section_start.html#2_4 +Use the -procs and -in "command-line switches"_Section_start.html#2_6 to launch LAMMPS on multiple partitions. In your input script, define a set of temperatures, one for each @@ -405,10 +405,12 @@ This site M is located at a fixed distance away from the oxygen along the bisector of the HOH bond angle. A bond style of {harmonic} and an angle style of {harmonic} or {charmm} should also be used. -Two different four-point models (cutoff and long-range Coulombics) can -be implemented using LAMMPS pair styles with {tip4p} in their style -name. For both models, the bond lengths and bond angles should be -held fixed using the "fix shake"_fix_shake.html command. +Currently, only a four-point model for long-range Coulombics is +implemented via the LAMMPS "pair style +lj/cut/coul/long/tip4p"_pair_lj.html. We plan to add a cutoff +version in the future. For both models, the bond lengths and bond +angles should be held fixed using the "fix shake"_fix_shake.html +command. These are the additional parameters (in real units) to set for O and H atoms and the water molecule to run a rigid TIP4P model with a cutoff @@ -506,16 +508,16 @@ a new fix to LAMMPS. (2) Define a new LAMMPS command that calls the other code. This is conceptually similar to method (1), but in this case LAMMPS and the -other code are on a more equal footing. Note that now the other -code is not called during the timesteps of a LAMMPS run, but between +other code are on a more equal footing. Note that now the other code +is not called during the timestepping of a LAMMPS run, but between runs. The LAMMPS input script can be used to alternate LAMMPS runs with calls to the other code, invoked via the new command. The "run"_run.html command facilitates this with its {every} option, which makes it easy to run a few steps, invoke the command, run a few steps, invoke the command, etc. -In this scenario, the other code can be a library, called by the -command, or it could be a stand-alone code, invoked by a system() call +In this scenario, the other code can be called as a library, as in +(1), or it could be a stand-alone code, invoked by a system() call made by the command (assuming your parallel machine allows one or more processors to start up another program). In the latter case the stand-alone code could communicate with LAMMPS thru files that the @@ -531,49 +533,55 @@ Again, the "run"_run.html command has options that allow it to be invoked with minimal overhead (no setup or clean-up) if you wish to do multiple short runs, driven by another program. -"This section"_Section_start.html#2_2 of the documentation describes -how to build LAMMPS as a library. Once this is done, you can interface -with LAMMPS either via C++, C, or Fortran (or any other language that -supports a vanilla C-like interface, e.g. a scripting language). For -example, from C++ you could create an "instance" of LAMMPS, and -initialize it, pass it an input script to process, or execute +"This section"_Section_start.html#2_4 of the documentation describes +how to build LAMMPS as a library. Once this is done, you can +interface with LAMMPS either via C++, C, or Fortran (or any other +language that supports a vanilla C-like interface, e.g. a scripting +language). For example, from C++ you could create one (or more) +"instances" of LAMMPS, pass it an input script to process, or execute individual commands, all by invoking the correct class methods in -LAMMPS. From C or Fortran you would make function calls to do the -same things. Library.cpp and library.h contain such a C interface -that illustrates this with the functions: +LAMMPS. From C or Fortran you can make function calls to do the same +things. Library.cpp and library.h contain such a C interface with the +functions: -void lammps_open(int, char **, MPI_Comm); -void lammps_close(); -void lammps_file(char *); -char *lammps_command(char *); :pre +void lammps_open(int, char **, MPI_Comm, void **); +void lammps_close(void *); +void lammps_file(void *, char *); +char *lammps_command(doivd *, char *); :pre -The functions contain the C++ code you would need to put in a C++ -application that was invoking LAMMPS directly. +The functions contain C++ code you could write in a C++ application +that was invoking LAMMPS directly. Note that LAMMPS classes are +defined wihin a LAMMPS namespace (LAMMPS_NS) if you use them +from another C++ application. Two of the routines in library.cpp are of particular note. The lammps_open() function initiates LAMMPS and takes an MPI communicator -as an argument. LAMMPS will run on the set of processors in the -communicator. This means the calling code can run LAMMPS on all or a -subset of processors. For example, a wrapper script might decide to -alternate between LAMMPS and another code, allowing them both to run -on all the processors. Or it might allocate half the processors to -LAMMPS and half to the other code and run both codes simultaneously -before syncing them up periodically. +as an argument. It returns a pointer to a LAMMPS "object". As with +C++, the lammps_open() function can be called mutliple times, to +create multiple instances of LAMMPS. -Library.cpp also contains a lammps_command() function to which the -caller passes a single LAMMPS command (a string). Thus the calling -code can read or generate a series of LAMMPS commands (e.g. an input -script) one line at a time and pass it thru the library interface to -setup a problem and then run it. +LAMMPS will run on the set of processors in the communicator. This +means the calling code can run LAMMPS on all or a subset of +processors. For example, a wrapper script might decide to alternate +between LAMMPS and another code, allowing them both to run on all the +processors. Or it might allocate half the processors to LAMMPS and +half to the other code and run both codes simultaneously before +syncing them up periodically. -A few other sample routines are included in library.cpp, but the key -idea is that you can write any routines you wish to define an +Library.cpp contains a lammps_command() function to which the caller +passes a single LAMMPS command (a string). Thus the calling code can +read or generate a series of LAMMPS commands (e.g. an input script) +one line at a time and pass it thru the library interface to setup a +problem and then run it. + +A few other sample functions are included in library.cpp, but the key +idea is that you can write any functions you wish to define an interface for how your code talks to LAMMPS and add them to library.cpp and library.h. The routines you add can access any LAMMPS -data. The umbrella.cpp code in examples/couple is a simple example of -how a stand-alone code can link LAMMPS as a library, run LAMMPS on a -subset of processors, grab data from LAMMPS, change it, and put it -back into LAMMPS. +data. The examples/couple directory has example C++ and C codes which +show how a stand-alone code can link LAMMPS as a library, run LAMMPS +on a subset of processors, grab data from LAMMPS, change it, and put +it back into LAMMPS. :line diff --git a/doc/Section_modify.html b/doc/Section_modify.html index 887b903188..7ea5846db9 100644 --- a/doc/Section_modify.html +++ b/doc/Section_modify.html @@ -14,29 +14,34 @@ Section

    8. Modifying & extending LAMMPS

    LAMMPS is designed in a modular fashion so as to be easy to modify and -extend with new functionality. In this section, changes and additions -users can make are listed along with some minimal instructions. -Realistically, the best way to add a new feature is to find a similar -feature in LAMMPS and look at the corresponding source and header -files to figure out what it does. You will need some knowledge of C++ -to be able to understand the hi-level structure of LAMMPS and its -class organization, but functions (class methods) that do actual -computations are written in vanilla C-style code and operate on simple -C-style data structures (vectors and arrays). +extend with new functionality. In fact, about 75% if its source code +is files added in this fashion. +

    +

    In this section, changes and additions users can make are listed along +with minimal instructions. The best way to add a new feature is to +find a similar feature in LAMMPS and look at the corresponding source +and header files to figure out what it does. You will need some +knowledge of C++ to be able to understand the hi-level structure of +LAMMPS and its class organization, but functions (class methods) that +do actual computations are written in vanilla C-style code and operate +on simple C-style data structures (vectors and arrays).

    Most of the new features described in this section require you to -write a new C++ class (except for dump, thermo, and variable options, -described below, where you can make small edits to existing files). -Creating a new class requires 2 files, a source code file (*.cpp) and -a header file (*.h). Their contents are briefly discussed below. -Enabling LAMMPS to invoke the new class is as simple as adding two -definition lines to the style_user.h file, in the same syntax as the -existing LAMMPS classes are defined in the style.h file. +write a new C++ derived class (except for exceptions described below, +where you can make small edits to existing files). Creating a new +class requires 2 files, a source code file (*.cpp) and a header file +(*.h). The derived class must provide certain methods to work as a +new option. Depending on how different your new feature is compared +to existing features, you can either derive from the base class +itself, or from a derived class that already exists. Enabling LAMMPS +to invoke the new class is as simple as adding two lines to the +style_user.h file, in the same syntax as other LAMMPS classes are +specified in the style.h file.

    -

    The power of C++ and its object-orientation is that usually, all the -code and variables needed to define the new feature are contained in -the 2 files you write, and thus shouldn't make the rest of the code -more complex or cause side-effect bugs. +

    The advantage of C++ and its object-orientation is that all the code +and variables needed to define the new feature are in the 2 files you +write, and thus shouldn't make the rest of LAMMPS more complex or +cause side-effect bugs.

    Here is a concrete example. Suppose you write 2 files pair_foo.cpp and pair_foo.h that define a new class PairFoo that computes pairwise @@ -46,8 +51,8 @@ command like

    pair_style foo 0.1 3.5 
     
    -

    you simply need to put your 2 files in the LAMMPS src directory, add 2 -lines to the style_user.h file, and re-make the code. +

    you put your 2 files in the LAMMPS src directory, add 2 lines to the +style_user.h file, and re-make the code.

    The first line added to style_user.h would be

    @@ -69,108 +74,121 @@ the executable and can be invoked with a pair_style command like the example above. Arguments like 0.1 and 3.5 can be defined and processed by your new class.

    -

    Note that if you are using Makefile.list instead of Makefile to build -LAMMPS, you will need to explicitly add the names of your new .cpp and -.h file to Makefile.list. +

    Here is a list of the new features that can be added in this way:

    -

    Here is a list of the kinds of new features that can be added in this -way. The dump and thermo options do not typically require new styles; -LAMMPS can simply be recompiled after new code is added to -dump_custom.cpp or thermo_custom.cpp. -

    -
    • Pairwise potentials + -

      As illustrated by the pairwise example, these options are -referred to in the LAMMPS documentation as the "style" of a particular -command. +

      As illustrated by the pairwise example, these options are referred to +in the LAMMPS documentation as the "style" of a particular command.

      -

      The instructions below for each category will list the header file for -the parent class that these styles are sub-classes of. Public -variables in that file are ones used and set by the sub-classes which -are also used by the parent class. Sometimes they are also used by -the rest of LAMMPS. Virtual functions in the header file which are -set = 0 are ones you must define in your new class to give it the -functionality LAMMPS expects. Virtual functions that are not set to 0 -are functions you can optionally define. +

      The instructions below give the header file for the base class that +these styles are derived from. Public variables in that file are ones +used and set by the derived classes which are also used by the base +class. Sometimes they are also used by the rest of LAMMPS. Virtual +functions in the base class header file which are set = 0 are ones you +must define in your new derived class to give it the functionality +LAMMPS expects. Virtual functions that are not set to 0 are functions +you can optionally define.

      -

      Here are some additional guidelines for modifying LAMMPS and adding -new functionality: -

      -

      Think about whether what you want to do would be better as a pre- or -post-processing step. Many computations are more easily and more -quickly done that way. -

      -

      Don't do anything within the timestepping of a run that isn't -parallel. E.g. don't accumulate a bunch of data on a single processor -and analyze it. You run the risk of seriously degrading the parallel -efficiency. -

      -

      If your new feature reads arguments or writes output, make sure you -follow the unit conventions discussed by the units -command. -

      -

      If you add something you think is truly useful and doesn't impact -LAMMPS performance when it isn't used, send an email to the -developers. We might be -interested in adding it to the LAMMPS distribution. +

      Additionally, new output options can be added directly to the +thermo.cpp, dump_custom.cpp, and variable.cpp files as explained in +these sections:

      +
      -

      Pairwise potentials +

      Here are additional guidelines for modifying LAMMPS and adding new +functionality: +

      +
      • Think about whether what you want to do would be better as a pre- or +post-processing step. Many computations are more easily and more +quickly done that way. + +
      • Don't do anything within the timestepping of a run that isn't +parallel. E.g. don't accumulate a bunch of data on a single processor +and analyze it. You run the risk of seriously degrading the parallel +efficiency. + +
      • If your new feature reads arguments or writes output, make sure you +follow the unit conventions discussed by the units +command. + +
      • If you add something you think is truly useful and doesn't impact +LAMMPS performance when it isn't used, send an email to the +developers. We might be +interested in adding it to the LAMMPS distribution. +
      +
      + +
      + +

      Atom styles

      -

      All classes that compute pairwise interactions are sub-classes of the -Pair class. See the pair.h file for a list of methods this class -defines. +

      Classes that define an atom style are derived from the Atom class. +The atom style determines what quantities are associated with an atom. +A new atom style can be created if one of the existing atom styles +does not define all the arrays you need to store and communicate with +atoms.

      -

      Pair_lj_cut.cpp and pair_lj_cut.h are the simplest example of a Pair -class. They implement the lj/cut style of the -pair_style command. +

      Atom_vec_atomic.cpp is a simple example of an atom style.

      -

      Here is a brief description of the class methods in pair.h: +

      Here is a brief description of methods you define in your new derived +class. See atom.h for details.

      - - - - - - - - + + + + + + + + + + + + + + +
      compute the workhorse routine that computes the pairwise interactions
      settings reads the input script line with any arguments you define
      coeff set coefficients for one i,j type pair
      init_one perform initialization for one i,j type pair
      write & read_restart write/read i,j pair coeffs to restart files
      write & read_restart_settings write/read global settings to restart files
      single force and energy of a single pairwise interaction between 2 atoms
      compute_inner/middle/outer versions of compute used by rRESPA +
      grow re-allocate atom arrays to longer lengths
      copy copy info for one atom to another atom's array locations
      pack_comm store an atom's info in a buffer communicated every timestep
      unpack_comm retrieve an atom's info from the buffer
      pack_reverse store an atom's info in a buffer communicating partial forces
      unpack_reverse retrieve an atom's info from the buffer
      pack_border store an atom's info in a buffer communicated on neighbor re-builds
      unpack_border retrieve an atom's info from the buffer
      pack_exchange store all an atom's info to migrate to another processor
      unpack_exchange retrieve an atom's info from the buffer
      size_restart number of restart quantities associated with proc's atoms
      pack_restart pack atom quantities into a buffer
      unpack_restart unpack atom quantities from a buffer
      create_atom create an individual atom of this style
      data_atom parse an atom line from the data file
      memory_usage tally memory allocated by atom arrays
      -

      The inner/middle/outer routines are optional. Only a few of the -pairwise potentials use these in conjunction with rRESPA as set by the -run_style command. +

      The constructor of the derived class sets values for several variables +that you must set when defining a new atom style. The atom arrays +themselves are defined in atom.cpp. Search for the word "customize" +and you will find locations you will need to modify.


      Bond, angle, dihedral, improper potentials

      -

      All classes that compute molecular interactions are sub-classes of the -Bond, Angle, Dihedral, and Improper classes. See the bond.h, angle.h, -dihedral.h, and improper.h file for a list of methods these classes -defines. +

      Classes that compute molecular interactions are derived from the Bond, +Angle, Dihedral, and Improper classes. New styles can be created to +add new potentials to LAMMPS.

      -

      Bond_harmonic.cpp and bond_harmonic.h are the simplest example of a -Bond class. Ditto for the harmonic forms of the angle, dihedral, and -improper style commands. The bond_harmonic files implement the -harmonic style of the bond_style command. +

      Bond_harmonic.cpp is the simplest example of a bond style. Ditto for +the harmonic forms of the angle, dihedral, and improper style +commands.

      -

      Here is a brief description of the class methods in bond.h, angle.h, -etc: +

      Here is a brief description of methods you define in your new derived +bond class. See bond.h, angle.h, dihedral.h, and improper.h for +details.

      - + @@ -179,145 +197,85 @@ etc:
      -

      Dump options +

      Compute styles

      -

      There are several classes that print dump files (snapshots of atoms) -that are sub-classes of the Dump class. These include the -dump_atom.cpp, dump_bond.cpp, and dump_custom.cpp files. +

      Classes that compute scalar and vector quantities like temperature +and the pressure tensor, as well as classes that compute per-atom +quantities like kinetic energy and the centro-symmetry parameter +are derived from the Compute class. New styles can be created +to add new calculations to LAMMPS.

      -

      New dump classes can be added, but it is typically simpler to modify -the DumpCustom class contained in the dump_custom.cpp file. See the -dump command and its custom style for a list of what -atom information can already be dumped by DumpCustom. If the -attribute you want to dump is not in the list, or if you define a new -atom style with new attributes (e.g. atoms that store their own -magnetic moment), here is how to dump it out in a snapshot file: +

      Compute_temp.cpp is a simple example of computing a scalar +temperature. Compute_ke_atom.cpp is a simple example of computing +per-atom kinetic energy.

      -

      Search the dump_custom.cpp and dump_custom.h files for the word -"customize". It appears in roughly half a dozen locations. In each -of the locations you can add a bit of code that will extend the -DumpCustom class to enable it to dump a new quantity. E.g. you will -add a keyword, add an if test, add a new small method that packs the -requested data into a buffer, etc. For the latter, you can perform a -modest amount of computation in this method; see the pack_xs() -function for an example. -

      -

      If desired, a dump custom option can also compute more complicated -quantities by invoking a fix that computed quantities at the end of a -timestep (should be the same timestep the dump is invoked on). See -the ENERGY, CENTRO, and stress options (SXX, SYY, etc) in -dump_custom.cpp for examples. -

      -

      When you re-make LAMMPS, your new option should now be useable via the -dump custom command. -

      -
      - -

      Thermodynamic output options -

      -

      There is only one class that computes and prints thermodynamic -information to the screen and log file, although the -thermo_style command treats its options as styles. -

      -

      There are several styles defined in thermo.cpp: "one", "multi", and -"granular". There is also a flexible "custom" style which allows you -to specify what quantities will be printed each timestep where -thermodynamics is computed. See the thermo_style -command for a list of pre-defined quantities. -

      -

      Here is how you can extend the thermo output capabilities. Search the -thermo.cpp and thermo.h files for the word "customize" which will tell -you where to make these additions. Note that fixes can also print-out -thermodynamic quantities via the fix_modify command, -so you do not need to modify thermo.cpp to print fix information. -

      -

      If you want to create a new style (like "one" or "granular") that -prints a collection of pre-defined quantities, you add a few lines -that define the new style to thermo.cpp. First, add a #DEFINE line at -the top of the file which lists the quantities to print. Then add the -style name you have chosen to the if test in the constructor to copy -the defined string to the line variable. -

      -

      You can also add new quantities to the custom list. Add your new -keyword to the if test in the parse_fields() function where the call -to addfield() specifies the text string (8 character max) that will be -printed with the quantity, the function that will compute it, and the -data type (INT,FLOAT) of the quantity. Then at the bottom of the -file, add a function compute_*() which computes the quantity you wish -to print. The function assigns the quantity to the variable "dvalue" -if it is a floating-point quantity, or to "ivalue" if it is an -integer. See the other compute_*() functions for examples of how -various quantities can be accessed, computed, summed across -processors, normalized as per-atom values, etc. Also, if it makes -sense to allow the quantity to be stored in a variable in the input -script, add a couple of lines to the compute_value() function that is -called when a variable is evaluated. Finally, add a prototype for -your new compute method to thermo.h. -

      -
      - -

      Temperature computation options -

      -

      All classes that compute the temperature of the system are sub-classes -of the Temperature class. See the temperature.h file for a list of -methods these classes defines. Temperatures are computed by LAMMPS -when velocities are set, when thermodynamics are computed, and when -temperature is controlled by various thermostats like the fix -nvt of fix langevin commands. -

      -

      Temp_full.cpp and temp_full.h are the simplest example of a -Temperature class. They implement the full style of the -temperature command. -

      -

      Here is a brief description of the class methods in temperature.h: +

      Here is a brief description of methods you define in your new derived +class. See compute.h for details.

      compute the workhorse routine that computes the molecular interactions
      compute compute the molecular interactions
      coeff set coefficients for one bond type
      equilibrium_distance length of bond, used by SHAKE
      write & read_restart writes/reads coeffs to restart files
      - - + + + + + + +
      init setup the temperature computation
      compute compute and return temperature +
      compute_scalar compute a scalar quantity
      compute_vector compute a vector of quantities
      compute_peratom compute one or more quantities per atom
      pack_comm pack a buffer with items to communicate
      unpack_comm unpack the buffer
      pack_reverse pack a buffer with items to reverse communicate
      unpack_reverse unpack the buffer
      memory_usage tally memory usage

      -

      Region geometry options +

      Dump styles

      -

      All classes that define geometric regions are sub-classes of the -Region class. See the region.h file for a list of methods these -classes defines. Regions are used elsewhere in LAMMPS to group atoms, -delete atoms to create a void, insert atoms in a specified region, -etc. +

      Dump custom output options +

      +

      Classes that dump per-atom info to files are derived from the Dump +class. To dump new quantities or in a new format, a new derived dump +class can be added, but it is typically simpler to modify the +DumpCustom class contained in the dump_custom.cpp file.

      -

      Region_sphere.cpp and region_sphere.h are the simplest example of a -Region class. They implement the sphere style of the -region command. +

      Dump_atom.cpp is a simple example of a derived dump class.

      -

      Here is a brief description of the single class method required: +

      Here is a brief description of methods you define in your new derived +class. See dump.h for details.

      - + + +
      match determine whether a point is in the region +
      write_header write the header section of a snapshot of atoms
      count count the number of lines a processor will output
      pack pack a proc's output data into a buffer
      write_data write a proc's data to a file
      +

      See the dump command and its custom style for a list of +keywords for atom information that can already be dumped by +DumpCustom. It includes options to dump per-atom info from Compute +classes, so adding a new derived Compute class is one way to calculate +new quantities to dump. +

      +

      Alternatively, you can add new keywords to the dump custom command. +Search for the word "customize" in dump_custom.cpp to see the +half-dozen or so locations where code will need to be added. +


      -

      Fix options +

      Fix styles

      In LAMMPS, a "fix" is any operation that is computed during timestepping that alters some property of the system. Essentially everything that happens during a simulation besides force computation, -neighbor list manipulation, and output, is a "fix". This includes -time integration (update of velocity and coordinates), force -constraints (SHAKE or walls), and diagnostics (compute a diffusion -coefficient). See the fix.h file for a list of methods these classes -defines. +neighbor list construction, and output, is a "fix". This includes +time integration (update of coordinates and velocities), force +constraints or boundary conditions (SHAKE or walls), and diagnostics +(compute a diffusion coefficient). New styles can be created to add +new options to LAMMPS.

      -

      There are dozens of fix options in LAMMPS; choose one as a template -that is similar to what you want to implement. They can be as simple -as zeroing out forces (see fix enforce2d which -corresponds to the enforce2d style) or as complicated as applying -SHAKE constraints on bonds and angles (see fix shake -which corresponds to the shake style) which involves many extra -computations. +

      Fix_setforce.cpp is a simple example of setting forces on atoms to +prescribed values. There are dozens of fix options already in LAMMPS; +choose one as a template that is similar to what you want to +implement.

      -

      Here is a brief description of the class methods in fix.h: +

      Here is a brief description of methods you can define in your new +derived class. See fix.h for details.

      @@ -347,8 +305,7 @@ computations. - -
      setmask determines when the fix is called during the timestep
      unpack_comm unpack a buffer to communicate a per-atom quantity
      pack_reverse_comm pack a buffer to reverse communicate a per-atom quantity
      unpack_reverse_comm unpack a buffer to reverse communicate a per-atom quantity
      thermo_fields define quantities for thermodynamic output
      thermo_compute compute thermodynamic quantities +
      thermo compute quantities for thermodynamic output

      Typically, only a small fraction of these methods are defined for a @@ -363,130 +320,201 @@ when to call the fix. By convention, this is the first argument the fix defines (after the ID, group-ID, style).

      If the fix needs to store information for each atom that persists from -timestep to timestep, it can manage that memory and migrate it with -the atoms as they move from processors to processor by implementing -the grow_arrays, copy_arrays, pack_exchange, and unpack_exchange -methods. Similarly, the pack_restart and unpack_restart methods can be -implemented to store information about the fix in restart files. If -you wish an integrator or force constraint fix to work with rRESPA (see -the run_style command), the initial_integrate, -post_force_integrate, and final_integrate_respa methods can be -implemented. The thermo_fields and thermo_compute methods enable a -fix to contribute values to thermodynamic output, as printed +timestep to timestep, it can manage that memory and migrate the info +with the atoms as they move from processors to processor by +implementing the grow_arrays, copy_arrays, pack_exchange, and +unpack_exchange methods. Similarly, the pack_restart and +unpack_restart methods can be implemented to store information about +the fix in restart files. If you wish an integrator or force +constraint fix to work with rRESPA (see the run_style +command), the initial_integrate, post_force_integrate, and +final_integrate_respa methods can be implemented. The thermo method +enables a fix to contribute values to thermodynamic output, as printed quantities and/or to be summed to the potential energy of the system.


      -

      Atom options +

      Input script commands

      -

      All classes that define an atom style are sub-classes of the Atom -class. See the atom.h file for a list of methods these classes -defines. The atom style determines what quantities are associated -with an atom in a LAMMPS simulation. If one of the existing atom -styles does not define all the arrays you need to store with an atom, -then a new atom class can be created. -

      -

      Atom_atomic.cpp and atom_atomic.h are the simplest example of an Atom -class. They implement the atomic style of the -atom_style command. -

      -

      Here is a brief description of the class methods in atom.h: -

      -
      - - - - - - - - - -
      copy copy info for one atom to another atom's array location
      pack_comm store an atom's info in a buffer communicated every timestep
      unpack_comm retrieve an atom's info from the buffer
      pack_reverse store an atom's info in a buffer communicating partial forces
      unpack_reverse retrieve an atom's info from the buffer
      pack_border store an atom's info in a buffer communicated on neighbor re-builds
      unpack_border retrieve an atom's info from the buffer
      pack_exchange store all an atom's info to migrate to another processor
      unpack_exchange retrieve an atom's info from the buffer
      -
      - -

      There are also several methods in atom.cpp you will need to augment -with information about your new atom class, following the patterns of -the other atom styles. These routines are so similar for all classes, -that it was simpler to just have one master routine for all classes. -

      -
      - - - - - - - - - - - - -
      constructor create style variable and atom array ptrs to NULL
      destructor free memory for atom arrays
      set_style set style variable
      check_style check for pure style vs hybrid style
      style2arg convert style variables to keywords
      grow re-allocate atom arrays to longer lengths
      unpack_data parse atom lines from data file
      create_one create an individual atom of this style
      size_restart number of restart quantities associated with proc's atoms
      pack_restart pack atom quantities into a buffer
      unpack_restart unpack atom quantities from a buffer
      memory_usage memory allocated by atom arrays
      -
      - -
      - -

      Variable options -

      -

      The variable class stores and evaluates input script variables $a, $b, -... $z, as described in this section. -Equal-style variables are defined by an equation that is evaluated -each time the variable is used. The equation can include functions, -vectors, keywords, and numbers as described in the -variable command. The list of valid functions, -vectors, and keywords, can be extended by adding a few lines of code -to the evaluate() method at the end of the variable.cpp file. Search -for the word "customize" to find the correct locations for adding -code. -

      -

      A new function (e.g. foo(arg1,arg2,...)) can be added in the section -that starts with the comment -

      -
      // customize by adding function to this list and to if statement 
      -
      -

      A new vector (e.g. q) can be added in the section that starts with -the comment -

      -
      // customize by adding vector to this list and to if statement 
      -
      -

      A new keyword (e.g. mysum) can be added in the section that starts with -the comment -

      -
      // customize by adding keyword to this list and to if statement 
      -
      -

      Note that keywords supported by the thermo_style -custom command are evaluated by the thermo routines, -so do not need to be added to variable.cpp. -

      -
      - -

      New top-level commands -

      -

      It is possible to add a new command to a LAMMPS input script as -opposed to adding a new style to an existing command (atom_style, -pair_style, fix, etc). For example the create_atoms, read_data, -velocity, and run commands are all top-level LAMMPS commands that are -listed in the Command section of style.h. When such a command is -encountered in the LAMMPS input script, the topmost level of LAMMPS -(lammps.cpp) simply creates a class with the corresponding name, +

      New commands can be added to LAMMPS input scripts by adding new +classes that have a "command" method and are listed in the Command +sections of style.h (or style_user.h). For example, the create_atoms, +read_data, velocity, and run commands are all implemented in this +fashion. When such a command is encountered in the LAMMPS input +script, LAMMPS simply creates a class with the corresponding name, invokes the "command" method of the class, and passes it the arguments from the input script. The command method can perform whatever -operations it wishes on the LAMMPS data structures. +operations it wishes on LAMMPS data structures.

      -

      Thus to add a new command, you simply need to add a *.cpp and *.h file -containing a single class: +

      The single method your new class must define is as follows:

      command operations performed by the new command
      -

      Of course, the new class can define other methods and variables that -it uses internally. +

      Of course, the new class can define other methods and variables as +needed.


      +

      Kspace computations +

      +

      Classes that compute long-range Coulombic interactions via K-space +represenations (Ewald, PPPM) are derived from the KSpace class. New +styles can be created to add new K-space options to LAMMPS. +

      +

      Ewald.cpp is an example of computing K-space interactions. +

      +

      Here is a brief description of methods you define in your new derived +class. See kspace.h for details. +

      +
      + + + +
      init initialize the calculation before a run
      setup computation before the 1st timestep of a run
      compute every-timestep computation
      memory_usage tally of memory usage +
      + +
      + +

      Minimization solvers +

      +

      Classes that perform energy minimization derived from the Min class. +New styles can be created to add new minimization algorithms to +LAMMPS. +

      +

      Min_cg.cpp is an example of conjugate gradient minimization. +

      +

      Here is a brief description of methods you define in your new derived +class. See min.h for details. +

      +
      + + +
      init initialize the minimization before a run
      run perform the minimization
      memory_usage tally of memory usage +
      + +
      + +

      Pairwise potentials +

      +

      Classes that compute pairwise interactions are derived from the Pair +class. In LAMMPS, pairwise calculation include manybody potentials +such as EAM or Tersoff where particles interact without a static bond +topology. New styles can be created to add new pair potentials to +LAMMPS. +

      +

      Pair_lj_cut.cpp is a simple example of a Pair class, though it +includes some optional methods to enable its use with rRESPA. +

      +

      Here is a brief description of the class methods in pair.h: +

      +
      + + + + + + + + +
      compute workhorse routine that computes pairwise interactions
      settings reads the input script line with arguments you define
      coeff set coefficients for one i,j type pair
      init_one perform initialization for one i,j type pair
      init_style initialization specific to this pair style
      write & read_restart write/read i,j pair coeffs to restart files
      write & read_restart_settings write/read global settings to restart files
      single force and energy of a single pairwise interaction between 2 atoms
      compute_inner/middle/outer versions of compute used by rRESPA +
      + +

      The inner/middle/outer routines are optional. +

      +
      + +

      Region styles +

      +

      Classes that define geometric regions are derived from the Region +class. Regions are used elsewhere in LAMMPS to group atoms, delete +atoms to create a void, insert atoms in a specified region, etc. New +styles can be created to add new region shapes to LAMMPS. +

      +

      Region_sphere.cpp is an example of a spherical region. +

      +

      Here is a brief description of methods you define in your new derived +class. See region.h for details. +

      +
      +
      match determine whether a point is in the region +
      + +
      + +

      Thermodynamic output options +

      +

      There is one class that computes and prints thermodynamic information +to the screen and log file; see the file thermo.cpp. +

      +

      There are several styles defined in thermo.cpp: "one", "multi", +"granular", etc. There is also a flexible "custom" style which allows +the user to explicitly list keywords for quantities to print when +thermodynamic info is output. See the +thermo_style command for a list of defined +quantities. +

      +

      The thermo styles (one, multi, etc) are simply lists of keywords. +Adding a new style thus only requies defining a new list of keywords. +Search for the word "customize" with references to "thermo style" in +thermo.cpp to see the two locations where code will need to be added. +

      +

      New keywords can also be added to thermo.cpp to compute new quantities +for output. Search for the word "customize" with references to +"keyword" in thermo.cpp to see the several locations where code will +need to be added. +

      +

      Note that the thermo_style custom command already allows +for thermo output of quantities calculated by fixes, +computes, and variables. Thus, it may +be simpler to compute what you wish via one of those constructs, than +by adding a new keyword to the thermo command. +

      +
      + +

      Variable options +

      +

      There is one class that computes and stores variable +information in LAMMPS; see the file variable.cpp. The value +associated with a variable can be periodically printed to the screen +via the print, fix print, or +thermo_style custom commands. Variables of style +"equal" can compute complex equations that involve the following types +of arguments: +

      +

      thermo keywords = ke, vol, atoms, ... +other variables = v_a, v_myvar, ... +math functions = div(x,y), mult(x,y), add(x,y), ... +group functions = mass(group), xcm(group,x), ... +atom values = x123, y3, vx34, ... +compute values = c_mytemp0, c_thermo_press3, ... +

      +

      Adding keywords for the thermo_style custom command +(which can then be accessed by variables) was discussed +here on this page. +

      +

      Adding a new math function of one or two arguments can be done by +editing one section of the Variable::evaulate() method. Search for +the word "customize" to find the appropriate location. +

      +

      Adding a new group function can be done by editing one section of the +Variable::evaulate() method. Search for the word "customize" to find +the appropriate location. You may need to add a new method to the +Group class as well (see the group.cpp file). +

      +

      Accessing a new atom-based vector can be done by editing one section +of the Variable::evaulate() method. Search for the word "customize" +to find the appropriate location. +

      +

      Adding new compute styles (whose calculated values can +then be accessed by variables) was discussed +here on this page. +

      +
      + +
      +

      (Foo) Foo, Morefoo, and Maxfoo, J of Classic Potentials, 75, 345 (1997). diff --git a/doc/Section_modify.txt b/doc/Section_modify.txt index be68a29efc..df8a158a9f 100644 --- a/doc/Section_modify.txt +++ b/doc/Section_modify.txt @@ -11,29 +11,34 @@ Section"_Section_errors.html :c 8. Modifying & extending LAMMPS :h3 LAMMPS is designed in a modular fashion so as to be easy to modify and -extend with new functionality. In this section, changes and additions -users can make are listed along with some minimal instructions. -Realistically, the best way to add a new feature is to find a similar -feature in LAMMPS and look at the corresponding source and header -files to figure out what it does. You will need some knowledge of C++ -to be able to understand the hi-level structure of LAMMPS and its -class organization, but functions (class methods) that do actual -computations are written in vanilla C-style code and operate on simple -C-style data structures (vectors and arrays). +extend with new functionality. In fact, about 75% if its source code +is files added in this fashion. + +In this section, changes and additions users can make are listed along +with minimal instructions. The best way to add a new feature is to +find a similar feature in LAMMPS and look at the corresponding source +and header files to figure out what it does. You will need some +knowledge of C++ to be able to understand the hi-level structure of +LAMMPS and its class organization, but functions (class methods) that +do actual computations are written in vanilla C-style code and operate +on simple C-style data structures (vectors and arrays). Most of the new features described in this section require you to -write a new C++ class (except for dump, thermo, and variable options, -described below, where you can make small edits to existing files). -Creating a new class requires 2 files, a source code file (*.cpp) and -a header file (*.h). Their contents are briefly discussed below. -Enabling LAMMPS to invoke the new class is as simple as adding two -definition lines to the style_user.h file, in the same syntax as the -existing LAMMPS classes are defined in the style.h file. +write a new C++ derived class (except for exceptions described below, +where you can make small edits to existing files). Creating a new +class requires 2 files, a source code file (*.cpp) and a header file +(*.h). The derived class must provide certain methods to work as a +new option. Depending on how different your new feature is compared +to existing features, you can either derive from the base class +itself, or from a derived class that already exists. Enabling LAMMPS +to invoke the new class is as simple as adding two lines to the +style_user.h file, in the same syntax as other LAMMPS classes are +specified in the style.h file. -The power of C++ and its object-orientation is that usually, all the -code and variables needed to define the new feature are contained in -the 2 files you write, and thus shouldn't make the rest of the code -more complex or cause side-effect bugs. +The advantage of C++ and its object-orientation is that all the code +and variables needed to define the new feature are in the 2 files you +write, and thus shouldn't make the rest of LAMMPS more complex or +cause side-effect bugs. Here is a concrete example. Suppose you write 2 files pair_foo.cpp and pair_foo.h that define a new class PairFoo that computes pairwise @@ -43,8 +48,8 @@ command like pair_style foo 0.1 3.5 :pre -you simply need to put your 2 files in the LAMMPS src directory, add 2 -lines to the style_user.h file, and re-make the code. +you put your 2 files in the LAMMPS src directory, add 2 lines to the +style_user.h file, and re-make the code. The first line added to style_user.h would be @@ -66,107 +71,119 @@ the executable and can be invoked with a pair_style command like the example above. Arguments like 0.1 and 3.5 can be defined and processed by your new class. -Note that if you are using Makefile.list instead of Makefile to build -LAMMPS, you will need to explicitly add the names of your new .cpp and -.h file to Makefile.list. +Here is a list of the new features that can be added in this way: -Here is a list of the kinds of new features that can be added in this -way. The dump and thermo options do not typically require new styles; -LAMMPS can simply be recompiled after new code is added to -dump_custom.cpp or thermo_custom.cpp. - -"Pairwise potentials"_#pair +"Atom styles"_#atom "Bond, angle, dihedral, improper potentials"_#bond -"Dump options"_#dump -"Thermodynamic output options"_#thermo -"Temperature computation options"_#temp -"Region geometry options"_#region -"Fix options"_#fix which include integrators, \ +"Compute styles"_#compute +"Dump styles"_#dump +"Fix styles"_#fix which include integrators, \ temperature and pressure control, force constraints, \ boundary conditions, diagnostic output, etc -"Atom options"_#atom -"Variable options"_#variable -"New top-level commands"_#command :ul +"Input script commands"_#command +"Kspace computations"_#kspace +"Minimization solvers"_#min +"Pairwise potentials"_#pair +"Region styles"_#region :ul -As illustrated by the pairwise example, these options are -referred to in the LAMMPS documentation as the "style" of a particular -command. +As illustrated by the pairwise example, these options are referred to +in the LAMMPS documentation as the "style" of a particular command. -The instructions below for each category will list the header file for -the parent class that these styles are sub-classes of. Public -variables in that file are ones used and set by the sub-classes which -are also used by the parent class. Sometimes they are also used by -the rest of LAMMPS. Virtual functions in the header file which are -set = 0 are ones you must define in your new class to give it the -functionality LAMMPS expects. Virtual functions that are not set to 0 -are functions you can optionally define. +The instructions below give the header file for the base class that +these styles are derived from. Public variables in that file are ones +used and set by the derived classes which are also used by the base +class. Sometimes they are also used by the rest of LAMMPS. Virtual +functions in the base class header file which are set = 0 are ones you +must define in your new derived class to give it the functionality +LAMMPS expects. Virtual functions that are not set to 0 are functions +you can optionally define. -Here are some additional guidelines for modifying LAMMPS and adding -new functionality: +Additionally, new output options can be added directly to the +thermo.cpp, dump_custom.cpp, and variable.cpp files as explained in +these sections: + +"Dump custom output options"_#dump_custom +"Thermodynamic output options"_#thermo +"Variable options"_#variable :ul + +:line + +Here are additional guidelines for modifying LAMMPS and adding new +functionality: Think about whether what you want to do would be better as a pre- or post-processing step. Many computations are more easily and more -quickly done that way. +quickly done that way. :ulb,l Don't do anything within the timestepping of a run that isn't parallel. E.g. don't accumulate a bunch of data on a single processor and analyze it. You run the risk of seriously degrading the parallel -efficiency. +efficiency. :l If your new feature reads arguments or writes output, make sure you follow the unit conventions discussed by the "units"_units.html -command. +command. :l If you add something you think is truly useful and doesn't impact LAMMPS performance when it isn't used, send an email to the "developers"_http://lammps.sandia.gov/authors.html. We might be -interested in adding it to the LAMMPS distribution. +interested in adding it to the LAMMPS distribution. :l,ule +:line :line -Pairwise potentials :link(pair),h4 +Atom styles :link(atom),h4 -All classes that compute pairwise interactions are sub-classes of the -Pair class. See the pair.h file for a list of methods this class -defines. +Classes that define an atom style are derived from the Atom class. +The atom style determines what quantities are associated with an atom. +A new atom style can be created if one of the existing atom styles +does not define all the arrays you need to store and communicate with +atoms. -Pair_lj_cut.cpp and pair_lj_cut.h are the simplest example of a Pair -class. They implement the {lj/cut} style of the -"pair_style"_pair_style.html command. +Atom_vec_atomic.cpp is a simple example of an atom style. -Here is a brief description of the class methods in pair.h: +Here is a brief description of methods you define in your new derived +class. See atom.h for details. -compute: the workhorse routine that computes the pairwise interactions -settings: reads the input script line with any arguments you define -coeff: set coefficients for one i,j type pair -init_one: perform initialization for one i,j type pair -write & read_restart: write/read i,j pair coeffs to restart files -write & read_restart_settings: write/read global settings to restart files -single: force and energy of a single pairwise interaction between 2 atoms -compute_inner/middle/outer: versions of compute used by rRESPA :tb(s=:) +grow: re-allocate atom arrays to longer lengths +copy: copy info for one atom to another atom's array locations +pack_comm: store an atom's info in a buffer communicated every timestep +unpack_comm: retrieve an atom's info from the buffer +pack_reverse: store an atom's info in a buffer communicating partial forces +unpack_reverse: retrieve an atom's info from the buffer +pack_border: store an atom's info in a buffer communicated on neighbor re-builds +unpack_border: retrieve an atom's info from the buffer +pack_exchange: store all an atom's info to migrate to another processor +unpack_exchange: retrieve an atom's info from the buffer +size_restart: number of restart quantities associated with proc's atoms +pack_restart: pack atom quantities into a buffer +unpack_restart: unpack atom quantities from a buffer +create_atom: create an individual atom of this style +data_atom: parse an atom line from the data file +memory_usage: tally memory allocated by atom arrays :tb(s=:) -The inner/middle/outer routines are optional. Only a few of the -pairwise potentials use these in conjunction with rRESPA as set by the -"run_style"_run_style.html command. +The constructor of the derived class sets values for several variables +that you must set when defining a new atom style. The atom arrays +themselves are defined in atom.cpp. Search for the word "customize" +and you will find locations you will need to modify. :line Bond, angle, dihedral, improper potentials :link(bond),h4 -All classes that compute molecular interactions are sub-classes of the -Bond, Angle, Dihedral, and Improper classes. See the bond.h, angle.h, -dihedral.h, and improper.h file for a list of methods these classes -defines. +Classes that compute molecular interactions are derived from the Bond, +Angle, Dihedral, and Improper classes. New styles can be created to +add new potentials to LAMMPS. -Bond_harmonic.cpp and bond_harmonic.h are the simplest example of a -Bond class. Ditto for the harmonic forms of the angle, dihedral, and -improper style commands. The bond_harmonic files implement the -{harmonic} style of the "bond_style"_bond_style.html command. +Bond_harmonic.cpp is the simplest example of a bond style. Ditto for +the harmonic forms of the angle, dihedral, and improper style +commands. -Here is a brief description of the class methods in bond.h, angle.h, -etc: +Here is a brief description of methods you define in your new derived +bond class. See bond.h, angle.h, dihedral.h, and improper.h for +details. -compute: the workhorse routine that computes the molecular interactions +compute: compute the molecular interactions coeff: set coefficients for one bond type equilibrium_distance: length of bond, used by SHAKE write & read_restart: writes/reads coeffs to restart files @@ -174,141 +191,80 @@ single: force and energy of a single bond :tb(s=:) :line -Dump options :link(dump),h4 +Compute styles :link(compute),h4 -There are several classes that print dump files (snapshots of atoms) -that are sub-classes of the Dump class. These include the -dump_atom.cpp, dump_bond.cpp, and dump_custom.cpp files. +Classes that compute scalar and vector quantities like temperature +and the pressure tensor, as well as classes that compute per-atom +quantities like kinetic energy and the centro-symmetry parameter +are derived from the Compute class. New styles can be created +to add new calculations to LAMMPS. -New dump classes can be added, but it is typically simpler to modify -the DumpCustom class contained in the dump_custom.cpp file. See the -"dump"_dump.html command and its {custom} style for a list of what -atom information can already be dumped by DumpCustom. If the -attribute you want to dump is not in the list, or if you define a "new -atom style"_#atom with new attributes (e.g. atoms that store their own -magnetic moment), here is how to dump it out in a snapshot file: +Compute_temp.cpp is a simple example of computing a scalar +temperature. Compute_ke_atom.cpp is a simple example of computing +per-atom kinetic energy. -Search the dump_custom.cpp and dump_custom.h files for the word -"customize". It appears in roughly half a dozen locations. In each -of the locations you can add a bit of code that will extend the -DumpCustom class to enable it to dump a new quantity. E.g. you will -add a keyword, add an if test, add a new small method that packs the -requested data into a buffer, etc. For the latter, you can perform a -modest amount of computation in this method; see the pack_xs() -function for an example. +Here is a brief description of methods you define in your new derived +class. See compute.h for details. -If desired, a dump custom option can also compute more complicated -quantities by invoking a fix that computed quantities at the end of a -timestep (should be the same timestep the dump is invoked on). See -the ENERGY, CENTRO, and stress options (SXX, SYY, etc) in -dump_custom.cpp for examples. - -When you re-make LAMMPS, your new option should now be useable via the -dump custom command. +compute_scalar: compute a scalar quantity +compute_vector: compute a vector of quantities +compute_peratom: compute one or more quantities per atom +pack_comm: pack a buffer with items to communicate +unpack_comm: unpack the buffer +pack_reverse: pack a buffer with items to reverse communicate +unpack_reverse: unpack the buffer +memory_usage: tally memory usage :tb(s=:) :line -Thermodynamic output options :link(thermo),h4 +Dump styles :link(dump),h4 +Dump custom output options :link(dump_custom),h4 -There is only one class that computes and prints thermodynamic -information to the screen and log file, although the -"thermo_style"_thermo_style.html command treats its options as styles. +Classes that dump per-atom info to files are derived from the Dump +class. To dump new quantities or in a new format, a new derived dump +class can be added, but it is typically simpler to modify the +DumpCustom class contained in the dump_custom.cpp file. -There are several styles defined in thermo.cpp: "one", "multi", and -"granular". There is also a flexible "custom" style which allows you -to specify what quantities will be printed each timestep where -thermodynamics is computed. See the "thermo_style"_thermo_style.html -command for a list of pre-defined quantities. +Dump_atom.cpp is a simple example of a derived dump class. -Here is how you can extend the thermo output capabilities. Search the -thermo.cpp and thermo.h files for the word "customize" which will tell -you where to make these additions. Note that fixes can also print-out -thermodynamic quantities via the "fix_modify"_fix_modify.html command, -so you do not need to modify thermo.cpp to print fix information. +Here is a brief description of methods you define in your new derived +class. See dump.h for details. -If you want to create a new style (like "one" or "granular") that -prints a collection of pre-defined quantities, you add a few lines -that define the new style to thermo.cpp. First, add a #DEFINE line at -the top of the file which lists the quantities to print. Then add the -style name you have chosen to the if test in the constructor to copy -the defined string to the line[] variable. +write_header: write the header section of a snapshot of atoms +count: count the number of lines a processor will output +pack: pack a proc's output data into a buffer +write_data: write a proc's data to a file :tb(s=:) -You can also add new quantities to the custom list. Add your new -keyword to the if test in the parse_fields() function where the call -to addfield() specifies the text string (8 character max) that will be -printed with the quantity, the function that will compute it, and the -data type (INT,FLOAT) of the quantity. Then at the bottom of the -file, add a function compute_*() which computes the quantity you wish -to print. The function assigns the quantity to the variable "dvalue" -if it is a floating-point quantity, or to "ivalue" if it is an -integer. See the other compute_*() functions for examples of how -various quantities can be accessed, computed, summed across -processors, normalized as per-atom values, etc. Also, if it makes -sense to allow the quantity to be stored in a variable in the input -script, add a couple of lines to the compute_value() function that is -called when a variable is evaluated. Finally, add a prototype for -your new compute method to thermo.h. +See the "dump"_dump.html command and its {custom} style for a list of +keywords for atom information that can already be dumped by +DumpCustom. It includes options to dump per-atom info from Compute +classes, so adding a new derived Compute class is one way to calculate +new quantities to dump. + +Alternatively, you can add new keywords to the dump custom command. +Search for the word "customize" in dump_custom.cpp to see the +half-dozen or so locations where code will need to be added. :line -Temperature computation options :link(temp),h4 - -All classes that compute the temperature of the system are sub-classes -of the Temperature class. See the temperature.h file for a list of -methods these classes defines. Temperatures are computed by LAMMPS -when velocities are set, when thermodynamics are computed, and when -temperature is controlled by various thermostats like the "fix -nvt"_fix_nvt.html of "fix langevin"_fix_langevin.html commands. - -Temp_full.cpp and temp_full.h are the simplest example of a -Temperature class. They implement the {full} style of the -"temperature"_temperature.html command. - -Here is a brief description of the class methods in temperature.h: - -init: setup the temperature computation -compute: compute and return temperature :tb(s=:) - -:line - -Region geometry options :link(region),h4 - -All classes that define geometric regions are sub-classes of the -Region class. See the region.h file for a list of methods these -classes defines. Regions are used elsewhere in LAMMPS to group atoms, -delete atoms to create a void, insert atoms in a specified region, -etc. - -Region_sphere.cpp and region_sphere.h are the simplest example of a -Region class. They implement the {sphere} style of the -"region"_region.html command. - -Here is a brief description of the single class method required: - -match: determine whether a point is in the region :tb(s=:) - -:line - -Fix options :link(fix),h4 +Fix styles :link(fix),h4 In LAMMPS, a "fix" is any operation that is computed during timestepping that alters some property of the system. Essentially everything that happens during a simulation besides force computation, -neighbor list manipulation, and output, is a "fix". This includes -time integration (update of velocity and coordinates), force -constraints (SHAKE or walls), and diagnostics (compute a diffusion -coefficient). See the fix.h file for a list of methods these classes -defines. +neighbor list construction, and output, is a "fix". This includes +time integration (update of coordinates and velocities), force +constraints or boundary conditions (SHAKE or walls), and diagnostics +(compute a diffusion coefficient). New styles can be created to add +new options to LAMMPS. -There are dozens of fix options in LAMMPS; choose one as a template -that is similar to what you want to implement. They can be as simple -as zeroing out forces (see "fix enforce2d"_fix_enforce2d.html which -corresponds to the {enforce2d} style) or as complicated as applying -SHAKE constraints on bonds and angles (see "fix shake"_fix_shake.html -which corresponds to the {shake} style) which involves many extra -computations. +Fix_setforce.cpp is a simple example of setting forces on atoms to +prescribed values. There are dozens of fix options already in LAMMPS; +choose one as a template that is similar to what you want to +implement. -Here is a brief description of the class methods in fix.h: +Here is a brief description of methods you can define in your new +derived class. See fix.h for details. setmask: determines when the fix is called during the timestep init: initialization before a run @@ -337,8 +293,7 @@ pack_comm: pack a buffer to communicate a per-atom quantity unpack_comm: unpack a buffer to communicate a per-atom quantity pack_reverse_comm: pack a buffer to reverse communicate a per-atom quantity unpack_reverse_comm: unpack a buffer to reverse communicate a per-atom quantity -thermo_fields: define quantities for thermodynamic output -thermo_compute: compute thermodynamic quantities :tb(s=:) +thermo: compute quantities for thermodynamic output :tb(s=:) Typically, only a small fraction of these methods are defined for a particular fix. Setmask is mandatory, as it determines when the fix @@ -352,122 +307,188 @@ when to call the fix. By convention, this is the first argument the fix defines (after the ID, group-ID, style). If the fix needs to store information for each atom that persists from -timestep to timestep, it can manage that memory and migrate it with -the atoms as they move from processors to processor by implementing -the grow_arrays, copy_arrays, pack_exchange, and unpack_exchange -methods. Similarly, the pack_restart and unpack_restart methods can be -implemented to store information about the fix in restart files. If -you wish an integrator or force constraint fix to work with rRESPA (see -the "run_style"_run_style.html command), the initial_integrate, -post_force_integrate, and final_integrate_respa methods can be -implemented. The thermo_fields and thermo_compute methods enable a -fix to contribute values to thermodynamic output, as printed +timestep to timestep, it can manage that memory and migrate the info +with the atoms as they move from processors to processor by +implementing the grow_arrays, copy_arrays, pack_exchange, and +unpack_exchange methods. Similarly, the pack_restart and +unpack_restart methods can be implemented to store information about +the fix in restart files. If you wish an integrator or force +constraint fix to work with rRESPA (see the "run_style"_run_style.html +command), the initial_integrate, post_force_integrate, and +final_integrate_respa methods can be implemented. The thermo method +enables a fix to contribute values to thermodynamic output, as printed quantities and/or to be summed to the potential energy of the system. :line -Atom options :link(atom),h4 +Input script commands :link(command),h4 -All classes that define an atom style are sub-classes of the Atom -class. See the atom.h file for a list of methods these classes -defines. The atom style determines what quantities are associated -with an atom in a LAMMPS simulation. If one of the existing atom -styles does not define all the arrays you need to store with an atom, -then a new atom class can be created. +New commands can be added to LAMMPS input scripts by adding new +classes that have a "command" method and are listed in the Command +sections of style.h (or style_user.h). For example, the create_atoms, +read_data, velocity, and run commands are all implemented in this +fashion. When such a command is encountered in the LAMMPS input +script, LAMMPS simply creates a class with the corresponding name, +invokes the "command" method of the class, and passes it the arguments +from the input script. The command method can perform whatever +operations it wishes on LAMMPS data structures. -Atom_atomic.cpp and atom_atomic.h are the simplest example of an Atom -class. They implement the {atomic} style of the -"atom_style"_atom_style.html command. +The single method your new class must define is as follows: -Here is a brief description of the class methods in atom.h: +command: operations performed by the new command :tb(s=:) -copy: copy info for one atom to another atom's array location -pack_comm: store an atom's info in a buffer communicated every timestep -unpack_comm: retrieve an atom's info from the buffer -pack_reverse: store an atom's info in a buffer communicating partial forces -unpack_reverse: retrieve an atom's info from the buffer -pack_border: store an atom's info in a buffer communicated on neighbor re-builds -unpack_border: retrieve an atom's info from the buffer -pack_exchange: store all an atom's info to migrate to another processor -unpack_exchange: retrieve an atom's info from the buffer -:tb(s=:) +Of course, the new class can define other methods and variables as +needed. -There are also several methods in atom.cpp you will need to augment -with information about your new atom class, following the patterns of -the other atom styles. These routines are so similar for all classes, -that it was simpler to just have one master routine for all classes. +:line -constructor: create style variable and atom array ptrs to NULL -destructor: free memory for atom arrays -set_style: set style variable -check_style: check for pure style vs hybrid style -style2arg: convert style variables to keywords -grow: re-allocate atom arrays to longer lengths -unpack_data: parse atom lines from data file -create_one: create an individual atom of this style -size_restart: number of restart quantities associated with proc's atoms -pack_restart: pack atom quantities into a buffer -unpack_restart: unpack atom quantities from a buffer -memory_usage: memory allocated by atom arrays -:tb(s=:) +Kspace computations :link(kspace),h4 + +Classes that compute long-range Coulombic interactions via K-space +represenations (Ewald, PPPM) are derived from the KSpace class. New +styles can be created to add new K-space options to LAMMPS. + +Ewald.cpp is an example of computing K-space interactions. + +Here is a brief description of methods you define in your new derived +class. See kspace.h for details. + +init: initialize the calculation before a run +setup: computation before the 1st timestep of a run +compute: every-timestep computation +memory_usage: tally of memory usage :tb(s=:) + +:line + +Minimization solvers :link(min),h4 + +Classes that perform energy minimization derived from the Min class. +New styles can be created to add new minimization algorithms to +LAMMPS. + +Min_cg.cpp is an example of conjugate gradient minimization. + +Here is a brief description of methods you define in your new derived +class. See min.h for details. + +init: initialize the minimization before a run +run: perform the minimization +memory_usage: tally of memory usage :tb(s=:) + +:line + +Pairwise potentials :link(pair),h4 + +Classes that compute pairwise interactions are derived from the Pair +class. In LAMMPS, pairwise calculation include manybody potentials +such as EAM or Tersoff where particles interact without a static bond +topology. New styles can be created to add new pair potentials to +LAMMPS. + +Pair_lj_cut.cpp is a simple example of a Pair class, though it +includes some optional methods to enable its use with rRESPA. + +Here is a brief description of the class methods in pair.h: + +compute: workhorse routine that computes pairwise interactions +settings: reads the input script line with arguments you define +coeff: set coefficients for one i,j type pair +init_one: perform initialization for one i,j type pair +init_style: initialization specific to this pair style +write & read_restart: write/read i,j pair coeffs to restart files +write & read_restart_settings: write/read global settings to restart files +single: force and energy of a single pairwise interaction between 2 atoms +compute_inner/middle/outer: versions of compute used by rRESPA :tb(s=:) + +The inner/middle/outer routines are optional. + +:line + +Region styles :link(region),h4 + +Classes that define geometric regions are derived from the Region +class. Regions are used elsewhere in LAMMPS to group atoms, delete +atoms to create a void, insert atoms in a specified region, etc. New +styles can be created to add new region shapes to LAMMPS. + +Region_sphere.cpp is an example of a spherical region. + +Here is a brief description of methods you define in your new derived +class. See region.h for details. + +match: determine whether a point is in the region :tb(s=:) + +:line + +Thermodynamic output options :link(thermo),h4 + +There is one class that computes and prints thermodynamic information +to the screen and log file; see the file thermo.cpp. + +There are several styles defined in thermo.cpp: "one", "multi", +"granular", etc. There is also a flexible "custom" style which allows +the user to explicitly list keywords for quantities to print when +thermodynamic info is output. See the +"thermo_style"_thermo_style.html command for a list of defined +quantities. + +The thermo styles (one, multi, etc) are simply lists of keywords. +Adding a new style thus only requies defining a new list of keywords. +Search for the word "customize" with references to "thermo style" in +thermo.cpp to see the two locations where code will need to be added. + +New keywords can also be added to thermo.cpp to compute new quantities +for output. Search for the word "customize" with references to +"keyword" in thermo.cpp to see the several locations where code will +need to be added. + +Note that the "thermo_style custom"_thermo.html command already allows +for thermo output of quantities calculated by "fixes"_fix.html, +"computes"_compute.html, and "variables"_variable.html. Thus, it may +be simpler to compute what you wish via one of those constructs, than +by adding a new keyword to the thermo command. :line Variable options :link(variable),h4 -The variable class stores and evaluates input script variables $a, $b, -... $z, as described in "this section"_Section_commands.html#3_2. -{Equal}-style variables are defined by an equation that is evaluated -each time the variable is used. The equation can include functions, -vectors, keywords, and numbers as described in the -"variable"_variable.html command. The list of valid functions, -vectors, and keywords, can be extended by adding a few lines of code -to the evaluate() method at the end of the variable.cpp file. Search -for the word "customize" to find the correct locations for adding -code. +There is one class that computes and stores "variable"_variable.html +information in LAMMPS; see the file variable.cpp. The value +associated with a variable can be periodically printed to the screen +via the "print"_print.html, "fix print"_fix_print.html, or +"thermo_style custom"_thermo_style.html commands. Variables of style +"equal" can compute complex equations that involve the following types +of arguments: -A new function (e.g. foo(arg1,arg2,...)) can be added in the section -that starts with the comment +thermo keywords = ke, vol, atoms, ... +other variables = v_a, v_myvar, ... +math functions = div(x,y), mult(x,y), add(x,y), ... +group functions = mass(group), xcm(group,x), ... +atom values = x[123], y[3], vx[34], ... +compute values = c_mytemp[0], c_thermo_press[3], ... -// customize by adding function to this list and to if statement :pre +Adding keywords for the "thermo_style custom"_themo_style.html command +(which can then be accessed by variables) was discussed +"here"_Section_modify.html#thermo on this page. -A new vector (e.g. q[]) can be added in the section that starts with -the comment +Adding a new math function of one or two arguments can be done by +editing one section of the Variable::evaulate() method. Search for +the word "customize" to find the appropriate location. -// customize by adding vector to this list and to if statement :pre +Adding a new group function can be done by editing one section of the +Variable::evaulate() method. Search for the word "customize" to find +the appropriate location. You may need to add a new method to the +Group class as well (see the group.cpp file). -A new keyword (e.g. mysum) can be added in the section that starts with -the comment +Accessing a new atom-based vector can be done by editing one section +of the Variable::evaulate() method. Search for the word "customize" +to find the appropriate location. -// customize by adding keyword to this list and to if statement :pre - -Note that keywords supported by the "thermo_style -custom"_themo_style.html command are evaluated by the thermo routines, -so do not need to be added to variable.cpp. +Adding new "compute styles"_compute.html (whose calculated values can +then be accessed by variables) was discussed +"here"_Section_modify.html#compute on this page. :line - -New top-level commands :link(command),h4 - -It is possible to add a new command to a LAMMPS input script as -opposed to adding a new style to an existing command (atom_style, -pair_style, fix, etc). For example the create_atoms, read_data, -velocity, and run commands are all top-level LAMMPS commands that are -listed in the Command section of style.h. When such a command is -encountered in the LAMMPS input script, the topmost level of LAMMPS -(lammps.cpp) simply creates a class with the corresponding name, -invokes the "command" method of the class, and passes it the arguments -from the input script. The command method can perform whatever -operations it wishes on the LAMMPS data structures. - -Thus to add a new command, you simply need to add a *.cpp and *.h file -containing a single class: - -command: operations performed by the new command :tb(s=:) - -Of course, the new class can define other methods and variables that -it uses internally. - :line :link(Foo) diff --git a/doc/Section_start.html b/doc/Section_start.html index d88eb13540..93a186dccc 100644 --- a/doc/Section_start.html +++ b/doc/Section_start.html @@ -16,16 +16,18 @@ new and experienced users.

      2.1 What's in the LAMMPS distribution
      2.2 Making LAMMPS
      -2.3 Running LAMMPS
      -2.4 Command-line options
      -2.5 Screen output
      -2.6 Tips for users of previous versions
      +2.3 Making LAMMPS with optional packages
      +2.4 Building LAMMPS as a library
      +2.5 Running LAMMPS
      +2.6 Command-line options
      +2.7 Screen output
      +2.8 Tips for users of previous versions

      2.1 What's in the LAMMPS distribution

      -

      When you download LAMMPS you will need to unzip and untar the +

      When you download SLAMMPS you will need to unzip and untar the downloaded file with the following commands, after placing the file in an appropriate directory.

      @@ -57,20 +59,19 @@ makefile, there are compiler options, additional libraries can be used (MPI, FFT), etc. Please read this section carefully. If you are not comfortable with makefiles, or building codes on a Unix platform, or running an MPI job on your machine, please find a local expert to help -you. Many of the emails we get about build and run problems are not -really about LAMMPS - they are peculiar to the user's system, -compilers, libraries, etc. Such questions are better answered by a -local expert. +you. Many compiling, linking, and run problems users have do not +really have to do with LAMMPS - they are peculiar to the user's +system, compilers, libraries, etc. Such questions are better answered +by a local expert.

      If you have a build problem that you are convinced is a LAMMPS issue (e.g. the compiler complains about a line of LAMMPS source code), then please send an email to the -developers. Note that doesn't -include linking problems - that's a question for a local expert! +developers.

      -

      Also, if you succeed in building LAMMPS on a new kind of machine -(which there isn't a similar Makefile for in the distribution), send -it to the developers and we'll include it in future LAMMPS releases. +

      If you succeed in building LAMMPS on a new kind of machine (which +there isn't a similar Makefile for in the distribution), send it to +the developers and we'll include it in future LAMMPS releases.

      Building a LAMMPS executable:

      @@ -85,12 +86,9 @@ type a command like: gmake mac

    If you get no errors and an executable like lmp_linux or lmp_mac is -produced, you're done; it's your lucky day. The remainder of this -section addressed the following topics: errors that occur when making -LAMMPS, editing a new low-level Makefile.foo, how to make LAMMPS with -and without packages, and additional build tips. +produced, you're done; it's your lucky day.

    -

    Errors that occur when making LAMMPS: +

    Errors that can occur when making LAMMPS:

    (1) If the make command breaks immediately with errors that indicate it can't find files with a "*" in their names, this can be because @@ -210,98 +208,6 @@ gmake foo

    You should get the executable lmp_foo when the build is complete.

    -

    How to make LAMMPS with and without packages: -

    -

    The source code for LAMMPS is structured as a large set of core files -that are always used plus additional packages, which are groups of -files that enable a specific set of features. For example, force -fields for molecular systems or granular systems are in packages. You -can see the list of packages by typing "make package". The current -list of packages is as follows: -

    -
    - - - - - - - -
    class2 class 2 force fields
    dpd dissipative particle dynamics (DPD) force field
    granular force fields and boundary conditions for granular systems
    kspace long-range Ewald and particle-mesh (PPPM) solvers
    manybody metal, 3-body, bond-order potentials
    molecule force fields for molecular systems
    poems coupled rigid body motion
    xtc dump atom snapshots in XTC format -
    - -

    Any or all of these packages can be included or excluded when LAMMPS -is built. The default is to include only the kspace, manybody, and -molecule packages. You may wish to exclude certain packages if you -will never run certain kinds of simulations. This will produce a -smaller executable which in some cases will also run a bit faster. -

    -

    Packages are included or excluded by typing "make yes-name" or "make -no-name", where "name" is the name of the package. You can also type -"make yes-all" or "make no-all" to include/exclude all optional -packages. These commands work by simply moving files back and forth -between the main src directory and sub-directories with the package -name, so that the files are not seen when LAMMPS is built. After you -have included or excluded a package, you must re-make LAMMPS. -

    -

    Additional make options exist to help manage LAMMPS files that exist -in both the src directory and in package sub-directories. Typing -"make package-update" will overwrite src files with files from the -package directories if the package has been included. Typing "make -package-overwrite" will overwrite files in the package directories -with src files. Typing "make package-check" will list differences -between src and package versions of the same files. -

    -

    To use the poems package you must build LAMMPS with the POEMS library, -which computes the constrained rigid-body motion of articulated -(jointed) multibody systems. POEMS was written and is distributed by -Prof Kurt Anderson's group at Rensselaer Polytechnic Institute (RPI). -It is included in the LAMMPS distribution. To build LAMMPS with -POEMS, you must use a low-level LAMMPS Makefile that includes the -POEMS directory in its paths. See Makefile.g++.poems as an example. -You must also build POEMS itself as a library before building LAMMPS, -so that LAMMPS can link against it. The POEMS library is built by -typing "make" from within the poems directory in the LAMMPS -distribution. By default this uses Makefile which uses the gcc -compiler. If you need to use another compiler (so that the POEMS -library and LAMMPS are consistent), use another poems/Makefile.* or -create your own and invoke it as "make -f Makefile.*". -

    -

    Building LAMMPS as a library: -

    -

    LAMMPS can be built as a library, which can then be called from -another application or a scripting language. See this -section for more info on coupling LAMMPS to -other codes. Building LAMMPS as a library is done by typing -

    -
    make makelib
    -make -f Makefile.lib foo 
    -
    -

    where foo is the machine name. The first "make" command will create a -current Makefile.lib with all the file names in your src dir. The 2nd -"make" command will use it to build LAMMPS as a library. This -requires that Makefile.foo have a library target (lib) and -system-specific settings for ARCHIVE and ARFLAGS. See Makefile.linux -for an example. The build will create the file liblmp_foo.a which -another application can link to. The callable functions in the -library are listed in library.h, but you can add as many functions as -you wish to library.h and library.cpp, which can access LAMMPS data -and return it to the caller or set LAMMPS data values as specified by -the caller. These 3 functions are included in the library: -

    -
    void lammps_open(int, char **, MPI_Comm);
    -void lammps_close();
    -int lammps_command(char *); 
    -
    -

    The lammps_open() function is used to initialize LAMMPS, passing in a -list of strings as if they were command-line arguments when -LAMMPS is run from the command line and a MPI communicator for LAMMPS -to run under. The lammps_close() function is used to shut down LAMMPS -and free all its memory. The lammps_command() function is used to -pass a string to LAMMPS as if it were an input command read from an -input script. See the library.h file for more information about the -arguments and return values for these 3 functions. -

    Additional build tips:

    (1) Building LAMMPS for multiple platforms. @@ -337,11 +243,149 @@ make. Or you should be able to pull all the source files into Visual C++ (ugh) or some similar development environment and build it. In the src/MAKE/Windows directory are some notes from users on how they built LAMMPS under Windows, so you can look at their instructions for -tips. Good luck - I can't help you on this one. +tips. Good luck - we can't help you on this one. +

    +

    2.3 Making LAMMPS with optional packages +

    +

    The source code for LAMMPS is structured as a large set of core files +that are always used plus additional packages, which are groups of +files that enable a specific set of features. For example, force +fields for molecular systems or granular systems are in packages. You +can see the list of packages by typing "make package". The current +list of packages is as follows: +

    +
    + + + + + + + + + +
    class2 class 2 force fields
    dpd dissipative particle dynamics (DPD) force field
    granular force fields and boundary conditions for granular systems
    kspace long-range Ewald and particle-mesh (PPPM) solvers
    manybody metal, 3-body, bond-order potentials
    meam modified embedded atom method (MEAM) potential
    molecule force fields for molecular systems
    opt optimized versions of a few pair potentials
    poems coupled rigid body motion
    xtc dump atom snapshots in XTC format +
    + +

    Any or all packages can be included or excluded when LAMMPS is built. +The one exception is that to use the "opt" package, you must also be +using the "molecule" and "manybody" packages. You may wish to exclude +certain packages if you will never run certain kinds of simulations. +This will produce a smaller executable which may run a bit faster. +

    +

    By default, LAMMPS includes only the "kspace", "manybody", and +"molecule" packages. As described below, some packages require LAMMPS +be linked to separately built library files, which will require +editing of your machine Makefile. +

    +

    Packages are included or excluded by typing "make yes-name" or "make +no-name", where "name" is the name of the package. You can also type +"make yes-all" or "make no-all" to include/exclude all optional +packages. These commands work by simply moving files back and forth +between the main src directory and sub-directories with the package +name, so that the files are seen or not seen when LAMMPS is built. +After you have included or excluded a package, you must re-make +LAMMPS. +

    +

    Additional make options exist to help manage LAMMPS files that exist +in both the src directory and in package sub-directories. You do not +normally need to use these commands unless you are editing LAMMPS +files or have downloaded a patch from the LAMMPS WWW site. Typing +"make package-update" will overwrite src files with files from the +package directories if the package has been included. It should be +used after a patch is installed, since patches only update the master +package version of a file. Typing "make package-overwrite" will +overwrite files in the package directories with src files. Typing +"make package-check" will list differences between src and package +versions of the same files. +

    +

    To use the "poems" package you must build LAMMPS with the POEMS +library, which computes the constrained rigid-body motion of +articulated (jointed) multibody systems. POEMS was written and is +distributed by Prof Kurt Anderson's group at Rensselaer Polytechnic +Institute (RPI) and a version is included in the LAMMPS distribution +under the "lib" directory. To build LAMMPS with POEMS, you must use a +low-level LAMMPS Makefile that includes the POEMS directory in its +paths. See Makefile.g++_poems as an example. You must also build +POEMS itself as a library before building LAMMPS, so that LAMMPS can +link against it. The POEMS library is built by typing "make" from +within the poems directory with the appropriate Makefile, e.g. "make +-f Makefile.g++". If one of the provided Makefiles is not appropriate +for your system you can edit or add one as needed. +

    +

    To use the "meam" package you must build LAMMPS with the MEAM library, +which computes the modified embedded atom method potential, which is a +generalization of EAM potentials that can be used to model a wider +variety of materials. This MEAM implementation was written by Greg +Wagner at Sandia and is included under the "lib" directory. To build +LAMMPS with MEAM, you must use a low-level LAMMPS Makefile that +includes the MEAM directory in its paths. See Makefile.linux_meam as +an example. You must also build MEAM itself as a library before +building LAMMPS, so that LAMMPS can link against it. This requires a +F90 compiler. The library is built by typing "make" from within the +meam directory with the appropriate Makefile, e.g. "make -f +Makefile.icc". If one of the provided Makefiles is not appropriate +for your system you can edit or add one as needed. +

    +

    Linking a Fortran library to a C++ code can be problematic +(e.g. non-matching underscore conventions). If you have problems with +a particular compiler/machine, please send an email to the developers. +

    +

    2.4 Building LAMMPS as a library +

    +

    LAMMPS can be built as a library, which can then be called from +another application or a scripting language. See this +section for more info on coupling LAMMPS to +other codes. Building LAMMPS as a library is done by typing +

    +
    make makelib
    +make -f Makefile.lib foo 
    +
    +

    where foo is the machine name. The first "make" command will create a +current Makefile.lib with all the file names in your src dir. The 2nd +"make" command will use it to build LAMMPS as a library. This +requires that Makefile.foo have a library target (lib) and +system-specific settings for ARCHIVE and ARFLAGS. See Makefile.linux +for an example. The build will create the file liblmp_foo.a which +another application can link to. +

    +

    When used from a C++ program, the library allows one or more LAMMPS +objects to be instantiated. All of LAMMPS is wrapped in a LAMMPS_NS +namespace; you can safely use any of its classes and methods from +within your application code, as needed. See the sample code +examples/couple/c++_driver.cpp as an example. +

    +

    When used from a C or Fortran program or a scripting language, the +library has a simple function-style interface, provided in library.cpp +and library.h. See the sample code examples/couple/c_driver.cpp as an +example. +

    +

    You can add as many functions as you wish to library.cpp and +library.h. In a general sense, those functions can access LAMMPS data +and return it to the caller or set LAMMPS data values as specified by +the caller. These 4 functions are currently included in library.cpp: +

    +
    void lammps_open(int, char **, MPI_Comm, void **ptr);
    +void lammps_close(void *ptr);
    +int lammps_file(void *ptr, char *);
    +int lammps_command(void *ptr, char *); 
    +
    +

    The lammps_open() function is used to initialize LAMMPS, passing in a +list of strings as if they were command-line arguments when +LAMMPS is run from the command line and a MPI communicator for LAMMPS +to run under. It returns a ptr to the LAMMPS object that is created, +and which should be used in subsequent library calls. Note that +lammps_open() can be called multiple times to create multiple LAMMPS +objects. +

    +

    The lammps_close() function is used to shut down LAMMPS and free all +its memory. The lammps_file() and lammps_command() functions are used +to pass a file or string to LAMMPS as if it were an input file or +single command read from an input script.


    -

    2.3 Running LAMMPS +

    2.5 Running LAMMPS

    By default, LAMMPS runs by reading commands from stdin; e.g. lmp_linux < in.file. This means you first create an input script (e.g. in.file) @@ -388,7 +432,7 @@ more processors or setup a smaller problem.


    -

    2.4 Command-line options +

    2.6 Command-line options

    At run time, LAMMPS recognizes several optional command-line switches which may be used in any order. For example, lmp_ibm might be @@ -476,7 +520,7 @@ variables in scripts.


    -

    2.5 LAMMPS screen output +

    2.7 LAMMPS screen output

    As LAMMPS reads an input script, it prints information to both the screen and a log file about significant actions it takes to setup a @@ -573,7 +617,7 @@ communication, roughly 75% in the example above.


    -

    2.6 Tips for users of previous LAMMPS versions +

    2.8 Tips for users of previous LAMMPS versions

    LAMMPS 2003 is a complete C++ rewrite of LAMMPS 2001, which was written in F90. Features of earlier versions of LAMMPS are listed in diff --git a/doc/Section_start.txt b/doc/Section_start.txt index d84f7592c2..a3a98e508b 100644 --- a/doc/Section_start.txt +++ b/doc/Section_start.txt @@ -13,16 +13,18 @@ new and experienced users. 2.1 "What's in the LAMMPS distribution"_#2_1 2.2 "Making LAMMPS"_#2_2 -2.3 "Running LAMMPS"_#2_3 -2.4 "Command-line options"_#2_4 -2.5 "Screen output"_#2_5 -2.6 "Tips for users of previous versions"_#2_6 :all(b) +2.3 "Making LAMMPS with optional packages"_#2_3 +2.4 "Building LAMMPS as a library"_#2_4 +2.5 "Running LAMMPS"_#2_5 +2.6 "Command-line options"_#2_6 +2.7 "Screen output"_#2_7 +2.8 "Tips for users of previous versions"_#2_8 :all(b) :line 2.1 What's in the LAMMPS distribution :h4,link(2_1) -When you download LAMMPS you will need to unzip and untar the +When you download SLAMMPS you will need to unzip and untar the downloaded file with the following commands, after placing the file in an appropriate directory. @@ -52,20 +54,19 @@ makefile, there are compiler options, additional libraries can be used (MPI, FFT), etc. Please read this section carefully. If you are not comfortable with makefiles, or building codes on a Unix platform, or running an MPI job on your machine, please find a local expert to help -you. Many of the emails we get about build and run problems are not -really about LAMMPS - they are peculiar to the user's system, -compilers, libraries, etc. Such questions are better answered by a -local expert. +you. Many compiling, linking, and run problems users have do not +really have to do with LAMMPS - they are peculiar to the user's +system, compilers, libraries, etc. Such questions are better answered +by a local expert. If you have a build problem that you are convinced is a LAMMPS issue (e.g. the compiler complains about a line of LAMMPS source code), then please send an email to the -"developers"_http://lammps.sandia.gov/authors.html. Note that doesn't -include linking problems - that's a question for a local expert! +"developers"_http://lammps.sandia.gov/authors.html. -Also, if you succeed in building LAMMPS on a new kind of machine -(which there isn't a similar Makefile for in the distribution), send -it to the developers and we'll include it in future LAMMPS releases. +If you succeed in building LAMMPS on a new kind of machine (which +there isn't a similar Makefile for in the distribution), send it to +the developers and we'll include it in future LAMMPS releases. [{Building a LAMMPS executable:}] @@ -80,12 +81,9 @@ make linux gmake mac :pre If you get no errors and an executable like lmp_linux or lmp_mac is -produced, you're done; it's your lucky day. The remainder of this -section addressed the following topics: errors that occur when making -LAMMPS, editing a new low-level Makefile.foo, how to make LAMMPS with -and without packages, and additional build tips. +produced, you're done; it's your lucky day. -[{Errors that occur when making LAMMPS:}] +[{Errors that can occur when making LAMMPS:}] (1) If the make command breaks immediately with errors that indicate it can't find files with a "*" in their names, this can be because @@ -205,96 +203,6 @@ gmake foo :pre You should get the executable lmp_foo when the build is complete. -[{How to make LAMMPS with and without packages:}] - -The source code for LAMMPS is structured as a large set of core files -that are always used plus additional packages, which are groups of -files that enable a specific set of features. For example, force -fields for molecular systems or granular systems are in packages. You -can see the list of packages by typing "make package". The current -list of packages is as follows: - -class2 : class 2 force fields -dpd : dissipative particle dynamics (DPD) force field -granular : force fields and boundary conditions for granular systems -kspace : long-range Ewald and particle-mesh (PPPM) solvers -manybody : metal, 3-body, bond-order potentials -molecule : force fields for molecular systems -poems : coupled rigid body motion -xtc : dump atom snapshots in XTC format :tb(s=:) - -Any or all of these packages can be included or excluded when LAMMPS -is built. The default is to include only the kspace, manybody, and -molecule packages. You may wish to exclude certain packages if you -will never run certain kinds of simulations. This will produce a -smaller executable which in some cases will also run a bit faster. - -Packages are included or excluded by typing "make yes-name" or "make -no-name", where "name" is the name of the package. You can also type -"make yes-all" or "make no-all" to include/exclude all optional -packages. These commands work by simply moving files back and forth -between the main src directory and sub-directories with the package -name, so that the files are not seen when LAMMPS is built. After you -have included or excluded a package, you must re-make LAMMPS. - -Additional make options exist to help manage LAMMPS files that exist -in both the src directory and in package sub-directories. Typing -"make package-update" will overwrite src files with files from the -package directories if the package has been included. Typing "make -package-overwrite" will overwrite files in the package directories -with src files. Typing "make package-check" will list differences -between src and package versions of the same files. - -To use the poems package you must build LAMMPS with the POEMS library, -which computes the constrained rigid-body motion of articulated -(jointed) multibody systems. POEMS was written and is distributed by -Prof Kurt Anderson's group at Rensselaer Polytechnic Institute (RPI). -It is included in the LAMMPS distribution. To build LAMMPS with -POEMS, you must use a low-level LAMMPS Makefile that includes the -POEMS directory in its paths. See Makefile.g++.poems as an example. -You must also build POEMS itself as a library before building LAMMPS, -so that LAMMPS can link against it. The POEMS library is built by -typing "make" from within the poems directory in the LAMMPS -distribution. By default this uses Makefile which uses the gcc -compiler. If you need to use another compiler (so that the POEMS -library and LAMMPS are consistent), use another poems/Makefile.* or -create your own and invoke it as "make -f Makefile.*". - -[{Building LAMMPS as a library:}] - -LAMMPS can be built as a library, which can then be called from -another application or a scripting language. See "this -section"_Section_howto.html#4_10 for more info on coupling LAMMPS to -other codes. Building LAMMPS as a library is done by typing - -make makelib -make -f Makefile.lib foo :pre - -where foo is the machine name. The first "make" command will create a -current Makefile.lib with all the file names in your src dir. The 2nd -"make" command will use it to build LAMMPS as a library. This -requires that Makefile.foo have a library target (lib) and -system-specific settings for ARCHIVE and ARFLAGS. See Makefile.linux -for an example. The build will create the file liblmp_foo.a which -another application can link to. The callable functions in the -library are listed in library.h, but you can add as many functions as -you wish to library.h and library.cpp, which can access LAMMPS data -and return it to the caller or set LAMMPS data values as specified by -the caller. These 3 functions are included in the library: - -void lammps_open(int, char **, MPI_Comm); -void lammps_close(); -int lammps_command(char *); :pre - -The lammps_open() function is used to initialize LAMMPS, passing in a -list of strings as if they were "command-line arguments"_#2_4 when -LAMMPS is run from the command line and a MPI communicator for LAMMPS -to run under. The lammps_close() function is used to shut down LAMMPS -and free all its memory. The lammps_command() function is used to -pass a string to LAMMPS as if it were an input command read from an -input script. See the library.h file for more information about the -arguments and return values for these 3 functions. - [{Additional build tips:}] (1) Building LAMMPS for multiple platforms. @@ -330,11 +238,147 @@ make. Or you should be able to pull all the source files into Visual C++ (ugh) or some similar development environment and build it. In the src/MAKE/Windows directory are some notes from users on how they built LAMMPS under Windows, so you can look at their instructions for -tips. Good luck - I can't help you on this one. +tips. Good luck - we can't help you on this one. + +2.3 Making LAMMPS with optional packages :h4,link(2_3) + +The source code for LAMMPS is structured as a large set of core files +that are always used plus additional packages, which are groups of +files that enable a specific set of features. For example, force +fields for molecular systems or granular systems are in packages. You +can see the list of packages by typing "make package". The current +list of packages is as follows: + +class2 : class 2 force fields +dpd : dissipative particle dynamics (DPD) force field +granular : force fields and boundary conditions for granular systems +kspace : long-range Ewald and particle-mesh (PPPM) solvers +manybody : metal, 3-body, bond-order potentials +meam : modified embedded atom method (MEAM) potential +molecule : force fields for molecular systems +opt : optimized versions of a few pair potentials +poems : coupled rigid body motion +xtc : dump atom snapshots in XTC format :tb(s=:) + +Any or all packages can be included or excluded when LAMMPS is built. +The one exception is that to use the "opt" package, you must also be +using the "molecule" and "manybody" packages. You may wish to exclude +certain packages if you will never run certain kinds of simulations. +This will produce a smaller executable which may run a bit faster. + +By default, LAMMPS includes only the "kspace", "manybody", and +"molecule" packages. As described below, some packages require LAMMPS +be linked to separately built library files, which will require +editing of your machine Makefile. + +Packages are included or excluded by typing "make yes-name" or "make +no-name", where "name" is the name of the package. You can also type +"make yes-all" or "make no-all" to include/exclude all optional +packages. These commands work by simply moving files back and forth +between the main src directory and sub-directories with the package +name, so that the files are seen or not seen when LAMMPS is built. +After you have included or excluded a package, you must re-make +LAMMPS. + +Additional make options exist to help manage LAMMPS files that exist +in both the src directory and in package sub-directories. You do not +normally need to use these commands unless you are editing LAMMPS +files or have downloaded a patch from the LAMMPS WWW site. Typing +"make package-update" will overwrite src files with files from the +package directories if the package has been included. It should be +used after a patch is installed, since patches only update the master +package version of a file. Typing "make package-overwrite" will +overwrite files in the package directories with src files. Typing +"make package-check" will list differences between src and package +versions of the same files. + +To use the "poems" package you must build LAMMPS with the POEMS +library, which computes the constrained rigid-body motion of +articulated (jointed) multibody systems. POEMS was written and is +distributed by Prof Kurt Anderson's group at Rensselaer Polytechnic +Institute (RPI) and a version is included in the LAMMPS distribution +under the "lib" directory. To build LAMMPS with POEMS, you must use a +low-level LAMMPS Makefile that includes the POEMS directory in its +paths. See Makefile.g++_poems as an example. You must also build +POEMS itself as a library before building LAMMPS, so that LAMMPS can +link against it. The POEMS library is built by typing "make" from +within the poems directory with the appropriate Makefile, e.g. "make +-f Makefile.g++". If one of the provided Makefiles is not appropriate +for your system you can edit or add one as needed. + +To use the "meam" package you must build LAMMPS with the MEAM library, +which computes the modified embedded atom method potential, which is a +generalization of EAM potentials that can be used to model a wider +variety of materials. This MEAM implementation was written by Greg +Wagner at Sandia and is included under the "lib" directory. To build +LAMMPS with MEAM, you must use a low-level LAMMPS Makefile that +includes the MEAM directory in its paths. See Makefile.linux_meam as +an example. You must also build MEAM itself as a library before +building LAMMPS, so that LAMMPS can link against it. This requires a +F90 compiler. The library is built by typing "make" from within the +meam directory with the appropriate Makefile, e.g. "make -f +Makefile.icc". If one of the provided Makefiles is not appropriate +for your system you can edit or add one as needed. + +Linking a Fortran library to a C++ code can be problematic +(e.g. non-matching underscore conventions). If you have problems with +a particular compiler/machine, please send an email to the developers. + +2.4 Building LAMMPS as a library :h4,link(2_4) + +LAMMPS can be built as a library, which can then be called from +another application or a scripting language. See "this +section"_Section_howto.html#4_10 for more info on coupling LAMMPS to +other codes. Building LAMMPS as a library is done by typing + +make makelib +make -f Makefile.lib foo :pre + +where foo is the machine name. The first "make" command will create a +current Makefile.lib with all the file names in your src dir. The 2nd +"make" command will use it to build LAMMPS as a library. This +requires that Makefile.foo have a library target (lib) and +system-specific settings for ARCHIVE and ARFLAGS. See Makefile.linux +for an example. The build will create the file liblmp_foo.a which +another application can link to. + +When used from a C++ program, the library allows one or more LAMMPS +objects to be instantiated. All of LAMMPS is wrapped in a LAMMPS_NS +namespace; you can safely use any of its classes and methods from +within your application code, as needed. See the sample code +examples/couple/c++_driver.cpp as an example. + +When used from a C or Fortran program or a scripting language, the +library has a simple function-style interface, provided in library.cpp +and library.h. See the sample code examples/couple/c_driver.cpp as an +example. + +You can add as many functions as you wish to library.cpp and +library.h. In a general sense, those functions can access LAMMPS data +and return it to the caller or set LAMMPS data values as specified by +the caller. These 4 functions are currently included in library.cpp: + +void lammps_open(int, char **, MPI_Comm, void **ptr); +void lammps_close(void *ptr); +int lammps_file(void *ptr, char *); +int lammps_command(void *ptr, char *); :pre + +The lammps_open() function is used to initialize LAMMPS, passing in a +list of strings as if they were "command-line arguments"_#2_6 when +LAMMPS is run from the command line and a MPI communicator for LAMMPS +to run under. It returns a ptr to the LAMMPS object that is created, +and which should be used in subsequent library calls. Note that +lammps_open() can be called multiple times to create multiple LAMMPS +objects. + +The lammps_close() function is used to shut down LAMMPS and free all +its memory. The lammps_file() and lammps_command() functions are used +to pass a file or string to LAMMPS as if it were an input file or +single command read from an input script. :line -2.3 Running LAMMPS :h4,link(2_3) +2.5 Running LAMMPS :h4,link(2_5) By default, LAMMPS runs by reading commands from stdin; e.g. lmp_linux < in.file. This means you first create an input script (e.g. in.file) @@ -381,7 +425,7 @@ more processors or setup a smaller problem. :line -2.4 Command-line options :h4,link(2_4) +2.6 Command-line options :h4,link(2_6) At run time, LAMMPS recognizes several optional command-line switches which may be used in any order. For example, lmp_ibm might be @@ -469,7 +513,7 @@ variables in scripts. :line -2.5 LAMMPS screen output :h4,link(2_5) +2.7 LAMMPS screen output :h4,link(2_7) As LAMMPS reads an input script, it prints information to both the screen and a log file about significant actions it takes to setup a @@ -566,7 +610,7 @@ communication, roughly 75% in the example above. :line -2.6 Tips for users of previous LAMMPS versions :h4,link(2_6) +2.8 Tips for users of previous LAMMPS versions :h4,link(2_8) LAMMPS 2003 is a complete C++ rewrite of LAMMPS 2001, which was written in F90. Features of earlier versions of LAMMPS are listed in diff --git a/doc/angle_coeff.html b/doc/angle_coeff.html index a268f46e9f..7b6fbe62ec 100644 --- a/doc/angle_coeff.html +++ b/doc/angle_coeff.html @@ -62,14 +62,14 @@ corresponds to the 1st example above would be listed as the style to display the formula it computes and coefficients specified by the associated angle_coeff command:

    -
    • angle_style none - turn off angle interactions -
    • angle_style hybrid - define multiple styles of angle interactions + -
      • angle_style charmm - CHARMM angle -
      • angle_style class2 - COMPASS (class 2) angle -
      • angle_style cosine - cosine angle potential -
      • angle_style cosine/squared - cosine squared angle potential -
      • angle_style harmonic - harmonic angle +
        diff --git a/doc/angle_coeff.txt b/doc/angle_coeff.txt index 5c4ed066e1..2b58850e51 100644 --- a/doc/angle_coeff.txt +++ b/doc/angle_coeff.txt @@ -59,14 +59,14 @@ Here is an alphabetic list of angle styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "angle_coeff"_angle_coeff.html command: -"angle_style none"_angle_style_none.html - turn off angle interactions -"angle_style hybrid"_angle_style_hybrid.html - define multiple styles of angle interactions :ul +"angle_style none"_angle_none.html - turn off angle interactions +"angle_style hybrid"_angle_hybrid.html - define multiple styles of angle interactions :ul -"angle_style charmm"_angle_style_charmm.html - CHARMM angle -"angle_style class2"_angle_style_class2.html - COMPASS (class 2) angle -"angle_style cosine"_angle_style_cosine.html - cosine angle potential -"angle_style cosine/squared"_angle_style_cosine_squared.html - cosine squared angle potential -"angle_style harmonic"_angle_style_harmonic.html - harmonic angle :ul +"angle_style charmm"_angle_charmm.html - CHARMM angle +"angle_style class2"_angle_class2.html - COMPASS (class 2) angle +"angle_style cosine"_angle_cosine.html - cosine angle potential +"angle_style cosine/squared"_angle_cosine_squared.html - cosine squared angle potential +"angle_style harmonic"_angle_harmonic.html - harmonic angle :ul :line diff --git a/doc/angle_style.html b/doc/angle_style.html index a6b7311ecc..9975e92ba5 100644 --- a/doc/angle_style.html +++ b/doc/angle_style.html @@ -51,14 +51,14 @@ exist between the 3 bonded atoms. the style to display the formula it computes and coefficients specified by the associated angle_coeff command:

        -
        • angle_style none - turn off angle interactions -
        • angle_style hybrid - define multiple styles of angle interactions + -
          • angle_style charmm - CHARMM angle -
          • angle_style class2 - COMPASS (class 2) angle -
          • angle_style cosine - cosine angle potential -
          • angle_style cosine/squared - cosine squared angle potential -
          • angle_style harmonic - harmonic angle +
            diff --git a/doc/angle_style.txt b/doc/angle_style.txt index ddedf0a0fe..2d7ee8238b 100644 --- a/doc/angle_style.txt +++ b/doc/angle_style.txt @@ -49,14 +49,14 @@ Here is an alphabetic list of angle styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "angle_coeff"_angle_coeff.html command: -"angle_style none"_angle_style_none.html - turn off angle interactions -"angle_style hybrid"_angle_style_hybrid.html - define multiple styles of angle interactions :ul +"angle_style none"_angle_none.html - turn off angle interactions +"angle_style hybrid"_angle_hybrid.html - define multiple styles of angle interactions :ul -"angle_style charmm"_angle_style_charmm.html - CHARMM angle -"angle_style class2"_angle_style_class2.html - COMPASS (class 2) angle -"angle_style cosine"_angle_style_cosine.html - cosine angle potential -"angle_style cosine/squared"_angle_style_cosine_squared.html - cosine squared angle potential -"angle_style harmonic"_angle_style_harmonic.html - harmonic angle :ul +"angle_style charmm"_angle_charmm.html - CHARMM angle +"angle_style class2"_angle_class2.html - COMPASS (class 2) angle +"angle_style cosine"_angle_cosine.html - cosine angle potential +"angle_style cosine/squared"_angle_cosine_squared.html - cosine squared angle potential +"angle_style harmonic"_angle_harmonic.html - harmonic angle :ul :line diff --git a/doc/atom_style.html b/doc/atom_style.html index cc39bf7369..3007f047b4 100644 --- a/doc/atom_style.html +++ b/doc/atom_style.html @@ -15,14 +15,15 @@

            atom_style style args 
             
            -
            • style = angle or atomic or bond or charge or dipole or dpd or full or granular or molecular or hybrid +
              • style = angle or atomic or bond or charge or dpd or full or granular or molecular or hybrid
                args = none for any style except hybrid
              -  hybrid args = list of one or more styles 
              +  hybrid args = list of one or more sub-styles 
               

              Examples:

              -
              atom_style bond
              +
              atom_style atomic
              +atom_style bond
               atom_style full
               atom_style hybrid charge bond 
               
              @@ -51,11 +52,10 @@ velocities, atom IDs and types.
            • atomic = only the default values
            • bond = bonds - e.g. bead-spring polymers
            • charge = charge -
            • dipole = charge + dipole moments
            • dpd = default values, also communicates velocities
            • molecular = bonds, angles, dihedrals, impropers - e.g. all-atom polymers
            • full = molecular + charge - e.g. biomolecules, charged polymers -
            • granular = granular material with rotational properties +
            • granular = granular atoms with rotational properties

            Typical simulations with a single pair potential will use only one of these styles. For cases where multiple pair potentials will be used @@ -77,13 +77,15 @@ section.

            The angle, bond, full, and molecular styles are part of the "molecular" package. The granular style is part of the "granular" package. The dpd style is part of the "dpd" package. They are only -enabled if LAMMPS was built with that package. See the Making +enabled if LAMMPS was built with that package. See the Making LAMMPS section for more info.

            Related commands:

            read_data, pair_style

            -

            Default: none +

            Default: +

            +

            atom_style atomic

            diff --git a/doc/atom_style.txt b/doc/atom_style.txt index 3a39e152bf..a1f2b13436 100644 --- a/doc/atom_style.txt +++ b/doc/atom_style.txt @@ -12,13 +12,14 @@ atom_style command :h3 atom_style style args :pre -style = {angle} or {atomic} or {bond} or {charge} or {dipole} or {dpd} or \ +style = {angle} or {atomic} or {bond} or {charge} or {dpd} or \ {full} or {granular} or {molecular} or {hybrid} :ul args = none for any style except {hybrid} - {hybrid} args = list of one or more styles :pre + {hybrid} args = list of one or more sub-styles :pre [Examples:] +atom_style atomic atom_style bond atom_style full atom_style hybrid charge bond :pre @@ -48,11 +49,10 @@ velocities, atom IDs and types. {atomic} = only the default values {bond} = bonds - e.g. bead-spring polymers {charge} = charge -{dipole} = charge + dipole moments {dpd} = default values, also communicates velocities {molecular} = bonds, angles, dihedrals, impropers - e.g. all-atom polymers {full} = molecular + charge - e.g. biomolecules, charged polymers -{granular} = granular material with rotational properties :ul +{granular} = granular atoms with rotational properties :ul Typical simulations with a single pair potential will use only one of these styles. For cases where multiple pair potentials will be used @@ -75,10 +75,12 @@ The {angle}, {bond}, {full}, and {molecular} styles are part of the "molecular" package. The {granular} style is part of the "granular" package. The {dpd} style is part of the "dpd" package. They are only enabled if LAMMPS was built with that package. See the "Making -LAMMPS"_Section_start.html#2_2 section for more info. +LAMMPS"_Section_start.html#2_3 section for more info. [Related commands:] "read_data"_read_data.html, "pair_style"_pair_style.html -[Default:] none +[Default:] + +atom_style atomic diff --git a/doc/bond_coeff.html b/doc/bond_coeff.html index c99261aabf..7f8d95e79b 100644 --- a/doc/bond_coeff.html +++ b/doc/bond_coeff.html @@ -63,16 +63,16 @@ corresponds to the 1st example above would be listed as the style to display the formula it computes and coefficients specified by the associated bond_coeff command:

            -
            • bond_style none - turn off bonded interactions -
            • bond_style hybrid - define multiple styles of bond interactions + -
              • bond_style class2 - COMPASS (class 2) bond -
              • bond_style fene - FENE (finite-extensible non-linear elastic) bond -
              • bond_style fene/expand - FENE bonds with variable size particles -
              • bond_style harmonic - harmonic bond -
              • bond_style morse - Morse bond -
              • bond_style nonlinear - nonlinear bond -
              • bond_style quartic - breakable quartic bond +
                diff --git a/doc/bond_coeff.txt b/doc/bond_coeff.txt index bb02a0df76..238f0d68b7 100644 --- a/doc/bond_coeff.txt +++ b/doc/bond_coeff.txt @@ -60,16 +60,16 @@ Here is an alphabetic list of bond styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "bond_coeff"_bond_coeff.html command: -"bond_style none"_bond_style_none.html - turn off bonded interactions -"bond_style hybrid"_bond_style_hybrid.html - define multiple styles of bond interactions :ul +"bond_style none"_bond_none.html - turn off bonded interactions +"bond_style hybrid"_bond_hybrid.html - define multiple styles of bond interactions :ul -"bond_style class2"_bond_style_class.html - COMPASS (class 2) bond -"bond_style fene"_bond_style_fene.html - FENE (finite-extensible non-linear elastic) bond -"bond_style fene/expand"_bond_style_fene_expand.html - FENE bonds with variable size particles -"bond_style harmonic"_bond_style_harmonic.html - harmonic bond -"bond_style morse"_bond_style_morse.html - Morse bond -"bond_style nonlinear"_bond_style_nonlinear.html - nonlinear bond -"bond_style quartic"_bond_style_quartic.html - breakable quartic bond :ul +"bond_style class2"_bond_class.html - COMPASS (class 2) bond +"bond_style fene"_bond_fene.html - FENE (finite-extensible non-linear elastic) bond +"bond_style fene/expand"_bond_fene_expand.html - FENE bonds with variable size particles +"bond_style harmonic"_bond_harmonic.html - harmonic bond +"bond_style morse"_bond_morse.html - Morse bond +"bond_style nonlinear"_bond_nonlinear.html - nonlinear bond +"bond_style quartic"_bond_quartic.html - breakable quartic bond :ul :line diff --git a/doc/bond_style.html b/doc/bond_style.html index 9450b9c44b..f5eb708571 100644 --- a/doc/bond_style.html +++ b/doc/bond_style.html @@ -60,16 +60,16 @@ exist between 2 bonded atoms. the style to display the formula it computes and coefficients specified by the associated bond_coeff command:

                -
                • bond_style none - turn off bonded interactions -
                • bond_style hybrid - define multiple styles of bond interactions + -
                  • bond_style class2 - COMPASS (class 2) bond -
                  • bond_style fene - FENE (finite-extensible non-linear elastic) bond -
                  • bond_style fene/expand - FENE bonds with variable size particles -
                  • bond_style harmonic - harmonic bond -
                  • bond_style morse - Morse bond -
                  • bond_style nonlinear - nonlinear bond -
                  • bond_style quartic - breakable quartic bond +
                    diff --git a/doc/bond_style.txt b/doc/bond_style.txt index 8c7ff5e6f1..34febc705e 100644 --- a/doc/bond_style.txt +++ b/doc/bond_style.txt @@ -57,16 +57,16 @@ Here is an alphabetic list of bond styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "bond_coeff"_bond_coeff.html command: -"bond_style none"_bond_style_none.html - turn off bonded interactions -"bond_style hybrid"_bond_style_hybrid.html - define multiple styles of bond interactions :ul +"bond_style none"_bond_none.html - turn off bonded interactions +"bond_style hybrid"_bond_hybrid.html - define multiple styles of bond interactions :ul -"bond_style class2"_bond_style_class2.html - COMPASS (class 2) bond -"bond_style fene"_bond_style_fene.html - FENE (finite-extensible non-linear elastic) bond -"bond_style fene/expand"_bond_style_fene_expand.html - FENE bonds with variable size particles -"bond_style harmonic"_bond_style_harmonic.html - harmonic bond -"bond_style morse"_bond_style_morse.html - Morse bond -"bond_style nonlinear"_bond_style_nonlinear.html - nonlinear bond -"bond_style quartic"_bond_style_quartic.html - breakable quartic bond :ul +"bond_style class2"_bond_class2.html - COMPASS (class 2) bond +"bond_style fene"_bond_fene.html - FENE (finite-extensible non-linear elastic) bond +"bond_style fene/expand"_bond_fene_expand.html - FENE bonds with variable size particles +"bond_style harmonic"_bond_harmonic.html - harmonic bond +"bond_style morse"_bond_morse.html - Morse bond +"bond_style nonlinear"_bond_nonlinear.html - nonlinear bond +"bond_style quartic"_bond_quartic.html - breakable quartic bond :ul :line diff --git a/doc/dihedral_coeff.html b/doc/dihedral_coeff.html index 54494d11f7..96bad6121f 100644 --- a/doc/dihedral_coeff.html +++ b/doc/dihedral_coeff.html @@ -64,15 +64,15 @@ corresponds to the 1st example above would be listed as the style to display the formula it computes and coefficients specified by the associated dihedral_coeff command:

                    -
                    • dihedral_style none - turn off dihedral interactions -
                    • dihedral_style hybrid - define multiple styles of dihedral interactions + -
                      • dihedral_style charmm - CHARMM dihedral -
                      • dihedral_style class2 - COMPASS (class 2) dihedral -
                      • dihedral_style harmonic - harmonic dihedral -
                      • dihedral_style helix - helix dihedral -
                      • dihedral_style multi/harmonic - multi-harmonic dihedral -
                      • dihedral_style opls - OPLS dihedral +
                        diff --git a/doc/dihedral_coeff.txt b/doc/dihedral_coeff.txt index 23f66f9a26..3675df19f6 100644 --- a/doc/dihedral_coeff.txt +++ b/doc/dihedral_coeff.txt @@ -61,15 +61,15 @@ Here is an alphabetic list of dihedral styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "dihedral_coeff"_dihedral_coeff.html command: -"dihedral_style none"_dihedral_style_none.html - turn off dihedral interactions -"dihedral_style hybrid"_dihedral_style_hybrid.html - define multiple styles of dihedral interactions :ul +"dihedral_style none"_dihedral_none.html - turn off dihedral interactions +"dihedral_style hybrid"_dihedral_hybrid.html - define multiple styles of dihedral interactions :ul -"dihedral_style charmm"_dihedral_style_charmm.html - CHARMM dihedral -"dihedral_style class2"_dihedral_style_class2.html - COMPASS (class 2) dihedral -"dihedral_style harmonic"_dihedral_style_harmonic.html - harmonic dihedral -"dihedral_style helix"_dihedral_style_helix.html - helix dihedral -"dihedral_style multi/harmonic"_dihedral_style_multi_harmonic.html - multi-harmonic dihedral -"dihedral_style opls"_dihedral_style_opls.html - OPLS dihedral :ul +"dihedral_style charmm"_dihedral_charmm.html - CHARMM dihedral +"dihedral_style class2"_dihedral_class2.html - COMPASS (class 2) dihedral +"dihedral_style harmonic"_dihedral_harmonic.html - harmonic dihedral +"dihedral_style helix"_dihedral_helix.html - helix dihedral +"dihedral_style multi/harmonic"_dihedral_multi_harmonic.html - multi-harmonic dihedral +"dihedral_style opls"_dihedral_opls.html - OPLS dihedral :ul :line diff --git a/doc/dihedral_style.html b/doc/dihedral_style.html index a93035d543..573fed9394 100644 --- a/doc/dihedral_style.html +++ b/doc/dihedral_style.html @@ -66,15 +66,15 @@ torsions that contain the j-k bond in an i-j-k-l torsion. the style to display the formula it computes and coefficients specified by the associated dihedral_coeff command:

                        -
                        • dihedral_style none - turn off dihedral interactions -
                        • dihedral_style hybrid - define multiple styles of dihedral interactions + -
                          • dihedral_style charmm - CHARMM dihedral -
                          • dihedral_style class2 - COMPASS (class 2) dihedral -
                          • dihedral_style harmonic - harmonic dihedral -
                          • dihedral_style helix - helix dihedral -
                          • dihedral_style multi/harmonic - multi-harmonic dihedral -
                          • dihedral_style opls - OPLS dihedral +
                            diff --git a/doc/dihedral_style.txt b/doc/dihedral_style.txt index 5f0a0368af..ea01bc7205 100644 --- a/doc/dihedral_style.txt +++ b/doc/dihedral_style.txt @@ -64,15 +64,15 @@ Here is an alphabetic list of dihedral styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "dihedral_coeff"_dihedral_coeff.html command: -"dihedral_style none"_dihedral_style_none.html - turn off dihedral interactions -"dihedral_style hybrid"_dihedral_style_hybrid.html - define multiple styles of dihedral interactions :ul +"dihedral_style none"_dihedral_none.html - turn off dihedral interactions +"dihedral_style hybrid"_dihedral_hybrid.html - define multiple styles of dihedral interactions :ul -"dihedral_style charmm"_dihedral_style_charmm.html - CHARMM dihedral -"dihedral_style class2"_dihedral_style_class2.html - COMPASS (class 2) dihedral -"dihedral_style harmonic"_dihedral_style_harmonic.html - harmonic dihedral -"dihedral_style helix"_dihedral_style_helix.html - helix dihedral -"dihedral_style multi/harmonic"_dihedral_style_multi_harmonic.html - multi-harmonic dihedral -"dihedral_style opls"_dihedral_style_opls.html - OPLS dihedral :ul +"dihedral_style charmm"_dihedral_charmm.html - CHARMM dihedral +"dihedral_style class2"_dihedral_class2.html - COMPASS (class 2) dihedral +"dihedral_style harmonic"_dihedral_harmonic.html - harmonic dihedral +"dihedral_style helix"_dihedral_helix.html - helix dihedral +"dihedral_style multi/harmonic"_dihedral_multi_harmonic.html - multi-harmonic dihedral +"dihedral_style opls"_dihedral_opls.html - OPLS dihedral :ul :line diff --git a/doc/dump.html b/doc/dump.html index 5b3d827f29..1d84665788 100644 --- a/doc/dump.html +++ b/doc/dump.html @@ -19,7 +19,7 @@
                          • group-ID = ID of the group of atoms to be dumped -
                          • style = atom or bond or custom or dcd or xtc or xyz +
                          • style = atom or bond or dcd or xtc or xyz or custom
                          • N = dump every this many timesteps @@ -29,11 +29,18 @@
                              atom args = none
                               bond args = none
                            +  dcd args = none
                            +  xtc args = precision (optional)
                            +    precision = power-of-10 value from 10 to 1000000 (default = 1000)
                            +  xyz args = none
                               custom args = list of atom attributes
                            -    possible attributes = tag, mol, type, x, y, z, xs, ys, zs, xu, yu, zu,
                            -                 ix, iy, iz, vx, vy, vz, fx, fy, fz,
                            -                 q, mux, muy, muz, tqx, tqy, tqz,
                            -		 etotal, ke, epair, centro, sxx, syy, szz, sxy, sxz, syz 
                            +    possible attributes = tag, mol, type,
                            +			  x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
                            +			  vx, vy, vz, fx, fy, fz,
                            +                          q, mux, muy, muz, tqx, tqy, tqz,
                            +		          epair, ke, etotal, centro,
                            +                          sxx, syy, szz, sxy, sxz, syz,
                            +			  c_ID, c_ID[N]
                                   tag = atom ID
                                   mol = molecule ID
                                   type = atom type
                            @@ -46,15 +53,13 @@
                                   q = atom charge
                                   mux,muy,muz = orientation of dipolar atom
                                   tqx,tqy,tqz = torque on dipolar atoms
                            -      etotal = per-atom total energy (ke + epair)
                            -      ke = per-atom kinetic energy
                                   epair = per-atom pairwise energy
                            +      ke = per-atom kinetic energy
                            +      etotal = per-atom total energy (ke + epair)
                                   centro = per-atom centro-symmetry parameter
                                   sxx, syy, szz, sxy, sxz, syz = per-atom stress tensor components
                            -  dcd args = none
                            -  xtc args = precision (optional)
                            -    precision = power-of-10 value from 10 to 1000000 (default = 1000)
                            -  xyz args = none 
                            +      c_ID = scalar per-atom quantity calculated by a compute identified by its ID
                            +      c_ID[N] = Nth per-atom vector quantity calculated by a compute identified by its ID 
                             
                          @@ -63,7 +68,7 @@
                          dump myDump all atom 100 dump.atom
                           dump 2 subgroup atom 50 dump.run.bin
                           dump 4a all custom 100 dump.myforce.* tag type x y vx fx
                          -dump 4b flow custom 100 dump.%.myforce tag type epair sxx syy szz
                          +dump 4b flow custom 100 dump.%.myforce tag type epair sxx syy szz c_myF[3]
                           dump 1 all xtc 1000 file.xtc 100.0 
                           

                          Description: @@ -207,87 +212,71 @@ styles. part of the custom style.

                          The tag, mol, type, x, y, z, vx, vy, vz, fx, fy, -fz, q attributes are self-explanatory. Tag is the atom ID. -Mol is the molecule ID, included in the data file for molecular -systems. The x, y, z attributes write atom coordinates -"unscaled", in the appropriate distance units (Angstroms, sigma, etc). -Use xs, ys, zs if you want the coordinates "scaled" to the box -size, so that each value is 0.0 to 1.0. Use xu, yu, zu if you -want the coordinates "unwrapped" by the image flags for each atom. -Unwrapped means that if the atom has passed thru a periodic boundary -one or more times, the value is printed for what the coordinate would -be if it had not been wrapped back into the periodic box. Note that -using xu, yu, zu means that the coordinate values may be far -outside the box size printed with the snapshot. The image flags can -be printed directly using the ix, iy, iz attributes. The -dump_modify documentation describes in more detail -what is meant by scaled vs unscaled coordinates and the image flags. +fz, q keywords are self-explanatory. Tag is the atom ID. Mol +is the molecule ID, included in the data file for molecular systems. +The x, y, z keywords write atom coordinates "unscaled", in the +appropriate distance units (Angstroms, sigma, etc). Use xs, ys, +zs if you want the coordinates "scaled" to the box size, so that +each value is 0.0 to 1.0. Use xu, yu, zu if you want the +coordinates "unwrapped" by the image flags for each atom. Unwrapped +means that if the atom has passed thru a periodic boundary one or more +times, the value is printed for what the coordinate would be if it had +not been wrapped back into the periodic box. Note that using xu, +yu, zu means that the coordinate values may be far outside the box +size printed with the snapshot. The image flags can be printed +directly using the ix, iy, iz keywords. The +dump_modify command describes in more detail what +is meant by scaled vs unscaled coordinates and the image flags.

                          -

                          The mux, muy, muz, tqy, tqx, tqy attributes are specific -to dipolar systems defined with an atom style of dipole. +

                          The mux, muy, muz, tqy, tqx, tqy keywords are specific +to dipolar systems defined with an atom style of dipole. The first +3 give the orientation of the atom's dipole. The latter 3 give the +torque on the dipolar atoms.

                          -

                          The etotal attribute computes the total energy of each atom, which -is the ke plus epair values. Note that it does not include -contributions due to bonds, angles, etc that the atom is part of. +

                          The epair, ke, etotal, centro, and sxx, etc keywords print +the pairwise energy, kinetic energy, total energy (pairwise + +kinetic), centro-symmetry parameter, and components of the per-atom +stress tensor for each atom. These quantities are calculated by +computes that the dump defines, as if these commands had been issued:

                          -

                          The ke attribute computes the kinetic energy of each atom -which is simply 0.5 m v^2. +

                          compute dump-ID_epair/atom group-ID epair/atom
                          +compute dump-ID_ke/atom group-ID ke/atom
                          +compute dump-ID_etotal/atom group-ID etotal/atom
                          +compute dump-ID_centro/atom group-ID centro/atom
                          +compute dump-ID_stress/atom group-ID stress/atom 
                          +
                          +

                          See the corresponding compute style commands for +details on what is computed for each atom. Note that the ID of each +new compute is the dump-ID with the compute style appended (with an +underscore). The group for each new compute is the same as the dump +group.

                          -

                          The epair attribute computes the pairwise energy for each atom. -This is its pairwise interaction with all of its neighbors (divided by -2). Summed over all atoms, this should equal the pairwise energy of -the entire system (Van der Waals + Coulombic). However, for force -fields that include a contribution to the pairwise energy that is -computed as part of dihedral terms (i.e. 1-4 interactions), this -contribution is not included in the per-atom pairwise energy. -Computation of the per-atom energy requires a loop thru the neighbor -list and inter-processor communication, so it can be inefficient to -dump this quantity too frequently or to have multiple dump commands, -each with a epair attribute. +

                          Note that the etotal keyword does not include energy contributions +due to bonds, angles, etc that the atom is part of.

                          -

                          The centro attribute causes the centro-symmetry parameter to be -computed for each atom in the dump group using the following formula -from (Kelchner) +

                          The sxx, syy, szz, sxy, sxz, syz keywords access the 6 +components of the stress tensor calculated for each atom by the +compute stress/atom style.

                          -
                          -
                          -

                          where the 12 nearest neighbors are found and Ri and Ri+6 are the -vectors from the central atom to the opposite pair of nearest -neighbors. In solid state systems this is a useful measure of the -local lattice disorder around an atom and can be used to characterize -whether the atom is part of a perfect lattice, a local defect (e.g. a -dislocation or stacking fault), or at a surface. The neighbor list -needed to compute this quantity is constructed each time the dump is -performed. Thus it can be inefficient to dump this quantity too -frequently or to have multiple dump commands, each with a centro -attribute. +

                          The c_ID and c_ID[N] keywords allow scalar or vector per-atom +quantities calculated by a compute to be output. The ID in the +keyword should be replaced by the actual ID of the compute that has +been defined elsewhere in the input script. See the +compute command for details. Note that scalar and +vector quantities that are not calculated on a per-atoms basis +(e.g. global temperature or pressure) cannot be output in a dump. +Rather, these quantities are output by the thermo_style +custom command.

                          -

                          The sxx, syy, szz, sxy, sxz, syz attributes compute the -pairwise stress tensor for each atom where the ab component of the -stress on atom i is given by +

                          If c_ID is used as a keyword, then the a single per-atom quantity +calculated by the compute is printed. If c_ID[N] is used, then N in +the range from 1-M will print a specific component of the per-atom +vector calculated by the compute. A value of N=0 will output the +single per-atom quantity.

                          -
                          -
                          -

                          where the first term is a kinetic energy component for atom i, j -loops over the N neighbors of atom i, and Fb is one of 3 -components of force on atom i due to atom j. Both a and b can -take on values x,y,z to generate the 6 components of the symmetric -tensor. -

                          -

                          Note that this formula for stress does not include virial -contributions from intra-molecular interactions (e.g. bonds, angles, -torsions, etc). Also note that this quantity is the negative of the -per-atom pressure tensor. It is also really a stress-volume -formulation. It would need to be divided by a per-atom volume to have -units of stress, but an individual atom's volume is not easy to -compute in a deformed solid. Computation of stress tensor components -requires a loop thru the neighbor list and inter-processor -communication, so it can be inefficient to dump this quantity too -frequently or to have multiple dump commands, each with stress tensor -attributes. -

                          -

                          See this section for information on how to modify -LAMMPS to dump other kinds of per-atom quantities. +

                          See this section for information on how to add +new compute styles to LAMMPS that calculate per-atom quantities which +could then be output with these keywords.


                          @@ -319,10 +308,4 @@ gran/diag command should be used instead.

                          Default: none

                          -
                          - - - -

                          (Kelchner) Kelchner, Plimpton, Hamilton, Phys Rev B, 58, 11085 (1998). -

                          diff --git a/doc/dump.txt b/doc/dump.txt index 099651d88a..d706f41a63 100644 --- a/doc/dump.txt +++ b/doc/dump.txt @@ -14,17 +14,24 @@ dump ID group-ID style N file args :pre ID = user-assigned name for the dump :ulb,l group-ID = ID of the group of atoms to be dumped :l -style = {atom} or {bond} or {custom} or {dcd} or {xtc} or {xyz} :l +style = {atom} or {bond} or {dcd} or {xtc} or {xyz} or {custom} :l N = dump every this many timesteps :l file = name of file to write dump info to :l args = list of arguments for a particular style :l {atom} args = none {bond} args = none + {dcd} args = none + {xtc} args = precision (optional) + precision = power-of-10 value from 10 to 1000000 (default = 1000) + {xyz} args = none {custom} args = list of atom attributes - possible attributes = tag, mol, type, x, y, z, xs, ys, zs, xu, yu, zu, - ix, iy, iz, vx, vy, vz, fx, fy, fz, - q, mux, muy, muz, tqx, tqy, tqz, - etotal, ke, epair, centro, sxx, syy, szz, sxy, sxz, syz + possible attributes = tag, mol, type, + x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz, + vx, vy, vz, fx, fy, fz, + q, mux, muy, muz, tqx, tqy, tqz, + epair, ke, etotal, centro, + sxx, syy, szz, sxy, sxz, syz, + c_ID, c_ID\[N\] tag = atom ID mol = molecule ID type = atom type @@ -37,15 +44,13 @@ args = list of arguments for a particular style :l q = atom charge mux,muy,muz = orientation of dipolar atom tqx,tqy,tqz = torque on dipolar atoms - etotal = per-atom total energy (ke + epair) - ke = per-atom kinetic energy epair = per-atom pairwise energy + ke = per-atom kinetic energy + etotal = per-atom total energy (ke + epair) centro = per-atom centro-symmetry parameter sxx, syy, szz, sxy, sxz, syz = per-atom stress tensor components - {dcd} args = none - {xtc} args = precision (optional) - precision = power-of-10 value from 10 to 1000000 (default = 1000) - {xyz} args = none :pre + c_ID = scalar per-atom quantity calculated by a compute identified by its ID + c_ID\[N\] = Nth per-atom vector quantity calculated by a compute identified by its ID :pre :ule [Examples:] @@ -53,7 +58,7 @@ args = list of arguments for a particular style :l dump myDump all atom 100 dump.atom dump 2 subgroup atom 50 dump.run.bin dump 4a all custom 100 dump.myforce.* tag type x y vx fx -dump 4b flow custom 100 dump.%.myforce tag type epair sxx syy szz +dump 4b flow custom 100 dump.%.myforce tag type epair sxx syy szz c_myF\[3\] dump 1 all xtc 1000 file.xtc 100.0 :pre [Description:] @@ -197,87 +202,71 @@ This section explains the atom quantities that can be specified as part of the {custom} style. The {tag}, {mol}, {type}, {x}, {y}, {z}, {vx}, {vy}, {vz}, {fx}, {fy}, -{fz}, {q} attributes are self-explanatory. {Tag} is the atom ID. -{Mol} is the molecule ID, included in the data file for molecular -systems. The {x}, {y}, {z} attributes write atom coordinates -"unscaled", in the appropriate distance units (Angstroms, sigma, etc). -Use {xs}, {ys}, {zs} if you want the coordinates "scaled" to the box -size, so that each value is 0.0 to 1.0. Use {xu}, {yu}, {zu} if you -want the coordinates "unwrapped" by the image flags for each atom. -Unwrapped means that if the atom has passed thru a periodic boundary -one or more times, the value is printed for what the coordinate would -be if it had not been wrapped back into the periodic box. Note that -using {xu}, {yu}, {zu} means that the coordinate values may be far -outside the box size printed with the snapshot. The image flags can -be printed directly using the {ix}, {iy}, {iz} attributes. The -"dump_modify"_dump_modify.html documentation describes in more detail -what is meant by scaled vs unscaled coordinates and the image flags. +{fz}, {q} keywords are self-explanatory. {Tag} is the atom ID. {Mol} +is the molecule ID, included in the data file for molecular systems. +The {x}, {y}, {z} keywords write atom coordinates "unscaled", in the +appropriate distance units (Angstroms, sigma, etc). Use {xs}, {ys}, +{zs} if you want the coordinates "scaled" to the box size, so that +each value is 0.0 to 1.0. Use {xu}, {yu}, {zu} if you want the +coordinates "unwrapped" by the image flags for each atom. Unwrapped +means that if the atom has passed thru a periodic boundary one or more +times, the value is printed for what the coordinate would be if it had +not been wrapped back into the periodic box. Note that using {xu}, +{yu}, {zu} means that the coordinate values may be far outside the box +size printed with the snapshot. The image flags can be printed +directly using the {ix}, {iy}, {iz} keywords. The +"dump_modify"_dump_modify.html command describes in more detail what +is meant by scaled vs unscaled coordinates and the image flags. -The {mux}, {muy}, {muz}, {tqy}, {tqx}, {tqy} attributes are specific -to dipolar systems defined with an atom style of {dipole}. +The {mux}, {muy}, {muz}, {tqy}, {tqx}, {tqy} keywords are specific +to dipolar systems defined with an atom style of {dipole}. The first +3 give the orientation of the atom's dipole. The latter 3 give the +torque on the dipolar atoms. -The {etotal} attribute computes the total energy of each atom, which -is the {ke} plus {epair} values. Note that it does not include -contributions due to bonds, angles, etc that the atom is part of. +The {epair}, {ke}, {etotal}, {centro}, and {sxx}, etc keywords print +the pairwise energy, kinetic energy, total energy (pairwise + +kinetic), centro-symmetry parameter, and components of the per-atom +stress tensor for each atom. These quantities are calculated by +computes that the dump defines, as if these commands had been issued: -The {ke} attribute computes the kinetic energy of each atom -which is simply 0.5 m v^2. +compute dump-ID_epair/atom group-ID "epair/atom"_compute_epair_atom.html +compute dump-ID_ke/atom group-ID "ke/atom"_compute_ke_atom.html +compute dump-ID_etotal/atom group-ID "etotal/atom"_compute_etotal_atom.html +compute dump-ID_centro/atom group-ID "centro/atom"_compute_centro_atom.html +compute dump-ID_stress/atom group-ID "stress/atom"_compute_stress_atom.html :pre -The {epair} attribute computes the pairwise energy for each atom. -This is its pairwise interaction with all of its neighbors (divided by -2). Summed over all atoms, this should equal the pairwise energy of -the entire system (Van der Waals + Coulombic). However, for force -fields that include a contribution to the pairwise energy that is -computed as part of dihedral terms (i.e. 1-4 interactions), this -contribution is not included in the per-atom pairwise energy. -Computation of the per-atom energy requires a loop thru the neighbor -list and inter-processor communication, so it can be inefficient to -dump this quantity too frequently or to have multiple dump commands, -each with a {epair} attribute. +See the corresponding "compute"_compute.html style commands for +details on what is computed for each atom. Note that the ID of each +new compute is the dump-ID with the compute style appended (with an +underscore). The group for each new compute is the same as the dump +group. -The {centro} attribute causes the centro-symmetry parameter to be -computed for each atom in the dump group using the following formula -from "(Kelchner)"_#Kelchner +Note that the {etotal} keyword does not include energy contributions +due to bonds, angles, etc that the atom is part of. -:c,image(Eqs/centro_symmetry.jpg) +The {sxx}, {syy}, {szz}, {sxy}, {sxz}, {syz} keywords access the 6 +components of the stress tensor calculated for each atom by the +"compute stress/atom"_compute_stress_atom.html style. -where the 12 nearest neighbors are found and Ri and Ri+6 are the -vectors from the central atom to the opposite pair of nearest -neighbors. In solid state systems this is a useful measure of the -local lattice disorder around an atom and can be used to characterize -whether the atom is part of a perfect lattice, a local defect (e.g. a -dislocation or stacking fault), or at a surface. The neighbor list -needed to compute this quantity is constructed each time the dump is -performed. Thus it can be inefficient to dump this quantity too -frequently or to have multiple dump commands, each with a {centro} -attribute. +The {c_ID} and {c_ID\[N\]} keywords allow scalar or vector per-atom +quantities calculated by a compute to be output. The ID in the +keyword should be replaced by the actual ID of the compute that has +been defined elsewhere in the input script. See the +"compute"_compute.html command for details. Note that scalar and +vector quantities that are not calculated on a per-atoms basis +(e.g. global temperature or pressure) cannot be output in a dump. +Rather, these quantities are output by the "thermo_style +custom"_thermo_style.html command. -The {sxx}, {syy}, {szz}, {sxy}, {sxz}, {syz} attributes compute the -pairwise stress tensor for each atom where the {ab} component of the -stress on atom {i} is given by +If {c_ID} is used as a keyword, then the a single per-atom quantity +calculated by the compute is printed. If {c_ID\[N\]} is used, then N in +the range from 1-M will print a specific component of the per-atom +vector calculated by the compute. A value of N=0 will output the +single per-atom quantity. -:c,image(Eqs/stress_tensor.jpg) - -where the first term is a kinetic energy component for atom {i}, {j} -loops over the {N} neighbors of atom {i}, and {Fb} is one of 3 -components of force on atom {i} due to atom {j}. Both {a} and {b} can -take on values x,y,z to generate the 6 components of the symmetric -tensor. - -Note that this formula for stress does not include virial -contributions from intra-molecular interactions (e.g. bonds, angles, -torsions, etc). Also note that this quantity is the negative of the -per-atom pressure tensor. It is also really a stress-volume -formulation. It would need to be divided by a per-atom volume to have -units of stress, but an individual atom's volume is not easy to -compute in a deformed solid. Computation of stress tensor components -requires a loop thru the neighbor list and inter-processor -communication, so it can be inefficient to dump this quantity too -frequently or to have multiple dump commands, each with stress tensor -attributes. - -See "this section"_Section_modify.html for information on how to modify -LAMMPS to dump other kinds of per-atom quantities. +See "this section"_Section_modify.html for information on how to add +new compute styles to LAMMPS that calculate per-atom quantities which +could then be output with these keywords. :line @@ -308,8 +297,3 @@ gran/diag"_fix_gran_diag.html command should be used instead. "dump_modify"_dump_modify.html, "undump"_undump.html [Default:] none - -:line - -:link(Kelchner) -[(Kelchner)] Kelchner, Plimpton, Hamilton, Phys Rev B, 58, 11085 (1998). diff --git a/doc/fix_indent.html b/doc/fix_indent.html index 41d490ccc0..37f96f8f63 100644 --- a/doc/fix_indent.html +++ b/doc/fix_indent.html @@ -100,12 +100,12 @@ choice affects not only the indenter's physical geometry, but also its velocity and force constant since they are defined in terms of distance as well.

                          -

                          This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle interacting with the indenter is K/3 -(r - R)^3. The latter will add this contribution to the total -potential energy (PotEng). +

                          This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The energy of each +particle interacting with the indenter is K/3 (r - R)^3. The +contribution can also be printed by itself via the keyword f_fix-ID +in the thermo_style custom command.

                          The forces due to this fix are also imposed during an energy minimization, invoked by the minimize command. If you diff --git a/doc/fix_indent.txt b/doc/fix_indent.txt index 174cf098d1..ff045b9236 100644 --- a/doc/fix_indent.txt +++ b/doc/fix_indent.txt @@ -91,12 +91,12 @@ choice affects not only the indenter's physical geometry, but also its velocity and force constant since they are defined in terms of distance as well. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle interacting with the indenter is K/3 -(r - R)^3. The latter will add this contribution to the total -potential energy (PotEng). +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The energy of each +particle interacting with the indenter is K/3 (r - R)^3. The +contribution can also be printed by itself via the keyword {f_fix-ID} +in the "thermo_style custom"_thermo_style.html command. The forces due to this fix are also imposed during an energy minimization, invoked by the "minimize"_minimize.html command. If you diff --git a/doc/fix_modify.html b/doc/fix_modify.html index f5455500de..6a1721fa98 100644 --- a/doc/fix_modify.html +++ b/doc/fix_modify.html @@ -19,18 +19,18 @@

                        • one or more keyword/value pairs may be appended -
                        • keyword = temp or energy or thermo +
                        • keyword = temp or press or thermo -
                            temp value = temperature ID
                          -  energy value = yes or no
                          +
                            temp value = compute ID that calculates a temperature
                          +  press value = compute ID that calculates a pressure
                             thermo value = yes or no 
                           

                        Examples:

                        -
                        fix_modify 3 temp myTemp
                        -fix_modify 1 thermo yes energy no 
                        +
                        fix_modify 3 temp myTemp press myPress
                        +fix_modify 1 thermo yes 
                         

                        Description:

                        @@ -38,30 +38,29 @@ fix_modify 1 thermo yes energy no fix styles support all parameters.

                        The temp keyword is used to determine how a fix computes -temperature. The specified temperature ID must have been previously -defined by the user via the temperature command. -The default setting for temp is temperature ID = default. Fix -styles that use the temp setting are -temp/rescale, nvt, and -npt. +temperature. The specified compute ID must have been previously +defined by the user via the compute command and it must +be a style of compute that calculates a temperature. All fixes that +compute temperatures defined their own compute by default, as +described in their documentation. Thus this option allows the user to +override the default method for computing T.

                        -

                        The energy and thermo keywords enable a fix to compute and/or -print quantities as part of the thermodynamic output to the screen and -log file (if the fix defines such quantities). When the energy -keyword is set to yes, the fix computes a contribution to the total -potential energy that is printed as PotEng during thermodynamic -output. When the thermo keyword is set to yes, the fix prints one -or more values that are appended to the list of thermodynamic outputs. -See the thermo_style command for how this printing -is formatted. +

                        The press keyword is used to determine how a fix computes pressure. +The specified compute ID must have been previously defined by the user +via the compute command and it must be a style of +compute that calculates a pressure. All fixes that compute pressures +defined their own compute by default, as described in their +documentation. Thus this option allows the user to override the +default method for computing P.

                        -

                        The fixes that support the energy and thermo options include: fix -indent, fix nvt, fix -nph, fix npt, fix -orient/fcc, fix -temp/rescale, and fix -wall/lj93. See the individual fix commands for -more info on what is computed and/or printed. +

                        For fixes that calculates a contribution to the potential energy of +the system, the thermo keyword will include that contribution in +thermodyanmic output of the potential energy, as invoked by the +thermo_style command. The value of the +contribution can also be printed by itself using the thermo_style +custom keywords. The documentation for individual +fix commands specifies whether they make a contribution to the +potential energy.

                        Restrictions: none

                        @@ -72,6 +71,7 @@ more info on what is computed and/or printed.

                        Default:

                        -

                        The option defaults are temp = default, energy = no, thermo = no. +

                        The option defaults are temp = ID defined by fix, press = ID defined +by fix, thermo = no.

                        diff --git a/doc/fix_modify.txt b/doc/fix_modify.txt index 147b20ddf3..4014670c05 100644 --- a/doc/fix_modify.txt +++ b/doc/fix_modify.txt @@ -14,16 +14,16 @@ fix_modify fix-ID keyword value ... :pre fix-ID = ID of the fix to modify :ulb,l one or more keyword/value pairs may be appended :l -keyword = {temp} or {energy} or {thermo} :l - {temp} value = temperature ID - {energy} value = {yes} or {no} +keyword = {temp} or {press} or {thermo} :l + {temp} value = compute ID that calculates a temperature + {press} value = compute ID that calculates a pressure {thermo} value = {yes} or {no} :pre :ule [Examples:] -fix_modify 3 temp myTemp -fix_modify 1 thermo yes energy no :pre +fix_modify 3 temp myTemp press myPress +fix_modify 1 thermo yes :pre [Description:] @@ -31,30 +31,29 @@ Modify one or more parameters of a previously defined fix. Not all fix styles support all parameters. The {temp} keyword is used to determine how a fix computes -temperature. The specified temperature ID must have been previously -defined by the user via the "temperature"_temperature.html command. -The default setting for {temp} is temperature ID = {default}. Fix -styles that use the {temp} setting are -"temp/rescale"_fix_temp_rescale.html, "nvt"_fix_nvt.html, and -"npt"_fix_npt.html. +temperature. The specified compute ID must have been previously +defined by the user via the "compute"_compute.html command and it must +be a style of compute that calculates a temperature. All fixes that +compute temperatures defined their own compute by default, as +described in their documentation. Thus this option allows the user to +override the default method for computing T. -The {energy} and {thermo} keywords enable a fix to compute and/or -print quantities as part of the thermodynamic output to the screen and -log file (if the fix defines such quantities). When the {energy} -keyword is set to {yes}, the fix computes a contribution to the total -potential energy that is printed as PotEng during thermodynamic -output. When the {thermo} keyword is set to yes, the fix prints one -or more values that are appended to the list of thermodynamic outputs. -See the "thermo_style"_thermo_style.html command for how this printing -is formatted. +The {press} keyword is used to determine how a fix computes pressure. +The specified compute ID must have been previously defined by the user +via the "compute"_compute.html command and it must be a style of +compute that calculates a pressure. All fixes that compute pressures +defined their own compute by default, as described in their +documentation. Thus this option allows the user to override the +default method for computing P. -The fixes that support the {energy} and {thermo} options include: "fix -indent"_fix_indent.html, "fix nvt"_fix_nvt.html, "fix -nph"_fix_nph.html, "fix npt"_fix_npt.html, "fix -orient/fcc"_fix_orient_fcc.html, "fix -temp/rescale"_fix_temp_rescale.html, and "fix -wall/lj93"_fix_wall_lj93.html. See the individual fix commands for -more info on what is computed and/or printed. +For fixes that calculates a contribution to the potential energy of +the system, the {thermo} keyword will include that contribution in +thermodyanmic output of the potential energy, as invoked by the +"thermo_style"_thermo_style.html command. The value of the +contribution can also be printed by itself using the "thermo_style +custom"_thermo_style.html keywords. The documentation for individual +fix commands specifies whether they make a contribution to the +potential energy. [Restrictions:] none @@ -65,4 +64,5 @@ more info on what is computed and/or printed. [Default:] -The option defaults are temp = default, energy = no, thermo = no. +The option defaults are temp = ID defined by fix, press = ID defined +by fix, thermo = no. diff --git a/doc/fix_nph.html b/doc/fix_nph.html index 84a2577382..bd64b264ae 100644 --- a/doc/fix_nph.html +++ b/doc/fix_nph.html @@ -71,26 +71,8 @@ only the atoms in the fix group are re-scaled. The latter can be useful for leaving the coordinates of atoms in a solid substrate unchanged and controlling the pressure of a surrounding fluid.

                        -

                        This fix computes a temperature each timestep, to contribute to the -pressure. The fix creates its own method for computing T, as if it -had been defined by the command: -

                        -
                        temperature fix-ID all full 
                        -
                        -

                        See the temperature command for details. Note that -this is NOT the temperature with ID = default. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the temp_modify command or -print the temperature with thermodyanmic output via the thermo_style -custom command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -fix_modify command. If you do this, note that the -kinetic energy derived from T should be consistent with the virial -term computed using all atoms. LAMMPS will warn you if you choose to -compute temperature on a subset of atoms. -

                        +
                        +

                        The pressure can be controlled in one of several styles, as specified by the p-style argument. In each case, the desired pressure at each timestep is a ramped value during the run from the starting value to @@ -130,17 +112,49 @@ oscillations after a few periods. shape. Parinello-Rahman boundary conditions (tilted box) are not implemented in LAMMPS.

                        -

                        For all styles, the Pdamp parameter is specified in time units and -determines how rapidly the pressure is relaxed. For example, a value -of 1000.0 means to relax the temperature in a timespan of (roughly) -1000 time units (tau or fmsec or psec - see the units -command). +

                        For all styles, the Pdamp parameter operates like the Tdamp +parameter, determining the time scale on which pressure is relaxed. +For example, a value of 1000.0 means to relax the pressure in a +timespan of (roughly) 1000 time units (tau or fmsec or psec - see the +units command).

                        -

                        This fix supports the "fix_modify" options for thermo and energy. -The former will print the contribution the fix makes to the energy of -the system when thermodynamics is printed. The latter will add this -contribution to the total potential energy (PotEng) so that energy -conservation can be monitored. +


                        + +

                        This fix computes a temperature and pressure each timestep. To do +this, the fix creates its own computes of style "temp" and "pressure", +as if these commands had been issued: +

                        +
                        compute fix-ID_temp group-ID temp 
                        +
                        +
                        compute fix-ID_press group-ID pressure fix-ID_temp 
                        +
                        +

                        See the compute temp and >>compute +pressure commands for details. Note that the +IDs of the new computes are the fix-ID with or +appended and the group for the new computes is the same as the fix +group. +

                        +

                        Note that these are NOT the computes used by thermodynamic output (see +the thermo_style command) with ID = thermo_temp +and thermo_press. This means you can change the attributes of this +fix's temperature or pressure via the +compute_modify command or print this temperature +or pressure during thermodyanmic output via the thermo_style +custom command using the appropriate compute-ID. +It also means that changing attributes of thermo_temp or +thermo_press will have no effect on this fix. Alternatively, you +can directly assign a new compute (for calculating temeperature or +pressure) that you have defined to this fix via the +fix_modify command. If you do this, note that the +kinetic energy derived from T should be consistent with the virial +term computed using all atoms. LAMMPS will warn you if you choose to +compute temperature on a subset of atoms. +

                        +

                        This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                        Restrictions:

                        diff --git a/doc/fix_nph.txt b/doc/fix_nph.txt index 9675b5b884..7842803097 100644 --- a/doc/fix_nph.txt +++ b/doc/fix_nph.txt @@ -62,25 +62,7 @@ only the atoms in the fix group are re-scaled. The latter can be useful for leaving the coordinates of atoms in a solid substrate unchanged and controlling the pressure of a surrounding fluid. -This fix computes a temperature each timestep, to contribute to the -pressure. The fix creates its own method for computing T, as if it -had been defined by the command: - -temperature fix-ID all full :pre - -See the "temperature"_temperature.html command for details. Note that -this is NOT the temperature with ID = {default}. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the "temp_modify"_temp_modify.html command or -print the temperature with thermodyanmic output via the "thermo_style -custom"_thermo_style.html command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -"fix_modify"_fix_modify.html command. If you do this, note that the -kinetic energy derived from T should be consistent with the virial -term computed using all atoms. LAMMPS will warn you if you choose to -compute temperature on a subset of atoms. +:line The pressure can be controlled in one of several styles, as specified by the {p-style} argument. In each case, the desired pressure at each @@ -121,17 +103,48 @@ For all pressure styles, the simulation box stays rectangular in shape. Parinello-Rahman boundary conditions (tilted box) are not implemented in LAMMPS. -For all styles, the {Pdamp} parameter is specified in time units and -determines how rapidly the pressure is relaxed. For example, a value -of 1000.0 means to relax the temperature in a timespan of (roughly) -1000 time units (tau or fmsec or psec - see the "units"_units.html -command). +For all styles, the {Pdamp} parameter operates like the {Tdamp} +parameter, determining the time scale on which pressure is relaxed. +For example, a value of 1000.0 means to relax the pressure in a +timespan of (roughly) 1000 time units (tau or fmsec or psec - see the +"units"_units.html command). -This fix supports the "fix_modify" options for {thermo} and {energy}. -The former will print the contribution the fix makes to the energy of -the system when thermodynamics is printed. The latter will add this -contribution to the total potential energy (PotEng) so that energy -conservation can be monitored. +:line + +This fix computes a temperature and pressure each timestep. To do +this, the fix creates its own computes of style "temp" and "pressure", +as if these commands had been issued: + +compute fix-ID_temp group-ID temp :pre +compute fix-ID_press group-ID pressure fix-ID_temp :pre + +See the "compute temp"_compute_temp.html and "compute +pressure"_compute_pressure.html commands for details. Note that the +IDs of the new computes are the fix-ID with "_temp" or "_press" +appended and the group for the new computes is the same as the fix +group. + +Note that these are NOT the computes used by thermodynamic output (see +the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} +and {thermo_press}. This means you can change the attributes of this +fix's temperature or pressure via the +"compute_modify"_compute_modify.html command or print this temperature +or pressure during thermodyanmic output via the "thermo_style +custom"_thermo_style.html command using the appropriate compute-ID. +It also means that changing attributes of {thermo_temp} or +{thermo_press} will have no effect on this fix. Alternatively, you +can directly assign a new compute (for calculating temeperature or +pressure) that you have defined to this fix via the +"fix_modify"_fix_modify.html command. If you do this, note that the +kinetic energy derived from T should be consistent with the virial +term computed using all atoms. LAMMPS will warn you if you choose to +compute temperature on a subset of atoms. + +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. [Restrictions:] diff --git a/doc/fix_npt.html b/doc/fix_npt.html index 82cecd9a28..5857a99eaf 100644 --- a/doc/fix_npt.html +++ b/doc/fix_npt.html @@ -76,26 +76,8 @@ only the atoms in the fix group are re-scaled. The latter can be useful for leaving the coordinates of atoms in a solid substrate unchanged and controlling the pressure of a surrounding fluid.

                        -

                        This fix computes a temperature each timestep, to contribute to the -pressure. The fix creates its own method for computing T, as if it -had been defined by the command: -

                        -
                        temperature fix-ID all full 
                        -
                        -

                        See the temperature command for details. Note that -this is NOT the temperature with ID = default. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the temp_modify command or -print the temperature with thermodyanmic output via the thermo_style -custom command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -fix_modify command. If you do this, note that the -kinetic energy derived from T should be consistent with the virial -term computed using all atoms. LAMMPS will warn you if you choose to -compute temperature on a subset of atoms. -

                        +
                        +

                        The pressure can be controlled in one of several styles, as specified by the p-style argument. In each case, the desired pressure at each timestep is a ramped value during the run from the starting value to @@ -137,12 +119,47 @@ implemented in LAMMPS.

                        For all styles, the Pdamp parameter operates like the Tdamp parameter, determining the time scale on which pressure is relaxed. +For example, a value of 1000.0 means to relax the pressure in a +timespan of (roughly) 1000 time units (tau or fmsec or psec - see the +units command).

                        -

                        This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. +


                        + +

                        This fix computes a temperature and pressure each timestep. To do +this, the fix creates its own computes of style "temp" and "pressure", +as if these commands had been issued: +

                        +
                        compute fix-ID_temp group-ID temp 
                        +
                        +
                        compute fix-ID_press group-ID pressure fix-ID_temp 
                        +
                        +

                        See the compute temp and >>compute +pressure commands for details. Note that the +IDs of the new computes are the fix-ID with or +appended and the group for the new computes is the same as the fix +group. +

                        +

                        Note that these are NOT the computes used by thermodynamic output (see +the thermo_style command) with ID = thermo_temp +and thermo_press. This means you can change the attributes of this +fix's temperature or pressure via the +compute_modify command or print this temperature +or pressure during thermodyanmic output via the thermo_style +custom command using the appropriate compute-ID. +It also means that changing attributes of thermo_temp or +thermo_press will have no effect on this fix. Alternatively, you +can directly assign a new compute (for calculating temeperature or +pressure) that you have defined to this fix via the +fix_modify command. If you do this, note that the +kinetic energy derived from T should be consistent with the virial +term computed using all atoms. LAMMPS will warn you if you choose to +compute temperature on a subset of atoms. +

                        +

                        This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                        Restrictions:

                        diff --git a/doc/fix_npt.txt b/doc/fix_npt.txt index e2f00034e9..8513efd1bb 100644 --- a/doc/fix_npt.txt +++ b/doc/fix_npt.txt @@ -65,25 +65,7 @@ only the atoms in the fix group are re-scaled. The latter can be useful for leaving the coordinates of atoms in a solid substrate unchanged and controlling the pressure of a surrounding fluid. -This fix computes a temperature each timestep, to contribute to the -pressure. The fix creates its own method for computing T, as if it -had been defined by the command: - -temperature fix-ID all full :pre - -See the "temperature"_temperature.html command for details. Note that -this is NOT the temperature with ID = {default}. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the "temp_modify"_temp_modify.html command or -print the temperature with thermodyanmic output via the "thermo_style -custom"_thermo_style.html command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -"fix_modify"_fix_modify.html command. If you do this, note that the -kinetic energy derived from T should be consistent with the virial -term computed using all atoms. LAMMPS will warn you if you choose to -compute temperature on a subset of atoms. +:line The pressure can be controlled in one of several styles, as specified by the {p-style} argument. In each case, the desired pressure at each @@ -126,12 +108,46 @@ implemented in LAMMPS. For all styles, the {Pdamp} parameter operates like the {Tdamp} parameter, determining the time scale on which pressure is relaxed. +For example, a value of 1000.0 means to relax the pressure in a +timespan of (roughly) 1000 time units (tau or fmsec or psec - see the +"units"_units.html command). -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. +:line + +This fix computes a temperature and pressure each timestep. To do +this, the fix creates its own computes of style "temp" and "pressure", +as if these commands had been issued: + +compute fix-ID_temp group-ID temp :pre +compute fix-ID_press group-ID pressure fix-ID_temp :pre + +See the "compute temp"_compute_temp.html and "compute +pressure"_compute_pressure.html commands for details. Note that the +IDs of the new computes are the fix-ID with "_temp" or "_press" +appended and the group for the new computes is the same as the fix +group. + +Note that these are NOT the computes used by thermodynamic output (see +the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} +and {thermo_press}. This means you can change the attributes of this +fix's temperature or pressure via the +"compute_modify"_compute_modify.html command or print this temperature +or pressure during thermodyanmic output via the "thermo_style +custom"_thermo_style.html command using the appropriate compute-ID. +It also means that changing attributes of {thermo_temp} or +{thermo_press} will have no effect on this fix. Alternatively, you +can directly assign a new compute (for calculating temeperature or +pressure) that you have defined to this fix via the +"fix_modify"_fix_modify.html command. If you do this, note that the +kinetic energy derived from T should be consistent with the virial +term computed using all atoms. LAMMPS will warn you if you choose to +compute temperature on a subset of atoms. + +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. [Restrictions:] diff --git a/doc/fix_nvt.html b/doc/fix_nvt.html index 6414db75eb..30e0cc4b17 100644 --- a/doc/fix_nvt.html +++ b/doc/fix_nvt.html @@ -61,27 +61,33 @@ Performing a short run and monitoring the temperature is the best way to determine if the drag term is working. Typically a value between 0.2 to 2.0 is sufficient to damp oscillations after a few periods.

                        -

                        This fix computes a temperature each timestep. The fix creates its -own method for computing T, as if it had been defined by the command: +

                        This fix computes a temperature each timestep. To do this, the fix +creates its own compute of style "temp", as if this command had been +issued:

                        -
                        temperature fix-ID group-ID full 
                        +
                        compute fix-ID_temp group-ID temp 
                         
                        -

                        See the temperature command for details. Note that -this is NOT the temperature with ID = default. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the temp_modify command or -print the temperature with thermodyanmic output via the thermo_style -custom command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -fix_modify command. +

                        See the >compute temp command for details. Note +that the ID of the new compute is the fix-ID with appended and +the group for the new compute is the same as the fix group.

                        -

                        This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. +

                        Note that this is NOT the compute used by thermodynamic output (see +the thermo_style command) with ID = thermo_temp. +This means you can change the attributes of this fix's temperature +(e.g. its degrees-of-freedom) via the +compute_modify command or print this temperature +during thermodyanmic output via the thermo_style +custom command using the appropriate compute-ID. +It also means that changing attributes of thermo_temp will have no +effect on this fix. Alternatively, you can directly assign a new +compute (for calculating temeperature) that you have defined to this +fix via the fix_modify command. +

                        +

                        This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                        Restrictions:

                        diff --git a/doc/fix_nvt.txt b/doc/fix_nvt.txt index 7ecc9d5bc7..bf3d122d3e 100644 --- a/doc/fix_nvt.txt +++ b/doc/fix_nvt.txt @@ -52,27 +52,33 @@ Performing a short run and monitoring the temperature is the best way to determine if the drag term is working. Typically a value between 0.2 to 2.0 is sufficient to damp oscillations after a few periods. -This fix computes a temperature each timestep. The fix creates its -own method for computing T, as if it had been defined by the command: +This fix computes a temperature each timestep. To do this, the fix +creates its own compute of style "temp", as if this command had been +issued: -temperature fix-ID group-ID full :pre +compute fix-ID_temp group-ID temp :pre -See the "temperature"_temperature.html command for details. Note that -this is NOT the temperature with ID = {default}. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the "temp_modify"_temp_modify.html command or -print the temperature with thermodyanmic output via the "thermo_style -custom"_thermo_style.html command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -"fix_modify"_fix_modify.html command. +See the "compute temp"_compute_temp.html command for details. Note +that the ID of the new compute is the fix-ID with "_temp" appended and +the group for the new compute is the same as the fix group. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. +Note that this is NOT the compute used by thermodynamic output (see +the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. +This means you can change the attributes of this fix's temperature +(e.g. its degrees-of-freedom) via the +"compute_modify"_compute_modify.html command or print this temperature +during thermodyanmic output via the "thermo_style +custom"_thermo_style.html command using the appropriate compute-ID. +It also means that changing attributes of {thermo_temp} will have no +effect on this fix. Alternatively, you can directly assign a new +compute (for calculating temeperature) that you have defined to this +fix via the "fix_modify"_fix_modify.html command. + +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. [Restrictions:] diff --git a/doc/fix_orient_fcc.html b/doc/fix_orient_fcc.html index 0a1034b0db..36ed72e7ac 100644 --- a/doc/fix_orient_fcc.html +++ b/doc/fix_orient_fcc.html @@ -116,11 +116,11 @@ symmetry, so the list must include one from each pair of equal-and-opposite neighbors. A pair of orientation files for a Sigma=5 tilt boundary are show below.

                        -

                        This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng). +

                        This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                        Restrictions:

                        diff --git a/doc/fix_orient_fcc.txt b/doc/fix_orient_fcc.txt index d966c58665..44cfd3045a 100644 --- a/doc/fix_orient_fcc.txt +++ b/doc/fix_orient_fcc.txt @@ -113,11 +113,11 @@ symmetry, so the list must include one from each pair of equal-and-opposite neighbors. A pair of orientation files for a Sigma=5 tilt boundary are show below. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng). +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. [Restrictions:] diff --git a/doc/fix_print.html b/doc/fix_print.html index b9f2517fab..6376baae68 100644 --- a/doc/fix_print.html +++ b/doc/fix_print.html @@ -30,28 +30,29 @@ simulation run. This can be used for diagnostic purposes or even as a debugging tool to monitor some quantity during a run. The text string must be a single argument, so it should be enclosed in double quotes -if it is more than one word. If it contains variables ($a thru $z) it -must be enclosed in double quotes to insure they are not evaluated -when the input script is read, but will instead be evaluated when the -string is printed. +if it is more than one word. If it contains variables it must be +enclosed in double quotes to insure they are not evaluated when the +input script is read, but will instead be evaluated when the string is +printed.

                        See the variable command for a description of equal style variables which are the most useful ones to use with the fix print command, since they are evaluated afresh each timestep that the -fix print line is output. +fix print line is output. Equal-style variables can calculate complex +formulas involving atom and group properties, mathematical operations, +other variables, etc.

                        -

                        Note that if equal-style variables are used in the print line which -contain thermo_style custom keywords for potential -energy such as pe, eng, evdwl, ebond, etc, they will only be -up-to-date on timesteps where thermodynamics are computed. Hence, if -you output thermodynamics every 100 steps, but issue a fix print -command with N = 2 that contains such a variable, the printed value -will only be current on timesteps that are a multiple of 100. This is -because the potential functions in LAMMPS (pairwise, bond, etc) only -compute energies on timesteps when thermodynamic output is being -performed. +

                        Restrictions:

                        -

                        Restrictions: none +

                        If equal-style variables are used which contain +thermo_style custom keywords for energy such as +pe, eng, evdwl, ebond, etc, then they will only be up-to-date on +timesteps where thermodynamics are computed. For example, if you +output thermodynamics every 100 steps, but issue a fix print command +with N = 2 that contains such a variable, the printed value will only +be current on timesteps that are a multiple of 100. This is because +the potential functions in LAMMPS (pairwise, bond, etc) only compute +energies on timesteps when thermodynamic output is being performed.

                        Related commands:

                        diff --git a/doc/fix_print.txt b/doc/fix_print.txt index a719ca58d5..f6bcfe1bb0 100644 --- a/doc/fix_print.txt +++ b/doc/fix_print.txt @@ -27,28 +27,29 @@ Print a text string to the screen and logfile every N steps during a simulation run. This can be used for diagnostic purposes or even as a debugging tool to monitor some quantity during a run. The text string must be a single argument, so it should be enclosed in double quotes -if it is more than one word. If it contains variables ($a thru $z) it -must be enclosed in double quotes to insure they are not evaluated -when the input script is read, but will instead be evaluated when the -string is printed. +if it is more than one word. If it contains variables it must be +enclosed in double quotes to insure they are not evaluated when the +input script is read, but will instead be evaluated when the string is +printed. See the "variable"_variable.html command for a description of {equal} style variables which are the most useful ones to use with the fix print command, since they are evaluated afresh each timestep that the -fix print line is output. +fix print line is output. Equal-style variables can calculate complex +formulas involving atom and group properties, mathematical operations, +other variables, etc. -Note that if {equal}-style variables are used in the print line which -contain "thermo_style custom"_thermo_style.html keywords for potential -energy such as pe, eng, evdwl, ebond, etc, they will only be -up-to-date on timesteps where thermodynamics are computed. Hence, if -you output thermodynamics every 100 steps, but issue a fix print -command with N = 2 that contains such a variable, the printed value -will only be current on timesteps that are a multiple of 100. This is -because the potential functions in LAMMPS (pairwise, bond, etc) only -compute energies on timesteps when thermodynamic output is being -performed. +[Restrictions:] -[Restrictions:] none +If {equal}-style variables are used which contain +"thermo_style custom"_thermo_style.html keywords for energy such as +pe, eng, evdwl, ebond, etc, then they will only be up-to-date on +timesteps where thermodynamics are computed. For example, if you +output thermodynamics every 100 steps, but issue a fix print command +with N = 2 that contains such a variable, the printed value will only +be current on timesteps that are a multiple of 100. This is because +the potential functions in LAMMPS (pairwise, bond, etc) only compute +energies on timesteps when thermodynamic output is being performed. [Related commands:] diff --git a/doc/fix_temp_rescale.html b/doc/fix_temp_rescale.html index 6d796f7e5a..a4068e435a 100644 --- a/doc/fix_temp_rescale.html +++ b/doc/fix_temp_rescale.html @@ -15,26 +15,17 @@

                        fix ID group-ID temp/rescale N Tstart Tstop window fraction keyword values ... 
                         
                        -
                        • ID, group-ID are documented in fix command - -
                        • temp/rescale = style name of this fix command - +
                          • ID, group-ID are documented in fix command +
                          • temp/rescale = style name of this fix command
                          • N = perform rescaling every N steps - -
                          • Tstart,Tstop = desired temperature at start/end of run (temperature units) - -
                          • window = only rescale if temperature is outside this window (temperature units) - -
                          • fraction = rescale to target temperature by this fraction - -
                          • zero or more keyword/value pairs may be appended to the args - -
                            keyword = region
                            -  region values = region-ID
                            -    region-ID = ID of region to apply rescaling to 
                            -
                            - +
                          • Tstart,Tstop = desired temperature at start/end of run (temperature units) +
                          • window = only rescale if temperature is outside this window (temperature units) +
                          • fraction = rescale to target temperature by this fraction +
                          • zero or more keyword/value pairs may be appended to the args +
                          • keyword = region
                          +
                            region values = region-ID of region to apply rescaling to 
                          +

                          Examples:

                          fix 3 flow temp/rescale 100 1.0 1.1 0.02 0.5
                          @@ -61,43 +52,47 @@ value.
                           specified geometric region (and in the fix group).  Since atoms can
                           enter/leave a region, this test is performed each timestep.
                           

                          -

                          This fix computes a temperature each timestep. The fix creates its -own method for computing T, as if it had been defined by one of these -commands: -

                          -
                          temperature fix-ID group-ID full
                          -temperature fix-ID group-ID region region-ID 
                          -
                          -

                          Which is used depends on whether a region was specified with the fix. -See the temperature command for details. Note that -this is NOT the temperature with ID = default. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the temp_modify command or -print the temperature with thermodyanmic output via the thermo_style -custom command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -fix_modify command. For consistency, if using the -keyword region, the temperature you assign should also be of style -region. -

                          A temp/rescale fix does not update the coordinates of its atoms. It is normally used with a fix of style nve that does that. A temp/rescale fix should not normally be used on atoms that also have their temperature controlled by another fix - e.g. a nvt or langevin fix.

                          -

                          This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. Note that the -energy value printed by thermo is not cummulative energy, but energy -added in the most recent rescaling. Also note that because this fix -is invoked every N steps and thermo may be printed every M steps, that -unless M is a multiple of N, the energy info printed by thermo will -not be for the current timestep. +

                          This fix computes a temperature each timestep. To do this, the fix +creates its own compute of style "temp" or "temp/region", as if one of +these commands had been issued: +

                          +
                          compute fix-ID_temp group-ID temp
                          +compute fix-ID_temp group-ID temp/region region-ID 
                          +
                          +

                          Which is used depends on whether a region was specified with the fix. +See the compute temp and >compute +temp/region commands for details. Note that +the ID of the new compute is the fix-ID with appended and the +group for the new compute is the same as the fix group. +

                          +

                          Note that this is NOT the compute used by thermodynamic output (see +the thermo_style command) with ID = thermo_temp. +This means you can change the attributes of this fix's temperature +(e.g. its degrees-of-freedom) via the +compute_modify command or print this temperature +during thermodyanmic output via the thermo_style +custom command using the appropriate compute-ID. +It also means that changing attributes of thermo_temp will have no +effect on this fix. Alternatively, you can directly assign a new +compute (for calculating temeperature) that you have defined to this +fix via the fix_modify command. For consistency, if +using the keyword region, the compute you assign should also be of +style temp/region. +

                          +

                          This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command. Note that because +this fix is invoked every N steps and thermodynamic info may be +printed every M steps, that unless M is a multiple of N, the energy +info accessed will not be for the current timestep.

                          Restrictions: none

                          diff --git a/doc/fix_temp_rescale.txt b/doc/fix_temp_rescale.txt index 5e7cc30297..0ebd27d36b 100644 --- a/doc/fix_temp_rescale.txt +++ b/doc/fix_temp_rescale.txt @@ -12,17 +12,15 @@ fix temp/rescale command :h3 fix ID group-ID temp/rescale N Tstart Tstop window fraction keyword values ... :pre -ID, group-ID are documented in "fix"_fix.html command :ulb,l -temp/rescale = style name of this fix command :l -N = perform rescaling every N steps :l -Tstart,Tstop = desired temperature at start/end of run (temperature units) :l -window = only rescale if temperature is outside this window (temperature units) :l -fraction = rescale to target temperature by this fraction :l -zero or more keyword/value pairs may be appended to the args :l -keyword = {region} - {region} values = region-ID - region-ID = ID of region to apply rescaling to :pre -:ule +ID, group-ID are documented in "fix"_fix.html command +temp/rescale = style name of this fix command +N = perform rescaling every N steps +Tstart,Tstop = desired temperature at start/end of run (temperature units) +window = only rescale if temperature is outside this window (temperature units) +fraction = rescale to target temperature by this fraction +zero or more keyword/value pairs may be appended to the args +keyword = {region} :ul + {region} values = region-ID of region to apply rescaling to :pre [Examples:] @@ -50,43 +48,47 @@ The keyword {region} applies the fix only to atoms that are in the specified geometric region (and in the fix group). Since atoms can enter/leave a region, this test is performed each timestep. -This fix computes a temperature each timestep. The fix creates its -own method for computing T, as if it had been defined by one of these -commands: - -temperature fix-ID group-ID full -temperature fix-ID group-ID region region-ID :pre - -Which is used depends on whether a region was specified with the fix. -See the "temperature"_temperature.html command for details. Note that -this is NOT the temperature with ID = {default}. This means you can -change the attributes of this fix's temperature (e.g. its -degrees-of-freedom) via the "temp_modify"_temp_modify.html command or -print the temperature with thermodyanmic output via the "thermo_style -custom"_thermo_style.html command using the appropriate temp-ID = -fix-ID. It also means that changing attributes of the default -temperature will have no effect on this fix. Alternatively, you can -directly assign a new temperature to the fix via the -"fix_modify"_fix_modify.html command. For consistency, if using the -keyword {region}, the temperature you assign should also be of style -{region}. - A temp/rescale fix does not update the coordinates of its atoms. It is normally used with a fix of style {nve} that does that. A temp/rescale fix should not normally be used on atoms that also have their temperature controlled by another fix - e.g. a "nvt"_fix_nvt.html or "langevin"_fix_langevin.html fix. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed. The -latter will add this contribution to the total potential energy -(PotEng) so that energy conservation can be monitored. Note that the -energy value printed by thermo is not cummulative energy, but energy -added in the most recent rescaling. Also note that because this fix -is invoked every N steps and thermo may be printed every M steps, that -unless M is a multiple of N, the energy info printed by thermo will -not be for the current timestep. +This fix computes a temperature each timestep. To do this, the fix +creates its own compute of style "temp" or "temp/region", as if one of +these commands had been issued: + +compute fix-ID_temp group-ID temp +compute fix-ID_temp group-ID temp/region region-ID :pre + +Which is used depends on whether a region was specified with the fix. +See the "compute temp"_compute_temp.html and "compute +temp/region"_compute_temp_region.html commands for details. Note that +the ID of the new compute is the fix-ID with "_temp" appended and the +group for the new compute is the same as the fix group. + +Note that this is NOT the compute used by thermodynamic output (see +the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. +This means you can change the attributes of this fix's temperature +(e.g. its degrees-of-freedom) via the +"compute_modify"_compute_modify.html command or print this temperature +during thermodyanmic output via the "thermo_style +custom"_thermo_style.html command using the appropriate compute-ID. +It also means that changing attributes of {thermo_temp} will have no +effect on this fix. Alternatively, you can directly assign a new +compute (for calculating temeperature) that you have defined to this +fix via the "fix_modify"_fix_modify.html command. For consistency, if +using the keyword {region}, the compute you assign should also be of +style {temp/region}. + +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. Note that because +this fix is invoked every N steps and thermodynamic info may be +printed every M steps, that unless M is a multiple of N, the energy +info accessed will not be for the current timestep. [Restrictions:] none diff --git a/doc/fix_wall_lj126.html b/doc/fix_wall_lj126.html index 48b2ccdf2c..b972d58b98 100644 --- a/doc/fix_wall_lj126.html +++ b/doc/fix_wall_lj126.html @@ -44,12 +44,11 @@ provided by the fix wall/lj93 command.

                          The wall potential is shifted so that the energy of a wall-particle interaction is 0.0 at the cutoff distance.

                          -

                          This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle comes from the integrated form of -the equation above. The latter will add this contribution to the -total potential energy (PotEng). +

                          This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                          The forces due to this fix are also imposed during an energy minimization, invoked by the minimize command. If you diff --git a/doc/fix_wall_lj126.txt b/doc/fix_wall_lj126.txt index 4446144524..1f76d2dd6e 100644 --- a/doc/fix_wall_lj126.txt +++ b/doc/fix_wall_lj126.txt @@ -41,12 +41,11 @@ provided by the "fix wall/lj93"_fix_wall_lj93.html command. The wall potential is shifted so that the energy of a wall-particle interaction is 0.0 at the cutoff distance. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle comes from the integrated form of -the equation above. The latter will add this contribution to the -total potential energy (PotEng). +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. The forces due to this fix are also imposed during an energy minimization, invoked by the "minimize"_minimize.html command. If you diff --git a/doc/fix_wall_lj93.html b/doc/fix_wall_lj93.html index 1b4653ff86..9dd3bbe202 100644 --- a/doc/fix_wall_lj93.html +++ b/doc/fix_wall_lj93.html @@ -45,12 +45,11 @@ wall/lj126 command.

                          The wall potential is shifted so that the energy of a wall-particle interaction is 0.0 at the cutoff distance.

                          -

                          This fix supports the fix_modify options for -thermo and energy. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle comes from the integrated form of -the equation above. The latter will add this contribution to the -total potential energy (PotEng). +

                          This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the fix_modify energy option. The contribution can +also be printed by itself via the keyword f_fix-ID in the +thermo_style custom command.

                          The forces due to this fix are also imposed during an energy minimization, invoked by the minimize command. If you diff --git a/doc/fix_wall_lj93.txt b/doc/fix_wall_lj93.txt index 446bc4eebf..accd1853a3 100644 --- a/doc/fix_wall_lj93.txt +++ b/doc/fix_wall_lj93.txt @@ -42,12 +42,11 @@ wall/lj126"_fix_wall_lj126.html command. The wall potential is shifted so that the energy of a wall-particle interaction is 0.0 at the cutoff distance. -This fix supports the "fix_modify"_fix_modify.html options for -{thermo} and {energy}. The former will print the contribution the fix -makes to the energy of the system when thermodynamics is printed, -where the energy of each particle comes from the integrated form of -the equation above. The latter will add this contribution to the -total potential energy (PotEng). +This fix makes a contribution to the potential energy of the system +that can be included in thermodynamic output of potential energy using +the "fix_modify energy"_fix_modify.html option. The contribution can +also be printed by itself via the keyword {f_fix-ID} in the +"thermo_style custom"_thermo_style.html command. The forces due to this fix are also imposed during an energy minimization, invoked by the "minimize"_minimize.html command. If you diff --git a/doc/improper_coeff.html b/doc/improper_coeff.html index 901fe4e356..9ce9452398 100644 --- a/doc/improper_coeff.html +++ b/doc/improper_coeff.html @@ -64,12 +64,12 @@ corresponds to the 1st example above would be listed as the style to display the formula it computes and coefficients specified by the associated improper_coeff command:

                          -
                          • improper_style none - turn off improper interactions -
                          • improper_style hybrid - define multiple styles of improper interactions + -
                            • improper_style class2 - COMPASS (class 2) improper -
                            • improper_style cvff - CVFF improper -
                            • improper_style harmonic - harmonic improper +
                              diff --git a/doc/improper_coeff.txt b/doc/improper_coeff.txt index 146fb1a480..148651b86f 100644 --- a/doc/improper_coeff.txt +++ b/doc/improper_coeff.txt @@ -61,12 +61,12 @@ Here is an alphabetic list of improper styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "improper_coeff"_improper_coeff.html command: -"improper_style none"_improper_style_none.html - turn off improper interactions -"improper_style hybrid"_improper_style_hybrid.html - define multiple styles of improper interactions :ul +"improper_style none"_improper_none.html - turn off improper interactions +"improper_style hybrid"_improper_hybrid.html - define multiple styles of improper interactions :ul -"improper_style class2"_improper_style_class2.html - COMPASS (class 2) improper -"improper_style cvff"_improper_style_cvff.html - CVFF improper -"improper_style harmonic"_improper_style_harmonic.html - harmonic improper :ul +"improper_style class2"_improper_class2.html - COMPASS (class 2) improper +"improper_style cvff"_improper_cvff.html - CVFF improper +"improper_style harmonic"_improper_harmonic.html - harmonic improper :ul :line diff --git a/doc/improper_style.html b/doc/improper_style.html index 1adc9d2414..9f7d0c6c06 100644 --- a/doc/improper_style.html +++ b/doc/improper_style.html @@ -48,12 +48,12 @@ exist between the 4 bonded atoms. the style to display the formula it computes and coefficients specified by the associated improper_coeff command:

                              -
                              • improper_style none - turn off improper interactions -
                              • improper_style hybrid - define multiple styles of improper interactions + -
                                • improper_style class2 - COMPASS (class 2) improper -
                                • improper_style cvff - CVFF improper -
                                • improper_style harmonic - harmonic improper +
                                  diff --git a/doc/improper_style.txt b/doc/improper_style.txt index 0d5ceb2947..85fbc69183 100644 --- a/doc/improper_style.txt +++ b/doc/improper_style.txt @@ -45,12 +45,12 @@ Here is an alphabetic list of improper styles defined in LAMMPS. Click on the style to display the formula it computes and coefficients specified by the associated "improper_coeff"_improper_coeff.html command: -"improper_style none"_improper_style_none.html - turn off improper interactions -"improper_style hybrid"_improper_style_hybrid.html - define multiple styles of improper interactions :ul +"improper_style none"_improper_none.html - turn off improper interactions +"improper_style hybrid"_improper_hybrid.html - define multiple styles of improper interactions :ul -"improper_style class2"_improper_style_class2.html - COMPASS (class 2) improper -"improper_style cvff"_improper_style_cvff.html - CVFF improper -"improper_style harmonic"_improper_style_harmonic.html - harmonic improper :ul +"improper_style class2"_improper_class2.html - COMPASS (class 2) improper +"improper_style cvff"_improper_cvff.html - CVFF improper +"improper_style harmonic"_improper_harmonic.html - harmonic improper :ul :line diff --git a/doc/log.html b/doc/log.html index 67c81392a9..baf805ee69 100644 --- a/doc/log.html +++ b/doc/log.html @@ -33,7 +33,7 @@ the same log file.

                                  The file "log.lammps" is the default log file for a LAMMPS run. The name of the initial log file can also be set by the command-line -switch -log. See this section for details. +switch -log. See this section for details.

                                  Restrictions: none

                                  diff --git a/doc/log.txt b/doc/log.txt index 49eb868dae..76a5729c3a 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -30,7 +30,7 @@ the same log file. The file "log.lammps" is the default log file for a LAMMPS run. The name of the initial log file can also be set by the command-line -switch -log. See "this section"_Section_start.html#2_4 for details. +switch -log. See "this section"_Section_start.html#2_6 for details. [Restrictions:] none diff --git a/doc/neighbor.html b/doc/neighbor.html index 78b14e3ce8..3111eefca7 100644 --- a/doc/neighbor.html +++ b/doc/neighbor.html @@ -48,7 +48,7 @@ stored in the list.

                                  When a run is finished, counts of the number of neighbors stored in the pairwise list and the number of times neighbor lists were built -are printed to the screen and log file. See this +are printed to the screen and log file. See this section for details.

                                  Restrictions: none diff --git a/doc/neighbor.txt b/doc/neighbor.txt index 2c790813a5..8daff1bdab 100644 --- a/doc/neighbor.txt +++ b/doc/neighbor.txt @@ -46,7 +46,7 @@ stored in the list. When a run is finished, counts of the number of neighbors stored in the pairwise list and the number of times neighbor lists were built are printed to the screen and log file. See "this -section"_Section_start.html#2_5 for details. +section"_Section_start.html#2_7 for details. [Restrictions:] none diff --git a/doc/next.html b/doc/next.html index 06baa5ffd6..d2a0b201b9 100644 --- a/doc/next.html +++ b/doc/next.html @@ -47,7 +47,7 @@ the next command is used with universe- or uloop-style variables, the next value is assigned to whichever processor partition executes the command first. All processors in the partition are assigned the same value. Running LAMMPS on multiple partitions of processors via -the "-partition" command-line switch is described in this +the "-partition" command-line switch is described in this section of the manual. Universe- and uloop-style variables are incremented using the files "tmp.lammps.variable" and "tmp.lammps.variable.lock" which you will diff --git a/doc/next.txt b/doc/next.txt index ea6e1861ef..0125ca9e93 100644 --- a/doc/next.txt +++ b/doc/next.txt @@ -45,7 +45,7 @@ the next value is assigned to whichever processor partition executes the command first. All processors in the partition are assigned the same value. Running LAMMPS on multiple partitions of processors via the "-partition" command-line switch is described in "this -section"_Section_start.html#2_4 of the manual. {Universe}- and +section"_Section_start.html#2_6 of the manual. {Universe}- and {uloop}-style variables are incremented using the files "tmp.lammps.variable" and "tmp.lammps.variable.lock" which you will see in your directory during such a LAMMPS run. diff --git a/doc/pair_coeff.html b/doc/pair_coeff.html index 0c121c3221..0723e1961f 100644 --- a/doc/pair_coeff.html +++ b/doc/pair_coeff.html @@ -83,40 +83,39 @@ the style to display the formula it computes, arguments specified in the pair_style command, and coefficients specified by the associated pair_coeff command:

                                  -
                                  • pair_style none - turn off pairwise interactions -
                                  • pair_style hybrid - define multiple styles of pairwise interactions + -
                                    • pair_style buck - Buckingham potential -
                                    • pair_style buck/coul/cut - Buckinhham with cutoff Coulomb -
                                    • pair_style buck/coul/long - Buckingham with long-range Coulomb -
                                    • pair_style dipole/cut - cutoff dipole and charge interactions -
                                    • pair_style dpd - dissipative particle dynamics (DPD) -
                                    • pair_style eam - embedded atom method (EAM) -
                                    • pair_style eam/alloy - alloy EAM -
                                    • pair_style eam/fs - Finnis-Sinclair EAM -
                                    • pair_style gran/hertzian - granular potential with Hertizain interactions -
                                    • pair_style gran/history - granular potential with history effects -
                                    • pair_style gran/no_history - granular potential without history effects -
                                    • pair_style lj/charmm/coul/charmm - CHARMM potential with cutoff Coulomb -
                                    • pair_style lj/charmm/coul/charmm/implicit - CHARMM for implicit solvent -
                                    • pair_style lj/charmm/coul/long - CHARMM with long-range Coulomb -
                                    • pair_style lj/class2 - COMPASS (class 2) force field with no Coulomb -
                                    • pair_style lj/class2/coul/cut - COMPASS with cutoff Coulomb -
                                    • pair_style lj/class2/coul/long - COMPASS with long-range Coulomb -
                                    • pair_style lj/cut - cutoff Lennard-Jones potential with no Coulomb -
                                    • pair_style lj/cut/coul/cut - LJ with cutoff Coulomb -
                                    • pair_style lj/cut/coul/debye - LJ with Debye damping added to Coulomb -
                                    • pair_style lj/cut/coul/long - LJ with long-range Coulomb -
                                    • pair_style lj/cut/coul/long/tip4p - LJ with long-range Coulomb for TIP4P water -
                                    • pair_style lj/expand - Lennard-Jones for variable size particles -
                                    • pair_style lj/smooth - smoothed Lennard-Jones potential -
                                    • pair_style meam - modified embedded atom method (MEAM) -
                                    • pair_style morse - Morse potential -
                                    • pair_style soft - Soft (cosine) potential -
                                    • pair_style sw - Stillinger-Weber 3-body potential -
                                    • pair_style table - tabulated pair potential -
                                    • pair_style tersoff - Tersoff 3-body potential -
                                    • pair_style yukawa - Yukawa potential +
                                      diff --git a/doc/pair_coeff.txt b/doc/pair_coeff.txt index 97618acbbf..8fe7430ad4 100644 --- a/doc/pair_coeff.txt +++ b/doc/pair_coeff.txt @@ -80,40 +80,39 @@ the style to display the formula it computes, arguments specified in the pair_style command, and coefficients specified by the associated "pair_coeff"_pair_coeff.html command: -"pair_style none"_pair_style_none.html - turn off pairwise interactions -"pair_style hybrid"_pair_style_hybrid.html - define multiple styles of pairwise interactions :ul +"pair_style none"_pair_none.html - turn off pairwise interactions +"pair_style hybrid"_pair_hybrid.html - define multiple styles of pairwise interactions :ul -"pair_style buck"_pair_style_buck.html - Buckingham potential -"pair_style buck/coul/cut"_pair_style_buck.html - Buckinhham with cutoff Coulomb -"pair_style buck/coul/long"_pair_style_buck.html - Buckingham with long-range Coulomb -"pair_style dipole/cut"_pair_style_dipole.html - cutoff dipole and charge interactions -"pair_style dpd"_pair_style_dpd.html - dissipative particle dynamics (DPD) -"pair_style eam"_pair_style_eam.html - embedded atom method (EAM) -"pair_style eam/alloy"_pair_style_eam.html - alloy EAM -"pair_style eam/fs"_pair_style_eam.html - Finnis-Sinclair EAM -"pair_style gran/hertzian"_pair_style_granular.html - granular potential with Hertizain interactions -"pair_style gran/history"_pair_style_granular.html - granular potential with history effects -"pair_style gran/no_history"_pair_style_granular.html - granular potential without history effects -"pair_style lj/charmm/coul/charmm"_pair_style_charmm.html - CHARMM potential with cutoff Coulomb -"pair_style lj/charmm/coul/charmm/implicit"_pair_style_charmm.html - CHARMM for implicit solvent -"pair_style lj/charmm/coul/long"_pair_style_charmm.html - CHARMM with long-range Coulomb -"pair_style lj/class2"_pair_style_class2.html - COMPASS (class 2) force field with no Coulomb -"pair_style lj/class2/coul/cut"_pair_style_class2.html - COMPASS with cutoff Coulomb -"pair_style lj/class2/coul/long"_pair_style_class2.html - COMPASS with long-range Coulomb -"pair_style lj/cut"_pair_style_lj.html - cutoff Lennard-Jones potential with no Coulomb -"pair_style lj/cut/coul/cut"_pair_style_lj.html - LJ with cutoff Coulomb -"pair_style lj/cut/coul/debye"_pair_style_lj.html - LJ with Debye damping added to Coulomb -"pair_style lj/cut/coul/long"_pair_style_lj.html - LJ with long-range Coulomb -"pair_style lj/cut/coul/long/tip4p"_pair_style_lj.html - LJ with long-range Coulomb for TIP4P water -"pair_style lj/expand"_pair_style_lj_expand.html - Lennard-Jones for variable size particles -"pair_style lj/smooth"_pair_style_lj_smooth.html - smoothed Lennard-Jones potential -"pair_style meam"_pair_style_meam.html - modified embedded atom method (MEAM) -"pair_style morse"_pair_style_morse.html - Morse potential -"pair_style soft"_pair_style_soft.html - Soft (cosine) potential -"pair_style sw"_pair_style_sw.html - Stillinger-Weber 3-body potential -"pair_style table"_pair_style_table.html - tabulated pair potential -"pair_style tersoff"_pair_style_tersoff.html - Tersoff 3-body potential -"pair_style yukawa"_pair_style_yukawa.html - Yukawa potential :ul +"pair_style buck"_pair_buck.html - Buckingham potential +"pair_style buck/coul/cut"_pair_buck.html - Buckinhham with cutoff Coulomb +"pair_style buck/coul/long"_pair_buck.html - Buckingham with long-range Coulomb +"pair_style dpd"_pair_dpd.html - dissipative particle dynamics (DPD) +"pair_style eam"_pair_eam.html - embedded atom method (EAM) +"pair_style eam/alloy"_pair_eam.html - alloy EAM +"pair_style eam/fs"_pair_eam.html - Finnis-Sinclair EAM +"pair_style gran/hertzian"_pair_granular.html - granular potential with Hertizain interactions +"pair_style gran/history"_pair_granular.html - granular potential with history effects +"pair_style gran/no_history"_pair_granular.html - granular potential without history effects +"pair_style lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb +"pair_style lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent +"pair_style lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb +"pair_style lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb +"pair_style lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb +"pair_style lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb +"pair_style lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb +"pair_style lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb +"pair_style lj/cut/coul/debye"_pair_lj.html - LJ with Debye damping added to Coulomb +"pair_style lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulomb +"pair_style lj/cut/coul/long/tip4p"_pair_lj.html - LJ with long-range Coulomb for TIP4P water +"pair_style lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles +"pair_style lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential +"pair_style meam"_pair_meam.html - modified embedded atom method (MEAM) +"pair_style morse"_pair_morse.html - Morse potential +"pair_style soft"_pair_soft.html - Soft (cosine) potential +"pair_style sw"_pair_sw.html - Stillinger-Weber 3-body potential +"pair_style table"_pair_table.html - tabulated pair potential +"pair_style tersoff"_pair_tersoff.html - Tersoff 3-body potential +"pair_style yukawa"_pair_yukawa.html - Yukawa potential :ul :line diff --git a/doc/pair_style.html b/doc/pair_style.html index a0465ad058..65aac0f673 100644 --- a/doc/pair_style.html +++ b/doc/pair_style.html @@ -17,25 +17,14 @@
                          • style = one of the following -
                            • none -
                            • hybrid -
                            • buck or buck/coul/cut or buck/coul/long -
                            • dipole/cut or dipole/long -
                            • dpd -
                            • eam or eam/alloy or eam/fs -
                            • gran/hertzian or gran/history or gran/no_history -
                            • lj/charmm/coul/charmm or lj/charmm/coul/charmm/implicit or lj/charmm/coul/long -
                            • lj/class2 or lj/class2/coul/cut or lj/class2/coul/long -
                            • lj/cut or lj/cut/coul/cut or lj/cut/coul/debye or lj/cut/coul/long or lj/cut/coul/long/tip4p -
                            • lj/expand -
                            • lj/smooth -
                            • meam -
                            • morse -
                            • soft -
                            • sw -
                            • table -
                            • tersoff -
                            • yukawa +
                              • none, hybrid, buck, buck/coul/cut, buck/coul/long, dpd, +
                              • eam, eam/alloy or eam/fs, gran/hertzian, gran/history, +
                              • gran/no_history, lj/charmm/coul/charmm, +
                              • lj/charmm/coul/charmm/implicit or lj/charmm/coul/long, +
                              • lj/class2, lj/class2/coul/cut or lj/class2/coul/long, lj/cut, +
                              • lj/cut/coul/cut or lj/cut/coul/debye, lj/cut/coul/long, +
                              • lj/cut/coul/long/tip4p, lj/expand, lj/smooth, meam, morse, +
                              • soft, sw, table, tersoff, yukawa
                            • args = arguments used by a particular style
                            @@ -100,40 +89,39 @@ the style to display the formula it computes, arguments specified in the pair_style command, and coefficients specified by the associated pair_coeff command:

                            -
                            • pair_style none - turn off pairwise interactions -
                            • pair_style hybrid - define multiple styles of pairwise interactions + -
                              • pair_style buck - Buckingham potential -
                              • pair_style buck/coul/cut - Buckinhham with cutoff Coulomb -
                              • pair_style buck/coul/long - Buckingham with long-range Coulomb -
                              • pair_style dipole/cut - cutoff dipole and charge interactions -
                              • pair_style dpd - dissipative particle dynamics (DPD) -
                              • pair_style eam - embedded atom method (EAM) -
                              • pair_style eam/alloy - alloy EAM -
                              • pair_style eam/fs - Finnis-Sinclair EAM -
                              • pair_style gran/hertzian - granular potential with Hertizain interactions -
                              • pair_style gran/history - granular potential with history effects -
                              • pair_style gran/no_history - granular potential without history effects -
                              • pair_style lj/charmm/coul/charmm - CHARMM potential with cutoff Coulomb -
                              • pair_style lj/charmm/coul/charmm/implicit - CHARMM for implicit solvent -
                              • pair_style lj/charmm/coul/long - CHARMM with long-range Coulomb -
                              • pair_style lj/class2 - COMPASS (class 2) force field with no Coulomb -
                              • pair_style lj/class2/coul/cut - COMPASS with cutoff Coulomb -
                              • pair_style lj/class2/coul/long - COMPASS with long-range Coulomb -
                              • pair_style lj/cut - cutoff Lennard-Jones potential with no Coulomb -
                              • pair_style lj/cut/coul/cut - LJ with cutoff Coulomb -
                              • pair_style lj/cut/coul/debye - LJ with Debye damping added to Coulomb -
                              • pair_style lj/cut/coul/long - LJ with long-range Coulomb -
                              • pair_style lj/cut/coul/long/tip4p - LJ with long-range Coulomb for TIP4P water -
                              • pair_style lj/expand - Lennard-Jones for variable size particles -
                              • pair_style lj/smooth - smoothed Lennard-Jones potential -
                              • pair_style meam - modified embedded atom method (MEAM) -
                              • pair_style morse - Morse potential -
                              • pair_style soft - Soft (cosine) potential -
                              • pair_style sw - Stillinger-Weber 3-body potential -
                              • pair_style table - tabulated pair potential -
                              • pair_style tersoff - Tersoff 3-body potential -
                              • pair_style yukawa - Yukawa potential +
                                diff --git a/doc/pair_style.txt b/doc/pair_style.txt index 02eabb7238..406663ed6f 100644 --- a/doc/pair_style.txt +++ b/doc/pair_style.txt @@ -14,25 +14,14 @@ pair_style style args :pre style = one of the following :ulb,l -{none} -{hybrid} -{buck} or {buck/coul/cut} or {buck/coul/long} -{dipole/cut} or {dipole/long} -{dpd} -{eam} or {eam/alloy} or {eam/fs} -{gran/hertzian} or {gran/history} or {gran/no_history} -{lj/charmm/coul/charmm} or {lj/charmm/coul/charmm/implicit} or {lj/charmm/coul/long} -{lj/class2} or {lj/class2/coul/cut} or {lj/class2/coul/long} -{lj/cut} or {lj/cut/coul/cut} or {lj/cut/coul/debye} or {lj/cut/coul/long} or {lj/cut/coul/long/tip4p} -{lj/expand} -{lj/smooth} -{meam} -{morse} -{soft} -{sw} -{table} -{tersoff} -{yukawa} :ul +{none}, {hybrid}, {buck}, {buck/coul/cut}, {buck/coul/long}, {dpd}, +{eam}, {eam/alloy} or {eam/fs}, {gran/hertzian}, {gran/history}, +{gran/no_history}, {lj/charmm/coul/charmm}, +{lj/charmm/coul/charmm/implicit} or {lj/charmm/coul/long}, +{lj/class2}, {lj/class2/coul/cut} or {lj/class2/coul/long}, {lj/cut}, +{lj/cut/coul/cut} or {lj/cut/coul/debye}, {lj/cut/coul/long}, +{lj/cut/coul/long/tip4p}, {lj/expand}, {lj/smooth}, {meam}, {morse}, +{soft}, {sw}, {table}, {tersoff}, {yukawa} :ul args = arguments used by a particular style :l,ule @@ -97,40 +86,39 @@ the style to display the formula it computes, arguments specified in the pair_style command, and coefficients specified by the associated "pair_coeff"_pair_coeff.html command: -"pair_style none"_pair_style_none.html - turn off pairwise interactions -"pair_style hybrid"_pair_style_hybrid.html - define multiple styles of pairwise interactions :ul +"pair_style none"_pair_none.html - turn off pairwise interactions +"pair_style hybrid"_pair_hybrid.html - define multiple styles of pairwise interactions :ul -"pair_style buck"_pair_style_buck.html - Buckingham potential -"pair_style buck/coul/cut"_pair_style_buck.html - Buckinhham with cutoff Coulomb -"pair_style buck/coul/long"_pair_style_buck.html - Buckingham with long-range Coulomb -"pair_style dipole/cut"_pair_style_dipole.html - cutoff dipole and charge interactions -"pair_style dpd"_pair_style_dpd.html - dissipative particle dynamics (DPD) -"pair_style eam"_pair_style_eam.html - embedded atom method (EAM) -"pair_style eam/alloy"_pair_style_eam.html - alloy EAM -"pair_style eam/fs"_pair_style_eam.html - Finnis-Sinclair EAM -"pair_style gran/hertzian"_pair_style_granular.html - granular potential with Hertizain interactions -"pair_style gran/history"_pair_style_granular.html - granular potential with history effects -"pair_style gran/no_history"_pair_style_granular.html - granular potential without history effects -"pair_style lj/charmm/coul/charmm"_pair_style_charmm.html - CHARMM potential with cutoff Coulomb -"pair_style lj/charmm/coul/charmm/implicit"_pair_style_charmm.html - CHARMM for implicit solvent -"pair_style lj/charmm/coul/long"_pair_style_charmm.html - CHARMM with long-range Coulomb -"pair_style lj/class2"_pair_style_class2.html - COMPASS (class 2) force field with no Coulomb -"pair_style lj/class2/coul/cut"_pair_style_class2.html - COMPASS with cutoff Coulomb -"pair_style lj/class2/coul/long"_pair_style_class2.html - COMPASS with long-range Coulomb -"pair_style lj/cut"_pair_style_lj.html - cutoff Lennard-Jones potential with no Coulomb -"pair_style lj/cut/coul/cut"_pair_style_lj.html - LJ with cutoff Coulomb -"pair_style lj/cut/coul/debye"_pair_style_lj.html - LJ with Debye damping added to Coulomb -"pair_style lj/cut/coul/long"_pair_style_lj.html - LJ with long-range Coulomb -"pair_style lj/cut/coul/long/tip4p"_pair_style_lj.html - LJ with long-range Coulomb for TIP4P water -"pair_style lj/expand"_pair_style_lj_expand.html - Lennard-Jones for variable size particles -"pair_style lj/smooth"_pair_style_lj_smooth.html - smoothed Lennard-Jones potential -"pair_style meam"_pair_style_meam.html - modified embedded atom method (MEAM) -"pair_style morse"_pair_style_morse.html - Morse potential -"pair_style soft"_pair_style_soft.html - Soft (cosine) potential -"pair_style sw"_pair_style_sw.html - Stillinger-Weber 3-body potential -"pair_style table"_pair_style_table.html - tabulated pair potential -"pair_style tersoff"_pair_style_tersoff.html - Tersoff 3-body potential -"pair_style yukawa"_pair_style_yukawa.html - Yukawa potential :ul +"pair_style buck"_pair_buck.html - Buckingham potential +"pair_style buck/coul/cut"_pair_buck.html - Buckinhham with cutoff Coulomb +"pair_style buck/coul/long"_pair_buck.html - Buckingham with long-range Coulomb +"pair_style dpd"_pair_dpd.html - dissipative particle dynamics (DPD) +"pair_style eam"_pair_eam.html - embedded atom method (EAM) +"pair_style eam/alloy"_pair_eam.html - alloy EAM +"pair_style eam/fs"_pair_eam.html - Finnis-Sinclair EAM +"pair_style gran/hertzian"_pair_granular.html - granular potential with Hertizain interactions +"pair_style gran/history"_pair_granular.html - granular potential with history effects +"pair_style gran/no_history"_pair_granular.html - granular potential without history effects +"pair_style lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb +"pair_style lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent +"pair_style lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb +"pair_style lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb +"pair_style lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb +"pair_style lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb +"pair_style lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb +"pair_style lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb +"pair_style lj/cut/coul/debye"_pair_lj.html - LJ with Debye damping added to Coulomb +"pair_style lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulomb +"pair_style lj/cut/coul/long/tip4p"_pair_lj.html - LJ with long-range Coulomb for TIP4P water +"pair_style lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles +"pair_style lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential +"pair_style meam"_pair_meam.html - modified embedded atom method (MEAM) +"pair_style morse"_pair_morse.html - Morse potential +"pair_style soft"_pair_soft.html - Soft (cosine) potential +"pair_style sw"_pair_sw.html - Stillinger-Weber 3-body potential +"pair_style table"_pair_table.html - tabulated pair potential +"pair_style tersoff"_pair_tersoff.html - Tersoff 3-body potential +"pair_style yukawa"_pair_yukawa.html - Yukawa potential :ul :line diff --git a/doc/print.html b/doc/print.html index acf581d809..f95016cd3d 100644 --- a/doc/print.html +++ b/doc/print.html @@ -15,7 +15,7 @@

                                print args 
                                 
                                -
                                • args = one or more text strings and variables names to print out +
                                  • args = a line of text and variables names to print out

                                  Examples:

                                  @@ -25,14 +25,23 @@

                                  Print the list of arguments as a line of text to the screen and/or logfile. If variables are included in the arguments, they will be -evaluated and their values printed. Note that if variables are -included, the print string should not be enclosed in double quotes, -else it will prevent the variables from being evaluated. +evaluated and their current values printed. Note that if variables +are included, the print string should not be enclosed in double +quotes, else it will prevent the variables from being evaluated.

                                  -

                                  By using the print command in a section of the input script that is -looped over (see the jump command), and by including -variables of the equal style (see the variable -command), a string with changing values can be printed. +

                                  If you want the print command to be executed multiple times (with +changing variable values), there are 3 options. First, consider using +the fix print command, which will invoke a print +periodically during a simulation. Second, the print command can be +used as an argument to the every option of the run +command. Third, the print command could appear in a section of the +input script that is looped over (see the jump command). +

                                  +

                                  See the variable command for a description of equal +style variables which are typically the most useful ones to use with +the print command. Equal-style variables can calculate complex +formulas involving atom and group properties, mathematical operations, +other variables, etc.

                                  Restrictions: none

                                  diff --git a/doc/print.txt b/doc/print.txt index 3eaff3ba5c..98b9309767 100644 --- a/doc/print.txt +++ b/doc/print.txt @@ -12,7 +12,7 @@ print command :h3 print args :pre -args = one or more text strings and variables names to print out :ul +args = a line of text and variables names to print out :ul [Examples:] @@ -22,14 +22,23 @@ print The system volume is now $v :pre Print the list of arguments as a line of text to the screen and/or logfile. If variables are included in the arguments, they will be -evaluated and their values printed. Note that if variables are -included, the print string should not be enclosed in double quotes, -else it will prevent the variables from being evaluated. +evaluated and their current values printed. Note that if variables +are included, the print string should not be enclosed in double +quotes, else it will prevent the variables from being evaluated. -By using the print command in a section of the input script that is -looped over (see the "jump"_jump.html command), and by including -variables of the {equal} style (see the "variable"_variable.html -command), a string with changing values can be printed. +If you want the print command to be executed multiple times (with +changing variable values), there are 3 options. First, consider using +the "fix print"_fix_print.html command, which will invoke a print +periodically during a simulation. Second, the print command can be +used as an argument to the {every} option of the "run"_run.html +command. Third, the print command could appear in a section of the +input script that is looped over (see the "jump"_jump.html command). + +See the "variable"_variable.html command for a description of {equal} +style variables which are typically the most useful ones to use with +the print command. Equal-style variables can calculate complex +formulas involving atom and group properties, mathematical operations, +other variables, etc. [Restrictions:] none diff --git a/doc/processors.html b/doc/processors.html index 8bfb85b2ef..5969428ce3 100644 --- a/doc/processors.html +++ b/doc/processors.html @@ -38,7 +38,7 @@ dramatically over the course of the simulation.

                                  The product of Px, Py, Pz must equal P, the total # of processors LAMMPS is running on. If multiple partitions are being used then P is -the number of processors in this partition; see this +the number of processors in this partition; see this section for an explanation of the -partition command-line switch.

                                  diff --git a/doc/processors.txt b/doc/processors.txt index d21d0bd7e1..2223b13263 100644 --- a/doc/processors.txt +++ b/doc/processors.txt @@ -36,7 +36,7 @@ dramatically over the course of the simulation. The product of Px, Py, Pz must equal P, the total # of processors LAMMPS is running on. If multiple partitions are being used then P is the number of processors in this partition; see "this -section"_Section_start.html#2_4 for an explanation of the -partition +section"_Section_start.html#2_6 for an explanation of the -partition command-line switch. If P is large and prime, a grid such as 1 x P x 1 will be required, diff --git a/doc/read_data.html b/doc/read_data.html index 0842022ac1..e1d897a36c 100644 --- a/doc/read_data.html +++ b/doc/read_data.html @@ -212,47 +212,39 @@ integers (1, not 1.0).

                                  Atoms section:

                                  -
                                  • one line per atom +
                                    • one line per atom
                                    • line syntax: depends on atom style
                                    -

                                    This is the list of all possible quantities that can appear on each -line of this section: +

                                    An Atoms section must appear in the data file if natoms > 0 in the +header section. The atoms can be listed in any order. These are the +line formats for each atom style in LAMMPS: +

                                    +
                                    + + + + + + + +
                                    angle atom-ID molecule-ID atom-type x y z
                                    atomic atom-ID atom-type x y z
                                    bond atom-ID molecule-ID atom-type x y z
                                    charge atom-ID atom-type q x y z
                                    dpd atom-ID atom-type x y z
                                    full atom-ID molecule-ID atom-type q x y z
                                    granular atom-ID atom-type diameter density x y z
                                    molecular atom-ID molecule-ID atom-type x y z +
                                    + +

                                    where the keywords have these meanings:

                                    • atom-ID = integer ID of atom
                                    • molecule-ID = integer ID of molecule the atom belongs to -
                                    • type-ID = integer type ID of atom (1-Ntype) +
                                    • type-ID = type of atom (1-Ntype)
                                    • q = charge on atom
                                    • diameter = diameter of atom
                                    • density = density of atom -
                                    • x,y,z = coordinates of atom -
                                    • mux,muy,muz = components of dipole orientation of atom -
                                    • nx,ny,nz = image indices for atom +
                                    • x,y,z = coordinates of atom
                                    -

                                    Which of these quantities are actually listed depends on the atom -style. This is the list of which styles require each -quantity: -

                                    -
                                    • atom-ID = all styles -
                                    • molecule-ID = angle, bond, molecular, full styles -
                                    • type-ID = all styles -
                                    • q = charge, dipole, full styles -
                                    • diameter = granular style -
                                    • density = granular style -
                                    • x,y,z = all styles -
                                    • mux,muy,muz = dipole style -
                                    • nx,ny,nz = optional for all styles (see below) -
                                    -

                                    Any quantity that is used by the atom style appears in the order -listed above. Thus if the atom style is atomic, an atom line should -have 5 quantities: atom-ID, type-ID, x, y, z. If the atom style is -hybrid dipole molecular, then an atom line should have 10 quantites: -atom-ID, molecule-ID, type-ID, q, x, y, z, mux, muy, muz. -

                                    The units for these quantities depend on the unit style; see the units command for details.

                                    -

                                    For 2d simulations specify z as 0.0, or whatever value is within the -zlo zhi setting in the data file header. +

                                    For 2d simulations specify z as 0.0, or a value is within the zlo +zhi setting in the data file header.

                                    The atom-ID is used to identify the atom throughout the simulation and in dump files. Normally, it is a unique value from 1 to Natoms for @@ -266,25 +258,21 @@ be set to 0.

                                    The molecule ID is a 2nd identifier attached to an atom. Normally, it is a number from 1 to N, identifying which molecule the atom belongs -to. It can be 0 if it is an unbonded atom or if you don't care about -molecule assignments. +to. It can be 0 if it is an unbonded atom or if you don't care to +keep track of molecule assignments.

                                    -

                                    An Atoms section must appear in the data file if natoms > 0 in the -header section. The atoms can be listed in any order. -

                                    -

                                    Atom lines (all or none of them) can optionally list 3 final integer -values: nx,ny,nz. For periodic dimensions, they specify which image -of the box the atom is considered to be in. An image of 0 means the -box as defined. A value of 2 means add 2 box lengths to get the true -value. A value of -1 means subtract 1 box length to get the true +

                                    Atom lines (all lines or none of them) can optionally list 3 final +integer values: nx,ny,nz. For periodic dimensions, they specify which +image of the box the atom is considered to be in. An image of 0 means +the box as defined. A value of 2 means add 2 box lengths to get the +true value. A value of -1 means subtract 1 box length to get the true value. LAMMPS updates these flags as atoms cross periodic boundaries -during the simulation. The flags can be output via the -dump and dump_modify commands. If -nx,ny,nz values are not set in the data file, LAMMPS initializes them -to 0. +during the simulation. The flags can be output with atom snapshots +via the dump command. If nx,ny,nz values are not set in +the data file, LAMMPS initializes them to 0.

                                    Atom velocities are set to 0.0 when the Atoms section is read. They -may later be set by a Velocities section or by a +may later be set by a Velocities section in the data file or by a velocity command in the input script.


                                    diff --git a/doc/read_data.txt b/doc/read_data.txt index e76f886c46..c154e69b8f 100644 --- a/doc/read_data.txt +++ b/doc/read_data.txt @@ -191,47 +191,37 @@ line syntax: ID coeffs :l {Atoms} section: -one line per atom +one line per atom line syntax: depends on atom style :ul -This is the list of all possible quantities that can appear on each -line of this section: +An {Atoms} section must appear in the data file if natoms > 0 in the +header section. The atoms can be listed in any order. These are the +line formats for each "atom style"_atom_style.html in LAMMPS: + +angle: atom-ID molecule-ID atom-type x y z +atomic: atom-ID atom-type x y z +bond: atom-ID molecule-ID atom-type x y z +charge: atom-ID atom-type q x y z +dpd: atom-ID atom-type x y z +full: atom-ID molecule-ID atom-type q x y z +granular: atom-ID atom-type diameter density x y z +molecular: atom-ID molecule-ID atom-type x y z :tb(s=:) + +where the keywords have these meanings: atom-ID = integer ID of atom molecule-ID = integer ID of molecule the atom belongs to -type-ID = integer type ID of atom (1-Ntype) +type-ID = type of atom (1-Ntype) q = charge on atom diameter = diameter of atom density = density of atom -x,y,z = coordinates of atom -mux,muy,muz = components of dipole orientation of atom -nx,ny,nz = image indices for atom :ul - -Which of these quantities are actually listed depends on the "atom -style"_atom_style.html. This is the list of which styles require each -quantity: - -atom-ID = all styles -molecule-ID = angle, bond, molecular, full styles -type-ID = all styles -q = charge, dipole, full styles -diameter = granular style -density = granular style -x,y,z = all styles -mux,muy,muz = dipole style -nx,ny,nz = optional for all styles (see below) :ul - -Any quantity that is used by the atom style appears in the order -listed above. Thus if the atom style is {atomic}, an atom line should -have 5 quantities: atom-ID, type-ID, x, y, z. If the atom style is -{hybrid dipole molecular}, then an atom line should have 10 quantites: -atom-ID, molecule-ID, type-ID, q, x, y, z, mux, muy, muz. +x,y,z = coordinates of atom :ul The units for these quantities depend on the unit style; see the "units"_units.html command for details. -For 2d simulations specify z as 0.0, or whatever value is within the -{zlo zhi} setting in the data file header. +For 2d simulations specify z as 0.0, or a value is within the {zlo +zhi} setting in the data file header. The atom-ID is used to identify the atom throughout the simulation and in dump files. Normally, it is a unique value from 1 to Natoms for @@ -245,25 +235,21 @@ be set to 0. The molecule ID is a 2nd identifier attached to an atom. Normally, it is a number from 1 to N, identifying which molecule the atom belongs -to. It can be 0 if it is an unbonded atom or if you don't care about -molecule assignments. +to. It can be 0 if it is an unbonded atom or if you don't care to +keep track of molecule assignments. -An {Atoms} section must appear in the data file if natoms > 0 in the -header section. The atoms can be listed in any order. - -Atom lines (all or none of them) can optionally list 3 final integer -values: nx,ny,nz. For periodic dimensions, they specify which image -of the box the atom is considered to be in. An image of 0 means the -box as defined. A value of 2 means add 2 box lengths to get the true -value. A value of -1 means subtract 1 box length to get the true +Atom lines (all lines or none of them) can optionally list 3 final +integer values: nx,ny,nz. For periodic dimensions, they specify which +image of the box the atom is considered to be in. An image of 0 means +the box as defined. A value of 2 means add 2 box lengths to get the +true value. A value of -1 means subtract 1 box length to get the true value. LAMMPS updates these flags as atoms cross periodic boundaries -during the simulation. The flags can be output via the -"dump"_dump.html and "dump_modify"_dump_modify.html commands. If -nx,ny,nz values are not set in the data file, LAMMPS initializes them -to 0. +during the simulation. The flags can be output with atom snapshots +via the "dump"_dump.html command. If nx,ny,nz values are not set in +the data file, LAMMPS initializes them to 0. Atom velocities are set to 0.0 when the {Atoms} section is read. They -may later be set by a {Velocities} section or by a +may later be set by a {Velocities} section in the data file or by a "velocity"_velocity.html command in the input script. :line diff --git a/doc/temper.html b/doc/temper.html index c8287609f1..78268c48f7 100644 --- a/doc/temper.html +++ b/doc/temper.html @@ -33,7 +33,7 @@ temper 40000 100 $t tempfix 0 32285 $w

                                    Run a parallel tempering (replica exchange) simulation of multiple ensembles of a system on multiple partitions of processors. The processor partitions are defined using the -partition command-line -switch (see this section). Each ensemble's +switch (see this section). Each ensemble's temperature is typically controlled at a different value by a fix with ID fix-ID that controls temperature. Possible fix styles are nvt, npt, and diff --git a/doc/temper.txt b/doc/temper.txt index 8c0032c416..05efeb9517 100644 --- a/doc/temper.txt +++ b/doc/temper.txt @@ -30,7 +30,7 @@ temper 40000 100 $t tempfix 0 32285 $w :pre Run a parallel tempering (replica exchange) simulation of multiple ensembles of a system on multiple partitions of processors. The processor partitions are defined using the -partition command-line -switch (see "this section"_Section_start.html#2_4). Each ensemble's +switch (see "this section"_Section_start.html#2_6). Each ensemble's temperature is typically controlled at a different value by a fix with ID {fix-ID} that controls temperature. Possible fix styles are "nvt"_fix_nvt.html, "npt"_fix_npt.html, and diff --git a/doc/thermo.html b/doc/thermo.html index 06a1cf1f2e..3884116f01 100644 --- a/doc/thermo.html +++ b/doc/thermo.html @@ -23,10 +23,14 @@

                        Description:

                        -

                        Compute and print thermodynamics (temperature, energy, pressure) on -timesteps that are a multiple of N and at the beginning and end of a -simulation. A value of 0 will only print thermodynamics at the -beginning and end. +

                        Compute and print thermodynamic info (e.g. temperature, energy, +pressure) on timesteps that are a multiple of N and at the beginning +and end of a simulation. A value of 0 will only print thermodynamics +at the beginning and end. +

                        +

                        The content and format of what is printed is controlled by the +thermo_style and +thermo_modify commands.

                        Restrictions: none

                        diff --git a/doc/thermo.txt b/doc/thermo.txt index 0397682541..4fa05eb862 100644 --- a/doc/thermo.txt +++ b/doc/thermo.txt @@ -20,10 +20,14 @@ thermo 100 :pre [Description:] -Compute and print thermodynamics (temperature, energy, pressure) on -timesteps that are a multiple of N and at the beginning and end of a -simulation. A value of 0 will only print thermodynamics at the -beginning and end. +Compute and print thermodynamic info (e.g. temperature, energy, +pressure) on timesteps that are a multiple of N and at the beginning +and end of a simulation. A value of 0 will only print thermodynamics +at the beginning and end. + +The content and format of what is printed is controlled by the +"thermo_style"_thermo_style.html and +"thermo_modify"_thermo_modify.html commands. [Restrictions:] none diff --git a/doc/thermo_modify.html b/doc/thermo_modify.html index aa270fa35a..42403f59d8 100644 --- a/doc/thermo_modify.html +++ b/doc/thermo_modify.html @@ -19,8 +19,7 @@
                      • keyword = temp or lost or norm or flush or line or format -
                          temp value = ID of temperature
                        -  lost value = error or warn or ignore
                        +
                          lost value = error or warn or ignore
                           norm value = yes or no
                           flush value = yes or no
                           line value = one or multi
                        @@ -30,57 +29,95 @@
                           window value = N
                             N = number of previous print-outs to average over 
                         
                        + temp value = compute ID that calculates a temperature + press value = compute ID that calculates a pressure + drot value = compute ID that calculates rotational energy for dipolar atoms + grot value = compute ID that calculates rotational energy for granular atoms

                      Examples:

                      -
                      thermo_modify temp mydef
                      -thermo_modify lost no flush yes
                      +
                      thermo_modify lost no flush yes
                      +thermo_modify temp myTemp
                       thermo_modify line multi format float %g format 3 %15.8g 
                       

                      Description:

                      -

                      Set options for how thermodynamics are computed and printed by LAMMPS. +

                      Set options for how thermodynamic information is computed and printed +by LAMMPS.

                      -

                      The temp option allows you to specify how temperature is computed -when used to output thermodynamic info (temperature, kinetic energy, -pressure). Different methods of computing temperature can be defined -via the temperature command. -

                      -

                      The lost option determines whether LAMMPS checks for lost atoms each -time it computes thermodynamics and what it does if atoms are lost. -If the value is ignore, LAMMPS does not check for lost atoms. If -the value is error or warn, LAMMPS checks and either issues an +

                      The lost keyword determines whether LAMMPS checks for lost atoms +each time it computes thermodynamics and what it does if atoms are +lost. If the value is ignore, LAMMPS does not check for lost atoms. +If the value is error or warn, LAMMPS checks and either issues an error or warning. The code will exit with an error and continue with a warning. This can be a useful debugging option.

                      -

                      The norm option determines whether the thermodynamic print-out is +

                      The norm keyword determines whether the thermodynamic print-out is normalized by the number of atoms or is the total summed across all atoms. Different unit styles have different defaults for this setting.

                      -

                      The flush option invokes a flush operation after thermodynamic info +

                      The flush keyword invokes a flush operation after thermodynamic info is written to the log file. This insures the output in that file is current (no buffering by the OS), even if LAMMPS halts before the simulation completes.

                      -

                      The line option determines whether thermodynamics will be printed as -a series of numeric values on one line or in a multi-line format with -3 quantities with text strings per line and a dashed-line header +

                      The line keyword determines whether thermodynamics will be printed +as a series of numeric values on one line or in a multi-line format +with 3 quantities with text strings per line and a dashed-line header containing the timestep and CPU time. This modify option overrides the one and multi thermo_style settings.

                      -

                      The format option sets the numeric format of individual printed +

                      The format keyword sets the numeric format of individual printed quantities. The int and float settings set the format for all integer or floating-point quantities printed. The setting with a numeric value (e.g. format 5 %10.4g) sets the format of the Nth value printed. If the format for a specific value has been set, it will take precedent over the int or float setting.

                      -

                      The window option sets the number of previous thermodynamic screen +

                      The window keyword sets the number of previous thermodynamic screen outputs over which thermo_style custom ave quantities are averaged when printed.

                      +

                      The temp keyword is used to determine how thermodynamic temperature +is calculated, which is used by all thermo quantities that require a +temperature ("temp", "press", "ke", "etotal", "enthalpy", "pxx etc", +"tave", "pave"). The specified compute ID must have been previously +defined by the user via the compute command and it must +be a style of compute that calculates a temperature. As described in +the thermo_style command, thermo output has a +default compute for temperature with ID = thermo_temp. This option +allows the user to override the default. +

                      +

                      The press keyword is used to determine how thermodynamic pressure is +calculated, which is used by all thermo quantities that require a +pressure ("press", "enthalpy", "pxx etc", "pave"). The specified +compute ID must have been previously defined by the user via the +compute command and it must be a style of compute that +calculates a pressure. As described in the +thermo_style command, thermo output has a default +compute for pressure with ID = thermo_press. This option allows the +user to override the default. +

                      +

                      The drot keyword is used to determine how rotational energy is +calculated for dipolar atoms, which is used by the thermo_style +keyword drot. The specified compute ID must have been previously +defined by the user via the compute command. As +described in the thermo_style command, thermo +output has a default compute for this calculation with ID = +thermo_rotate_dipole. This option allows the user to override the +default. +

                      +

                      The grot keyword is used to determine how rotational energy is +calculated for granular atoms, which is used by the thermo_style +keyword grot. The specified compute ID must have been previously +defined by the user via the compute command. As +described in the thermo_style command, thermo +output has a default compute for this calculation with ID = +thermo_rotate_gran. This option allows the user to override the +default. +

                      Restrictions: none

                      Related commands: @@ -90,12 +127,14 @@ quantities are averaged when printed.

                      Default:

                      -

                      The option defaults are temp = default, lost = error, norm = yes for -unit style of lj, norm = no for unit style of real and metal, -flush = no, window = 10. The defaults for the line and format options -depend on the thermo style. For styles "one", "granular", and -"custom" the line and format defaults are "one", "%8d", and "%12.8g". -For style "multi", the line and format defaults are "multi", "%8d", -and "%14.4f". +

                      The option defaults are lost = error, norm = yes for unit style of +lj, norm = no for unit style of real and metal, flush = no, +window = 10, temp/press/drot/grot = compute IDs defined by +thermo_style. +

                      +

                      The defaults for the line and format options depend on the thermo +style. For styles "one", "granular", and "custom" the line and format +defaults are "one", "%8d", and "%12.8g". For style "multi", the line +and format defaults are "multi", "%8d", and "%14.4f".

                      diff --git a/doc/thermo_modify.txt b/doc/thermo_modify.txt index a1b9e12a52..b2fefdd811 100644 --- a/doc/thermo_modify.txt +++ b/doc/thermo_modify.txt @@ -14,7 +14,6 @@ thermo_modify keyword value ... :pre one or more keyword/value pairs may be listed :ulb,l keyword = {temp} or {lost} or {norm} or {flush} or {line} or {format} :l - {temp} value = ID of temperature {lost} value = {error} or {warn} or {ignore} {norm} value = {yes} or {no} {flush} value = {yes} or {no} @@ -24,57 +23,95 @@ keyword = {temp} or {lost} or {norm} or {flush} or {line} or {format} :l string = C-style format string {window} value = N N = number of previous print-outs to average over :pre + {temp} value = compute ID that calculates a temperature + {press} value = compute ID that calculates a pressure + {drot} value = compute ID that calculates rotational energy for dipolar atoms + {grot} value = compute ID that calculates rotational energy for granular atoms :ule [Examples:] -thermo_modify temp mydef thermo_modify lost no flush yes +thermo_modify temp myTemp thermo_modify line multi format float %g format 3 %15.8g :pre [Description:] -Set options for how thermodynamics are computed and printed by LAMMPS. +Set options for how thermodynamic information is computed and printed +by LAMMPS. -The {temp} option allows you to specify how temperature is computed -when used to output thermodynamic info (temperature, kinetic energy, -pressure). Different methods of computing temperature can be defined -via the "temperature"_temperature.html command. - -The {lost} option determines whether LAMMPS checks for lost atoms each -time it computes thermodynamics and what it does if atoms are lost. -If the value is {ignore}, LAMMPS does not check for lost atoms. If -the value is {error} or {warn}, LAMMPS checks and either issues an +The {lost} keyword determines whether LAMMPS checks for lost atoms +each time it computes thermodynamics and what it does if atoms are +lost. If the value is {ignore}, LAMMPS does not check for lost atoms. +If the value is {error} or {warn}, LAMMPS checks and either issues an error or warning. The code will exit with an error and continue with a warning. This can be a useful debugging option. -The {norm} option determines whether the thermodynamic print-out is +The {norm} keyword determines whether the thermodynamic print-out is normalized by the number of atoms or is the total summed across all atoms. Different unit styles have different defaults for this setting. -The {flush} option invokes a flush operation after thermodynamic info +The {flush} keyword invokes a flush operation after thermodynamic info is written to the log file. This insures the output in that file is current (no buffering by the OS), even if LAMMPS halts before the simulation completes. -The {line} option determines whether thermodynamics will be printed as -a series of numeric values on one line or in a multi-line format with -3 quantities with text strings per line and a dashed-line header +The {line} keyword determines whether thermodynamics will be printed +as a series of numeric values on one line or in a multi-line format +with 3 quantities with text strings per line and a dashed-line header containing the timestep and CPU time. This modify option overrides the {one} and {multi} thermo_style settings. -The {format} option sets the numeric format of individual printed +The {format} keyword sets the numeric format of individual printed quantities. The {int} and {float} settings set the format for all integer or floating-point quantities printed. The setting with a numeric value (e.g. format 5 %10.4g) sets the format of the Nth value printed. If the format for a specific value has been set, it will take precedent over the {int} or {float} setting. -The {window} option sets the number of previous thermodynamic screen +The {window} keyword sets the number of previous thermodynamic screen outputs over which "thermo_style custom"_thermo_style.html {ave} quantities are averaged when printed. +The {temp} keyword is used to determine how thermodynamic temperature +is calculated, which is used by all thermo quantities that require a +temperature ("temp", "press", "ke", "etotal", "enthalpy", "pxx etc", +"tave", "pave"). The specified compute ID must have been previously +defined by the user via the "compute"_compute.html command and it must +be a style of compute that calculates a temperature. As described in +the "thermo_style"_thermo_style.html command, thermo output has a +default compute for temperature with ID = {thermo_temp}. This option +allows the user to override the default. + +The {press} keyword is used to determine how thermodynamic pressure is +calculated, which is used by all thermo quantities that require a +pressure ("press", "enthalpy", "pxx etc", "pave"). The specified +compute ID must have been previously defined by the user via the +"compute"_compute.html command and it must be a style of compute that +calculates a pressure. As described in the +"thermo_style"_thermo_style.html command, thermo output has a default +compute for pressure with ID = {thermo_press}. This option allows the +user to override the default. + +The {drot} keyword is used to determine how rotational energy is +calculated for dipolar atoms, which is used by the thermo_style +keyword {drot}. The specified compute ID must have been previously +defined by the user via the "compute"_compute.html command. As +described in the "thermo_style"_thermo_style.html command, thermo +output has a default compute for this calculation with ID = +{thermo_rotate_dipole}. This option allows the user to override the +default. + +The {grot} keyword is used to determine how rotational energy is +calculated for granular atoms, which is used by the thermo_style +keyword {grot}. The specified compute ID must have been previously +defined by the user via the "compute"_compute.html command. As +described in the "thermo_style"_thermo_style.html command, thermo +output has a default compute for this calculation with ID = +{thermo_rotate_gran}. This option allows the user to override the +default. + [Restrictions:] none [Related commands:] @@ -84,10 +121,12 @@ quantities are averaged when printed. [Default:] -The option defaults are temp = default, lost = error, norm = yes for -unit style of {lj}, norm = no for unit style of {real} and {metal}, -flush = no, window = 10. The defaults for the line and format options -depend on the thermo style. For styles "one", "granular", and -"custom" the line and format defaults are "one", "%8d", and "%12.8g". -For style "multi", the line and format defaults are "multi", "%8d", -and "%14.4f". +The option defaults are lost = error, norm = yes for unit style of +{lj}, norm = no for unit style of {real} and {metal}, flush = no, +window = 10, temp/press/drot/grot = compute IDs defined by +thermo_style. + +The defaults for the line and format options depend on the thermo +style. For styles "one", "granular", and "custom" the line and format +defaults are "one", "%8d", and "%12.8g". For style "multi", the line +and format defaults are "multi", "%8d", and "%14.4f". diff --git a/doc/thermo_style.html b/doc/thermo_style.html index cfd70dbe8d..4ca783d4e0 100644 --- a/doc/thermo_style.html +++ b/doc/thermo_style.html @@ -27,8 +27,11 @@ pe, ke, etotal, enthalpy, evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail, - vol, lx, ly, lz, pxx, pyy, pzz, pxy, pxz, pyz - gke, grot, tave, pave, eave, peave, t_ID + vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, + pxx, pyy, pzz, pxy, pxz, pyz + drot, grot, + tave, pave, eave, peave, + c_ID, c_ID[n], f_ID, f_ID[n], v_name step = timestep atoms = # of atoms cpu = elapsed CPU time @@ -50,11 +53,16 @@ etail = VanderWaal energy long-range tail correction vol = volume lx,ly,lz = box lengths in x,y,z + xlo,xhi,ylo,yhi,zlo,zhi = box boundaries pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor - gke = granular translational kinetic energy (without frozen atoms) - grot = granular rotational kinetic energy (without frozen atoms) + drot = rotational energy of dipolar atoms + grot = rotational energy of granular atoms tave, pave, eave, peave = time-averaged temp, press, etotal, pe - t_ID = termperature as computed by temperature ID + c_ID = scalar quantity calculated by a compute identified by its ID + c_ID[N] = Nth vector quantity calculated by a compute identified by its ID + f_ID = scalar quantity calculated by a fix identified by its ID + f_ID[N] = Nth vector quantity calculated by a fix identified by its ID + v_name = current value of a variable identified by the variable name
                    @@ -62,12 +70,12 @@

                    thermo_style multi
                     thermo_style custom step temp pe etotal press vol
                    -thermo_style custom step temp t_left t_right etotal 
                    +thermo_style custom step temp etotal c_myTemp v_abc 
                     

                    Description:

                    -

                    Set the style in which thermodynamic data is printed to the screen and -log file. +

                    Set the style and content for printing thermodynamic data to the +screen and log file.

                    Style one prints a one-line summary of thermodynamic info that is the equivalent of "thermo_style custom step temp epair emol etotal @@ -80,23 +88,97 @@ numeric values and a string ID for each quantity.

                    Style granular is used with atom style granular and prints a one-line numeric summary that is the equivalent of -"thermo_style custom step atoms gke grot". +"thermo_style custom step atoms ke grot".

                    Style custom is the most general setting and allows you to specify -which of the quantities listed above you want printed on each -thermodynamic timestep. +which of the keywords listed above you want printed on each +thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are +references to computes, fixes, and +variables that have been defined elsewhere in the +input script or can even be new styles which users have added to +LAMMPS (see the Section_modify section of the +documentation). Thus the custom style provides a flexible means of +outputting essentially any desired quantity as a simulation proceeds.

                    -

                    Also, all styles except custom have vol added to their list of -outputs as a final printed quantity when the simulation box volume -changes during the simulation. +

                    All styles except custom have vol appended to their list of +outputs if the simulation box volume changes during the simulation.

                    -

                    All thermodynamic quantities which require a temperature (temp, press, -ke, etotal, tave, eave) use the temperature with ID = default that is -defined by LAMMPS (see the temperature command) -that performs an average over all atoms. This can be changed via the -thermo_modify command. The exception is the -t_ID quantity which directly specifies which temperature to compute -and print out. +

                    Options invoked by the thermo_modify command can +be used to set the one- or multi-line format of the print-out, the +normalization of energy quantities (total or per-atom), and the +numeric precision of each printed value. +

                    +
                    + +

                    Several of the thermodynamic quantities require a temperature to be +computed: "temp", "press", "ke", "etotal", "enthalpy", "pxx etc", +"tave", "pave". To do this, a compute of style "temp" is created, as +if this command had been issued: +

                    +
                    compute thermo_temp all temp 
                    +
                    +

                    See the compute temp command for details. Note +that the ID of the new compute is thermo_temp and the group is +all. You can change the attributes of this temperature (e.g. its +degrees-of-freedom) via the compute_modify +command. Alternatively, you can directly assign a new compute (that +calculates temperature) which you have defined, to be used for any +thermodynamic quantity that requires a temperature. This is done via +the thermo_modify command. +

                    +

                    Several of the thermodynamic quantities require a pressure to be +computed: "press", "enthalpy", "pxx etc", "pave". To do this, a +compute of style "pressure" is created, as if this command had been +issued: +

                    +
                    compute thermo_press all pressure thermo_temp 
                    +
                    +

                    See the compute pressure command for details. +Note that the ID of the new compute is thermo_press and the group is +all. You can change the attributes of this pressure via the +compute_modify command. Alternatively, you can +directly assign a new compute (that calculates pressure) which you +have defined, to be used for any thermodynamic quantity that requires +a pressure. This is done via the thermo_modify +command. +

                    +

                    The drot keyword requires a rotational energy to be compute for +dipolar particles. To do this, a compute of style "rotate/dipole" is +created, as if this command had been issued: +

                    +
                    compute thermo_rotate_dipole all rotate/dipole 
                    +
                    +

                    See the compute rotate/dipole command for +details. Note that the ID of the new compute is +thermo_rotate_dipole and the group is all. You can change the +attributes of this computation via the +compute_modify command. Alternatively, you can +directly assign a new compute which you have defined, to be used for +drot. This is done via the thermo_modify +command. For example, this could be useful if you wish to exclude +certain particles from the compuation. +

                    +

                    The grot keyword requires a rotational energy to be compute for +granular particles. To do this, a compute of style "rotate/gran" is +created, as if this command had been issued: +

                    +
                    compute thermo_rotate_gran all rotate/gran 
                    +
                    +

                    See the compute rotate/gran command for +details. Note that the ID of the new compute is thermo_rotate_gran +and the group is all. You can change the attributes of this +computation via the compute_modify command. +Alternatively, you can directly assign a new compute which you have +defined, to be used for grot. This is done via the +thermo_modify command. For example, this could +be useful if you wish to exclude frozen particles from the compuation. +

                    +
                    + +

                    The potential energy of the system pe will include contributions +from fixes if the fix_modify thermo option was set +for each fix. For example, the fix wall/lj93 fix will +contribute the energy of atoms interacting with the wall.

                    A long-range tail correction etail for the VanderWaal pairwise energy will be non-zero only if the pair_modify @@ -105,39 +187,53 @@ is included in evdwl, pe, and etotal, and the corresponding correction to the pressure is included in press and pxx, pyy, etc.

                    -

                    The time-averaged quantities tave, pave, eave, peave are averaged -over the last N thermodynamic outputs to the screen (not the last N +

                    The time-averaged keywords tave, pave, eave, peave are averaged over +the last N thermodynamic outputs to the screen (not the last N timesteps), where N is the value set by the window option of the thermo_modify command (N = 10 by default).

                    -

                    The t_ID quantity allows for user-defined temperatures to be printed -with thermodynamic output. For example, if either of the commands +


                    + +

                    The c_ID and c_ID[N] keywords allow scalar or vector quantities +calculated by a compute to be output. The ID in the keyword should be +replaced by the actual ID of the compute that has been defined +elsewhere in the input script. See the compute command +for details. Note that per-atom quantities calcalated by a compute +cannot be output as part of thermodynamics. Rather, these quantities +are output by the dump custom command.

                    -
                    temperature mine all region sphere
                    -fix mine all temp/rescale 100 1.0 1.0 0.1 1.0 region sphere 
                    -
                    -

                    were used to compute or thermostat the temperature of atoms inside a -spherical geometric region, then the keyword t_mine will print that -temperature as part of thermodynamic output. +

                    If c_ID is used as a keyword, then the scalar quantity calculated by +the compute is printed. If c_ID[N] is used, then N in the range +from 1-M will print a specific component of the vector calculated by +the compute. A value of N=0 will output the scalar quantity.

                    -

                    Some fixes also generate quantities that can be appended to these -lists each time thermodyanmic info prints out, if enabled by the -fix_modify command. See invidividual fix commands -for more details, e.g. the fix nvt and fix -npt commands. +

                    The f_ID and f_ID[N] keywords allow scalar or vector quantities +calculated by a fix to be output. The ID in the keyword should be +replaced by the actual ID of the fix that has been defined elsewhere +in the input script. See the fix command for details.

                    -

                    Options invoked by the thermo_modify command can -be used to set the one- or multi-line format of the print-out, the -normalization of energy quantities (total or per-atom), and the -numeric precision of each printed value. +

                    If f_ID is used as a keyword, then the scalar quantity calculated by +the fix is printed. If f_ID[N] is used, then N in the range from +1-M will print a specific component of the vector calculated by the +fix. A value of N=0 will output the scalar quantity.

                    +

                    The v_name keyword allow the current value of a variable to be +output. The name in the keyword should be replaced by the actual namd +of the variable that has been defined elsewhere in the input script. +See the variable command for details. Equal-style +variables can calculate complex formulas involving atom and group +properties, mathematical operations, other variables, etc. This +keyword enables them to be evaluated and their value printed +periodically during a simulation. +

                    +

                    See this section for information on how to add +new compute and fix styles as well as variable options to LAMMPS that +calculate quantities that could then be output with these keywords. +

                    +
                    +

                    Restrictions:

                    -

                    Atom style granular cannot compute the usual -temperature and pressure settings because it stores atom masses -differently. The gke and grot settings should be used instead (or use -thermo style granular). -

                    This command must come after the simulation box is defined by a read_data, read_restart, or create_box command. diff --git a/doc/thermo_style.txt b/doc/thermo_style.txt index 2d8789aeee..5c39f4d8cf 100644 --- a/doc/thermo_style.txt +++ b/doc/thermo_style.txt @@ -22,8 +22,11 @@ args = list of arguments for a particular style :l pe, ke, etotal, enthalpy, evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail, - vol, lx, ly, lz, pxx, pyy, pzz, pxy, pxz, pyz - gke, grot, tave, pave, eave, peave, t_ID + vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, + pxx, pyy, pzz, pxy, pxz, pyz + drot, grot, + tave, pave, eave, peave, + c_ID, c_ID\[n\], f_ID, f_ID\[n\], v_name step = timestep atoms = # of atoms cpu = elapsed CPU time @@ -45,23 +48,28 @@ args = list of arguments for a particular style :l etail = VanderWaal energy long-range tail correction vol = volume lx,ly,lz = box lengths in x,y,z + xlo,xhi,ylo,yhi,zlo,zhi = box boundaries pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor - gke = granular translational kinetic energy (without frozen atoms) - grot = granular rotational kinetic energy (without frozen atoms) + drot = rotational energy of dipolar atoms + grot = rotational energy of granular atoms tave, pave, eave, peave = time-averaged temp, press, etotal, pe - t_ID = termperature as computed by temperature ID :pre + c_ID = scalar quantity calculated by a compute identified by its ID + c_ID\[N\] = Nth vector quantity calculated by a compute identified by its ID + f_ID = scalar quantity calculated by a fix identified by its ID + f_ID\[N\] = Nth vector quantity calculated by a fix identified by its ID + v_name = current value of a variable identified by the variable name :pre :ule [Examples:] thermo_style multi thermo_style custom step temp pe etotal press vol -thermo_style custom step temp t_left t_right etotal :pre +thermo_style custom step temp etotal c_myTemp v_abc :pre [Description:] -Set the style in which thermodynamic data is printed to the screen and -log file. +Set the style and content for printing thermodynamic data to the +screen and log file. Style {one} prints a one-line summary of thermodynamic info that is the equivalent of "thermo_style custom step temp epair emol etotal @@ -74,23 +82,97 @@ numeric values and a string ID for each quantity. Style {granular} is used with "atom style"_atom_style.html granular and prints a one-line numeric summary that is the equivalent of -"thermo_style custom step atoms gke grot". +"thermo_style custom step atoms ke grot". Style {custom} is the most general setting and allows you to specify -which of the quantities listed above you want printed on each -thermodynamic timestep. +which of the keywords listed above you want printed on each +thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are +references to "computes"_compute.html, "fixes"_fix.html, and +"variables"_variable.html" that have been defined elsewhere in the +input script or can even be new styles which users have added to +LAMMPS (see the "Section_modify"_Section_modify.html section of the +documentation). Thus the {custom} style provides a flexible means of +outputting essentially any desired quantity as a simulation proceeds. -Also, all styles except {custom} have {vol} added to their list of -outputs as a final printed quantity when the simulation box volume -changes during the simulation. +All styles except {custom} have {vol} appended to their list of +outputs if the simulation box volume changes during the simulation. -All thermodynamic quantities which require a temperature ({temp, press, -ke, etotal, tave, eave}) use the temperature with ID = {default} that is -defined by LAMMPS (see the "temperature"_temperature.html command) -that performs an average over all atoms. This can be changed via the -"thermo_modify"_thermo_modify.html command. The exception is the -{t_ID} quantity which directly specifies which temperature to compute -and print out. +Options invoked by the "thermo_modify"_thermo_modify.html command can +be used to set the one- or multi-line format of the print-out, the +normalization of energy quantities (total or per-atom), and the +numeric precision of each printed value. + +:line + +Several of the thermodynamic quantities require a temperature to be +computed: "temp", "press", "ke", "etotal", "enthalpy", "pxx etc", +"tave", "pave". To do this, a compute of style "temp" is created, as +if this command had been issued: + +compute thermo_temp all temp :pre + +See the "compute temp"_compute_temp.html command for details. Note +that the ID of the new compute is {thermo_temp} and the group is +{all}. You can change the attributes of this temperature (e.g. its +degrees-of-freedom) via the "compute_modify"_compute_modify.html +command. Alternatively, you can directly assign a new compute (that +calculates temperature) which you have defined, to be used for any +thermodynamic quantity that requires a temperature. This is done via +the "thermo_modify"_thermo_modify.html command. + +Several of the thermodynamic quantities require a pressure to be +computed: "press", "enthalpy", "pxx etc", "pave". To do this, a +compute of style "pressure" is created, as if this command had been +issued: + +compute thermo_press all pressure thermo_temp :pre + +See the "compute pressure"_compute_pressure.html command for details. +Note that the ID of the new compute is {thermo_press} and the group is +{all}. You can change the attributes of this pressure via the +"compute_modify"_compute_modify.html command. Alternatively, you can +directly assign a new compute (that calculates pressure) which you +have defined, to be used for any thermodynamic quantity that requires +a pressure. This is done via the "thermo_modify"_thermo_modify.html +command. + +The {drot} keyword requires a rotational energy to be compute for +dipolar particles. To do this, a compute of style "rotate/dipole" is +created, as if this command had been issued: + +compute thermo_rotate_dipole all rotate/dipole :pre + +See the "compute rotate/dipole"_compute_rotate_dipole.html command for +details. Note that the ID of the new compute is +{thermo_rotate_dipole} and the group is {all}. You can change the +attributes of this computation via the +"compute_modify"_compute_modify.html command. Alternatively, you can +directly assign a new compute which you have defined, to be used for +{drot}. This is done via the "thermo_modify"_thermo_modify.html +command. For example, this could be useful if you wish to exclude +certain particles from the compuation. + +The {grot} keyword requires a rotational energy to be compute for +granular particles. To do this, a compute of style "rotate/gran" is +created, as if this command had been issued: + +compute thermo_rotate_gran all rotate/gran :pre + +See the "compute rotate/gran"_compute_rotate_gran.html command for +details. Note that the ID of the new compute is {thermo_rotate_gran} +and the group is {all}. You can change the attributes of this +computation via the "compute_modify"_compute_modify.html command. +Alternatively, you can directly assign a new compute which you have +defined, to be used for {grot}. This is done via the +"thermo_modify"_thermo_modify.html command. For example, this could +be useful if you wish to exclude frozen particles from the compuation. + +:line + +The potential energy of the system {pe} will include contributions +from fixes if the "fix_modify thermo"_fix_modify.html option was set +for each fix. For example, the "fix wall/lj93"_fix_wall_lj93 fix will +contribute the energy of atoms interacting with the wall. A long-range tail correction {etail} for the VanderWaal pairwise energy will be non-zero only if the "pair_modify @@ -99,39 +181,53 @@ is included in {evdwl}, {pe}, and {etotal}, and the corresponding tail correction to the pressure is included in {press} and {pxx}, {pyy}, etc. -The time-averaged quantities {tave, pave, eave, peave} are averaged -over the last N thermodynamic outputs to the screen (not the last N +The time-averaged keywords {tave, pave, eave, peave} are averaged over +the last N thermodynamic outputs to the screen (not the last N timesteps), where N is the value set by the {window} option of the "thermo_modify"_thermo_modify.html command (N = 10 by default). -The {t_ID} quantity allows for user-defined temperatures to be printed -with thermodynamic output. For example, if either of the commands +:line -temperature mine all region sphere -fix mine all temp/rescale 100 1.0 1.0 0.1 1.0 region sphere :pre +The {c_ID} and {c_ID\[N\]} keywords allow scalar or vector quantities +calculated by a compute to be output. The ID in the keyword should be +replaced by the actual ID of the compute that has been defined +elsewhere in the input script. See the "compute"_compute.html command +for details. Note that per-atom quantities calcalated by a compute +cannot be output as part of thermodynamics. Rather, these quantities +are output by the "dump custom"_dump.html command. -were used to compute or thermostat the temperature of atoms inside a -spherical geometric region, then the keyword {t_mine} will print that -temperature as part of thermodynamic output. +If {c_ID} is used as a keyword, then the scalar quantity calculated by +the compute is printed. If {c_ID\[N\]} is used, then N in the range +from 1-M will print a specific component of the vector calculated by +the compute. A value of N=0 will output the scalar quantity. -Some fixes also generate quantities that can be appended to these -lists each time thermodyanmic info prints out, if enabled by the -"fix_modify"_fix_modify.html command. See invidividual fix commands -for more details, e.g. the "fix nvt"_fix_nvt.html and "fix -npt"_fix_npt.html commands. +The {f_ID} and {f_ID\[N\]} keywords allow scalar or vector quantities +calculated by a fix to be output. The ID in the keyword should be +replaced by the actual ID of the fix that has been defined elsewhere +in the input script. See the "fix"_fix.html command for details. -Options invoked by the "thermo_modify"_thermo_modify.html command can -be used to set the one- or multi-line format of the print-out, the -normalization of energy quantities (total or per-atom), and the -numeric precision of each printed value. +If {f_ID} is used as a keyword, then the scalar quantity calculated by +the fix is printed. If {f_ID\[N\]} is used, then N in the range from +1-M will print a specific component of the vector calculated by the +fix. A value of N=0 will output the scalar quantity. + +The {v_name} keyword allow the current value of a variable to be +output. The name in the keyword should be replaced by the actual namd +of the variable that has been defined elsewhere in the input script. +See the "variable"_variable.html command for details. Equal-style +variables can calculate complex formulas involving atom and group +properties, mathematical operations, other variables, etc. This +keyword enables them to be evaluated and their value printed +periodically during a simulation. + +See "this section"_Section_modify.html for information on how to add +new compute and fix styles as well as variable options to LAMMPS that +calculate quantities that could then be output with these keywords. + +:line [Restrictions:] -"Atom style"_atom_style.html granular cannot compute the usual -temperature and pressure settings because it stores atom masses -differently. The gke and grot settings should be used instead (or use -thermo style granular). - This command must come after the simulation box is defined by a "read_data"_read_data.html, "read_restart"_read_restart.html, or "create_box"_create_box.html command. diff --git a/doc/variable.html b/doc/variable.html index 1121788d77..d7fc682d9a 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -17,21 +17,24 @@

                    • name = name of variable to define -
                    • style = index or loop or equal or world or universe +
                    • style = index or loop or world or universe or uloop or equal
                        index args = one or more strings
                         loop args = N = integer size of loop
                      -  equal args = one string containing functions, vectors, keywords, numbers
                      +  world args = one string for each partition of processors
                      +  universe args = one or more strings
                      +  uloop args = N = integer size of loop
                      +  equal args = one equation containing numbers, thermo keywords, math functions, group functions, atom vectors, compute references, other variables
                      +    numbers = 0.0, -5.4, 2.8e-4, etc
                      +    thermo keywords = vol, ke, press, etc from thermo_style
                           math functions = add(x,y), sub(x,y), mult(x,y), div(x,y),
                                            neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
                           group functions = mass(group), charge(group), xcm(group,dim),
                                             vcm(group,dim), bound(group,xmin), gyration(group)
                      -    vectors = x[5], y[12], z[17], vx[88], vy[19], vz[2],
                      -              fx[1], fy[2005], fz[1]
                      -    keywords = same keywords (mostly) as in thermo_style custom command
                      -  world args = one string for each partition of processors
                      -  universe args = one or more strings
                      -  uloop args = N = integer size of loop 
                      +    atom vectors = x[N], y[N], z[N], vx[N], vy[N], vz[N],
                      +                   fx[N], fy[N], fz[N]
                      +    compute references = c_ID[0], c_ID[N]
                      +    other variables = v_abc, v_x, etc 
                       
                    @@ -40,8 +43,9 @@
                    variable x index run1 run2 run3 run4 run5 run6 run7 run8
                     variable LoopVar loop 20
                     variable beta equal div(temp,3.0)
                    -variable b1 equal add(x[234],mult(0.5,lx))
                    -variable b equal xcm(mol1,x)
                    +variable b1 equal add(x[234],mult(0.5,col))
                    +variable b equal div(xcm(mol1,x),2.0)
                    +variable b equal c_myTemp[0]
                     variable temp world 300.0 310.0 320.0 330.0
                     variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
                     variable x uloop 15 
                    @@ -49,15 +53,24 @@ variable x uloop 15
                     

                    Description:

                    This command assigns one or more values to a variable name so that the -variable can be used in subsequent input script commands. The "name" -of the variable is an arbitrary string. Each "value" is a string -which could be text or numbers, as in the examples above. As -explained in this section, occurrences of -the variable name in an input script line are replaced by the +variable can be used in subsequent input script commands or its value +output during a simulation. The "name" of the variable is an +arbitrary string. Each "value" is a string which could be text or +numbers, as in the examples above. +

                    +

                    As explained in this section, occurrences +of the variable name in an input script line are replaced by the variable's value. The variable name can be referenced in the input script as $x if the name "x" is a single character, or as ${LoopVar} if the name "LoopVar" is one or more characters.

                    +

                    Variable values can also be accessed for output once or periodically +during a simulation by the print command, fix +print command, run every command, and the +thermo_style command. +

                    +
                    +

                    As described below, for variable styles index, loop, universe, and uloop, the value assigned to a variable can be incremented via the next command. When there are no more values to @@ -79,12 +92,14 @@ equal-style variable is encountered. Also, if a variable is iterated on to the end of its list via the next command, it is available to be re-defined in a subsequent variable command.

                    +
                    +

                    For the index style, one or more strings are specified. Initially, the 1st string is assigned to the variable. Each time a next command is used with the variable name, the next string is assigned. All processors assign the same string to the variable. Index-style variables can also be set (with a single -value) by using the command-line switch -var; see this +value) by using the command-line switch -var; see this section for details.

                    The loop style is identical to the index style except that the @@ -95,59 +110,8 @@ Each time a next command is used with the variable nam the next string ("2", "3", etc) is assigned. All processors assign the same string to the variable.

                    -

                    For the equal style, a single string is specified which represents -an equation that will be evaluated afresh each time the variable is -used. Thus the variable can take on different values at different -stages of the input script. For example, if the variable is used in a -fix print command, it could print different values -each timestep it was invoked. The next command cannot be used with -equal-style variables, since there is only one value. Note that, as -with any other input script command, it is feasible to use another -variable in the equal variable's string, e.g. variable y equal -mult($x,2). However, $x will be replaced immediately by it's current -value when the command is first parsed, not each time that $y is -substituted for. -

                    -

                    The syntax of the equation assigned to equal variables is simple. -It can contain "functions", "vectors", "keywords", or "numbers" in any -combination. -

                    -
                    • Function = a keyword followed by parenthesis with one or two arguments -
                    • Supported arithmetic functions = add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(x) -
                    • Supported group functions = mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), bound(ID,dir), gyration(ID) -
                    • Example function usage = div(1.0e20,3.0), neg(x[34]), pow(lx,3.0), xcm(mol,x), bound(lower,zmin) -
                    • Vector = a keyword followed by square brackets containing an atom ID -
                    • Supported vectors = x, y, z, vx, vy, vz, fx, fy, fz -
                    • Example vector usage = x[123], fz[1000] -
                    • Keyword = any keyword supported by the thermo_style custom command except cpu, pressure tensor components (pxx, pyy, etc), time-averaged quantities (tave, pave, etc) -
                    • Example keyword usage = atoms, pow(vol,0.333), mult(elong,0.5) -
                    • Number = 0.2, 1.0e20, -15.4, etc -
                    -

                    For the group functions, ID is a group-ID, dim is 'x' or 'y' or 'z', -and dir is one of 6 strings: "xmin", "xmax", "ymin", "ymax", "zmin", -or "zmax". The group functions mass() and charge() are the total mass -and charge of the group of atoms. Xcm() and vcm() return components -of the position and velocity of the center of mass of the group. -Bound() returns the min/max of a particular coordinate for all atoms -in the group. Gyration() computes the radius-of-gyration of the group -of atoms. See the fix gyration command for the -formula. -

                    -

                    Keywords have restrictions on when they can be assigned to variables. -For example, keywords that compute thermodynamic quantites can only be -invoked after the first simulation has begun. A warning is issued if -thermodyanmic keywords are invoked on timesteps when thermodynamic -information is not being printed to the screen, since the values -assigned to the variable may be out-of-date. -

                    -

                    The variable equal equation can also be nested in that function -arguments can be functions, vectors, keywords, or numbers. For -example, this is a valid equation: -

                    -
                    variable x equal div(add(pe,ke),pow(vol,div(1,3))) 
                    -

                    For the world style, one or more strings are specified. There must -be one string for each processor partition or "world". See this +be one string for each processor partition or "world". See this section of the manual for information on running LAMMPS with multiple partitions via the "-partition" command-line switch. This variable command assigns one string to each @@ -161,7 +125,7 @@ different partitions.

                    For the universe style, one or more strings are specified. There must be at least as many strings as there are processor partitions or -"worlds". See this page for information on +"worlds". See this page for information on running LAMMPS with multiple partitions via the "-partition" command-line switch. This variable command initially assigns one string to each world. When a next command is encountered @@ -179,11 +143,117 @@ strings are the integers from 1 to N. This allows you to generate a long list of runs (e.g. 1000) without having to list N values in your input script.

                    +
                    + +

                    For the equal style, a single string is specified which represents +an equation that will be evaluated afresh each time the variable is +used. Thus the variable can take on different values at different +stages of the input script. For example, if the variable is used in a +fix print command, different values could be printed +each timestep it was invoked. The next command cannot be used with +equal-style variables, since there is only one value. +

                    +

                    The equation for an equal-style variable can contain a variety of +quantities. The syntax for each kind of quantity is simple, but +multiple quantities can be nested and combined in various ways to +build up formulas of arbitrary complexity. For example, this is a +valid (though strange) variable equation: +

                    +
                    variable x equal div(add(pe,c_MyTemp[0]),pow(vol,div(1,3))) 
                    +
                    +

                    Specifically, an equation can contain numbers, thermo keywords, math +functions, group functions, atom vectors, compute references, and +other variables: +

                    +
                    + + + + + + +
                    Number 0.2, 1.0e20, -15.4, etc
                    Thermo keywords vol, pe, ebond, etc
                    Math functions add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
                    Group functions mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), bound(ID,dir), gyration(ID)
                    Atom vectors x[N], y[N], z[N], vx[N], vy[N], vz[N], fx[N], fy[N], fz[N]
                    Compute references c_ID[0], c_ID[N]
                    Other variables v_abc, v_x, etc +
                    + +

                    The thermo keywords allowed in the equation are those defined by the +"thermo_style custom" command. Note that many thermodyanmic +quantities are only computable after the first simulation has begun. +Likewise, many thermodynamic quantities (such as energies) are only +computed on timesteps when thermodyanmic output is being performed. +If the variable equation these quantities at other times, out-of-date +or invalid values may be used. +

                    +

                    Math functions take one or two arguments, each of which may be an +equation containing any of the quantities defined above. This allows +equations to be nested, as in the examples above. +

                    +

                    Group functions take one or two arguments. The first argument is the +group-ID. The dim argument is x or y or z. The dir +argument is xmin, xmax, ymin, ymax, zmin, or zmax. The +group functions mass() and charge() are the total mass and charge of +the group of atoms. Xcm() and vcm() return components of the position +and velocity of the center of mass of the group. Bound() returns the +min/max of a particular coordinate for all atoms in the group. +Gyration() computes the radius-of-gyration of the group of atoms. See +the fix gyration command for the formula. +

                    +

                    The atom vectors take a single integer argument from 1-N, which +is the desired atom-ID, e.g. x[243]. +

                    +

                    Compute references access allow access to scalar or vector quantities +calculated by a compute. The ID in the reference should be replaced +by the actual ID of the compute that has been defined elsewhere in the +input script. See the compute command for details. +Note that per-atom quantities calcalated by a compute cannot be +accessed this way, but only global scalar or vector quantities. +

                    +

                    If c_ID[0] is used as a keyword, then the scalar quantity +calculated by the compute is printed. If c_ID[N] is used, then N +in the range from 1-M will print a specific component of the vector +calculated by the compute. +

                    +

                    The current values of other variables can be accessed by prepending a +"v_" to the variable name. This will cause the other variable to be +evaulated. Note that if you do something circular like this: +

                    +
                    variable a equal v_b
                    +variable b equal v_a
                    +print $a 
                    +
                    +

                    then LAMMPS will run for a while when the print statement is invoked. +

                    +

                    Note that there is a subtle difference between using a variable +in a equal-style equation in the form $x versus v_x. +

                    +

                    In the former case, as with any other input script command, the +variable's value is substituted for immediately when the line is read +from the input script. Thus if the current simulation box volume was +1000.0, then these lines: +

                    +
                    variable x equal vol
                    +variable y equal mult($x,2) 
                    +
                    +

                    would associate the equation string "mult(1000.0,2)" with variable y. +

                    +

                    By contrast, these lines: +

                    +
                    variable x equal vol
                    +variable y equal mult(v_x,2) 
                    +
                    +

                    would associate the equation string "mult(v_x,2)" with variable y. +

                    +

                    Thus if the variable y were evaluated periodically during a run where +the box volume changed, the resulting value would always be 500.0 for +the first case, but would change dynamically for the second case. +

                    +
                    +

                    Restrictions:

                    The use of atom vectors in equal style variables requires the atom style to use a global mapping in order to look up the vector indices. -Only atom styles with molecular information create global maps. +Only atom styles with molecular information create global maps unless +the atom_modify map command is used.

                    Related commands:

                    diff --git a/doc/variable.txt b/doc/variable.txt index 2d52d22fd6..a0d089dfe2 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -13,20 +13,23 @@ variable command :h3 variable name style args ... :pre name = name of variable to define :ulb,l -style = {index} or {loop} or {equal} or {world} or {universe} :l +style = {index} or {loop} or {world} or {universe} or {uloop} or {equal} :l {index} args = one or more strings {loop} args = N = integer size of loop - {equal} args = one string containing functions, vectors, keywords, numbers + {world} args = one string for each partition of processors + {universe} args = one or more strings + {uloop} args = N = integer size of loop + {equal} args = one equation containing numbers, thermo keywords, math functions, group functions, atom vectors, compute references, other variables + numbers = 0.0, -5.4, 2.8e-4, etc + thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html math functions = add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(x) group functions = mass(group), charge(group), xcm(group,dim), vcm(group,dim), bound(group,xmin), gyration(group) - vectors = x\[5\], y\[12\], z\[17\], vx\[88\], vy\[19\], vz\[2\], - fx\[1\], fy\[2005\], fz\[1\] - keywords = same keywords (mostly) as in "thermo_style custom"_thermo_style.html command - {world} args = one string for each partition of processors - {universe} args = one or more strings - {uloop} args = N = integer size of loop :pre + atom vectors = x\[N\], y\[N\], z\[N\], vx\[N\], vy\[N\], vz\[N\], + fx\[N\], fy\[N\], fz\[N\] + compute references = c_ID\[0\], c_ID\[N\] + other variables = v_abc, v_x, etc :pre :ule [Examples:] @@ -34,8 +37,9 @@ style = {index} or {loop} or {equal} or {world} or {universe} :l variable x index run1 run2 run3 run4 run5 run6 run7 run8 variable LoopVar loop 20 variable beta equal div(temp,3.0) -variable b1 equal add(x\[234\],mult(0.5,lx)) -variable b equal xcm(mol1,x) +variable b1 equal add(x\[234\],mult(0.5,col)) +variable b equal div(xcm(mol1,x),2.0) +variable b equal c_myTemp\[0\] variable temp world 300.0 310.0 320.0 330.0 variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x uloop 15 :pre @@ -43,15 +47,24 @@ variable x uloop 15 :pre [Description:] This command assigns one or more values to a variable name so that the -variable can be used in subsequent input script commands. The "name" -of the variable is an arbitrary string. Each "value" is a string -which could be text or numbers, as in the examples above. As -explained in "this section"_Section_commands.html#3_2, occurrences of -the variable name in an input script line are replaced by the +variable can be used in subsequent input script commands or its value +output during a simulation. The "name" of the variable is an +arbitrary string. Each "value" is a string which could be text or +numbers, as in the examples above. + +As explained in "this section"_Section_commands.html#3_2, occurrences +of the variable name in an input script line are replaced by the variable's value. The variable name can be referenced in the input script as $x if the name "x" is a single character, or as $\{LoopVar\} if the name "LoopVar" is one or more characters. +Variable values can also be accessed for output once or periodically +during a simulation by the "print"_print.html command, "fix +print"_fix_print.html command, "run every"_run.html command, and the +"thermo_style"_thermo_style.html command. + +:line + As described below, for variable styles {index}, {loop}, {universe}, and {uloop}, the value assigned to a variable can be incremented via the "next"_next.html command. When there are no more values to @@ -73,13 +86,15 @@ equal-style variable is encountered. Also, if a variable is iterated on to the end of its list via the "next"_next.html command, it is available to be re-defined in a subsequent variable command. +:line + For the {index} style, one or more strings are specified. Initially, the 1st string is assigned to the variable. Each time a "next"_next.html command is used with the variable name, the next string is assigned. All processors assign the same string to the variable. {Index}-style variables can also be set (with a single value) by using the command-line switch -var; see "this -section"_Section_start.html#2_4 for details. +section"_Section_start.html#2_6 for details. The {loop} style is identical to the {index} style except that the strings are the integers from 1 to N. This allows you to generate a @@ -89,66 +104,9 @@ Each time a "next"_next.html command is used with the variable name, the next string ("2", "3", etc) is assigned. All processors assign the same string to the variable. -For the {equal} style, a single string is specified which represents -an equation that will be evaluated afresh each time the variable is -used. Thus the variable can take on different values at different -stages of the input script. For example, if the variable is used in a -"fix print"_fix_print.html command, it could print different values -each timestep it was invoked. The next command cannot be used with -{equal}-style variables, since there is only one value. Note that, as -with any other input script command, it is feasible to use another -variable in the {equal} variable's string, e.g. variable y equal -mult($x,2). However, $x will be replaced immediately by it's current -value when the command is first parsed, not each time that $y is -substituted for. - -The syntax of the equation assigned to {equal} variables is simple. -It can contain "functions", "vectors", "keywords", or "numbers" in any -combination. - -Function = a keyword followed by parenthesis with one or two arguments -Supported arithmetic functions = add(x,y), sub(x,y), mult(x,y), div(x,y), \ - neg(x), pow(x,y), exp(x), ln(x), sqrt(x) -Supported group functions = mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), \ - bound(ID,dir), gyration(ID) -Example function usage = div(1.0e20,3.0), neg(x\[34\]), pow(lx,3.0), \ - xcm(mol,x), bound(lower,zmin) -Vector = a keyword followed by square brackets containing an atom ID -Supported vectors = x, y, z, vx, vy, vz, fx, fy, fz -Example vector usage = x\[123\], fz\[1000\] -Keyword = any keyword supported by the \ - "thermo_style custom"_thermo_style.html \ - command except cpu, pressure tensor components (pxx, pyy, etc), \ - time-averaged quantities (tave, pave, etc) -Example keyword usage = atoms, pow(vol,0.333), mult(elong,0.5) -Number = 0.2, 1.0e20, -15.4, etc :ul - -For the group functions, ID is a group-ID, dim is 'x' or 'y' or 'z', -and dir is one of 6 strings: "xmin", "xmax", "ymin", "ymax", "zmin", -or "zmax". The group functions mass() and charge() are the total mass -and charge of the group of atoms. Xcm() and vcm() return components -of the position and velocity of the center of mass of the group. -Bound() returns the min/max of a particular coordinate for all atoms -in the group. Gyration() computes the radius-of-gyration of the group -of atoms. See the "fix gyration"_fix_gyration.html command for the -formula. - -Keywords have restrictions on when they can be assigned to variables. -For example, keywords that compute thermodynamic quantites can only be -invoked after the first simulation has begun. A warning is issued if -thermodyanmic keywords are invoked on timesteps when thermodynamic -information is not being printed to the screen, since the values -assigned to the variable may be out-of-date. - -The variable {equal} equation can also be nested in that function -arguments can be functions, vectors, keywords, or numbers. For -example, this is a valid equation: - -variable x equal div(add(pe,ke),pow(vol,div(1,3))) :pre - For the {world} style, one or more strings are specified. There must be one string for each processor partition or "world". See "this -section"_Section_start.html#2_4 of the manual for information on +section"_Section_start.html#2_6 of the manual for information on running LAMMPS with multiple partitions via the "-partition" command-line switch. This variable command assigns one string to each world. All processors in the world are assigned the same string. The @@ -161,7 +119,7 @@ different partitions. For the {universe} style, one or more strings are specified. There must be at least as many strings as there are processor partitions or -"worlds". See "this page"_Section_start.html#2_4 for information on +"worlds". See "this page"_Section_start.html#2_6 for information on running LAMMPS with multiple partitions via the "-partition" command-line switch. This variable command initially assigns one string to each world. When a "next"_next.html command is encountered @@ -179,11 +137,118 @@ strings are the integers from 1 to N. This allows you to generate a long list of runs (e.g. 1000) without having to list N values in your input script. +:line + +For the {equal} style, a single string is specified which represents +an equation that will be evaluated afresh each time the variable is +used. Thus the variable can take on different values at different +stages of the input script. For example, if the variable is used in a +"fix print"_fix_print.html command, different values could be printed +each timestep it was invoked. The next command cannot be used with +{equal}-style variables, since there is only one value. + +The equation for an {equal}-style variable can contain a variety of +quantities. The syntax for each kind of quantity is simple, but +multiple quantities can be nested and combined in various ways to +build up formulas of arbitrary complexity. For example, this is a +valid (though strange) variable equation: + +variable x equal div(add(pe,c_MyTemp\[0\]),pow(vol,div(1,3))) :pre + +Specifically, an equation can contain numbers, thermo keywords, math +functions, group functions, atom vectors, compute references, and +other variables: + +Number: 0.2, 1.0e20, -15.4, etc +Thermo keywords: vol, pe, ebond, etc +Math functions: add(x,y), sub(x,y), mult(x,y), div(x,y), \ + neg(x), pow(x,y), exp(x), ln(x), sqrt(x) +Group functions: mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), \ + bound(ID,dir), gyration(ID) +Atom vectors: x\[N\], y\[N\], z\[N\], vx\[N\], vy\[N\], vz\[N\], \ + fx\[N\], fy\[N\], fz\[N\] +Compute references: c_ID\[0\], c_ID\[N\] +Other variables: v_abc, v_x, etc :tb(s=:) + +The thermo keywords allowed in the equation are those defined by the +"thermo_style custom" command. Note that many thermodyanmic +quantities are only computable after the first simulation has begun. +Likewise, many thermodynamic quantities (such as energies) are only +computed on timesteps when thermodyanmic output is being performed. +If the variable equation these quantities at other times, out-of-date +or invalid values may be used. + +Math functions take one or two arguments, each of which may be an +equation containing any of the quantities defined above. This allows +equations to be nested, as in the examples above. + +Group functions take one or two arguments. The first argument is the +group-ID. The {dim} argument is {x} or {y} or {z}. The {dir} +argument is {xmin}, {xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The +group functions mass() and charge() are the total mass and charge of +the group of atoms. Xcm() and vcm() return components of the position +and velocity of the center of mass of the group. Bound() returns the +min/max of a particular coordinate for all atoms in the group. +Gyration() computes the radius-of-gyration of the group of atoms. See +the "fix gyration"_fix_gyration.html command for the formula. + +The atom vectors take a single integer argument from 1-N, which +is the desired atom-ID, e.g. x\[243\]. + +Compute references access allow access to scalar or vector quantities +calculated by a compute. The ID in the reference should be replaced +by the actual ID of the compute that has been defined elsewhere in the +input script. See the "compute"_compute.html command for details. +Note that per-atom quantities calcalated by a compute cannot be +accessed this way, but only global scalar or vector quantities. + +If {c_ID\[0\]} is used as a keyword, then the scalar quantity +calculated by the compute is printed. If {c_ID\[N\]} is used, then N +in the range from 1-M will print a specific component of the vector +calculated by the compute. + +The current values of other variables can be accessed by prepending a +"v_" to the variable name. This will cause the other variable to be +evaulated. Note that if you do something circular like this: + +variable a equal v_b +variable b equal v_a +print $a :pre + +then LAMMPS will run for a while when the print statement is invoked. + +Note that there is a subtle difference between using a variable +in a {equal}-style equation in the form $x versus v_x. + +In the former case, as with any other input script command, the +variable's value is substituted for immediately when the line is read +from the input script. Thus if the current simulation box volume was +1000.0, then these lines: + +variable x equal vol +variable y equal mult($x,2) :pre + +would associate the equation string "mult(1000.0,2)" with variable y. + +By contrast, these lines: + +variable x equal vol +variable y equal mult(v_x,2) :pre + +would associate the equation string "mult(v_x,2)" with variable y. + +Thus if the variable y were evaluated periodically during a run where +the box volume changed, the resulting value would always be 500.0 for +the first case, but would change dynamically for the second case. + +:line + [Restrictions:] The use of atom vectors in {equal} style variables requires the atom style to use a global mapping in order to look up the vector indices. -Only atom styles with molecular information create global maps. +Only atom styles with molecular information create global maps unless +the "atom_modify map"_atom_modify.html command is used. [Related commands:]