Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed set but unused variables

  • Loading branch information...
commit 5895c0257a3500950eaa681f7aff530f967c5cde 1 parent 13e056f
@arnolda arnolda authored
View
8 src/comforce.c
@@ -52,7 +52,7 @@ int comforce_set_params(int part_type_a, int part_type_b,
void calc_comforce()
{
- int t0,t1,k, j;
+ int t0,t1, j;
IA_parameters *ia_params;
double com0[3], com1[3], MofImatrix[9], diff[3];
double vect0[3], vect1[3], eva[3], eve[3], fvect[3];
@@ -70,10 +70,10 @@ void calc_comforce()
diff[i]=com1[i]-com0[i];
}
momentofinertiamatrix(t0, MofImatrix);
- k=calc_eigenvalues_3x3(MofImatrix, eva);
+ calc_eigenvalues_3x3(MofImatrix, eva);
/* perpendicular force */
if(ia_params->COMFORCE_dir == 1) {
- k=calc_eigenvector_3x3(MofImatrix,eva[0],eve);
+ calc_eigenvector_3x3(MofImatrix,eva[0],eve);
/*By doing two vector products find radial axis along the target system */
vector_product(eve,diff,vect0);
vector_product(vect0,eve,vect1);
@@ -82,7 +82,7 @@ void calc_comforce()
unit_vector(vect1,fvect);
} else {
/* parallel force */
- k=calc_eigenvector_3x3(MofImatrix,eva[0],fvect);
+ calc_eigenvector_3x3(MofImatrix,eva[0],fvect);
}
/* orient it along the com vector */
View
6 src/communication.c
@@ -1125,10 +1125,10 @@ void mpi_integrate_slave(int pnode, int task)
/*************** REQ_BCAST_IA ************/
void mpi_bcast_ia_params(int i, int j)
{
- int tablesize=0;
-
mpi_call(mpi_bcast_ia_params_slave, i, j);
- tablesize = tabulated_forces.max;
+#ifdef TABULATED
+ int tablesize = tabulated_forces.max;
+#endif
#ifdef INTERFACE_CORRECTION
int adress_tablesize = adress_tab_forces.max;
#endif
View
3  src/constraint.c
@@ -889,7 +889,7 @@ void calculate_pore_dist(Particle *p1, double ppos[3], Particle *c_p, Constraint
double e_z[3], e_r[3]; /* unit vectors in the cylindrical coordinate system */
/* helper variables, for performance reasons should the be move the the
* constraint struct*/
- double slope, average_radius, z_left, z_right;
+ double slope, z_left, z_right;
/* and another helper that is hopefully optmized out */
double norm;
double c1_r, c1_z, c2_r, c2_z;
@@ -897,7 +897,6 @@ void calculate_pore_dist(Particle *p1, double ppos[3], Particle *c_p, Constraint
slope = (c->rad_right - c->rad_left)/2./(c->length-c->smoothing_radius);
- average_radius = 0.5*(c->rad_left + c->rad_right);
/* compute the position relative to the center of the pore */
for(i=0;i<3;i++) {
View
4 src/debug.c
@@ -109,7 +109,7 @@ void check_particle_consistency()
cell_part_cnt += cell->n;
part = cell->part;
np = cell->n;
- for(n=0; n<cell->n ; n++) {
+ for(n = 0; n < np ; n++) {
if(part[n].p.identity < 0 || part[n].p.identity > max_seen_particle) {
fprintf(stderr,"%d: check_particle_consistency: ERROR: Cell %d Part %d has corrupted id=%d\n",
this_node,c,n,cell->part[n].p.identity);
@@ -210,7 +210,7 @@ void check_particles()
cell_part_cnt += cell->n;
part = cell->part;
np = cell->n;
- for(n=0; n<cell->n ; n++) {
+ for(n = 0; n < np ; n++) {
if(part[n].p.identity < 0 || part[n].p.identity > max_seen_particle) {
fprintf(stderr,"%d: check_particles: ERROR: Cell %d Part %d has corrupted id=%d\n",
this_node,c,n,cell->part[n].p.identity);
View
3  src/domain_decomposition.c
@@ -97,12 +97,11 @@ double max_skin = 0.0;
void dd_create_cell_grid()
{
int i,n_local_cells,new_cells,min_ind;
- double cell_range[3], min_box_l, min_size, scale, volume;
+ double cell_range[3], min_size, scale, volume;
CELL_TRACE(fprintf(stderr, "%d: dd_create_cell_grid: max_range %f\n",this_node,max_range));
CELL_TRACE(fprintf(stderr, "%d: dd_create_cell_grid: local_box %f-%f, %f-%f, %f-%f,\n",this_node,my_left[0],my_right[0],my_left[1],my_right[1],my_left[2],my_right[2]));
/* initialize */
- min_box_l = dmin(dmin(local_box_l[0],local_box_l[1]),local_box_l[2]);
cell_range[0]=cell_range[1]=cell_range[2] = max_range;
if (max_range < ROUND_ERROR_PREC*box_l[0]) {
View
8 src/mdlc_correction.c
@@ -142,7 +142,7 @@ double slab_dip_count_mu(double *mt, double *mx, double *my)
double get_DLC_dipolar(int kcut,double *fx, double *fy, double *fz, double *tx, double *ty, double *tz){
- int ix,iy,kcut2,ip;
+ int ix,iy,ip;
double gx,gy,gr;
double S[4] = {0.0,0.0,0.0,0.0}; // S of Brodka methode, oder is S[4] = {Re(S+), Im(S+), Re(S-), Im(S-)}
@@ -173,8 +173,6 @@ double get_DLC_dipolar(int kcut,double *fx, double *fy, double *fz, double *tx,
ReGrad_Mum = (double *) malloc(sizeof(double)*n_local_particles);
ImGrad_Mum = (double *) malloc(sizeof(double)*n_local_particles);
- kcut2=kcut*kcut;
-
for(ix=-kcut;ix<=+kcut;ix++){
for(iy=-kcut;iy<=+kcut;iy++){
@@ -359,7 +357,7 @@ double get_DLC_dipolar(int kcut,double *fx, double *fy, double *fz, double *tx,
double get_DLC_energy_dipolar(int kcut){
- int ix,iy,kcut2,ip;
+ int ix,iy,ip;
double gx,gy,gr;
double S[4], global_S[4];
@@ -385,8 +383,6 @@ double get_DLC_energy_dipolar(int kcut){
energy=0.0;
- kcut2=kcut*kcut;
-
for(ix=-kcut;ix<=+kcut;ix++){
for(iy=-kcut;iy<=+kcut;iy++){
View
10 src/p3m-dipolar.c
@@ -955,10 +955,11 @@ double dp3m_calc_kspace_forces(int force_flag, int energy_flag)
P3M_TRACE(fprintf(stderr,"%d: dp3m.params.epsilon=%lf\n", this_node, dp3m.params.epsilon));
if(this_node==0) {
- double a;
/* self energy correction */
P3M_TRACE(fprintf(stderr,"%d: *dp3m.energy_correction=%20.15lf\n",this_node, dp3m.energy_correction));
- a = k_space_energy_dip;
+#ifdef P3M_DEBUG
+ double a = k_space_energy_dip;
+#endif
k_space_energy_dip -= coulomb.Dprefactor*(dp3m.sum_mu2*2*pow(dp3m.params.alpha_L*box_l_i[0],3) * wupii/3.0);
double volume=box_l[0]*box_l[1]*box_l[2];
@@ -2135,7 +2136,7 @@ void dp3m_tune_aliasing_sums(int nx, int ny, int nz, int mesh, double mesh_i, i
double P3M_DIPOLAR_real_space_error(double box_size, double prefac, double r_cut_iL, int n_c_part, double sum_q2, double alpha_L)
{
- double d_error_f,d_cc,d_dc,d_bc,d_rcut2,d_con;
+ double d_error_f,d_cc,d_dc,d_rcut2,d_con;
double d_a2,d_c,d_RCUT;
@@ -2155,9 +2156,6 @@ void dp3m_tune_aliasing_sums(int nx, int ny, int nz, int mesh, double mesh_i, i
d_dc=8.0*d_a2*d_a2*d_a2*d_rcut2*d_rcut2*d_rcut2+20.0*d_a2*d_a2*d_rcut2*d_rcut2 \
+30*d_a2*d_rcut2+15.0;
- d_bc=2.0*d_a2*d_rcut2 +1.0;
-
-
d_con=1.0/sqrt(box_size*box_size*box_size*d_a2*d_a2*d_rcut2*d_rcut2*d_rcut2*d_rcut2*d_RCUT*(double)n_c_part);
View
4 src/pressure.c
@@ -325,15 +325,13 @@ int getintersection(double pos1[3], double pos2[3],int given, int get, double va
/*this procedure returns the value of r[get] at that point */
double p2r[3];
- double oldvalue;
int i;
for (i=0;i<3;i++) {
p2r[i] = drem_down((pos2[i]-pos1[i])+box_size[i]/2.0,box_size[i])-box_size[i]/2.0;
}
- oldvalue =value;
value = drem_down((value-pos1[given])+box_size[given]/2.0,box_size[given])-box_size[given]/2.0;
- //PTENSOR_TRACE(fprintf(stderr,"%d: getintersection: p1 is %f %f %f p2 is %f %f %f p2r is %f %f %f value is %f newvalue is %f\n",this_node,pos1[0],pos1[1],pos1[2],pos2[0],pos2[1],pos2[2],p2r[0],p2r[1],p2r[2],oldvalue,value););
+ //PTENSOR_TRACE(fprintf(stderr,"%d: getintersection: p1 is %f %f %f p2 is %f %f %f p2r is %f %f %f newvalue is %f\n",this_node,pos1[0],pos1[1],pos1[2],pos2[0],pos2[1],pos2[2],p2r[0],p2r[1],p2r[2],value););
if ((value)*(p2r[given]) < -0.0001) {
char *errtxt = runtime_error(128 + 3*ES_INTEGER_SPACE);
View
5 src/statistics.c
@@ -357,12 +357,10 @@ void calc_gyration_tensor(int type, double **_gt)
double com[3];
double eva[3],eve0[3],eve1[3],eve2[3];
double *gt=NULL, tmp;
- double M;
double Smatrix[9],p1[3];
for (i=0; i<9; i++) Smatrix[i] = 0;
*_gt = gt = realloc(gt,16*sizeof(double)); /* 3*ev, rg, b, c, kappa, eve0[3], eve1[3], eve2[3]*/
- M=0.0;
updatePartCfg(WITHOUT_BONDS);
@@ -420,7 +418,7 @@ void calc_gyration_tensor(int type, double **_gt)
void nbhood(double pt[3], double r, IntList *il, int planedims[3] )
{
- double d[3],dsize;
+ double d[3];
int i,j;
double r2;
@@ -435,7 +433,6 @@ void nbhood(double pt[3], double r, IntList *il, int planedims[3] )
get_mi_vector(d, pt, partCfg[i].r.p);
} else {
/* Calculate the in plane distance */
- dsize = 0.0;
for ( j= 0 ; j < 3 ; j++ ) {
d[j] = planedims[j]*(partCfg[i].r.p[j]-pt[j]);
}
View
19 src/tcl/binary_file_tcl.c
@@ -199,10 +199,17 @@ int tclcommand_readmd(ClientData dummy, Tcl_Interp *interp,
f_row[3] = { -1 };
int av_pos = 0, av_v = 0,
- #ifdef DIPOLES
- av_dip=0,
- #endif
- av_mass=0, av_f = 0, av_q = 0, av_type = 0;
+#ifdef DIPOLES
+ av_dip=0,
+#endif
+#ifdef MASS
+ av_mass=0,
+#endif
+ av_f = 0,
+#ifdef ELECTROSTATICS
+ av_q = 0,
+#endif
+ av_type = 0;
int node, i;
struct MDHeader header;
@@ -254,8 +261,12 @@ int tclcommand_readmd(ClientData dummy, Tcl_Interp *interp,
case FX: f_row[0] = i; break;
case FY: f_row[1] = i; break;
case FZ: f_row[2] = i; break;
+#ifdef MASS
case MASSES: av_mass = 1; break;
+#endif
+#ifdef ELECTROSTATICS
case Q: av_q = 1; break;
+#endif
case TYPE: av_type = 1; break;
}
}
View
6 src/tcl/statistics_tcl.c
@@ -1135,7 +1135,7 @@ static int tclcommand_analyze_parse_find_principal_axis(Tcl_Interp *interp, int
/* 'analyze find_principal_axis [<type0>]' */
double MofImatrix[9],eva[3],eve[3];
char buffer[4*TCL_DOUBLE_SPACE+20];
- int p1,i,j;
+ int p1,j;
/* parse arguments */
if (argc != 1) {
@@ -1150,12 +1150,12 @@ static int tclcommand_analyze_parse_find_principal_axis(Tcl_Interp *interp, int
}
momentofinertiamatrix(p1, MofImatrix);
- i=calc_eigenvalues_3x3(MofImatrix, eva);
+ calc_eigenvalues_3x3(MofImatrix, eva);
sprintf(buffer,"{eigenval eigenvector} ");
Tcl_AppendResult(interp, buffer, (char *)NULL);
for (j= 0; j < 3; j++) {
- i=calc_eigenvector_3x3(MofImatrix,eva[j],eve);
+ calc_eigenvector_3x3(MofImatrix,eva[j],eve);
sprintf(buffer," { %f { %f %f %f } }",eva[j],eve[0],eve[1],eve[2]);
Tcl_AppendResult(interp, buffer, (char *)NULL);
}
View
20 src/tcl/uwerr_tcl.c
@@ -785,7 +785,7 @@ int uwerr_read_tcl_double_vector(Tcl_Interp *interp, char * data_in ,
int tclcommand_uwerr(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
{
int i, nrows, ncols, len, plot = 0,
- col_to_analyze = -1, analyze_col = 0, error = 0,
+ col_to_analyze = -1, analyze_col = 0,
result = TCL_OK;
double s_tau = 1.5;
int * nrep;
@@ -813,7 +813,7 @@ int tclcommand_uwerr(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
if (!Tcl_GetCommandInfo(interp, argv[3], &cmdInfo)) {
analyze_col = 1;
if (Tcl_GetInt(interp, argv[3], &col_to_analyze) == TCL_ERROR) {
- error = 1;
+ result = TCL_ERROR;
str = (char *)malloc(TCL_INTEGER_SPACE*sizeof(char));
sprintf(str, "%d", ncols);
Tcl_AppendResult(interp, "third argument has to be a function or a ",
@@ -822,9 +822,9 @@ int tclcommand_uwerr(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
}
}
- if (!error && analyze_col &&
+ if ((result == TCL_OK) && analyze_col &&
(col_to_analyze < 1 || col_to_analyze > ncols)) {
- error = 1;
+ result = TCL_ERROR;
str = (char *)malloc(TCL_INTEGER_SPACE*sizeof(char));
sprintf(str, "%d", ncols);
Tcl_AppendResult(interp, "third argument has to be a function or a ",
@@ -833,30 +833,30 @@ int tclcommand_uwerr(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
}
/* check for plot as fourth argument */
- if (argc > 4 && !error) {
+ if (argc > 4 && (result != TCL_OK)) {
if (!strcmp(argv[4], "plot"))
plot = 1;
else {
/* read s_tau if there is a fourth arg */
if (Tcl_GetDouble(interp, argv[4], &s_tau) == TCL_ERROR) {
- error = 1;
+ result = TCL_ERROR;
Tcl_AppendResult(interp, "fourth argument has to be a double or 'plot'.", (char *)NULL);
}
}
}
- if (argc > 5 && ! error)
+ if (argc > 5 && (result == TCL_OK))
if (!strcmp(argv[argc-1], "plot"))
plot = 1;
- if (!error && analyze_col) {
+ if ((result == TCL_OK) && analyze_col) {
result = UWerr(interp, data, nrows, ncols,
col_to_analyze-1, nrep, len, s_tau, plot);
}
- if (!error && !analyze_col) {
+ if ((result == TCL_OK) && !analyze_col) {
my_argv = (char**)malloc((argc-3)*sizeof(char*));
my_argv[0] = argv[3];
for (i = 0; i < argc-5-plot; ++i)
@@ -872,5 +872,5 @@ int tclcommand_uwerr(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
free(nrep);
- return error ? TCL_ERROR : TCL_OK;
+ return result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.