8. How-to discussions¶
このセクションでは、 LIGGGHTS(R)-PUBLICを使用して一般的なタスクを実行する方法について説明します。
8.2 2次元シミュレーション
8.3 1つの入力スクリプトから複数のシミュレーションを実行する
8.4 granularモデル
8.5 LIGGGHTS(R)-PUBLICと他のコードを連成する
8.6 LIGGGHTS(R)-PUBLICスナップショットの可視化
8.7 三斜晶(非直交)シミュレーションボックス
8.8 LIGGGHTS(R)-PUBLICからの出力(thermo、dump、compute、fix、variable)
8.9 壁
8.10 LIGGGHTS(R)-PUBLICへのライブラリ・インタフェース
This section describes how to perform common tasks using LIGGGHTS(R)-PUBLIC.
The example input scripts included in the LIGGGHTS(R)-PUBLIC distribution and highlighted in Section_example also show how to setup and run various kinds of simulations.
8.1. Restarting a simulation¶
長いLIGGGHTS(R)-
PUBLICシミュレーションを続ける3つの方法があります。複数のrunコマンドを同じ入力スクリプトで使用できます。
それぞれの実行は、前回の実行が途切れたところから続きます。または、binary restart
filesは、restartコ
マンドを使用してディスクに保存できます。後でこれらのバイナリファイルは、新しいスクリプトの
read_restartコマンドで読み込むことができます。または、-rコマンドラインスイッチを使用してテキスト
データファイルに変換し、新しいスクリプトでread_dataコマンドで読み取ることもできます。
通常、read_restartコマンドは、シミュレーションを再開する入力スクリプトのcreate_boxコマンド
を置き換えます。
シミュレーションの内部状態はリスタートファイルに保存されますが、ほとんどの材料プロパティとシミュレーション設定は
リスタートファイルに保存されません。シミュレーションをリスタートするときに設定や材料パラメータを変更するときは注
意が必要で す。
次のコマンドは、その設定がリスタートファイルに含まれているため、繰り返す必要はありません:units、
atom_style。
別の方法として、リスタートファイルを次のようにデータファイルに変換することができます。
There are 3 ways to continue a long LIGGGHTS(R)-PUBLIC simulation. Multiple run commands can be used in the same input script. Each run will continue from where the previous run left off. Or binary restart files can be saved to disk using the restart command. At a later time, these binary files can be read via a read_restart command in a new script. Or they can be converted to text data files using the -r command-line switch and read by a read_data command in a new script.
The read_restart command typically replaces the “create_box”create_box.html command in the input script that restarts the simulation.
Note that while the internal state of the simulation is stored in the restart file, most material properties and simulation settings are not stored in the restart file. Be careful when changing settings and/or material parameters when restarting a simulation.
The following commands do not need to be repeated because their settings are included in the restart file: units, atom_style.
As an alternate approach, the restart file could be converted to a data file as follows:
lmp_g++ -r tmp.restart.50 tmp.restart.data
次に、
"read_data"コマンドを使用してシミュレーションを再開することができます。
reset_timestepコマンドを使用して、LIGGGHTS(R)-PUBLICに現在のタイムステップを伝え
ることができます。
Then, the “read_data”read_data.html command can be used to restart the simulation.
reset_timestep command can be used to tell LIGGGHTS(R)-PUBLIC the current timestep.
8.2. 2d simulations¶
2次元シミュレーションを指定するには、
dimensionコマンドを使用します。
boundaryコマンドを使用してシミュレーションボックスをzで周期的に作成します。 これがデフォルトです。
create
boxコマンドを使用してシミュレーションボックスを定義する場合、create_atomsコマンドが単一のz平面のatomで3Dシミュレーションボックスをタイルす
るよ うに、zディメンションを狭めながら有限に設定します。
Use the dimension command to specify a 2d simulation.
Make the simulation box periodic in z via the boundary command. This is the default.
If using the create box command to define a simulation box, set the z dimensions narrow, but finite, so that the create_atoms command will tile the 3d simulation box with a single z plane of atoms - e.g.
create box 1 -10 10 -10 10 -0.25 0.25
read
dataコマンドを使用してatom座標のファイルを読み込む場合は、前述のcreate_boxコマンドの設定と同様に、「zlo
zhi」の値を有限で狭く設定します。
ファイル内の各atomについて、z座標をボックスのz境界の内側になるように割り当てます(例:0.0)。
速度と力のz成分がタイムステップごとにゼロになることを保証するために、最後に定義するfixとして、fix
enforce2dコマンドを使用します。
最後のfixを行う理由は、他のfixによって引き起こされる力がゼロになるようにするためです。
LIGGGHTS(R)-PUBLICディストリビューションに含まれている入力スクリプトの例の多くは、2Dモデル用
です。
If using the read data command to read in a file of atom coordinates, set the “zlo zhi” values to be finite but narrow, similar to the create_box command settings just described. For each atom in the file, assign a z coordinate so it falls inside the z-boundaries of the box - e.g. 0.0.
Use the fix enforce2d command as the last defined fix to insure that the z-components of velocities and forces are zeroed out every timestep. The reason to make it the last fix is so that any forces induced by other fixes will be zeroed out.
Many of the example input scripts included in the LIGGGHTS(R)-PUBLIC distribution are for 2d models.
Warning
LIGGGHTS(R)- PUBLICのいくつかのモデルは、ポイント粒子とは対照的に、粒子を有限サイズの球として扱う。 2dでは、パーティクルはディスクではなく球であり、慣性モーメントは3dと同じになります。
Some models in LIGGGHTS(R)-PUBLIC treat particles as finite-size spheres, as opposed to point particles. In 2d, the particles will still be spheres, not disks, meaning their moment of inertia will be the same as in 3d.
8.3. Running multiple simulations from one input script¶
これはいくつかの方法で行うことができま
す。 これらの例の動作の詳細については、個々のコマンドのドキュメントを参照してください。
「複数のシミュレーション」とは、より多くのタイムステップの前のシミュレーションを継続することを意味する場合は、単
にrunコマンドを複数回使用するだけです。 たとえば、このスクリプト
This can be done in several ways. See the documentation for individual commands for more details on how these examples work.
If “multiple simulations” means continue a previous simulation for more timesteps, then you simply use the run command multiple times. For example, this script
units lj
atom_style atomic
read_data data.lj
run 10000
run 10000
run 10000
run 10000
run 10000
同じシステムの5回の連続したシミュレー
ションを実行して合計50,000のタイムステップを実行します。
まったく異なるシミュレーションを実行したい場合は、LIGGGHTS(R)-PUBLICを再初期化するために、
clearコマンドを使用してそれらの間で相互に使用することができます。 たとえば、このスクリプト
would run 5 successive simulations of the same system for a total of 50,000 timesteps.
If you wish to run totally different simulations, one after the other, the clear command can be used in between them to re-initialize LIGGGHTS(R)-PUBLIC. For example, this script
units lj
atom_style atomic
read_data data.lj
run 10000
clear
units lj
atom_style atomic
read_data data.lj.new
run 10000
2つの独立したシミュレーションを1つず
つ実行します。
多数の独立したシミュレーションでは、変数とnext、jumpコマンドを使用して、同じ入力スクリプトを異なる設定で
複数回 ループすることができます。 たとえば、in.polymerという名前のこのスクリプト
would run 2 independent simulations, one after the other.
For large numbers of independent simulations, you can use variables and the next and jump commands to loop over the same input script multiple times with different settings. For example, this script, named in.polymer
variable d index run1 run2 run3 run4 run5 run6 run7 run8
shell cd $d
read_data data.polymer
run 10000
shell cd ..
clear
next d
jump in.polymer
各ディレクトリに data.polymerファイルを使用して、8つのシミュレーションを異なるディレクトリで実行します。 同じ概念を使用して、8つの異なる温度で同じシステムを実行し、温度変数を使用して、異なるログとダンプファイルに出力を格納することができます。
would run 8 simulations in different directories, using a data.polymer file in each directory. The same concept could be used to run the same system at 8 different temperatures, using a temperature variable and storing the output in different log and dump files, for example
variable a loop 8
variable t index 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15
log log.$a
read data.polymer
velocity all create $t 352839
fix 1 all nvt $t $t 100.0
dump 1 all atom 1000 dump.$a
run 100000
next t
next a
jump in.polymer
上記のすべての例は、1つまたは複数のプ
ロセッサで実行しているかどうかにかかわらず、プロセッサの単一パーティションでLIGGGHTS(R)-PUBLIC
を実行していると仮定しています。
LIGGGHTS(R)-PUBLICは、マニュアルのこのセクションで説明しているように、
"-partition"コマンドラインスイッチを使用して複数のパーティションで実行できます。
最後の2つの例では、LIGGGHTS(R)-PUBLICを3つのパーティションで実行した場合、variableコ
マンドで説明したように、 "index"変数と
"loop"変数をuniverseスタイルの変数に置き換えた場合、同じスクリプトを使用できます。
また、「next t」および「next a」コマンドは、「next a t」コマンドで置き換える必要があります。
これらの変更により、各スクリプトの8つのシミュレーションは、すべてが終了するまで3つのパーティション上で1つずつ
実行されます。 最初は、3つのシミュレーションが同時に開始されます(各パーティションに1つずつ)。
1つが終了すると、そのパーティションは4つ目のシミュレーションを開始し、8つすべてが完了するまで続きます。
All of the above examples work whether you are running on 1 or multiple processors, but assumed you are running LIGGGHTS(R)-PUBLIC on a single partition of processors. LIGGGHTS(R)-PUBLIC can be run on multiple partitions via the “-partition” command-line switch as described in this section of the manual.
In the last 2 examples, if LIGGGHTS(R)-PUBLIC were run on 3 partitions, the same scripts could be used if the “index” and “loop” variables were replaced with universe-style variables, as described in the variable command. Also, the “next t” and “next a” commands would need to be replaced with a single “next a t” command. With these modifications, the 8 simulations of each script would run on the 3 partitions one after the other until all were finished. Initially, 3 simulations would be started simultaneously, one on each partition. When one finished, that partition would then start the 4th simulation, and so forth, until all 8 were completed.
8.4. Granular models¶
granular系は、点粒子とは対照的 に、直径を有 する球状粒子からなる。 これは角速度を持っていることを意味し、それらにトルクを与えて回転させることができます。
granularモデルのシミュレーショ ンを実行するには、次のコマンドを使用します。
相互作用する粒子のペア、粒子と プリミティブな壁またはメッシュ要素との間の力およびトルクを計算する際に多数の粒子 - 粒子および粒子 - 壁接触モデルを使用する。 詳細はこちらをご覧ください:
これらのコマンドは、granularシ ステム固有のfixオプションを実装しています。
- fix freeze
- fix pour
- fix viscous
- fix wall/gran
fix wall / granコマンドは、プリミティブとメッシュの2種類の壁を定義できます。 メッシュ壁は、 fix mesh/surfaceまたは関連コマンドを使用して定義されます。
fix style freezeはフリーズしたatomの力とトルクの両方をゼロにします。fix style setforceの代わりに、granularシステムにこれを使用する必要方がよい。
計算効率のために、次のコマンドを使用し て、フリーズatom間の不必要なペアごとの計算を排除できます。
- neigh_modify exclude
Granular system are composed of spherical particles with a diameter, as opposed to point particles. This means they have an angular velocity and torque can be imparted to them to cause them to rotate.
To run a simulation of a granular model, you will want to use the following commands:
This compute
calculates rotational kinetic energy which can be output with thermodynamic info.
Use a number of particle-particle and particle-wall contact models, which compute forces and torques between interacting pairs of particles and between particles and primitive walls or mesh elements. Details can be found here:
These commands implement fix options specific to granular systems:
- fix freeze
- fix pour
- fix viscous
- fix wall/gran
fix wall/gran commands can define two types of walls: primitive and mesh. Mesh walls are defined using a fix mesh/surface or related command.
The fix style freeze zeroes both the force and torque of frozen atoms, and should be used for granular system instead of the fix style setforce.
For computational efficiency, you can eliminate needless pairwise computations between frozen atoms by using this command:
- neigh_modify exclude
8.5. Coupling LIGGGHTS(R)-PUBLIC to other codes¶
LIGGGHTS(R)-PUBLICは
他のコードと連成できるように設計されています。例えば、量子力学コードは、atomのサブセットに力を計算し、その力
を
LIGGGHTS(R)-PUBLICに渡すことができます。または、連続体有限要素(FE)シミュレーションでは、
FE節点の境界条件としてatom位置を使用し、FE解を計算し、MDatomに補間された力を戻します。
LIGGGHTS(R)-PUBLICは、少なくとも3つの方法で他のコードと連成することができます。それぞれに長所
と短所があります。これは、それぞれのアプリケーションのコンテキストで考える必要があります。
(1)他のコードを呼び出す新しいfixコマンドを定義します。このシナリオでは、LIGGGHTS(R)-
PUBLIC
がドライバーコードです。タイムステップ中に、fixが呼び出され、ライブラリとしてLIGGGHTS(R)-
PUBLICにリンクされている他のコードにライブラリ呼び出しを行うことができます。これは、atomグループに対して拘束され
た剛体運動を実行するPOEMSパッケージがLIGGGHTS(R)-PUBLICにフックされる方法です。詳細につい
ては、fix_poemsコマンドを参照してください。
LIGGGHTS(R)-PUBLICに新しいfixを追加する方法については、ドキュメントのこのセクションを参照してください。
(2)他のコードを呼び出す新しいLIGGGHTS(R)-PUBLICコマンドを定義します。これは、方法(1)と概
念的には似ていますが、この場合LIGGGHTS(R)-PUBLICと他のコードはより均等な立場にあります。他の
コードはLIGGGHTS(R)-PUBLIC実行のタイムステップ中に呼び出されるのではなく、実行されていることに
注意してください。
LIGGGHTS(R)-PUBLIC入力スクリプトを使用して、LIGGGHTS(R)-PUBLICの実行を、新しいコマンドで呼び出された別のコードの呼び出しと交
互に実行することができます。
runコマンドは、everyオプションでこれを容易にします。これにより、いくつかのステップを実行することを容易にしたり、コマンドを起動したり、いくつかのステップ
を実行したり、コマ ンドを呼び出すことができます。
このシナリオでは、(1)のように、他のコードをライブラリとして呼び出すこともできますし、コマンドによって行われた
system()callよって呼び出されるstand-aloneコードにすることもできます(並列マシンが1つもし
くはそれ以上プロ
セッサーによって別のプログラムを起動します)。後者の場合、stand-aloneコードは、コマンドが書き込みおよび読み取りを行
うLIGGGHTS(R)-PUBLICスルーファイルと通信できます。
LIGGGHTS(R)-PUBLICに新しいコマンドを追加する方法については、ドキュメントの
Section_modifyを参照してください。
(3)別のコードで呼び出されるライブラリとしてLIGGGHTS(R)-PUBLICを使用してください。この場合、
他のコードはドライバであり、必要に応じてLIGGGHTS(R)-PUBLICを呼び出します。あるいは、
wrapperコードによってLIGGGHTS(R)-PUBLICと他のコードをライブラリとしてリンクして呼び出す
ことができます。繰り
返しますが、runコマンドには、別のプログラムによって駆動される複数の短期実行を実行する場合、最小限のオーバー
ヘッド(セットアップやクリーンアップなし)で呼び出しできるオプションがあります。
ライブラリーとしてLIGGGHTS(R)-PUBLICを呼び出すドライバー・コードの例は、
LIGGGHTS(R)-PUBLICディストリビューションのexamples /
COUPLEディレクトリーに含まれています。詳細は、examples / COUPLE /
READMEを参照してください。
- シンプル:ライブラリとして LIGGGHTS(R)-PUBLICを呼び出すC ++とCのシンプルなドライバプログラム
- lammps_quest:LIGGGHTS(R)- PUBLICとQuestを連成して、密度汎関数コードによって計算された量子力で古典的MDを実行する
- lammps_spparks:LIGGGHTS(R)- PUBLICとSPPARKSを連成して、MDを使用して粒子成長のための動力学的モンテカルロモデルをカップリン グし、粒界に誘起される歪みを計算する
このセクションでは、LIGGGHTS(R)-PUBLICをライブラリーとしてビルドする方法について説明します。こ
れ が完了すると、C
++、C、Fortran、Python(またはvanilla-Cのようなインターフェースをサポートする他の言語)を介してLIGGGHTS(R)-PUBLICのイ
ンター フェースすることができます。たとえば、C
++から、LIGGGHTS(R)-PUBLICの1つ(または複数)の「インスタンス」を作成し、入力スクリプトを渡して処理したり、個々のコマンドを実行したり、
LIGGGHTS(R)-PUBLICで正しいクラスメソッドを呼び出すことによって、すべてのクラスを呼び出すことが
できます。 CやFortranから、同じことをする関数呼び出しを行うことができます。
LIGGGHTS(R)-PUBLICライブラリー・インターフェースを介して動作するLIGGGHTS(R)-PUBLICで提供されるPython
wrapperについて は、マニュアルのSection_pythonを参照してください。
ファイル、src / library.cppとlibrary.hには、C言語スタイルのLIGGGHTS(R)-
PUBLICへのインターフェイスが含まれています。インターフェイスの説明と必
要に応じて拡張する方法については、マニュアルのSection_howto 19を参照してください。
LIGGGHTS(R)-PUBLICのインスタンスを作成するlammps_open()関数は、MPIコミュニケー
タを引数として取ります。これは、LIGGGHTS(R)-PUBLICのインスタンスがコミュニケータのプロセッサ
セットで実行されることを意味します。したがって、呼び出しコードはLIGGGHTS(R)-PUBLICをすべてまた
は一部のプロセッサーで実行できます。たとえば、wrapperスクリプトは、LIGGGHTS(R)-PUBLICと
別の コードを交互に使用して、両方のプロセッサーで実行できるようにすることができます。または、プロセッサの半分を
LIGGGHTS(R)-PUBLICに割り当て、他のコードの半分を割り当てて、両方のコードを同時に実行してから定
期的に同期させることもできます。あるいは、LIGGGHTS(R)-PUBLICの複数のインスタンスをインスタンス
化して、異なる計算を実行することもできます。
LIGGGHTS(R)-PUBLIC is designed to allow it to be coupled to other codes. For example, a quantum mechanics code might compute forces on a subset of atoms and pass those forces to LIGGGHTS(R)-PUBLIC. Or a continuum finite element (FE) simulation might use atom positions as boundary conditions on FE nodal points, compute a FE solution, and return interpolated forces on MD atoms.
LIGGGHTS(R)-PUBLIC can be coupled to other codes in at least 3 ways. Each has advantages and disadvantages, which you’ll have to think about in the context of your application.
(1) Define a new fix command that calls the other code. In this scenario, LIGGGHTS(R)-PUBLIC is the driver code. During its timestepping, the fix is invoked, and can make library calls to the other code, which has been linked to LIGGGHTS(R)-PUBLIC as a library. This is the way the POEMS package that performs constrained rigid-body motion on groups of atoms is hooked to LIGGGHTS(R)-PUBLIC. See the fix_poems command for more details. See this section of the documentation for info on how to add a new fix to LIGGGHTS(R)-PUBLIC.
(2) Define a new LIGGGHTS(R)-PUBLIC command that calls the other code. This is conceptually similar to method (1), but in this case LIGGGHTS(R)-PUBLIC and the other code are on a more equal footing. Note that now the other code is not called during the timestepping of a LIGGGHTS(R)-PUBLIC run, but between runs. The LIGGGHTS(R)-PUBLIC input script can be used to alternate LIGGGHTS(R)-PUBLIC 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 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 LIGGGHTS(R)-PUBLIC thru files that the command writes and reads.
See Section_modify of the documentation for how to add a new command to LIGGGHTS(R)-PUBLIC.
(3) Use LIGGGHTS(R)-PUBLIC as a library called by another code. In this case the other code is the driver and calls LIGGGHTS(R)-PUBLIC as needed. Or a wrapper code could link and call both LIGGGHTS(R)-PUBLIC and another code as libraries. 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.
Examples of driver codes that call LIGGGHTS(R)-PUBLIC as a library are included in the examples/COUPLE directory of the LIGGGHTS(R)-PUBLIC distribution; see examples/COUPLE/README for more details:
- simple: simple driver programs in C++ and C which invoke LIGGGHTS(R)-PUBLIC as a library
- lammps_quest: coupling of LIGGGHTS(R)-PUBLIC and Quest, to run classical MD with quantum forces calculated by a density functional code
- lammps_spparks: coupling of LIGGGHTS(R)-PUBLIC and SPPARKS, to couple a kinetic Monte Carlo model for grain growth using MD to calculate strain induced across grain boundaries
This section of the documentation describes how to build LIGGGHTS(R)-PUBLIC as a library. Once this is done, you can interface with LIGGGHTS(R)-PUBLIC either via C++, C, Fortran, or Python (or any other language that supports a vanilla C-like interface). For example, from C++ you could create one (or more) “instances” of LIGGGHTS(R)-PUBLIC, pass it an input script to process, or execute individual commands, all by invoking the correct class methods in LIGGGHTS(R)-PUBLIC. From C or Fortran you can make function calls to do the same things. See Section_python of the manual for a description of the Python wrapper provided with LIGGGHTS(R)-PUBLIC that operates through the LIGGGHTS(R)-PUBLIC library interface.
The files src/library.cpp and library.h contain the C-style interface to LIGGGHTS(R)-PUBLIC. See Section_howto 19 of the manual for a description of the interface and how to extend it for your needs.
Note that the lammps_open() function that creates an instance of LIGGGHTS(R)-PUBLIC takes an MPI communicator as an argument. This means that instance of LIGGGHTS(R)-PUBLIC will run on the set of processors in the communicator. Thus the calling code can run LIGGGHTS(R)-PUBLIC on all or a subset of processors. For example, a wrapper script might decide to alternate between LIGGGHTS(R)-PUBLIC and another code, allowing them both to run on all the processors. Or it might allocate half the processors to LIGGGHTS(R)-PUBLIC and half to the other code and run both codes simultaneously before syncing them up periodically. Or it might instantiate multiple instances of LIGGGHTS(R)-PUBLIC to perform different calculations.
8.6. Visualizing LIGGGHTS(R)-PUBLIC snapshots¶
LIGGGHTS(R)-PUBLIC自
体は可視化を行いませんが、LIGGGHTS(R)-PUBLICシミュレーションからのスナップショットはさまざまな
方法で視覚化(および解析)できます。
LIGGGHTS(R)-PUBLICスナップショットは、いくつかの形式でファイルを作成できるdumpコマンドに
よって作成されます。
ネイティブLIGGGHTS(R)-PUBLICダンプ形式はテキストファイルです(「ダンプatom」または「ダンプカスタム」参照)。
私たちのグループによって配布されたPythonベースのツールキット(LPP)は、ユーザー指定のatom情報の列を
追 加したcustom
dumpファイルを含むネイティブLIGGGHTS(R)-PUBLICダンプファイルを読み込み、それら
をparaviewで読み込み可能なVTKファイル形式に変換できます。
また、VTKにネイティブに出力するいくつかのdumpコマンドが存在します。
LIGGGHTS(R)-PUBLIC itself does not do visualization, but snapshots from LIGGGHTS(R)-PUBLIC simulations can be visualized (and analyzed) in a variety of ways.
LIGGGHTS(R)-PUBLIC snapshots are created by the dump command which can create files in several formats. The native LIGGGHTS(R)-PUBLIC dump format is a text file (see “dump atom” or “dump custom”).
A Python-based toolkit (LPP) distributed by our group can read native LIGGGHTS(R)-PUBLIC dump files, including custom dump files with additional columns of user-specified atom information, and convert them to VTK file formats that can be read with Paraview.
Also, there exist a number of dump commands that output to VTK natively.
8.7. Triclinic (non-orthogonal) simulation boxes¶
デフォルトでは、
LIGGGHTS(R)-PUBLICは直交シミュレーションボックスを使用してパーティクルを包含します。boundaryコマン
ドは、ボックスの境界条件(周期的、非周期的など)を設定します。直交ボックスは、(xlo、ylo、zlo)に
"origin"を持ち、a
=(xhi-xlo、0,0)によって与えられる原点から始まる3つのエッジベクトルによって定義されます。 b
=(0、yhi-ylo、0); c =(0,0、z-zlo)。
6つのパラメータ(xlo、xhi、ylo、yhi、zlo、zhi)は、シミュレーションボックスの作成時に定義されます。
例えばcreate_boxまたはread_dataまたはread_restartコマンドによって実行されます。さ
らに、 LIGGGHTS(R)-PUBLICはボックスサイズパラメータlx、ly、lzを定義します。ここでlx
= xhi-xlo、yとzの次元についても同様です。
6つのパラメータとlx、ly、lzは、thermo_style customコマンドで出力できます。
LIGGGHTS(R)-PUBLICはまた、三斜晶対称性を有する平行六面体として形成された三線(非直交)シ
ミュレーションボックスでシミュレーションを実行することを可能にする。平行六面体は(xlo、ylo、zlo)に
"origin"を持ち、a =(xhi-xlo、0,0); b =(xy、yhi-ylo、0); c
=(xz、yz、zhi-zlo)で与えられる原点から3つのエッジベクトルで定
義されます。
xy、xz、yzは、0.0または正または負の値にすることができ、それは、元の直交ボックスの面に適用して平行六面体に変換する変位量であるため、「傾き係数」と呼ばれ
ます。
LIGGGHTS(R)-PUBLICでは、三斜晶系シミュレーションボックスのエッジベクトルa、b、およびcは任意のベクトルではありません。示されているよう
に、aは正のx軸上になければならない。 bは、厳密に正のy成分を持つxy平面内になければなりません。
cは厳密に正のz成分を有する任意の向きを有することができる。
a、b、cがそれぞれ厳密に正のx、y、z成分を持つという要件は、a、b、およびcが完全な右利きの基礎をもつことを保証します。これらの制限は、3つのクリスタル基底
ベクト ルの任意の集合を制限に従うように回転/反転することが可能であるため、一般性を失わせることはない。
例えば、3つのベクトルA、** B **、** C **は、一般的な平行六面体のエッジベクトルであり、A、**
B **、** C
**には、完全な右利きの基礎、すなわちA×B.C>0、を形成する以外に制限がない。同等のLIGGGHTS(R)-PUBLIC
a、** b **、** c **は、A、B、およびCの線形回転であり、以下のように計算することができる。
By default, LIGGGHTS(R)-PUBLIC uses an orthogonal simulation box to encompass the particles. The boundary command sets the boundary conditions of the box (periodic, non-periodic, etc). The orthogonal box has its “origin” at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (0,yhi-ylo,0); c = (0,0,zhi-zlo). The 6 parameters (xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simulation box is created, e.g. by the create_box or read_data or read_restart commands. Additionally, LIGGGHTS(R)-PUBLIC defines box size parameters lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions. The 6 parameters, as well as lx,ly,lz, can be output via the thermo_style custom command.
LIGGGHTS(R)-PUBLIC also allows simulations to be performed in triclinic (non-orthogonal) simulation boxes shaped as a parallelepiped with triclinic symmetry. The parallelepiped has its “origin” at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (xy,yhi-ylo,0); c = (xz,yz,zhi-zlo). xy,xz,yz can be 0.0 or positive or negative values and are called “tilt factors” because they are the amount of displacement applied to faces of an originally orthogonal box to transform it into the parallelepiped. In LIGGGHTS(R)-PUBLIC the triclinic simulation box edge vectors a, b, and c cannot be arbitrary vectors. As indicated, a must lie on the positive x axis. b must lie in the xy plane, with strictly positive y component. c may have any orientation with strictly positive z component. The requirement that a, b, and c have strictly positive x, y, and z components, respectively, ensures that a, b, and c form a complete right-handed basis. These restrictions impose no loss of generality, since it is possible to rotate/invert any set of 3 crystal basis vectors so that they conform to the restrictions.
For example, assume that the 3 vectors A,**B**,**C** are the edge vectors of a general parallelepiped, where there is no restriction on A,**B**,**C** other than they form a complete right-handed basis i.e. A x B . C > 0. The equivalent LIGGGHTS(R)-PUBLIC a,**b**,**c** are a linear rotation of A, B, and C and can be computed as follows:
ここで、A = | ** A ** |
Aのスカラー長を示します。^
hat記号は対応する単位ベクトルを示します。betaとgammaは、以下に説明するベクトル間の角度です。
構造上、a、b、およびcは、それぞれ厳密に正のx、yおよびz成分を有することに留意されたい。
A、B、およびCが左利きの基底を形成しなければ、上の方程式はcに対して有効ではない。
この場合、まず反転を適用する必要があります。
これは、2つの基底ベクトルを交換するか、または1つの基底ベクトルの符号を変えることによって達成できます。
一貫性のために、基底ベクトルに適用された同じ回転/反転をatom位置、速度、および他のベクトル量にも適用する必要
があ ります。
これは、まず、古い基準で分率座標に変換し、次に新しい基準で距離座標に変換することによって、便利に達成することができる。
変換は次の式で与えられます。
where A = |**A**| indicates the scalar length of A. The ^ hat symbol indicates the corresponding unit vector. beta and gamma are angles between the vectors described below. Note that by construction, a, b, and c have strictly positive x, y, and z components, respectively. If it should happen that A, B, and C form a left-handed basis, then the above equations are not valid for c. In this case, it is necessary to first apply an inversion. This can be achieved by interchanging two basis vectors or by changing the sign of one of them.
For consistency, the same rotation/inversion applied to the basis vectors must also be applied to atom positions, velocities, and any other vector quantities. This can be conveniently achieved by first converting to fractional coordinates in the old basis and then converting to distance coordinates in the new basis. The transformation is given by the following equation:
ここで、Vはボックスの体積、Xは元のベ
クトル量、xはLIGGGHTS(R)-PUBLIC単位のベクトルです。
三角形ボックスは任意の次元で周期的である必要はありませんが、その境界を越えて周期的な境界条件を変更したい場合は、
通常、少なくとも2番目の傾き(xy中のy)にする必要があります。 い くつかのコマンドは
triclinicボックスで動作します。例えば fix deformおよびfix
nptコマンドは、特定の次元で周期性または非シュリンクラップ境界条件を必要とします。詳細については、コマンドのdocページを参照してください。
シミュレーションボックスの作成時に9つのパラメータ(xlo、xhi、ylo、yhi、zlo、zhi、xy、
xz、yz)が定義されています。これは3つの方法のいずれかで発生します。
create_boxコマンドをスタイルprismの領域と共に使用すると、三角形ボックスが設定されます。詳細については、regionコマンドを参照してください。
read_dataコマンドを使用してシミュレーションボックスを定義し、データファイルのヘッダーに "xy xz
yz"キーワードの行が含まれる場合、三角形ボックスが設定されます。詳細については、read_dataコマンドを参
照してください。最後に、read_restartコマンドが、三角形ボックスを使用してシミュレーションから書き込ま
れたリスタートファイルを読み取った場合、シミュレーションをリスタートするための三角形ボックスが設定されます。
3つの傾き係数= 0.0の三角形ボックスを定義して、最初は直交とすることができます。例えばfix
nptまたはfix deformコマンドが起因となって、ボックスが非直交になる場合があります。あ
るいは、change_boxコマンドを使用して、シミュレーションボックスを直交から三角に変換することができます。
直交ボックスの場合と同様に、LIGGGHTS(R)-PUBLICは、三角形ボックスサイズパラメータlx、ly、
lzを定義する。ここでlx = xhi-xloであり、同様にyおよびz次元である。
9つのパラメータとlx、ly、lzは、thermo_style customコマンドで出力できます。
LIGGGHTS(R)-PUBLICは、通常、極端に傾いたボックス(計算上非効率的である)を回避するために、
傾き係数の第1の次元(xzのx)である平行ボックス長さの半分以上に歪曲するような傾き係数としないことを要求します。シミュレーションボックスが作成
されたとき(例えば、
create_boxまたはread_dataコマンドを介して)また、ボックス形状がシミュレーション中に動的に変化するとき、(例えば、
fix deformコマンドを介して)の両方を要求します。
たとえば、xlo = 2およびxhi =
12の場合、xボックスの長さは10で、xy傾き係数は-5と5の間でなければなりません。同様に、xzとyzの両方の係数とも
- (xhi-xlo)/ 2と+(yhi-ylo)/
2の間でなければなりません。最大傾き係数が5である場合(この例のように)tilt=
...、-15、-5,5,15,25、...を有する構成が幾何学的に全て同じなので、これは限定ではないことに留意されたい。ダイナミクス実行中(例えば、fix
deformコマンドを介して)ボックスの傾きがこの限界を超える場合、ボックスは境界内の傾き係数を有する同等の形状
に「反転」 され、実行を続けることができる。詳細は、fix deform docのページを参照してください。
このルールの1つの例外は、傾斜係数(xyのx)の第1次元が非周期的な場合です。その場合、その次元のボックスを反転
させても非周期性によるatom位置は変化しないので、傾斜因子の限界は強制されない。このモードでは、システムを極端
な角 度に傾けると、非常に歪んだシミュレーションボックスのために、シミュレーションが単純に非効率になります。
パラレルボックスの長さの半分以上を歪曲させる傾き係数を持つシミュレーションボックスを作成しないという制限
は、boxコマンドで上書きできます。 tiltキーワードをlargeに設定すると、任意の傾き係数を指定できます。
シミュレーションボックスの傾き係数が大きい場合、プロセッサの不規則な形状のサブドメインの周りにゴーストatomを
獲得する
ために、必要な大量の通信が必要になり、LIGGGHTS(R)-PUBLICの実行効率が低下することに注意してください。極端
な傾きの場合、LIGGGHTS(R)-PUBLICもatomを失い、エラーを生成する可能性があります。
三斜晶結晶構造は、3つの格子定数a、b、およびc、および3つの角度alpha、betaおよびgammaを用いて定
義されることが多い。こ
の命名法では、a、b、およびcの格子定数は、上で定義したエッジベクトルa、b、およびcのスカラー長です。これら6
つの量(a、b、c、alpha、beta、gamma)とLIGGGHTS(R)-PUBLICボックスサイズ
(lx、ly、lz)= (xhi-xlo、yhi-ylo、zhi-zlo)および傾き係数
(xy、xz、yz)は次のようになります。
where V is the volume of the box, X is the original vector quantity and x is the vector in the LIGGGHTS(R)-PUBLIC basis.
There is no requirement that a triclinic box be periodic in any dimension, though it typically should be in at least the 2nd dimension of the tilt (y in xy) if you want to enforce a shift in periodic boundary conditions across that boundary. Some commands that work with triclinic boxes, e.g. the fix deform and fix npt commands, require periodicity or non-shrink-wrap boundary conditions in specific dimensions. See the command doc pages for details.
The 9 parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) are defined at the time the simluation box is created. This happens in one of 3 ways. If the create_box command is used with a region of style prism, then a triclinic box is setup. See the region command for details. If the read_data command is used to define the simulation box, and the header of the data file contains a line with the “xy xz yz” keyword, then a triclinic box is setup. See the read_data command for details. Finally, if the read_restart command reads a restart file which was written from a simulation using a triclinic box, then a triclinic box will be setup for the restarted simulation.
Note that you can define a triclinic box with all 3 tilt factors = 0.0, so that it is initially orthogonal. This is necessary if the box will become non-orthogonal, e.g. due to the fix npt or fix deform commands. Alternatively, you can use the change_box command to convert a simulation box from orthogonal to triclinic and vice versa.
As with orthogonal boxes, LIGGGHTS(R)-PUBLIC defines triclinic box size parameters lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions. The 9 parameters, as well as lx,ly,lz, can be output via the thermo_style custom command.
To avoid extremely tilted boxes (which would be computationally inefficient), LIGGGHTS(R)-PUBLIC normally requires that no tilt factor can skew the box more than half the distance of the parallel box length, which is the 1st dimension in the tilt factor (x for xz). This is required both when the simulation box is created, e.g. via the create_box or read_data commands, as well as when the box shape changes dynamically during a simulation, e.g. via the fix deform command.
For example, if xlo = 2 and xhi = 12, then the x box length is 10 and the xy tilt factor must be between -5 and 5. Similarly, both xz and yz must be between -(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation, since if the maximum tilt factor is 5 (as in this example), then configurations with tilt = ..., -15, -5, 5, 15, 25, ... are geometrically all equivalent. If the box tilt exceeds this limit during a dynamics run (e.g. via the fix deform command), then the box is “flipped” to an equivalent shape with a tilt factor within the bounds, so the run can continue. See the fix deform doc page for further details.
One exception to this rule is if the 1st dimension in the tilt factor (x for xy) is non-periodic. In that case, the limits on the tilt factor are not enforced, since flipping the box in that dimension does not change the atom positions due to non-periodicity. In this mode, if you tilt the system to extreme angles, the simulation will simply become inefficient, due to the highly skewed simulation box.
The limitation on not creating a simulation box with a tilt factor skewing the box more than half the distance of the parallel box length can be overridden via the box command. Setting the tilt keyword to large allows any tilt factors to be specified.
Note that if a simulation box has a large tilt factor, LIGGGHTS(R)-PUBLIC will run less efficiently, due to the large volume of communication needed to acquire ghost atoms around a processor’s irregular-shaped sub-domain. For extreme values of tilt, LIGGGHTS(R)-PUBLIC may also lose atoms and generate an error.
Triclinic crystal structures are often defined using three lattice constants a, b, and c, and three angles alpha, beta and gamma. Note that in this nomenclature, the a, b, and c lattice constants are the scalar lengths of the edge vectors a, b, and c defined above. The relationship between these 6 quantities (a,b,c,alpha,beta,gamma) and the LIGGGHTS(R)-PUBLIC box sizes (lx,ly,lz) = (xhi-xlo,yhi-ylo,zhi-zlo) and tilt factors (xy,xz,yz) is as follows:
逆の関係は、次のように書くことができま す。
The inverse relationship can be written as follows:
a、b、c、alpha、beta、およ
びgammaの値は、thermo_style customキーワードcella、cellb、cellc、
cellalpha、cellbeta、cellgammaをそれぞれ使用して、computeによって出力またはアクセスできま
す。
dumpコマンドのdocページで説明したように、スナップショットのBOX
BOUNDSが三角形ボックスのダンプファイルに書き込まれると、三角形のシミュレーションボックスを囲む直交する境界ボックスが、三角形ボックスの3つの傾き係数
(xy、xz 、yz)に沿って出力され、次のようにフォーマットします。
The values of a, b, c , alpha, beta , and gamma can be printed out or accessed by computes using the thermo_style custom keywords cella, cellb, cellc, cellalpha, cellbeta, cellgamma, respectively.
As discussed on the dump command doc page, when the BOX BOUNDS for a snapshot is written to a dump file for a triclinic box, an orthogonal bounding box which encloses the triclinic simulation box is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic box, formatted as follows:
ITEM: BOX BOUNDS xy xz yz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz
この境界ボックスは、多くの視覚化プログ ラムに便利であり、次のように9つの三角形ボックスパラメータ(xlo、xhi、ylo、yhi、zlo、zhi、 xy、xz、yz)をから計算される。
This bounding box is convenient for many visualization programs and is calculated from the 9 triclinic box parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) as follows:
xlo_bound = xlo + MIN(0.0,xy,xz,xy+xz)
xhi_bound = xhi + MAX(0.0,xy,xz,xy+xz)
ylo_bound = ylo + MIN(0.0,yz)
yhi_bound = yhi + MAX(0.0,yz)
zlo_bound = zlo
zhi_bound = zhi
境界ボックスを三角形ボックス のパラメータに戻す必要がある場合は、これらの式を逆にすることができます。 例えば、xlo = xlo_bound - MIN(0.0、xy、xz、xy + xz)。
These formulas can be inverted if you need to convert the bounding box back into the triclinic box parameters, e.g. xlo = xlo_bound - MIN(0.0,xy,xz,xy+xz).
8.8. Output from LIGGGHTS(R)-PUBLIC (thermo, dumps, computes, fixes, variables)¶
LIGGGHTS(R)-PUBLIC出
力の4つの基本的な種類があります。
- 熱力学的出力。スクリーンとログ ファイルへのタイムステップが少しずつ出力されます。
- ファイルをダンプします。それは atomのスナップショットと atomごと のさまざまな値を含み、指定された頻度で書き込まれます。
- 特定のfixでは、ユーザー指 定の量をファイルに出力することができます。時間平均化のためのfix ave/time, 空 間平均化のためのfix ave/spatial, 変数の単一行出力のためのfix print。Fix printは画面にも出力できます。
- ファイルをリスタートします。
シミュレーションでは、1組の熱力学的出
力と(オプションで)リスタートファイルが出力されます。指定したダンプおよびfixコマンドに応じて、任意の数のダン
プファイルを生成して出力ファイルをfixできます。
以下で説明するように、LIGGGHTS(R)-PUBLICは、上記の熱力学、ダンプ、またはfixコマンドにより出
力を実 行するときに、計算、出力される量を決定するさまざまな方法を提供します。この議論を通して、ユーザーは
LIGGGHTS(R)-PUBLICに独自の計算とfixを追加することができます.LIGGGHTS(R)-
PUBLICは、これらのコマンドで出力できる値を生成することができます。
以下のサブセクションでは、出力に関連するさまざまなLIGGGHTS(R)-PUBLICコマンドと、それらが操作し
て生成するデータの種類について説明します。
- Global/per-atom/local data
- Scalar/vector/array
data
- 熱力学的出力
- ダンプファイルの出力
- 出力ファイルを書き込むfix
- 出力量を処理するcompute
- 出力量を処理するfix
- 出力する値を生成する compute
- 出力する値を生成するfix
- 出力する値を生成する変数
- コマンド間の出力オプションとデー タフローの要約表
There are four basic kinds of LIGGGHTS(R)-PUBLIC output:
- Thermodynamic output, which is a list of quantities printed every few timesteps to the screen and logfile.
- Dump files, which contain snapshots of atoms and various per-atom values and are written at a specified frequency.
- Certain fixes can output user-specified quantities to files: fix ave/time for time averaging, fix ave/spatial for spatial averaging, and fix print for single-line output of variables. Fix print can also output to the screen.
- Restart files.
A simulation prints one set of thermodynamic output and (optionally) restart files. It can generate any number of dump files and fix output files, depending on what dump and fix commands you specify.
As discussed below, LIGGGHTS(R)-PUBLIC gives you a variety of ways to determine what quantities are computed and printed when the thermodynamics, dump, or fix commands listed above perform output. Throughout this discussion, note that users can also add their own computes and fixes to LIGGGHTS(R)-PUBLIC which can then generate values that can then be output with these commands.
The following sub-sections discuss different LIGGGHTS(R)-PUBLIC command related to output and the kind of data they operate on and produce:
- Global/per-atom/local data
- Scalar/vector/array data
- Thermodynamic output
- Dump file output
- Fixes that write output files
- Computes that process output quantities
- Fixes that process output quantities
- Computes that generate values to output
- Fixes that generate values to output
- Variables that generate values to output
- Summary table of output options and data flow between commands
8.8.1. Global/per-atom/local data¶
さまざまな出力関連のコマンドは、グ ローバル、atomごと、またはローカルの3つの異なるスタイルのデータで動作します。 グローバルデータムは、システム全体の値(例えば、システムの温度)である。 atomごとのデータムは、atom当たりの1つ以上の値、例えば各atomの運動エネルギーである。ローカルデータムは、atomに基づいた各プロセッサによって計算さ れるが、atom当たりにゼロ以上、例えば結合距離のリストが存在してもよい。
Various output-related commands work with three different styles of data: global, per-atom, or local. A global datum is one or more system-wide values, e.g. the temperature of the system. A per-atom datum is one or more values per atom, e.g. the kinetic energy of each atom. Local datums are calculated by each processor based on the atoms it owns, but there may be zero or more per atom, e.g. a list of bond distances.
8.8.2. Scalar/vector/array data¶
グローバル、atomごと、および
ローカ ル の各データムは、単一のスカラ値、値のベクトル、または2次元の値の配列の3種類があります。
データを生成する "compute"または "fix"または
"変数"のドキュメントページは、それが生成するデータのスタイルと種類の両方を指定します(たとえば、atomごとのベクトル)。
以下に説明する多くの出力コマンドのように、量にアクセスすると、次の括弧表記を使用して参照することができます。
ここで、IDはcomputeのIDです。
先頭の「c_」は、fixの場合は「f_」、変数の場合は「v_」に置き換えられます。
Global, per-atom, and local datums can each come in three kinds: a single scalar value, a vector of values, or a 2d array of values. The doc page for a “compute” or “fix” or “variable” that generates data will specify both the style and kind of data it produces, e.g. a per-atom vector.
When a quantity is accessed, as in many of the output commands discussed below, it can be referenced via the following bracket notation, where ID in this case is the ID of a compute. The leading “c_” would be replaced by “f_” for a fix, or “v_” for a variable:
| c_ID | entire scalar, vector, or array |
| c_ID[I] | one element of vector, one column of array |
| c_ID[I][J] | one element of array |
言い換えると、1つの括弧を使用する と、データの次元を1つ減らすことができます(ベクトル - >スカラー、配列 - >ベクトル)。 2つの角括弧を使用すると、次元が2つ減少します(配列 - >スカラー)。 したがって、入力としてスカラー値を使用するコマンドは、通常、ベクトルまたは配列の要素も処理できます。
In other words, using one bracket reduces the dimension of the data once (vector -> scalar, array -> vector). Using two brackets reduces the dimension twice (array -> scalar). Thus a command that uses scalar values as input can typically also process elements of a vector or array.
8.8.3. Thermodynamic output¶
熱力学的出力の周波数とフォーマット
は、thermo、thermo_style、およびthermo_modifyコマンドで設定します。
thermo_styleコマンドは、計算して書き出す値を指定します。あらかじめ定義されたキーワードを指定する
ことができます(例:press、etotalなど)。さらに3種類のキーワード(c_ID、f_ID、
v_name)を指定することもできます。ここで、computeまたはfixまたは変数は出力する値を提供します。いずれの場
合も、compute、fix、または変数は、thermo_style
customコマンドへの入力用にグローバル値 を生成する必要があります。
熱力学的出力値は、「extensive」または「intensive」であり得ることに留意されたい。前者は、シ
ステム内のatomの数 (例えば、総エネルギー)でスケールされており、後者は、(例えば、温度)そうではない。
thermo_modify normの設定は、extensiveな量を正規化するかどうかを決定します。
computeとfixは、extensiveまたはintensiveな値を生成します。詳細については個々のド
キュメントを参照してください。equal-style
variableはintensiveな値のみを生成します。必要に応じて数式に
「natoms」という除算を含めて、extensiveな計算によってintensiveな結果が得られるようにすることができます。
The frequency and format of thermodynamic output is set by the thermo, thermo_style, and thermo_modify commands. The thermo_style command also specifies what values are calculated and written out. Pre-defined keywords can be specified (e.g. press, etotal, etc). Three additional kinds of keywords can also be specified (c_ID, f_ID, v_name), where a compute or fix or variable provides the value to be output. In each case, the compute, fix, or variable must generate global values for input to the thermo_style custom command.
Note that thermodynamic output values can be “extensive” or “intensive”. The former scale with the number of atoms in the system (e.g. total energy), the latter do not (e.g. temperature). The setting for thermo_modify norm determines whether extensive quantities are normalized or not. Computes and fixes produce either extensive or intensive values; see their individual doc pages for details. Equal-style variables produce only intensive values; you can include a division by “natoms” in the formula if desired, to make an extensive calculation produce an intensive result.
8.8.4. Dump file output¶
ダンプファイルの出力は、dump
およびdump_modifyコマンドによって指定されます。
あらかじめ定義されたフォーマットがいくつかあります(dump atom、dump xtcなど)。
ユーザーが各atomに出力する値を指定するdump custom形式もあります。
あらかじめ定義されたatom属性を指定できます(id、x、fxなど)。
さらに3種類のキーワード(c_ID、f_ID、v_name)を指定することもできます。ここで、computeまたはfixまたは変数は出力する値を提供します。
いずれの場合も、compute、fix、または変数は、dump custom
コマンドへの入力のためにatomごとの値 を生成する必要があります。
ユーザが出力するローカル値を指定するダdump local形式もあります。
ローカル値を列挙するために、あらかじめ定義されたindexキーワードを指定することができます。
2つの追加の種類のキーワード(c_ID、f_ID)を指定することもできます。ここでは、computeまたはfixまたは変数が出力する値を提供します。
いずれの場合も、computeまたはfixは、dump
localコマンドへの入力のためにローカル値を生成する必要があります。
Dump file output is specified by the dump and dump_modify commands. There are several pre-defined formats (dump atom, dump xtc, etc).
There is also a dump custom format where the user specifies what values are output with each atom. Pre-defined atom attributes can be specified (id, x, fx, etc). Three additional kinds of keywords can also be specified (c_ID, f_ID, v_name), where a compute or fix or variable provides the values to be output. In each case, the compute, fix, or variable must generate per-atom values for input to the dump custom command.
There is also a dump local format where the user specifies what local values to output. A pre-defined index keyword can be specified to enumuerate the local values. Two additional kinds of keywords can also be specified (c_ID, f_ID), where a compute or fix or variable provides the values to be output. In each case, the compute or fix must generate local values for input to the dump local command.
8.8.5. Fixes that write output files¶
いくつかのfixは入力としてさまざ
まな量を取り、出力ファイルを書き込むことができます:fix ave / time、fix ave /
spatial、fix ave / histo、fix ave / correlate、fix print。
fix / ave /
timeコマンドを使用すると、ファイルに直接出力したり、グローバルスカラまたはベクトルを時間平均したりすることができます。ユーザは、1つまたは複数の量を入力とし
て指定します。これらは、グローバルcompute値、グローバルfix値、またはatomごとの値を生成する
atomスタイ ルを除く 任意のスタイルの変数です。変数はthermo_style
customコマンド(tempやpressなど)と個々のatomごとの値によって使用されるキーワードを参照できるため、多種多様な量をこのように時間平均化および/
また は出
力することができます。入力が1つ以上のスカラー値である場合、fixはグローバルスカラーまたはベクト
ルの出力を生成します。入力が1つ以上のベクトル値である場合、fixプログラムはグローバルベクトルまたは配列の出力を生成
します。このfixの時間平均出力は、他の出力コマンドへの入力として使用することもできます。
fix ave /
spatialコマンドを使用すると、シミュレーションボックスの1dレイヤ内で、ダンプファイルで出力されるような、空間平均のatomごとの量をファイルに直接出力で
き ま
す。atomごとの量は、atom密度(質量または数)またはatomの属性(位置、速度、力など)であってもよい。また、computeでも、fixでも、atom-
style variableで計算された、atomごとの量で
も構いません。このfixの空間平均出 力は、 他の出力コマンドへの入力として使用することもできます。
fix ave /
histoコマンドを使用すると、ヒストグラム量のファイルに直接出力することができます。この量は、グローバル、atomごとまたはローカルの量であってもよい。こ
のfixのヒストグラム出力は、他の出力コマンドへの入力として使用することもできます。
fix ave / correlateコマンドを使用すると、時間相関のある、グローバルスカラーになる可能性がある、
量をファイルに直接出力することができます。このfixの相関
行列出力は、他の出力コマンドへの入力としても使用できます。
fix
printコマンドは、実行中のシミュレーション中に定期的に画面、ログファイルまたは別のファイルに書き込む、1出力行を生成することができます。この行には、atom
ス
タイル以外の変数スタイルの変数値を1つ以上含めることができます。上で説明したように、変数自体には、熱力学的
キーワード、compute、fix、または他の変数、または特定のatomのatomごとの値、によって生成され
るグローバル 値への参照を含めることができます。このように、fix
printコマンドは、通常の熱力学的出力またはダンプファイル出力とは別のさまざまな量を出力する手段です。
Several fixes take various quantities as input and can write output files: fix ave/time, fix ave/spatial, fix ave/histo, fix ave/correlate, and fix print.
The fix ave/time command enables direct output to a file and/or time-averaging of global scalars or vectors. The user specifies one or more quantities as input. These can be global compute values, global fix values, or variables of any style except the atom style which produces per-atom values. Since a variable can refer to keywords used by the thermo_style custom command (like temp or press) and individual per-atom values, a wide variety of quantities can be time averaged and/or output in this way. If the inputs are one or more scalar values, then the fix generate a global scalar or vector of output. If the inputs are one or more vector values, then the fix generates a global vector or array of output. The time-averaged output of this fix can also be used as input to other output commands.
The fix ave/spatial command enables direct output to a file of spatial-averaged per-atom quantities like those output in dump files, within 1d layers of the simulation box. The per-atom quantities can be atom density (mass or number) or atom attributes such as position, velocity, force. They can also be per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The spatial-averaged output of this fix can also be used as input to other output commands.
The fix ave/histo command enables direct output to a file of histogrammed quantities, which can be global or per-atom or local quantities. The histogram output of this fix can also be used as input to other output commands.
The fix ave/correlate command enables direct output to a file of time-correlated quantities, which can be global scalars. The correlation matrix output of this fix can also be used as input to other output commands.
The fix print command can generate a line of output written to the screen and log file or to a separate file, periodically during a running simulation. The line can contain one or more variable values for any style variable except the atom style). As explained above, variables themselves can contain references to global values generated by thermodynamic keywords, computes, fixes, or other variables, or to per-atom values for a specific atom. Thus the fix print command is a means to output a wide variety of quantities separate from normal thermodynamic or dump file output.
8.8.6. Computes that process output quantities¶
compute
reduceおよびcompute reduce /
regionコマンドは、1つまたは複数のatomごと、ローカルベクトル、を入力として受け取り、それらをスカラ量に減らします(sum、min、
max、ave)」。これらは、他の出力コマンドへの入力として使用できる出力値として生成されます。
compute
sliceコマンドは、1つ以上のグローバルベクトルまたは配列の量を入力として取り、それらの値のサブセットを抽出して新しいベクトルまたは配列を作成します。これら
は、他の出力コマンドへの入力として使用できる出力値として生成されます。
compute property /
atomコマンドは、あらかじめ定義された1つ以上のatom属性(id、x、fxなど)のリストを取得し、値をatomごとのベクトルまたは配列に格納します。これら
は、他の出力コマンドへの入力として使用できる出力値として生成されます。 atom属性のリストは、dump
customコマンドと同じです。
compute property /
localコマンドは、1つまたは複数のあらかじめ定義されたローカル属性(ボンド情報、角度情報など)のリストを取得し、値をローカルベクトルまたは配列に格納します。
これら は、他の出力コマンドへの入力として使用できる出力値として生成されます。
compute atom /
moleculeコマンドは、1つまたは複数のatomごとの量のリスト(compute、fix、atomごとの変数からの)を取得し、その量を分子ごとに合計します。
グローバルベ クトルまたは配列を出力値として生成し、他の出力コマンドへの入力として使用できます。
The compute reduce and compute reduce/region commands take one or more per-atom or local vector quantities as inputs and “reduce” them (sum, min, max, ave) to scalar quantities. These are produced as output values which can be used as input to other output commands.
The compute slice command take one or more global vector or array quantities as inputs and extracts a subset of their values to create a new vector or array. These are produced as output values which can be used as input to other output commands.
The compute property/atom command takes a list of one or more pre-defined atom attributes (id, x, fx, etc) and stores the values in a per-atom vector or array. These are produced as output values which can be used as input to other output commands. The list of atom attributes is the same as for the dump custom command.
The compute property/local command takes a list of one or more pre-defined local attributes (bond info, angle info, etc) and stores the values in a local vector or array. These are produced as output values which can be used as input to other output commands.
The compute atom/molecule command takes a list of one or more per-atom quantities (from a compute, fix, per-atom variable) and sums the quantities on a per-molecule basis. It produces a global vector or array as output values which can be used as input to other output commands.
8.8.7. Fixes that process output quantities¶
fix ave / atomコマンドは、atomごとのベクトルの時間平均を実行します。 atomごとの量は、位置、速度、力などのatom属性であってもよい。 また、computeで計算されたatomごとの量でもよいし、fixでも、atom-syle variableでもよい。 このfixの時間平均化されたatomごとの出力は、他の出力コマンドへの入力として使用できます。
fix store / stateコマンドは、特定の時刻に1つ以上のatomごとの属性をアーカイブすることができるので、古い値を将来の計算または出力で使用することができます。 atom属性のリストは、dump customコマンドと同く。compute、 fix、またはatom-style variableによって計算された、atomごとの量を 含みます。 このfixの出力は、他の出力コマンドへの入力として使用できます。
The fix ave/atom command performs time-averaging of per-atom vectors. The per-atom quantities can be atom attributes such as position, velocity, force. They can also be per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The time-averaged per-atom output of this fix can be used as input to other output commands.
The fix store/state command can archive one or more per-atom attributes at a particular time, so that the old values can be used in a future calculation or output. The list of atom attributes is the same as for the dump custom command, including per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The output of this fix can be used as input to other output commands.
8.8.8. Computes that generate values to output¶
LIGGGHTS(R)- PUBLIC内のすべてのcomputeは、グローバルまたはatomごとまたはローカルの値を生成します。 値は、スカラ、ベクトルまたはデータの配列です。 これらの値は、このセクションで説明する他のコマンドを使用して出力できます。 各computeコマンドのdocページには、なにを生成するか?が記述されています。 atomまたはローカルの値を生成する計算では、スタイル名に "atom"または "local"という単語があります。 "atom"または "local"という単語がない場合は、グローバル値が生成されます。
Every compute in LIGGGHTS(R)-PUBLIC produces either global or per-atom or local values. The values can be scalars or vectors or arrays of data. These values can be output using the other commands described in this section. The doc page for each compute command describes what it produces. Computes that produce per-atom or local values have the word “atom” or “local” in their style name. Computes without the word “atom” or “local” produce global values.
8.8.9. Fixes that generate values to output¶
LIGGGHTS(R)- PUBLICのいくつかのfixは、他のコマンドでアクセスできるグローバル、atomごと、またはローカルの値を生成 します。 値は、スカラ、ベクトルまたはデータの配列です。 これらの値は、このセクションで説明する他のコマンドを使用して出力できます。 各fixコマンドのdocページには、出力量が生成されて記述されているかどうかが示されます。
Some fixes in LIGGGHTS(R)-PUBLIC produces either global or per-atom or local values which can be accessed by other commands. The values can be scalars or vectors or arrays of data. These values can be output using the other commands described in this section. The doc page for each fix command tells whether it produces any output quantities and describes them.
8.8.10. Variables that generate values to output¶
入力スクリプトで定義されたすべての 変数は、アクセス時にグローバルスカラー値またはatomごとのベクトル(atom-style variableのみ)のいずれかを生成し ます。 equal-style、atom-style variableを定義するために使用される式には、熱力学的キーワードへの参照、compute、fix、およびその他の変数によって生成されるグローバルおよび atom単位のデータへの参照、を含めることができます。 変数によって生成される値は、この節で説明する他のコマンドを使用して出力できます。
Every variables defined in an input script generates either a global scalar value or a per-atom vector (only atom-style variables) when it is accessed. The formulas used to define equal- and atom-style variables can contain references to the thermodynamic keywords and to global and per-atom data generated by computes, fixes, and other variables. The values generated by variables can be output using the other commands described in this section.
8.8.11. Summary table of output options and data flow between commands¶
この表には、
LIGGGHTS(R)-PUBLICからの出力を生成するために使用できるさまざまなコマンドがまとめられていま
す。 各コマンドは、何らかの種類の出力データを生成し、および/またはデータをファイルに書き込む。
ほとんどのコマンドは、他のコマンドからのデータを入力として受け取ることができます。
したがって、これらのコマンドの多くをパイプライン形式でリンクすることができます。パイプライン形式では、あるコマンドで生成されたデータが別のコマンドへの入力として
使用され、最終的に画面またはファイルに書き込まれます。
2つのコマンドを一緒にフックするには、出力データ型と入力データ型が一致する必要があります(グローバル/atomごと/ローカルデータ、スカラ/ベクトル/配列データ
な ど)。
また、上で説明したように、コマンドがスカラーを入力として受け取るとき、それはベクトルまたは配列の要素である可
能性があることにも注意してください。 同様に、ベクトル入力は配列の列でもよい。
This table summarizes the various commands that can be used for generating output from LIGGGHTS(R)-PUBLIC. Each command produces output data of some kind and/or writes data to a file. Most of the commands can take data from other commands as input. Thus you can link many of these commands together in pipeline form, where data produced by one command is used as input to another command and eventually written to the screen or to a file. Note that to hook two commands together the output and input data types must match, e.g. global/per-atom/local data and scalar/vector/array data.
Also note that, as described above, when a command takes a scalar as input, that could be an element of a vector or array. Likewise a vector input could be a column of an array.
| Command | Input | Output | |
| thermo_style custom | global scalars | screen, log file | |
| dump custom | per-atom vectors | dump file | |
| dump local | local vectors | dump file | |
| fix print | global scalar from variable | screen, file | |
| global scalar from variable | screen | ||
| computes | N/A | global/per-atom/local scalar/vector/array | |
| fixes | N/A | global/per-atom/local scalar/vector/array | |
| variables | global scalars, per-atom vectors | global scalar, per-atom vector | |
| compute reduce | per-atom/local vectors | global scalar/vector | |
| compute slice | global vectors/arrays | global vector/array | |
| compute property/atom | per-atom vectors | per-atom vector/array | |
| compute property/local | local vectors | local vector/array | |
| compute atom/molecule | per-atom vectors | global vector/array | |
| fix ave/atom | per-atom vectors | per-atom vector/array | |
| fix ave/time | global scalars/vectors | global scalar/vector/array, file | |
| fix ave/spatial | per-atom vectors | global array, file | |
| fix ave/histo | global/per-atom/local scalars and vectors | global array, file | |
| fix ave/correlate | global scalars | global array, file | |
| fix store/state | per-atom vectors | per-atom vector/array | |
8.9. Walls¶
壁は、典型的には、粒子運動を束縛するた
めに、すなわち境界条件として働くために使用される。
granulaシミュレーションのためのLIGGGHTS(R)-PUBLICの壁は、一般的にはfix
wall/granを使用して定
義されます。このコマンドは、プリミティブとメッシュの2種類の壁を定義できます。メッシュ壁は、fix
mesh/surfaceまたは関連コマンドを使用して定義されます。
また、粒子からなる壁を構築することができます
粒子で造られたラフな壁は、さまざまな方法で作成できます。粒子自体は、latticeおよび
create_atomsコマンドを使用して他のパーティクルと同様に生成することも、read_dataコマンドで読
み込むこともできます。
それらの動きは、多くの異なるコマンドによって制約され、全く動かないか、一定の速度でグループとして一緒に動くか、ま
たは
それらに作用する正味の力に応答して、所定の方法で移動する(例えば、点の周りで回転するなど。)壁粒子を含むグループで、fix
nveのような時間統合fixを使用しない場合、その位置と速度は更新されません。
- fix aveforce - 粒子に平均的な力を設定して、一緒に移動するさせる
- fix setforce - 粒子の力を値に設定する。 例:0.0
- fix freeze - granular壁として使用し、固める。
- fix nve / noforce - 粒子をその速度で(力なしで)移流させる。
- fix move -
線形速度、振動、回転、変数による粒子の動きを規定する
fix
moveコマンドは、個々の粒子の動きを時間および/または粒子の位置に依存する可変式で指定することができるため、最も一般性が高い。
ラフな壁の場合、neigh_modify
excludeコマンドを使用して、壁粒子の間のペア相互作用オフにすると便利です。
ラフな壁は、移動せず、移動粒子と相互作用しない、したりすることなく凍
結粒子を指定したり、結合を介して他の粒子を固定粒子につなぎ合わ
せる凍結粒子によって作成することもできます。結合した粒子は他の移動粒子と相互作用できます。
- fix wall/reflect - 反射可能な平面壁
- fix wall/region
- 壁としてregionサーフェイスを使用する
regionサーフェスは壁として扱わ れ、 regionのジオメトリは単純なプリミティブボリューム(球体や立方体、平面など)やプリミティブボリュームの組合せと交差からなる複 雑なボリュームを作るうえで、fix wall / regionコマンドは最も一般的です 。 regionは、指定されたプリミティブ形状または組合せ、交差に対するボリューム「内部」または「外部」を指定することもできます。 regionは、一定速度、振動、または回転で移動することを意味する「動的」でもかまいません。
Walls are typically used to bound particle motion, i.e. to serve as a boundary condition.
Walls in LIGGGHTS(R)-PUBLIC for granular simulations are typically defined using fix wall/gran. This command can define two types of walls: primitive and mesh. Mesh walls are defined using a fix mesh/surface or related command.
Also. walls can be constructed made of particles
Rough walls, built of particles, can be created in various ways. The particles themselves can be generated like any other particle, via the lattice and create_atoms commands, or read in via the read_data command.
Their motion can be constrained by many different commands, so that they do not move at all, move together as a group at constant velocity or in response to a net force acting on them, move in a prescribed fashion (e.g. rotate around a point), etc. Note that if a time integration fix like fix nve is not used with the group that contains wall particles, their positions and velocities will not be updated.
- fix aveforce - set force on particles to average value, so they move together
- fix setforce - set force on particles to a value, e.g. 0.0
- fix freeze - freeze particles for use as granular walls
- fix nve/noforce - advect particles by their velocity, but without force
- fix move - prescribe motion of particles by a linear velocity, oscillation, rotation, variable
The fix move command offers the most generality, since the motion of individual particles can be specified with variable formula which depends on time and/or the particle position.
For rough walls, it may be useful to turn off pairwise interactions between wall particles via the neigh_modify exclude command.
Rough walls can also be created by specifying frozen particles that do not move and do not interact with mobile particles, and then tethering other particles to the fixed particles, via a bond. The bonded particles do interact with other mobile particles.
- fix wall/reflect - reflective flat walls
- fix wall/region - use region surface as wall
The fix wall/region command offers the most generality, since the region surface is treated as a wall, and the geometry of the region can be a simple primitive volume (e.g. a sphere, or cube, or plane), or a complex volume made from the union and intersection of primitive volumes. Regions can also specify a volume “interior” or “exterior” to the specified primitive shape or union or intersection. Regions can also be “dynamic” meaning they move with constant velocity, oscillate, or rotate.
8.10. Library interface to LIGGGHTS(R)-PUBLIC¶
Section_start
5で説明したように、LIGGGHTS(R)-PUBLICはライブラリとしてビルドすることができ、別のコードで呼び出すことも、他のコードと結合して使うことも、
Pythonインターフェイスを使って実行することもできます。
これらの方法はすべて、src / library.cppおよびsrc /
library.hファイルで提供されるLIGGGHTS(R)-PUBLICへのC言語スタイルのインターフェイスを使用します。
その中の関数はC言語スタイルの引数リストを持っており、C ++コードによってLIGGGHTS(R)-PUBLICを直接呼
び出すC ++アプリケーションを、あなた自身で書くことができます。 関数内のC
++コードは、内部LIGGGHTS(R)-PUBLIC操作を呼び出す方法を示しています。 別のC
++アプリケーションからLIGGGHTS(R)-PUBLICクラスを使用する場合、LIGGGHTS(R)-PUBLICクラスはLIGGGHTS(R)-
PUBLIC名前空間(LAMMPS_NS)内で定義されていることに注意してください。
Library.cppには、次の4つの関数が含まれます。
As described in Section_start 5, LIGGGHTS(R)-PUBLIC can be built as a library, so that it can be called by another code, used in a coupled manner with other codes, or driven through a Python interface.
All of these methodologies use a C-style interface to LIGGGHTS(R)-PUBLIC that is provided in the files src/library.cpp and src/library.h. The functions therein have a C-style argument list, but contain C++ code you could write yourself in a C++ application that was invoking LIGGGHTS(R)-PUBLIC directly. The C++ code in the functions illustrates how to invoke internal LIGGGHTS(R)-PUBLIC operations. Note that LIGGGHTS(R)-PUBLIC classes are defined within a LIGGGHTS(R)-PUBLIC namespace (LAMMPS_NS) if you use them from another C++ application.
Library.cpp contains these 4 functions:
void lammps_open(int, char **, MPI_Comm, void **);
void lammps_close(void *);
void lammps_file(void *, char *);
char *lammps_command(void *, char *);
lammps_open()関数は、
LIGGGHTS(R)-PUBLICを初期化するために使用され、LIGGGHTS(R)-PUBLICがコマンドラ
インからスタンドアロンモードで実行されているときに文字列のリストをコマンドライン引数として渡します。
LIGGGHTS(R)-PUBLICのMPIコミュニケータを実行します。これは、作成されたLIGGGHTS(R)-PUBLICオブジェクトにptrを返します。こ
れは、後続のライブラリ呼び出しで使用されます。
lammps_open()関数は、LIGGGHTS(R)-PUBLICの複数のインスタンスを作成するために複数回呼び出すことができます。
LIGGGHTS(R)-PUBLICは、コミュニケータのプロセッサセット上で動作します。これは、呼び出しコードが
LIGGGHTS(R)-PUBLICをすべてまたは一部のプロセッサーで実行できることを意味します。たとえば、
wrapperスクリプトは、LIGGGHTS(R)-PUBLICと別のコードを交互に使用して、両方のプロセッサー
で実行でき
るようにすることができます。または、プロセッサの半分をLIGGGHTS(R)-PUBLICに割り当て、他のコード
の半分を割り当てて、両方のコードを同時に実行してから定期的に同期させることもできます。あるいは、
LIGGGHTS(R)-PUBLICの複数のインスタンスをインスタンス化して、異なる計算を実行することもできま
す。
lammps_close()関数は、LIGGGHTS(R)-PUBLICのインスタンスをシャットダウンし、すべて
のメモリを解放するために使用されます。
lammps_file()およびlammps_command()関数は、ファイルまたは文字列を
LIGGGHTS(R)-PUBLICに入力スクリプトまたは入力スクリプトの単一コマンドであるかのように渡すために
使用されます。したがって、呼び出しコードは一連のLIGGGHTS(R)-PUBLICコマンドを一度に1行ずつ読み
込んだり生成したりすることができ、問題を設定して実行し、lammps_command()呼び出しを他の呼び出しで
インターリーブして抽出しますLIGGGHTS(R)-PUBLICの情報を取得したり、独自の操作を実行したり、別の
コードのライブラリを呼び出すことができます。
他の便利な関数もlibrary.cppに含まれています。例えば:
The lammps_open() function is used to initialize LIGGGHTS(R)-PUBLIC, passing in a list of strings as if they were command-line arguments when LIGGGHTS(R)-PUBLIC is run in stand-alone mode from the command line, and a MPI communicator for LIGGGHTS(R)-PUBLIC to run under. It returns a ptr to the LIGGGHTS(R)-PUBLIC object that is created, and which is used in subsequent library calls. The lammps_open() function can be called multiple times, to create multiple instances of LIGGGHTS(R)-PUBLIC.
LIGGGHTS(R)-PUBLIC will run on the set of processors in the communicator. This means the calling code can run LIGGGHTS(R)-PUBLIC on all or a subset of processors. For example, a wrapper script might decide to alternate between LIGGGHTS(R)-PUBLIC and another code, allowing them both to run on all the processors. Or it might allocate half the processors to LIGGGHTS(R)-PUBLIC and half to the other code and run both codes simultaneously before syncing them up periodically. Or it might instantiate multiple instances of LIGGGHTS(R)-PUBLIC to perform different calculations.
The lammps_close() function is used to shut down an instance of LIGGGHTS(R)-PUBLIC and free all its memory.
The lammps_file() and lammps_command() functions are used to pass a file or string to LIGGGHTS(R)-PUBLIC as if it were an input script or single command in an input script. Thus the calling code can read or generate a series of LIGGGHTS(R)-PUBLIC commands one line at a time and pass it thru the library interface to setup a problem and then run it, interleaving the lammps_command() calls with other calls to extract information from LIGGGHTS(R)-PUBLIC, perform its own operations, or call another code’s library.
Other useful functions are also included in library.cpp. For example:
void *lammps_extract_global(void *, char *)
void *lammps_extract_atom(void *, char *)
void *lammps_extract_compute(void *, char *, int, int)
void *lammps_extract_fix(void *, char *, int, int, int, int)
void *lammps_extract_variable(void *, char *, char *)
int lammps_get_natoms(void *)
void lammps_get_coords(void *, double *)
void lammps_put_coords(void *, double *)
これらは、LIGGGHTS(R)- PUBLICからcompute、fix、または変数によって計算された値だけでなく、さまざまなグローバルまたはatomごとの量 を抽出することができます。 「get」および「put」操作は、atom座標を取得してリセットすることができます。 詳細については、library.cppファイルおよび関連するヘッダーファイルlibrary.hを参照してくださ い。
ライブラリインタフェースの重要なアイデ アは、あなたのコードがLIGGGHTS(R)-PUBLICにどのように伝えているかを定義し、それらをsrc / library.cppとsrc / library.hに追加する機能を書くことができ、 Pythonインタフェースにも適用されることができます。 追加したルーチンは、必要なLIGGGHTS(R)-PUBLICデータにアクセスしたり変更したりすることができます。 examples/ COUPLEとpythonディレクトリには、ドライバコードがどのようにライブラリとしてLIGGGHTS(R)-PUBLICにリンクし、LIGGGHTS(R)- PUBLICをプロセッサのサブセットで実行できるかを示すC ++とCとPythonコードの例があります。LIGGGHTS(R)-PUBLICのデータを取得して変更し、LIGGGHTS(R)-PUBLICに戻します。
These can extract various global or per-atom quantities from LIGGGHTS(R)-PUBLIC as well as values calculated by a compute, fix, or variable. The “get” and “put” operations can retrieve and reset atom coordinates. See the library.cpp file and its associated header file library.h for details.
The key idea of the library interface is that you can write any functions you wish to define how your code talks to LIGGGHTS(R)-PUBLIC and add them to src/library.cpp and src/library.h, as well as to the Python interface. The routines you add can access or change any LIGGGHTS(R)-PUBLIC data you wish. The examples/COUPLE and python directories have example C++ and C and Python codes which show how a driver code can link to LIGGGHTS(R)-PUBLIC as a library, run LIGGGHTS(R)-PUBLIC on a subset of processors, grab data from LIGGGHTS(R)-PUBLIC, change it, and put it back into LIGGGHTS(R)-PUBLIC.
(Berendsen) Berendsen, Grigera, Straatsma, J Phys Chem, 91, 6269-6271 (1987).
(Cornell) Cornell, Cieplak, Bayly, Gould, Merz, Ferguson, Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
(Horn) Horn, Swope, Pitera, Madura, Dick, Hura, and Head-Gordon, J Chem Phys, 120, 9665 (2004).
(Ikeshoji) Ikeshoji and Hafskjold, Molecular Physics, 81, 251-261 (1994).
(MacKerell) MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field, Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
(Mayo) Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909 (1990).
(Jorgensen) Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem Phys, 79, 926 (1983).
(Price) Price and Brooks, J Chem Phys, 121, 10096 (2004).
(Shinoda) Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).