forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3661 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
62bfbe53fa
commit
05f1a5f7d2
|
@ -40,9 +40,8 @@ class requires 2 files, a source code file (*.cpp) and a header file
|
|||
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.
|
||||
to invoke the new class is as simple as putting the two source
|
||||
files in the src dir and re-building LAMMPS.
|
||||
</P>
|
||||
<P>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
|
||||
|
@ -57,25 +56,17 @@ command like
|
|||
</P>
|
||||
<PRE>pair_style foo 0.1 3.5
|
||||
</PRE>
|
||||
<P>you put your 2 files in the LAMMPS src directory, add 2 lines to the
|
||||
style_user.h file, and re-make the code.
|
||||
<P>then these lines should appear at the top of your pair_foo.h file:
|
||||
</P>
|
||||
<P>The first line added to style_user.h would be
|
||||
</P>
|
||||
<PRE>PairStyle(foo,PairFoo)
|
||||
<PRE>#ifdef PAIR_CLASS
|
||||
PairStyle(foo,PairFoo)
|
||||
#else
|
||||
</PRE>
|
||||
<P>in the #ifdef PairClass section, where "foo" is the style keyword in
|
||||
the pair_style command, and PairFoo is the class name in your C++
|
||||
<P>where "foo" is the style keyword in the pair_style command, and
|
||||
PairFoo is the class name defined in your pair_foo.cpp and pair_foo.h
|
||||
files.
|
||||
</P>
|
||||
<P>The 2nd line added to style_user.h would be
|
||||
</P>
|
||||
<PRE>#include "pair_foo.h"
|
||||
</PRE>
|
||||
<P>in the #ifdef PairInclude section, where pair_foo.h is the name of
|
||||
your new include file.
|
||||
</P>
|
||||
<P>When you re-make LAMMPS, your new pairwise potential becomes part of
|
||||
<P>When you re-build LAMMPS, your new pairwise potential becomes part of
|
||||
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.
|
||||
|
@ -576,15 +567,14 @@ consideration. Following these steps will save time for both you and
|
|||
us. See existing package files for examples.
|
||||
</P>
|
||||
<P>Your user package will be a directory with a name like USER-FOO. In
|
||||
addition to your new files, the directory should contain a README,
|
||||
Install.csh and style_user_foo.h file. Send us a tarball of this
|
||||
USER-FOO directory.
|
||||
addition to your new files, the directory should contain a README, and
|
||||
Install.csh file. Send us a tarball of this USER-FOO directory.
|
||||
</P>
|
||||
<P>The README text file should contain your name and contact information
|
||||
and a brief description of what your new package does.
|
||||
</P>
|
||||
<P>The Install.csh and style_user_foo.h files enable LAMMPS to include
|
||||
and exclude your package.
|
||||
<P>The Install.csh file enables LAMMPS to include and exclude your
|
||||
package.
|
||||
</P>
|
||||
<P>Your new source files need to have the LAMMPS copyright, GPL notice,
|
||||
and your name at the top. They need to create a class that is inside
|
||||
|
|
|
@ -37,9 +37,8 @@ class requires 2 files, a source code file (*.cpp) and a header file
|
|||
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.
|
||||
to invoke the new class is as simple as putting the two source
|
||||
files in the src dir and re-building LAMMPS.
|
||||
|
||||
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
|
||||
|
@ -54,25 +53,17 @@ command like
|
|||
|
||||
pair_style foo 0.1 3.5 :pre
|
||||
|
||||
you put your 2 files in the LAMMPS src directory, add 2 lines to the
|
||||
style_user.h file, and re-make the code.
|
||||
then these lines should appear at the top of your pair_foo.h file:
|
||||
|
||||
The first line added to style_user.h would be
|
||||
#ifdef PAIR_CLASS
|
||||
PairStyle(foo,PairFoo)
|
||||
#else :pre
|
||||
|
||||
PairStyle(foo,PairFoo) :pre
|
||||
|
||||
in the #ifdef PairClass section, where "foo" is the style keyword in
|
||||
the pair_style command, and PairFoo is the class name in your C++
|
||||
where "foo" is the style keyword in the pair_style command, and
|
||||
PairFoo is the class name defined in your pair_foo.cpp and pair_foo.h
|
||||
files.
|
||||
|
||||
The 2nd line added to style_user.h would be
|
||||
|
||||
#include "pair_foo.h" :pre
|
||||
|
||||
in the #ifdef PairInclude section, where pair_foo.h is the name of
|
||||
your new include file.
|
||||
|
||||
When you re-make LAMMPS, your new pairwise potential becomes part of
|
||||
When you re-build LAMMPS, your new pairwise potential becomes part of
|
||||
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.
|
||||
|
@ -553,15 +544,14 @@ consideration. Following these steps will save time for both you and
|
|||
us. See existing package files for examples.
|
||||
|
||||
Your user package will be a directory with a name like USER-FOO. In
|
||||
addition to your new files, the directory should contain a README,
|
||||
Install.csh and style_user_foo.h file. Send us a tarball of this
|
||||
USER-FOO directory.
|
||||
addition to your new files, the directory should contain a README, and
|
||||
Install.csh file. Send us a tarball of this USER-FOO directory.
|
||||
|
||||
The README text file should contain your name and contact information
|
||||
and a brief description of what your new package does.
|
||||
|
||||
The Install.csh and style_user_foo.h files enable LAMMPS to include
|
||||
and exclude your package.
|
||||
The Install.csh file enables LAMMPS to include and exclude your
|
||||
package.
|
||||
|
||||
Your new source files need to have the LAMMPS copyright, GPL notice,
|
||||
and your name at the top. They need to create a class that is inside
|
||||
|
|
Loading…
Reference in New Issue