diff --git a/src/USER-MEAMC/Install.sh b/src/USER-MEAMC/Install.sh deleted file mode 100644 index 2b4098a473..0000000000 --- a/src/USER-MEAMC/Install.sh +++ /dev/null @@ -1,47 +0,0 @@ -# Install/unInstall package files in LAMMPS -# mode = 0/1/2 for uninstall/install/update - -# this is default Install.sh for all packages -# if package has an auxiliary library or a file with a dependency, -# then package dir has its own customized Install.sh - -mode=$1 - -# enforce using portable C locale -LC_ALL=C -export LC_ALL - -# arg1 = file, arg2 = file it depends on - -action () { - if (test $mode = 0) then - rm -f ../$1 - elif (! cmp -s $1 ../$1) then - if (test -z "$2" || test -e ../$2) then - cp $1 .. - if (test $mode = 2) then - echo " updating src/$1" - fi - fi - elif (test -n "$2") then - if (test ! -e ../$2) then - rm -f ../$1 - fi - fi -} - -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - - -# additional files - -for file in meam_*.c; do - test -f ${file} && action ${file} -done - -action fm_exp.c -action meam.h diff --git a/src/USER-MEAMC/fm_exp.c b/src/USER-MEAMC/fm_exp.cpp similarity index 99% rename from src/USER-MEAMC/fm_exp.c rename to src/USER-MEAMC/fm_exp.cpp index 00b957b27c..253af868f7 100644 --- a/src/USER-MEAMC/fm_exp.c +++ b/src/USER-MEAMC/fm_exp.cpp @@ -1,3 +1,4 @@ +extern "C" { /* Copyright (c) 2012,2013 Axel Kohlmeyer All rights reserved. @@ -131,3 +132,4 @@ double fm_exp(double x) * indent-tabs-mode: nil * End: */ +} diff --git a/src/USER-MEAMC/meam.h b/src/USER-MEAMC/meam.h index ab2c756dc3..c8e46903c5 100644 --- a/src/USER-MEAMC/meam.h +++ b/src/USER-MEAMC/meam.h @@ -91,7 +91,7 @@ typedef struct { double dr,rdrar; } meam_data_t; -meam_data_t meam_data; +extern meam_data_t meam_data; // Functions we need for compat #ifndef max diff --git a/src/USER-MEAMC/meam_cleanup.c b/src/USER-MEAMC/meam_cleanup.cpp similarity index 95% rename from src/USER-MEAMC/meam_cleanup.c rename to src/USER-MEAMC/meam_cleanup.cpp index 5c81fc3b49..1beedc9fa0 100644 --- a/src/USER-MEAMC/meam_cleanup.c +++ b/src/USER-MEAMC/meam_cleanup.cpp @@ -1,3 +1,4 @@ +extern "C" { #include "meam.h" void meam_cleanup_(void) { @@ -12,3 +13,4 @@ void meam_cleanup_(void) { deallocate(meam_data.phir); } +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_data.c b/src/USER-MEAMC/meam_data.c deleted file mode 100644 index 54ddf81b64..0000000000 --- a/src/USER-MEAMC/meam_data.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "meam.h" - -meam_data_t meam_data = {}; \ No newline at end of file diff --git a/src/USER-MEAMC/meam_data.cpp b/src/USER-MEAMC/meam_data.cpp new file mode 100644 index 0000000000..c5fd152147 --- /dev/null +++ b/src/USER-MEAMC/meam_data.cpp @@ -0,0 +1,5 @@ +extern "C" { +#include "meam.h" + +meam_data_t meam_data = {}; +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_dens_final.c b/src/USER-MEAMC/meam_dens_final.cpp similarity index 99% rename from src/USER-MEAMC/meam_dens_final.c rename to src/USER-MEAMC/meam_dens_final.cpp index 1e553866e4..bdcff4a7f6 100644 --- a/src/USER-MEAMC/meam_dens_final.c +++ b/src/USER-MEAMC/meam_dens_final.cpp @@ -1,3 +1,4 @@ +extern "C"{ #include "meam.h" #include @@ -260,3 +261,5 @@ } //ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_dens_init.c b/src/USER-MEAMC/meam_dens_init.cpp similarity index 99% rename from src/USER-MEAMC/meam_dens_init.c rename to src/USER-MEAMC/meam_dens_init.cpp index 8c1d84f6d4..8a17f4e7e5 100644 --- a/src/USER-MEAMC/meam_dens_init.c +++ b/src/USER-MEAMC/meam_dens_init.cpp @@ -1,3 +1,4 @@ +extern "C" { #include "meam.h" #include @@ -500,5 +501,4 @@ //ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_force.c b/src/USER-MEAMC/meam_force.cpp similarity index 99% rename from src/USER-MEAMC/meam_force.c rename to src/USER-MEAMC/meam_force.cpp index d27d8ca7eb..b10a766716 100644 --- a/src/USER-MEAMC/meam_force.c +++ b/src/USER-MEAMC/meam_force.cpp @@ -1,3 +1,4 @@ +extern "C"{ #include "meam.h" #include @@ -549,3 +550,5 @@ void dsij(int i,int j,int k,int jn,int nmax,int numneigh,double rij2,double *dsi } } + +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_setup_done.c b/src/USER-MEAMC/meam_setup_done.cpp similarity index 99% rename from src/USER-MEAMC/meam_setup_done.c rename to src/USER-MEAMC/meam_setup_done.cpp index e777025067..0d445f84bc 100644 --- a/src/USER-MEAMC/meam_setup_done.c +++ b/src/USER-MEAMC/meam_setup_done.cpp @@ -1,3 +1,4 @@ +extern "C" { #include "meam.h" #include @@ -943,3 +944,6 @@ void G_gam(double Gamma,int ibar,double gsmooth_factor, double *G, int *errorfla return result; } + + +} diff --git a/src/USER-MEAMC/meam_setup_global.c b/src/USER-MEAMC/meam_setup_global.cpp similarity index 99% rename from src/USER-MEAMC/meam_setup_global.c rename to src/USER-MEAMC/meam_setup_global.cpp index c8c4ef8468..5f6dfcb317 100644 --- a/src/USER-MEAMC/meam_setup_global.c +++ b/src/USER-MEAMC/meam_setup_global.cpp @@ -1,3 +1,4 @@ +extern "C" { #include "meam.h" #include @@ -97,3 +98,4 @@ } +} \ No newline at end of file diff --git a/src/USER-MEAMC/meam_setup_param.c b/src/USER-MEAMC/meam_setup_param.cpp similarity index 98% rename from src/USER-MEAMC/meam_setup_param.c rename to src/USER-MEAMC/meam_setup_param.cpp index 2c49481a28..ff89eda96a 100644 --- a/src/USER-MEAMC/meam_setup_param.c +++ b/src/USER-MEAMC/meam_setup_param.cpp @@ -1,3 +1,4 @@ +extern "C" { #include "meam.h" // @@ -58,7 +59,7 @@ void meam_setup_param_(int *which_p, double *value_p, int *nindex_p, int *index /*index(3)*/, int *errorflag) { //: index[0..2] - int i1, i2; + int i1, i2, val; *errorflag = 0; int which = *which_p; double value = *value_p; @@ -97,7 +98,7 @@ case 4: meam_checkindex(2,maxelt,nindex,index,errorflag); if (*errorflag!=0) return; - int val = (int)value; + val = (int)value; if (val==0) meam_data.lattce_meam[index[0]][index[1]] = FCC; @@ -221,3 +222,5 @@ *errorflag = 1; } } + +} \ No newline at end of file