Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sph kernel macros to use same convention as cooling macros #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ParallelGravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ Main::Main(CkArgMsg* m) {
param.bSphStep = 0;
param.bDtAdjust = 0; // DtAdjust only affects gas
}
#if WENDLAND == 1
#ifdef WENDLAND
if(param.bDoGas && param.nSmooth < 32) {
ckerr << "WARNING: nSmooth < 32 with WENDLAND kernel." << endl;
ckerr << "WARNING: M4 kernel with be used for smoothing." << endl;
Expand Down Expand Up @@ -2401,13 +2401,13 @@ void Main::setupICs() {
#ifdef DTADJUST
ofsLog << " DTADJUST";
#endif
#if WENDLAND == 1
#ifdef WENDLAND
ofsLog << " WENDLAND";
#endif
#if M4KERNEL == 1
#ifdef M4KERNEL
ofsLog << " M4KERNEL";
#endif
#if M6KERNEL == 1
#ifdef M6KERNEL
ofsLog << " M6KERNEL";
#endif
#ifdef SPLITGAS
Expand Down
20 changes: 16 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -810,6 +811,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1062,6 +1064,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1199,7 +1210,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1352,6 +1363,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -4592,9 +4604,9 @@ fi
if test x$sph_kernel = xsph_none -a x$flag_sph_m6kernel_deprecated != x; then sph_kernel=$flag_sph_m6kernel_deprecated; fi
if test x$sph_kernel = xsph_none -a x$flag_sph_wendland_deprecated != x; then sph_kernel=$flag_sph_wendland_deprecated; fi
case $sph_kernel in
sph_none|"m4") FLAG_SPH_KERNEL="-DM4KERNEL=1 -DWENDLAND=0 -DM6KERNEL=0";;
m6 ) FLAG_SPH_KERNEL="-DM4KERNEL=0 -DWENDLAND=0 -DM6KERNEL=1";;
wendland ) FLAG_SPH_KERNEL="-DM4KERNEL=0 -DWENDLAND=1 -DM6KERNEL=0";;
sph_none|"m4") FLAG_SPH_KERNEL="-DM4KERNEL";;
m6 ) FLAG_SPH_KERNEL="-DM6KERNEL";;
wendland ) FLAG_SPH_KERNEL="-DWENDLAND";;
* ) as_fn_error $? "invalid argument for '--enable-sph-kernel': $sph_kernel" "$LINENO" 5;;
esac

Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ AC_ARG_ENABLE([sph_kernel], [AS_HELP_STRING([--enable-sph-kernel], [SPH interpol
if test x$sph_kernel = xsph_none -a x$flag_sph_m6kernel_deprecated != x; then sph_kernel=$flag_sph_m6kernel_deprecated; fi
if test x$sph_kernel = xsph_none -a x$flag_sph_wendland_deprecated != x; then sph_kernel=$flag_sph_wendland_deprecated; fi
case $sph_kernel in
sph_none|"m4") FLAG_SPH_KERNEL="-DM4KERNEL=1 -DWENDLAND=0 -DM6KERNEL=0";;
m6 ) FLAG_SPH_KERNEL="-DM4KERNEL=0 -DWENDLAND=0 -DM6KERNEL=1";;
wendland ) FLAG_SPH_KERNEL="-DM4KERNEL=0 -DWENDLAND=1 -DM6KERNEL=0";;
sph_none|"m4") FLAG_SPH_KERNEL="-DM4KERNEL";;
m6 ) FLAG_SPH_KERNEL="-DM6KERNEL";;
wendland ) FLAG_SPH_KERNEL="-DWENDLAND";;
* ) AC_MSG_ERROR([invalid argument for '--enable-sph-kernel': $sph_kernel]);;
esac
AC_SUBST([FLAG_SPH_KERNEL])
Expand Down
12 changes: 6 additions & 6 deletions smooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,11 @@ inline double dkernelM4(double ar2)
* @return KERNEL = (pi h^3) W
*/
inline double KERNEL(double ar2, int nSmooth) {
#if WENDLAND == 1
#if defined WENDLAND
return kernelWendland(ar2, nSmooth);
#elif M6KERNEL == 1
#elif defined M6KERNEL
return kernelM6(ar2);
#elif M4KERNEL == 1
#elif defined M4KERNEL
return kernelM4(ar2);
#else
#error No available kernel selected.
Expand All @@ -526,11 +526,11 @@ inline double KERNEL(double ar2, int nSmooth) {
* saying: gradW = (1/(pi h^5)) DKERNEL * dx
*/
inline double DKERNEL(double ar2) {
#if WENDLAND == 1
#if defined WENDLAND
return dkernelWendland(ar2);
#elif M6KERNEL == 1
#elif defined M6KERNEL
return dkernelM6(ar2);
#elif M4KERNEL == 1
#elif defined M4KERNEL
return dkernelM4(ar2);
#else
#error No available kernel selected.
Expand Down