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

Initial update to SNAP routine [WIP] #34

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add RIG to examinimd.h, comment nfac_table
  • Loading branch information
ajpowelsnl committed Oct 27, 2022

Verified

This commit was signed with the committer’s verified signature.
cdesiniotis Christopher Desiniotis
commit 267b6e2b90d9ef3014bfae8cad8ea0f1b7ff161f
5 changes: 4 additions & 1 deletion src/examinimd.h
Original file line number Diff line number Diff line change
@@ -36,6 +36,9 @@
// Questions? Contact Christian R. Trott ([email protected])
//************************************************************************

#ifndef EXAMINI_H
#define EXAMINIMD_H

#include <types.h>

#include<system.h>
@@ -69,4 +72,4 @@ class ExaMiniMD {

void shutdown();
};

#endif //EXAMINIMD_H
2 changes: 1 addition & 1 deletion src/force_types/sna.h
Original file line number Diff line number Diff line change
@@ -313,7 +313,7 @@ class SNA {
t_sna_2d rootpqarray;

static const int nmaxfactorial = 167;
static const double nfac_table[];
//static const double nfac_table[];
inline
double factorial(int);

16 changes: 10 additions & 6 deletions src/force_types/sna_impl.hpp
Original file line number Diff line number Diff line change
@@ -1886,19 +1886,22 @@ void SNA::compute_duarray_cpu(const typename Kokkos::TeamPolicy<>::member_type&
inline
double SNA::factorial(int n)
{
//if (n < 0 || n > nmaxfactorial) {
// char str[128];
// sprintf(str, "Invalid argument to factorial %d", n);
// error->all(FLERR, str);
//}
double result = 1.0;
for(int i=1; i<=n; i++)
result *= 1.0*i;
return result;

return nfac_table[n];
}

/* ----------------------------------------------------------------------
factorial n table, size SNA::nmaxfactorial+1
------------------------------------------------------------------------- */


// Using nfac_table gives linking errors


/*
const double SNA::nfac_table[] = {
1,
1,
@@ -2069,6 +2072,7 @@ const double SNA::nfac_table[] = {
9.00369170577843e+297,
1.503616514865e+300, // nmaxfactorial = 167
};
*/

/* ----------------------------------------------------------------------
the function delta given by VMK Eq. 8.2(1)