Move nbnxn files to nbnxm directory
[alexxy/gromacs.git] / src / gromacs / nbnxm / nbnxm_geometry.cpp
similarity index 78%
rename from src/gromacs/mdlib/nbnxn_util.h
rename to src/gromacs/nbnxm/nbnxm_geometry.cpp
index 1ab116afdedea512b464366c89920b17df4d889a..42f22b6f2095c44c3c73fb740cc28ba3b6dafed8 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef GMX_MDLIB_NBNXN_UTIL_H
-#define GMX_MDLIB_NBNXN_UTIL_H
+#include "gmxpre.h"
 
-#include <cmath>
+#include "nbnxm_geometry.h"
 
-#include "gromacs/mdlib/nb_verlet.h"
-#include "gromacs/mdlib/nbnxn_consts.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/nbnxm/nbnxm.h"
+#include "gromacs/nbnxm/pairlist.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/fatalerror.h"
 
-
-/* Returns the base-2 log of n.
- * Generates a fatal error when n is not an integer power of 2.
- */
-static inline int get_2log(int n)
-{
-    int log2;
-
-    log2 = 0;
-    while ((1 << log2) < n)
-    {
-        log2++;
-    }
-    if ((1 << log2) != n)
-    {
-        gmx_fatal(FARGS, "nbnxn na_c (%d) is not a power of 2", n);
-    }
-
-    return log2;
-}
-
-/* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
+int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
 {
     switch (nb_kernel_type)
     {
@@ -88,8 +64,7 @@ static inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
     return 0;
 }
 
-/* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
+int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
 {
     int nbnxn_simd_width = 0;
     int cj_size          = 0;
@@ -119,6 +94,3 @@ static inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
 
     return cj_size;
 }
-
-
-#endif