git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6393 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2011-06-14 00:04:59 +00:00
parent 8c1e14ea64
commit dcb00910dc
8 changed files with 0 additions and 303 deletions

View File

@ -1,51 +0,0 @@
//This code was written by Philip Nicoletti
//http://www.codeguru.com/forum/archive/index.php/t-129990.html
//
//Modified by Jin Ma, Oklahoma State University for LAMMPS
//erfc() is defined in GNU libraries. This code is a simplified
//version for implementation with Visual C++.
//
//Warning: these functions are not fully tested.
//
#include "erfc.h"
#include "math.h"
double erf(double x)
{
//
// Computation of the error function erf(x).
//
return (1-erfc(x));
}
//
//
double erfc(double x)
{
//
// Computation of the complementary error function erfc(x).
//
// The algorithm is based on a Chebyshev fit as denoted in
// Numerical Recipes 2nd ed. on p. 214 (W.H.Press et al.).
//
// The fractional error is always less than 1.2e-7.
//
//
// The parameters of the Chebyshev fit
//
const double a1 = -1.26551223, a2 = 1.00002368,
a3 = 0.37409196, a4 = 0.09678418,
a5 = -0.18628806, a6 = 0.27886807,
a7 = -1.13520398, a8 = 1.48851587,
a9 = -0.82215223, a10 = 0.17087277;
//
double v = 1; // The return value
double z = fabs(x);
//
if (z == 0) return v; // erfc(0)=1
double t = 1/(1+0.5*z);
v = t*exp((-z*z) +a1+t*(a2+t*(a3+t*(a4+t*(a5+t*(a6+
t*(a7+t*(a8+t*(a9+t*a10)))))))));
if (x < 0) v = 2-v; // erfc(-x)=2-erfc(x)
return v;
}

View File

@ -1,5 +0,0 @@
//
double erf(double x);
double erfc(double x);

View File

@ -1,52 +0,0 @@
Compiling LAMMPS under MS Windows:
Tips from Jin Ma at Oklahoma State Univerisity
jin.ma@okstate.edu
November 20, 2004
compiled without MPI and FFT in Viusal C++ 6.0
-------------------
0. Create an empty workspace (Win32 console), add all .h and .cpp
files into the project.
1. At about 80 places in the code, variables are redefined. Most of
these variables are loop counters, which can be easily fixed.
Code looks like this:
for (int i=0; i<5; i++) {
something;
}
for (int i=0; i<5; i++) {
something else;
}
This is ok with g++ compiler. But VC thinks the i is redefined in the
second loop. So the variable scope is different. This happens many times
in the code. It can be fixed easily based on the compiling error.
2. At the beginning of fft3d.h, added:
#ifndef FFT_NONE
#define FFT_NONE
#endif
3. In input.cpp, changed the two header files
//#include "unistd.h"
#include "direct.h"
4. Added mpi.h and mpi.cpp (in STUBS folder) to the workspace
In mpi.cpp, commented the time.h header file
//#include <sys/time.h>
commented the original code in MPI_Wtime(), just make it return 0;
5. In system.cpp, two changes due to difference in the input argument
list
Line 82: int iarg = 2;
Line 171: inflag=1;
The number of input arguments (nargs) is different in g++ and VC when
you give arguments to run a program. This might be related to MPI as
well. The difference is one. Once the above changes are made, the
program is taking the correct argument.

View File

@ -1,126 +0,0 @@
This is instruction for the modification of LAMMPS for MS Windows
LAMMPS version: Feb 2007
compiled without MPI and FFT in Viusal C++ 6.0
(All packages except for XTC, MEAM appear to work.)
-------------------
1. Create an empty workspace (Win32 console), add all .h and .cpp
files into the project.
2. At about 80 places in the code, variables are redefined. Most of
these variables are loop counters, which can be easily fixed.
Code looks like this:
for (int i=0; i<5; i++) {
something;
}
for (int i=0; i<5; i++) {
something else;
}
This is ok with g++ compiler. But VC thinks the i is redefined in the
second loop. So the variable scope is different. This happens many times
in the code. It can be fixed easily based on the compiling error.
3. At the beginning of fft3d.h, added:
#ifndef FFT_NONE
#define FFT_NONE
#endif
4. In input.cpp, changed the two header files
//#include "unistd.h"
#include "direct.h"
4A. (added by Tim Lau, MIT, ttl@mit.edu)
In variable.cpp, change the header files
//#include "unistd.h"
#include "sleep.h"
Add in the included sleep.h and sleep.cpp files.
4B. (added by Tim Lau, MIT, ttl@mit.edu)
In shell.cpp, change the header file:
//#include "unistd.h"
#include "direct.h"
Change the line in shell.cpp:
mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);
to:
mkdir(arg[i]);
since Windows obviously does not use UNIX file permissions.
It's also possible that the line has to be changed to:
_mkdir(arg[i]);
depending on the version of the Visual C++ compiler used.
5. Added mpi.h and mpi.cpp (in STUBS folder) to the workspace
In mpi.cpp, commented the time.h header file
//#include <sys/time.h>
commented the original code in MPI_Wtime(), just make it return 0;
6. In system.cpp, two changes due to difference in the input argument
list
Line 83: int iarg = 2;
Line 172: inflag=1; //add this line
The number of input arguments (nargs) is different in g++ and VC when
you give arguments to run a program. This might be related to MPI as
well. The difference is one. Once the above changes are made, the
program is taking the correct argument.
However, it has been observed in the latest versions of sytem.cpp that
no modification needs be made to the file as distributed from the
LAMMPS website to work. The user however, instead of starting LAMMPS
by the command:
lammps in.file
as he would if he implemented the changes detailed here, would launch
in the Unix style:
lammps < in.file
7. The new version LAMMPS calls the error function:
double erfc(double)
This function is in the GNU C library. However, it's not found for
VC++.
Three options:
a. One can try to find erfc() from other libraries.
b. The erfc() is called for pair_modify table option. One can set
the table option to be 0 to avoid calling this function.
c. Write your own functions.
In this code, two files erfc.h, erfc.cpp are created and added to the project.
Files that call erfc() all add
#include "erfc.h" at the beginning.
Note: the functions are not fully tested, use with caution.
8. MSVC does not have a inttypes.h file. The simplest way
to deal with this problem is to download inttypes.h from the
following site:
http://www.koders.com/c/fidDE7D6EFFD475FAB1B7F6A2BBA791401CFA88FFA3.aspx
and add this file into the workspace.
9. MSVC does not have dirent.h. The problem is solved by downloading
a version of it for Windows from the following website:
http://www.softagalleria.net/dirent/index.en.html
10. Every time an error pops up for a line like this:
char *words[params_per_line];
replace to the following type:
char **words = new char*[params_per_line];
The dynamic memory allocation in MSVC requires a line like this.
11. Build the project. Specify appropriate input file to run the code.
The Windows result might be different from Unix results. Be Cautious.

View File

@ -1,33 +0,0 @@
Using MPI and FFTW with LAMMPS under Windows
from Timothy Lau <ttl@MIT.EDU>
(the referenced step #'s refer to the notes.2 document)
-------
If the user would like to use FFT with LAMMPS, he can download the source code
for FFTW 2.1.5 and dump all the files into the same directory as LAMMPS. Then
he can add to the project all the .c and .h files of FFTW as though those were
LAMMPS files. Instead of following step 3 of the instructions, however, the
following should be added to fft3d.h:
#ifndef FFT_FFTW
#define FFT_FFTW
#endif
The user must take care to check for a Visual Studio compile that the "WIN32"
variable is defined although it is likely that Visual Studio would
automatically define this. Refer to line 137 of fftw.h that comes with FFTW
2.1.5.
If the user would like to use MPI with his Microsoft Visual Studio compile for
use on a multicore processor or for use on a Windows cluster, it has been
observed that MPICH 2 (at least the IA32 version) is known to compile with
LAMMPS in Visual Studio. Instead of following step 5 of the instructions, the
user could add the MPICH2\include as an additional include directory for MSVS
to find "mpi.h" and also add the MPICH2\lib as an additional link directory. He
should add mpi.lib to be specifically linked to.
-------
To compile LAMMPS with MPI-2 (e.g. MPICH 2) on Windows, you need
to use the MPICH_IGNORE_CXX_SEEK preprocessor definition.

View File

@ -1,25 +0,0 @@
Compiling LAMMPS under MS Windows:
Tips from Jamie Sanchez
jamiesanchezuk@gmail.com
24 Oct 2008
-------------------
1. add the line #include "erfc.h" in the following files:
pair_coul_long.cpp
pair_lj_charmm_coul_long.cpp
pair_lj_cut_coul_long.cpp
2. disable dump DCD in style.h
I'm using Visual Studio 2008 in a Win XP and if I don't disable this
option the code does not compile.
3. in read_restart.cpp comment line
#include "dirent.h"
then comment lines 323 to 340
I'm not using read_restart in Windows runs so even though this allows
the code to compile successfully I don't necessarily know what this
will do if you use this command in windows

View File

@ -1,10 +0,0 @@
#include "sleep.h"
#include "windows.h"
void usleep (int x)
{
int y = x;
y = x/1000;
Sleep(y);
}

View File

@ -1 +0,0 @@
void usleep(int x);