Archive for the ‘Modeling & Simulation’ Category.
October 27, 2009, 3:33 pm

Pizza.py is a post-processing tool package for lammps – a MD package. I downloaded it and unpacked in a local directory. Each time I have to start it with a command like “python -f abs_path/pizza.py” where the abs_path is the absolute path to pizza.py source directory. However this directory is very long on my computer and it’s not a directory recognized by python. I found a convenient way to make the call easier. Just add the abs_path to a system environment variable named “PYTHONPATH” (if you have no such env variable, create it), then to use pizza.py we can start python as usual by typing “python” and then type in “import pizza” (no .py suffix!), then we have all the module defined in pizza at the interactive command line no matter what is your current working directory. PYTHONPATH will be add to the search path for modules if it’s not empty. I also add the abs_path to the PATH system environment variable, which makes I could type “pizza.py -f ***.py” directly in any working directory.
Use PYTHONPATH environment variable to install a python
module without the need of root privilege. For example,
set
PYTHONPATH=/path/to/my/lib/python2.2/site-packages/
and when installing a third party Python module, use
python setup.py install --prefix=/path/to/my
Continue reading ‘Python and pizza.py’ »
October 18, 2009, 8:07 pm
Lammps is a powerful multi-purpose simulation software. To run a simulation with lammps, one needs to prepare an input script file in which commands are issued to control the work flow. There are MANY commands and lots of keywords supported by lammps. I found it’s good if there is a text editor capable of highlighting the keywords and keyword auto-completion. Notepad++ is one of the best free text editor. To add support of highlighting and auto-completion is pretty easy in Notepad++ cause it has a user-friendly interface (a dialog) to allow user to define new keywords, symbols, comments, operators for a new language. I just made the support for lammps commands. Continue reading ‘Keywords highlight and auto-completion for lammps input file in Notepad++’ »
September 1, 2009, 11:46 am
June 3, 2008, 6:17 pm
To compile Lammps, we needs fftw 2.x library. The latest is fftw 3.x which is not compatible. Go here and download fftw2.
If you don’t have root privilege on the server, meaning you cannot install the library to the default system path (/usr/lib,/usr/include), you have to specify a prefix before making the library. Simply do this in the source directory, “./configure –prefix=/your_parth/fftw2″. Then “make” and “make check”, “make install”. These commands compile and install fftw library under the path you give.
Continue reading ‘Notes on compiling lammps on linux’ »
May 26, 2008, 9:57 pm
The first time I compile a true Fortran program;) On my Debian pc, I installed gfortran and downloaded a copy of the famous DL_POLY. Maybe I was blind, I did find an instruction on how I should compile it. Compared to the previous version, version 2.19 has a different directory organization. Istead of ‘source’ I found the ‘srcmod’ should be the place hiding the treasure. You have to copy the make files from the build folder to this folder. Then, a problem which made me waste some time on was I have to rename the MakeSEQ or MakePAR to ‘makefile’. Believe or not I tried different name but with ‘make -f othername’, I failed with an error “no target seq”. Normally it should be not a problem if I specify a makefile name explicitly other than ‘makefile’. I don’t understand this. After this, I had no any trouble with the compilation.
DL_POLY is good, more physics sound than some other competitors. However, it seems not as ‘open’ as others. You have to register before you could get the code, although it’s for free. And it’s in Fortran which is not my favorite. Anyway I’d like to have a taste of it. Only after that you can know which is the best or fits my needs.
Continue reading ‘Compile DL_POLY’ »
May 20, 2008, 5:03 pm
Instead of using MS java virtual machine, you could install Sun java virtual machine. However, you can easily get error to prevent you displaying java applets in IE. (see http://www.java.com/en/download/help/6000060700.xml)
I followed above workarounds one by one. Finally after disabling the Google notebook browser extension, I get it work.
April 21, 2008, 4:13 pm
The default shell on most Linux operating system is called Bash. There are a couple of important hotkeys that you should get familiar with if you plan to spend a lot of time at the command line. These shortcuts will save you a ton of time if you learn them.
Here is the List of Bash Shell Keyboard shortcuts For Linux Users Continue reading ‘’ »
March 18, 2008, 8:40 pm
Pygsl is a Python wrapper for GNU scientific library. Because of the advantages of Python, I want to install it on my Windows PC. However, I met lots of trouble to make it installed. The official download should be fine when it is used on Linux. But I guess those Lunix fans ignore the pain of a Win user may have;)
First I downloaded the Win32 version of gsl from http://gnuwin32.sourceforge.net/packages/gsl.htm, because there is only source available on gnu official site. This precompiled gsl includes some *.a libs. I supposed they should work with pygsl if I use MinGW compiler. But it was wrong! The problem was gslwin32 (version 1.8 at that time) did not new enough to include all the functions implemented in pygsl (ver 0.9.1). I could not compile pygsl by “setyp.py build -c mingw32″. “undefined reference” was reported by the MinGW compiler.
Continue reading ‘Compile and install Pygsl on Windos XP’ »
August 14, 2007, 10:20 pm
This is a coarse-grained molecular model of
polymer brush, which is what I’m interested in now. This kind of
molecules has many potential applications and many interesting
properties on both macro- and micro scale.
The snapshot is rendered in a self-developed molecular modeling
software ‘Virtual Material’. (Written in VC + OpenGL) It’s not as good
as VMD yet, but very handy for my work.
Continue reading ‘A snapshot of Polymer brush’ »