Merge pull request #288 from andlaus/fix-clang-warnings

fix a few CLang warnings
This commit is contained in:
Bård Skaflestad 2013-07-30 12:18:54 -07:00
commit 6d3cbafa54
6 changed files with 15 additions and 18 deletions

View File

@ -316,7 +316,7 @@ compute_cell_geometry_3d(double *coords,
} }
if(subnormal_sign < 0.0){ if(subnormal_sign < 0.0){
tet_volume =- tet_volume; tet_volume = -tet_volume;
} }
if(!(neighbors[2*face+0]==c)){ if(!(neighbors[2*face+0]==c)){
tet_volume = -tet_volume; tet_volume = -tet_volume;

View File

@ -23,7 +23,7 @@
namespace Opm namespace Opm
{ {
class PhaseUsage; struct PhaseUsage;
/// Abstract base class for blackoil fluid and reservoir properties. /// Abstract base class for blackoil fluid and reservoir properties.
/// Supports variable number of spatial dimensions, called D. /// Supports variable number of spatial dimensions, called D.

View File

@ -96,8 +96,8 @@ namespace Opm
const RockCompressibility* rock_comp_props_; const RockCompressibility* rock_comp_props_;
WellsManager& wells_manager_; WellsManager& wells_manager_;
const Wells* wells_; const Wells* wells_;
const std::vector<double>& src_; //const std::vector<double>& src_;
const FlowBoundaryConditions* bcs_; //const FlowBoundaryConditions* bcs_;
const double* gravity_; const double* gravity_;
// Solvers // Solvers
CompressibleTpfa psolver_; CompressibleTpfa psolver_;
@ -236,8 +236,8 @@ namespace Opm
const BlackoilPropertiesInterface& props, const BlackoilPropertiesInterface& props,
const RockCompressibility* rock_comp_props, const RockCompressibility* rock_comp_props,
WellsManager& wells_manager, WellsManager& wells_manager,
const std::vector<double>& src, const std::vector<double>&,
const FlowBoundaryConditions* bcs, const FlowBoundaryConditions*,
LinearSolverInterface& linsolver, LinearSolverInterface& linsolver,
const double* gravity) const double* gravity)
: grid_(grid), : grid_(grid),
@ -245,8 +245,8 @@ namespace Opm
rock_comp_props_(rock_comp_props), rock_comp_props_(rock_comp_props),
wells_manager_(wells_manager), wells_manager_(wells_manager),
wells_(wells_manager.c_wells()), wells_(wells_manager.c_wells()),
src_(src), //src_(src),
bcs_(bcs), //bcs_(bcs),
gravity_(gravity), gravity_(gravity),
psolver_(grid, props, rock_comp_props, linsolver, psolver_(grid, props, rock_comp_props, linsolver,
param.getDefault("nl_pressure_residual_tolerance", 0.0), param.getDefault("nl_pressure_residual_tolerance", 0.0),

View File

@ -118,7 +118,7 @@ namespace Opm
void connect_timestep (T& t); void connect_timestep (T& t);
private: private:
class Impl; struct Impl;
// Using shared_ptr instead of scoped_ptr since scoped_ptr requires complete type for Impl. // Using shared_ptr instead of scoped_ptr since scoped_ptr requires complete type for Impl.
boost::shared_ptr<Impl> pimpl_; boost::shared_ptr<Impl> pimpl_;

View File

@ -139,7 +139,6 @@ spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double
double infnorm; double infnorm;
double *b; double *b;
double *x; double *x;
char *work;
double *mob, *dmob; double *mob, *dmob;
int i; int i;
int it; int it;
@ -160,7 +159,6 @@ spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double
b = malloc(nc * sizeof *b); b = malloc(nc * sizeof *b);
x = malloc(nc * sizeof *x); x = malloc(nc * sizeof *x);
work = malloc(6*sizeof (double));
mob = malloc(g->number_of_cells *2* sizeof *mob); mob = malloc(g->number_of_cells *2* sizeof *mob);
dmob = malloc(g->number_of_cells *2* sizeof *dmob); dmob = malloc(g->number_of_cells *2* sizeof *dmob);
@ -168,7 +166,7 @@ spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double
it = 0; it = 0;
while (infnorm > 1e-9 && it++ < 20) { while (infnorm > 1e-9 && it++ < 20) {
compute_mobilities(g->number_of_cells, s, mob, dmob, ntab, h, x0, tab); compute_mobilities(g->number_of_cells, s, mob, dmob, ntab, h, x0, tab);
spu_implicit_assemble(g, s0, s, mob, dmob, dflux, gflux, src, dt, S, b, work); spu_implicit_assemble(g, s0, s, mob, dmob, dflux, gflux, src, dt, S, b);
/* Compute inf-norm of residual */ /* Compute inf-norm of residual */
infnorm = 0.0; infnorm = 0.0;
@ -187,7 +185,6 @@ spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double
} }
} }
free(work);
free(mob); free(mob);
free(dmob); free(dmob);
@ -277,14 +274,14 @@ phase_upwind_mobility(double darcyflux, double gravityflux, int i, int c,
void void
spu_implicit_assemble(struct UnstructuredGrid *g, double *s0, double *s, double *mob, double *dmob, spu_implicit_assemble(struct UnstructuredGrid *g, double *s0, double *s, double *mob, double *dmob,
double *dflux, double *gflux, double *src, double dt, sparse_t *S, double *dflux, double *gflux, double *src, double dt, sparse_t *S,
double *b, char *work) double *b)
{ {
int i, k, f, c1, c2, c; int i, k, f, c1, c2, c;
int nc = g->number_of_cells; int nc = g->number_of_cells;
double *m = (double*)work; double m[6] = { 0, 0, 0, 0, 0, 0 };
double *dm = m + 2; double dm[2] = { 0, 0 };
int *cix = (int*)(dm + 2); int cix[2] = { 0, 0 };
double m1, m2, dm1, dm2, mt2; double m1, m2, dm1, dm2, mt2;
int *pja; int *pja;

View File

@ -19,7 +19,7 @@ typedef struct Sparse {
void void
spu_implicit_assemble(struct UnstructuredGrid *g, double *s0, double *s, double *mob, double *dmob, spu_implicit_assemble(struct UnstructuredGrid *g, double *s0, double *s, double *mob, double *dmob,
double *dflux, double *gflux, double *src, double dt, sparse_t *S, double *dflux, double *gflux, double *src, double dt, sparse_t *S,
double *b, char *work); double *b);
double double
spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double x0, int ntab, double *tab, spu_implicit(struct UnstructuredGrid *g, double *s0, double *s, double h, double x0, int ntab, double *tab,