Skip to content

Commit

Permalink
grid: Move coset into grid_common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Sep 30, 2020
1 parent dbf7a77 commit 178577b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
13 changes: 13 additions & 0 deletions src/grid/common/grid_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ static const double fac[] = {
0.30488834461171386050E+30, 0.88417619937397019545E+31,
0.26525285981219105864E+33};

/*******************************************************************************
* \brief Maps three angular momentum components to a single zero based index.
* \author Ole Schuett
******************************************************************************/
static inline int coset(int lx, int ly, int lz) {
const int l = lx + ly + lz;
if (l == 0) {
return 0;
} else {
return ncoset[l - 1] + ((l - lx) * (l - lx + 1)) / 2 + lz;
}
}

/*******************************************************************************
* \brief Minimum and maximum for integers (missing from the C standard)
* \author Ole Schuett
Expand Down
13 changes: 0 additions & 13 deletions src/grid/ref/grid_ref_prepare_pab.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@
#include "../common/grid_constants.h"
#include "grid_ref_prepare_pab.h"

/*******************************************************************************
* \brief Returns block size changes due to transformation grid_ref_prepare_pab.
* \author Ole Schuett
******************************************************************************/
int coset(int lx, int ly, int lz) {
const int l = lx + ly + lz;
if (l == 0) {
return 0;
} else {
return ncoset[l - 1] + ((l - lx) * (l - lx + 1)) / 2 + lz;
}
}

/*******************************************************************************
* \brief Implementation of function GRID_FUNC_AB, ie. identity transformation.
* \author Ole Schuett
Expand Down
6 changes: 0 additions & 6 deletions src/grid/ref/grid_ref_prepare_pab.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
#ifndef GRID_REF_PREPARE_PAB_H
#define GRID_REF_PREPARE_PAB_H

/*******************************************************************************
* \brief Maps three angular momentum components to a single zero based index.
* \author Ole Schuett
******************************************************************************/
int coset(int lx, int ly, int lz);

/*******************************************************************************
* \brief Returns block size changes due to transformation grid_prepare_pab.
* \author Ole Schuett
Expand Down

0 comments on commit 178577b

Please sign in to comment.