Skip to content

Commit

Permalink
replace rmg_double_t with double
Browse files Browse the repository at this point in the history
replace rmg_float_t with float
remove rmgtypes.h


git-svn-id: svn+ssh://chips.ncsu.edu/home/svn/repos/codes@3140 eb38b3b0-33ea-0310-94ad-d43fea0d214f
  • Loading branch information
WenchangLu committed Aug 6, 2015
1 parent 3e57b53 commit 5bde7db
Show file tree
Hide file tree
Showing 265 changed files with 1,460 additions and 1,492 deletions.
4 changes: 2 additions & 2 deletions Finite_diff/FiniteDiff_Cbindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ extern "C" void app_cir_driver (double * a, double * b, int dimx, int dimy, int
{
CPP_app_cir_driver<double>(&Rmg_L, Rmg_T, a, b, dimx, dimy, dimz, order);
}
extern "C" void app_cir_driver_f (rmg_float_t * a, rmg_float_t * b, int dimx, int dimy, int dimz, int order)
extern "C" void app_cir_driver_f (float * a, float * b, int dimx, int dimy, int dimz, int order)
{
CPP_app_cir_driver<float>(&Rmg_L, Rmg_T, a, b, dimx, dimy, dimz, order);
}
extern "C" double app_cil_driver (double * a, double * b, int dimx, int dimy, int dimz, double gridhx, double gridhy, double gridhz, int order)
{
return CPP_app_cil_driver<double>(&Rmg_L, Rmg_T, a, b, dimx, dimy, dimz, gridhx, gridhy, gridhz, order);
}
extern "C" double app_cil_driver_f (rmg_float_t * a, rmg_float_t * b, int dimx, int dimy, int dimz, double gridhx, double gridhy, double gridhz, int order)
extern "C" double app_cil_driver_f (float * a, float * b, int dimx, int dimy, int dimz, double gridhx, double gridhy, double gridhz, int order)
{
return CPP_app_cil_driver<float>(&Rmg_L, Rmg_T, a, b, dimx, dimy, dimz, gridhx, gridhy, gridhz, order);
}
Expand Down
14 changes: 7 additions & 7 deletions Finite_diff/app6_del2.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@



void app6_del2 (rmg_double_t *rho, rmg_double_t * work, int dimx, int dimy, int dimz,
rmg_double_t gridhx, rmg_double_t gridhy, rmg_double_t gridhz)
void app6_del2 (double *rho, double * work, int dimx, int dimy, int dimz,
double gridhx, double gridhy, double gridhz)

{

int iz, ix, iy, incx, incy, incxr, incyr;
int ixs, iys, ixms, ixps, iyms, iyps, ixmms, ixpps, iymms, iypps;

rmg_double_t h2, t0, t1x, t2x;
rmg_double_t t1y, t2y;
rmg_double_t t1z, t2z;
rmg_double_t *f;
double h2, t0, t1x, t2x;
double t1y, t2y;
double t1z, t2z;
double *f;

incx = (dimz + 4) * (dimy + 4);
incy = dimz + 4;
incxr = dimz * dimy;
incyr = dimz;

my_malloc(f, (dimx+4) * (dimy+4 ) * (dimz+4), rmg_double_t);
my_malloc(f, (dimx+4) * (dimy+4 ) * (dimz+4), double);

trade_imagesx (rho, f, dimx, dimy, dimz, 2, CENTRAL_TRADE);

Expand Down
16 changes: 8 additions & 8 deletions Finite_diff/app_cilr_sixth.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
#include "TradeImages.h"


rmg_double_t app_cilr_sixth (rmg_double_t * psi, rmg_double_t *a_psi, rmg_double_t *b_psi, rmg_double_t *vtot_eig_s, int dimx, int dimy, int dimz,
rmg_double_t gridhx, rmg_double_t gridhy, rmg_double_t gridhz)
double app_cilr_sixth (double * psi, double *a_psi, double *b_psi, double *vtot_eig_s, int dimx, int dimy, int dimz,
double gridhx, double gridhy, double gridhz)
{

rmg_double_t *rptr;
double *rptr;

int iz, ix, iy, incx, incy, incxr, incyr;
int ixs, iys, ixms, ixps, iyms, iyps, ixmms, ixpps, iymms, iypps;
rmg_double_t ecxy, ecxz, ecyz, cc, fcx, fcy, fcz, cor;
rmg_double_t fc2x, fc2y, fc2z, tcx, tcy, tcz;
rmg_double_t ihx, ihy, ihz;
rmg_double_t c000, c100, c110, c200;
double ecxy, ecxz, ecyz, cc, fcx, fcy, fcz, cor;
double fc2x, fc2y, fc2z, tcx, tcy, tcz;
double ihx, ihy, ihz;
double c000, c100, c110, c200;
int sbasis = (dimx + 4) * (dimy + 4) * (dimz + 4);


Expand All @@ -33,7 +33,7 @@ rmg_double_t app_cilr_sixth (rmg_double_t * psi, rmg_double_t *a_psi, rmg_double
c200 = -1.0 / 240.0;


my_malloc (rptr, sbasis + 64, rmg_double_t);
my_malloc (rptr, sbasis + 64, double);
trade_imagesx (psi, rptr, dimx, dimy, dimz, 2, FULL_TRADE);

incx = (dimz + 4) * (dimy + 4);
Expand Down
6 changes: 3 additions & 3 deletions Finite_diff/app_cir_bcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void app_cir_bcc(rmg_double_t *a, rmg_double_t *b, int dimx, int dimy, int dimz)
* void app_cir_bcc(double *a, double *b, int dimx, int dimy, int dimz)
* Applies the Mehrstellen RHS operator to a matrix for BCC lattice
* INPUTS
* a[(dimx+2) * (dimy+2) * (dimz+2)]: the matrix to be applied
Expand All @@ -43,14 +43,14 @@



void app_cir_bcc (rmg_double_t * a, rmg_double_t * b, int dimx, int dimy, int dimz)
void app_cir_bcc (double * a, double * b, int dimx, int dimy, int dimz)
{

int ix, iy, iz;
int ixs, iys;
int incy, incx;
int incyr, incxr;
rmg_double_t Bc, Bf;
double Bc, Bf;

incy = dimz + 2;
incx = (dimz + 2) * (dimy + 2);
Expand Down
2 changes: 1 addition & 1 deletion Finite_diff/app_cir_bcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void app_cir_bcc(rmg_double_t *a, rmg_double_t *b, int dimx, int dimy, int dimz)
* void app_cir_bcc(double *a, double *b, int dimx, int dimy, int dimz)
* Applies the Mehrstellen RHS operator to a matrix for BCC lattice
* INPUTS
* a[(dimx+2) * (dimy+2) * (dimz+2)]: the matrix to be applied
Expand Down
2 changes: 1 addition & 1 deletion Finite_diff/app_cir_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@



void app_cir_beta_driver (rmg_double_t * a, rmg_double_t * b, int dimx, int dimy, int dimz, int order)
void app_cir_beta_driver (double * a, double * b, int dimx, int dimy, int dimz, int order)
{


Expand Down
6 changes: 3 additions & 3 deletions Finite_diff/app_cir_fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void app_cir_fcc(rmg_double_t *a, rmg_double_t *b, int dimx, int dimy, int dimz)
* void app_cir_fcc(double *a, double *b, int dimx, int dimy, int dimz)
* Applies the Mehrstellen RHS operator to a matrix for FCC lattice
* INPUTS
* a[(dimx+2) * (dimy+2) * (dimz+2)]: the matrix to be applied
Expand All @@ -40,15 +40,15 @@
#include "TradeImages.h"


void app_cir_fcc (rmg_double_t * a, rmg_double_t * b, int dimx, int dimy, int dimz)
void app_cir_fcc (double * a, double * b, int dimx, int dimy, int dimz)
{

int ix, iy, iz;
int ixs, iys, ixms, ixps, iyms, iyps;
int incy, incx;
int incyr, incxr;

rmg_double_t Bc, Bf;
double Bc, Bf;


incy = dimz + 2;
Expand Down
2 changes: 1 addition & 1 deletion Finite_diff/app_cir_fcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void app_cir_fcc(rmg_double_t *a, rmg_double_t *b, int dimx, int dimy, int dimz)
* void app_cir_fcc(double *a, double *b, int dimx, int dimy, int dimz)
* Applies the Mehrstellen RHS operator to a matrix for FCC lattice
* INPUTS
* a[(dimx+2) * (dimy+2) * (dimz+2)]: the matrix to be applied
Expand Down
6 changes: 3 additions & 3 deletions Finite_diff/app_cir_ortho.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void app_cir_ortho(rmg_double_t *a, rmg_double_t *b, int dimx, int dimy, int dimz)
* void app_cir_ortho(double *a, double *b, int dimx, int dimy, int dimz)
* Applies the Mehrstellen RHS operator to a matrix for orthorhombic lattice
* INPUTS
* a[(dimx+2) * (dimy+2) * (dimz+2)]: the matrix to be applied
Expand All @@ -42,14 +42,14 @@
#include "TradeImages.h"


void app_cir_ortho (rmg_double_t * a, rmg_double_t * b, int dimx, int dimy, int dimz)
void app_cir_ortho (double * a, double * b, int dimx, int dimy, int dimz)
{

int ix, iy, iz;
int ixs, iys, ixms, ixps, iyms, iyps, iyps1, iyps2;
int incy, incx;
int incyr, incxr;
rmg_double_t Bc, Bf;
double Bc, Bf;

incy = dimz + 2;
incx = (dimz + 2) * (dimy + 2);
Expand Down
8 changes: 4 additions & 4 deletions Finite_diff/app_grad.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
#include <math.h>
#include <stdlib.h>

void app_grad (rmg_double_t * rho, rmg_double_t *wxr, rmg_double_t *wyr, rmg_double_t *wzr, int dimx, int dimy, int dimz, rmg_double_t gridhx, rmg_double_t gridhy, rmg_double_t gridhz)
void app_grad (double * rho, double *wxr, double *wyr, double *wzr, int dimx, int dimy, int dimz, double gridhx, double gridhy, double gridhz)
{

int iz, ix, iy, ibrav;
rmg_double_t t1, t2, t1x, t2x, t1y, t2y, t1z, t2z;
rmg_double_t time1, time2, *rptr;
double t1, t2, t1x, t2x, t1y, t2y, t1z, t2z;
double time1, time2, *rptr;
int ixs, iys;
int ix1, iy1;

Expand All @@ -54,7 +54,7 @@ void app_grad (rmg_double_t * rho, rmg_double_t *wxr, rmg_double_t *wyr, rmg_do

ibrav = get_ibrav_type();

my_malloc (rptr, (dimx + 4) * (dimy + 4) * (dimz + 4), rmg_double_t);
my_malloc (rptr, (dimx + 4) * (dimy + 4) * (dimz + 4), double);


trade_imagesx (rho, rptr, dimx, dimy, dimz, 2, CENTRAL_TRADE);
Expand Down
3 changes: 1 addition & 2 deletions Force/constrain.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <float.h>
#include <math.h>
#include "const.h"
#include "rmgtypes.h"
#include "rmgtypedefs.h"
#include "common_prototypes.h"
#include "main.h"
Expand Down Expand Up @@ -225,7 +224,7 @@ void constrain (void)
+ Tau[3*ion+Z]*Tau[3*ion+Z];
}

Mag_T = Mag_T > 0.0 ? sqrt(Mag_T) : error_handler("Left/Right image collision in NEB", pct.thisimg);
Mag_T = Mag_T > 0.0 ? sqrt(Mag_T) : error_handler("Left/Right image collision in NEB");
}
else if ( iptr->constraint.setA_weight > ct.TOTAL && ct.TOTAL > iptr->constraint.setB_weight)
{ /* this image energy is in a decreasing to the right section */
Expand Down
6 changes: 3 additions & 3 deletions Force/iiforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ void iiforce (void)
{

int i, j;
rmg_double_t Zi, Zj, rci, rcj, t1, t2, s1, s2, s3, n1, r;
rmg_double_t xtal_r[3], crd_r[3];
double Zi, Zj, rci, rcj, t1, t2, s1, s2, s3, n1, r;
double xtal_r[3], crd_r[3];
ION *iptr1, *iptr2;
rmg_double_t tx, ty, tz;
double tx, ty, tz;


n1 = 2.0 / sqrt (PI);
Expand Down
10 changes: 4 additions & 6 deletions Force/lforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@



void lforce (rmg_double_t * rho, rmg_double_t * vh)
void lforce (double * rho, double * vh)
{

int ix, iy, iz, ixx, iyy, izz;
int xstart, ystart, zstart, xend, yend, zend;
int ion, idx;
int ilow, jlow, klow, ihi, jhi, khi;
int dimx, dimy, dimz;
int FP0_BASIS;
int FPX0_GRID, FPY0_GRID, FPZ0_GRID;
int FPX_OFFSET, FPY_OFFSET, FPZ_OFFSET;
int FNX_GRID, FNY_GRID, FNZ_GRID;

rmg_double_t r, Zv, rc, rc2, rcnorm, t1;
rmg_double_t x[3], invdr;
rmg_double_t hxxgrid, hyygrid, hzzgrid;
double r, Zv, rc, rc2, rcnorm, t1;
double x[3], invdr;
double hxxgrid, hyygrid, hzzgrid;
double xside, yside, zside;
SPECIES *sp;
ION *iptr;
Expand All @@ -43,7 +42,6 @@ void lforce (rmg_double_t * rho, rmg_double_t * vh)
yside = get_yside();
zside = get_zside();

FP0_BASIS = get_FP0_BASIS();
FPX0_GRID = get_FPX0_GRID();
FPY0_GRID = get_FPY0_GRID();
FPZ0_GRID = get_FPZ0_GRID();
Expand Down
22 changes: 11 additions & 11 deletions Force/nlccforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Mark Wensell,Dan Sullivan, Chris Rapcewicz,
* Jerzy Bernholc
* FUNCTION
* void nlccforce(rmg_double_t *rho, rmg_double_t *vxc)
* void nlccforce(double *rho, double *vxc)
* Evaluates the ionic force component due to the non-linear core
* correction terms.
* INPUTS
Expand Down Expand Up @@ -45,15 +45,15 @@



void nlccforce (rmg_double_t * rho, rmg_double_t * vxc)
void nlccforce (double * rho, double * vxc)
{

int ishift;
rmg_double_t axs[3], bx[3];
rmg_double_t shift[4];
rmg_double_t fl[3];
rmg_double_t deltac;
rmg_double_t sumxc2, sumx, sumy, sumz;
double axs[3], bx[3];
double shift[4];
double fl[3];
double deltac;
double sumxc2, sumx, sumy, sumz;

int ix, iy, iz, ixx, iyy, izz;
int xstart, ystart, zstart, xend, yend, zend;
Expand All @@ -65,9 +65,9 @@ void nlccforce (rmg_double_t * rho, rmg_double_t * vxc)
int FPX_OFFSET, FPY_OFFSET, FPZ_OFFSET;
int FNX_GRID, FNY_GRID, FNZ_GRID;

rmg_double_t r, Zv, rc, rc2, rcnorm, t1;
rmg_double_t x[3], invdr;
rmg_double_t hxxgrid, hyygrid, hzzgrid;
double r, Zv, rc, rc2, rcnorm, t1;
double x[3], invdr;
double hxxgrid, hyygrid, hzzgrid;
double xside, yside, zside;
SPECIES *sp;
ION *iptr;
Expand Down Expand Up @@ -99,7 +99,7 @@ void nlccforce (rmg_double_t * rho, rmg_double_t * vxc)
khi = klow + FPZ0_GRID;


deltac = ct.hmaxgrid / 200.0 / (rmg_double_t) get_FG_RATIO();
deltac = ct.hmaxgrid / 200.0 / (double) get_FG_RATIO();
shift[0] = -TWO * deltac;
shift[1] = TWO * deltac;
shift[2] = -deltac;
Expand Down
14 changes: 7 additions & 7 deletions Force/partial_QI.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
#include "main.h"


void partial_QI (int ion, rmg_double_t * QI_R, ION * iptr)
void partial_QI (int ion, double * QI_R, ION * iptr)
{
int idx, idx1, i, j, num;
int ix, iy, iz, size, *dvec;
int lpx[9][9], lpl[9][9][9];
int nh, icount;
rmg_double_t x[3], cx[3], r, invdr, ap[25][9][9];
rmg_double_t ylm[25], ylm_x[25], ylm_y[25], ylm_z[25];
rmg_double_t xc, yc, zc;
rmg_double_t *QI_x, *QI_y, *QI_z;
rmg_double_t *qnmlig_tpr, *drqnmlig_tpr;
rmg_double_t hxxgrid, hyygrid, hzzgrid;
double x[3], cx[3], r, invdr, ap[25][9][9];
double ylm[25], ylm_x[25], ylm_y[25], ylm_z[25];
double xc, yc, zc;
double *QI_x, *QI_y, *QI_z;
double *qnmlig_tpr, *drqnmlig_tpr;
double hxxgrid, hyygrid, hzzgrid;
SPECIES *sp;

hxxgrid = get_hxxgrid();
Expand Down
Loading

0 comments on commit 5bde7db

Please sign in to comment.