Commit bf3f6ebd authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'tidy/warnings' into 'master'

tidy/warnings

This gets rid of all the compile warnings for the buildbot "full" equivalent on ubuntu 16.04, mac and the compute nodes.

See merge request !743
parents 2b9f3512 f4f75d11
......@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
}
}
char *vars[3] = { "u", "v", "w" };
string vars = "uvw";
for (int i = 0; i < dim; ++i)
{
......
......@@ -14,7 +14,7 @@ NekDouble Tri_sol(NekDouble x, NekDouble y, int order1, int order2);
int main(int argc, char *argv[])
{
int i, j;
int i;
int order, nq1, nq2;
LibUtilities::PointsType Qtype1, Qtype2;
LibUtilities::BasisType btype1, btype2;
......
......@@ -99,7 +99,7 @@ void ProcessAddCompositeID::Process(po::variables_map &vm)
m_f->m_graph->GetComposites();
SpatialDomains::CompositeMapConstIter it;
NekDouble compid;
NekDouble compid=0;
// loop over elements
for (int n = 0; n < exp->GetNumElmts(); ++n)
......
......@@ -862,8 +862,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
//Find neipghbours
int unique_index = 0;
bool unique_index_found = false;
int prog;
int prog=0;
for(i = 0; i < m_nvert; ++i)
{
if(verbose)
......@@ -871,7 +870,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
prog = LibUtilities::PrintProgressbar(i,m_nvert,
"Nearest verts",prog);
}
BPoint queryPoint = inPoints[i].first;
......@@ -882,7 +881,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
}
else
{
// find nearest 10 points within the distance box
std::vector<PointPair> result;
rtree.query(bgi::nearest(queryPoint, 10), std::back_inserter(result));
......@@ -898,7 +897,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
{
id2 = result[id1].second;
samept.insert(id2);
if(global_to_unique_map[id2] <unique_index)
{
new_index = global_to_unique_map[id2];
......@@ -919,7 +918,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
}
}
}
if(verbose)
{
cout << endl;
......
......@@ -83,7 +83,7 @@ void ProcessMultiShear::Process(po::variables_map &vm)
}
}
int nstart, i, j, nfields;
int nstart, i, j, nfields=0;
bool wssg = false;
NekDouble nfld = m_config["N"].as<NekDouble>();
string fromfld, basename, endname, nstartStr;
......
......@@ -108,7 +108,7 @@ void ProcessPointDataToFld::Process(po::variables_map &vm)
int i, j;
bool setnantovalue = false;
NekDouble defvalue;
NekDouble defvalue=0.0;
if (!boost::iequals(m_config["setnantovalue"].as<string>(), "NotSet"))
{
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description:
// Description:
//
///////////////////////////////////////////////////////////////////////////////
......
......@@ -28,8 +28,8 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: C functions to provide access to managers.
//
// Description: C functions to provide access to managers.
//
///////////////////////////////////////////////////////////////////////////////
......@@ -44,7 +44,7 @@
namespace Nektar
{
namespace LibUtilities
namespace LibUtilities
{
typedef NekManager<PointsKey, Points<NekDouble>, PointsKey::opLess> PointsManagerT;
......@@ -56,4 +56,3 @@ namespace Nektar
} // end of namespace LibUtilities
} // end of namespace Nektar
#endif //NEKTAR_LIB_UTILIITIES_FOUNDATIONS_MANAGER_ACCESS_H
......@@ -89,7 +89,11 @@ void TetGenInterface::InitialMesh(map<int, NodeSharedPtr> tgidton,
surface.facetmarkerlist[i] = 0;
}
tetrahedralize("pYzqQ", &surface, &output);
string cmd = "pYzqQ";
char *cstr = new char[cmd.length() + 1];
strcpy(cstr, cmd.c_str());
tetrahedralize(cstr, &surface, &output);
}
void TetGenInterface::GetNewPoints(int num,
......@@ -118,7 +122,11 @@ void TetGenInterface::RefineMesh(std::map<int, NekDouble> delta)
input.pointmtrlist[i] = delta[i];
}
tetrahedralize("pYrmzq1.1/0QO2/7", &input, &output);
string cmd = "pYrmzq1.1/0QO2/7";
char *cstr = new char[cmd.length() + 1];
strcpy(cstr, cmd.c_str());
tetrahedralize(cstr, &input, &output);
}
vector<Array<OneD, int> > TetGenInterface::Extract()
......
......@@ -114,14 +114,19 @@ void TriangleInterface::Mesh(bool Quality)
dt.in.holelist[(i - 1) * 2 + 1] = m_centers[i][1];
}
string cmd;
if (Quality)
{
dt.triangulate("pqY");
cmd = "pqY";
}
else if (!Quality)
{
dt.triangulate("pY");
cmd = "pY";
}
char *cstr = new char[cmd.length() + 1];
strcpy(cstr, cmd.c_str());
dt.triangulate(cstr);
}
void TriangleInterface::SetUp()
......
......@@ -58,6 +58,8 @@ inline OctantFace GetReverseFace(OctantFace f)
case eRight:
return eLeft;
}
return eUp;
}
Octant::Octant(int i, OctantSharedPtr p, Array<OneD, OctantFace> dir)
......@@ -496,14 +498,9 @@ void Octant::RemoveNeigbour(int id, OctantFace f)
{
vector<OctantSharedPtr> tmp = m_neigbours[f];
m_neigbours[f].clear();
bool found = false;
for (int i = 0; i < tmp.size(); i++)
{
if (tmp[i]->GetId() == id)
{
found = true;
}
else
if (tmp[i]->GetId() != id)
{
m_neigbours[f].push_back(tmp[i]);
}
......
......@@ -249,6 +249,7 @@ public:
return m_loc[2] - m_hd;
break;
}
return 0.0;
}
/**
......
......@@ -410,7 +410,7 @@ bool Octree::VerifyNeigbours()
{
if (it->second.size() == 0)
{
NekDouble expectedfx;
NekDouble expectedfx = 0.0;
switch (it->first)
{
case eUp:
......
......@@ -92,15 +92,12 @@ bool BGFSUpdate(OptiObjSharedPtr opti, DNekMat &J, DNekMat &B, DNekMat &H)
Array<OneD, NekDouble> xci(xi.num_elements());
bool hitbounded = false;
for (int i = 0; i < xci.num_elements(); i++)
{
if (xi[i] + d(i, 0) < li[i])
{
xci[i] = li[i];
Fset.erase(i);
hitbounded = true;
continue;
}
else
......@@ -112,7 +109,6 @@ bool BGFSUpdate(OptiObjSharedPtr opti, DNekMat &J, DNekMat &B, DNekMat &H)
{
xci[i] = ui[i];
Fset.erase(i);
hitbounded = true;
continue;
}
else
......@@ -173,22 +169,6 @@ bool BGFSUpdate(OptiObjSharedPtr opti, DNekMat &J, DNekMat &B, DNekMat &H)
}
}
/*if(hitbounded)
{
cout << endl << endl << Z << endl << endl;
cout << rg << endl << endl;
cout << du << endl << endl;
cout << alpha << endl << endl;
cout << grad << endl << endl;
for(int i = 0; i < xi.num_elements(); i++)
{
cout << xci[i] << " " << xibar[i] << endl;
}
exit(-1);
}*/
Vmath::Vsub(xci.num_elements(), &xibar[0], 1, &xi[0], 1, &dk[0], 1);
NekDouble c = 0.0;
......
......@@ -124,11 +124,8 @@ void HOSurfaceMesh::Process()
FaceSharedPtr f = m_mesh->m_element[2][i]->GetFaceLink();
bool d2 = false;
if(!f)
{
d2 = true;
f = boost::shared_ptr<Face>(new Face(m_mesh->m_element[2][i]->GetVertexList(),
vector<NodeSharedPtr>(),
m_mesh->m_element[2][i]->GetEdgeList(),
......
......@@ -3719,7 +3719,7 @@ void DelaunayTriangle::testtriangle(struct mesh *m, struct behavior *b, struct o
double dxod2, dyod2, dxda2, dyda2, dxao2, dyao2;
double apexlen, orglen, destlen, minedge;
double angle;
double area;
double area=0.0;
double dist1, dist2;
subseg sptr; /* Temporary variable used by tspivot(). */
triangle ptr; /* Temporary variable used by oprev() and dnext(). */
......@@ -4684,7 +4684,6 @@ enum insertvertexresult DelaunayTriangle::insertvertex(struct mesh *m,
vertex leftvertex, rightvertex, botvertex, topvertex, farvertex;
vertex segmentorg, segmentdest;
double attrib;
double area;
enum insertvertexresult success;
enum locateresult intersect;
int doflip;
......@@ -5570,7 +5569,7 @@ void DelaunayTriangle::undovertex(struct mesh *m, struct behavior *b)
/* */
/*****************************************************************************/
void DelaunayTriangle::vertexsort(vertex *sortarray, int arraysize)
void DelaunayTriangle::vertexsort(vertex *sortarray, unsigned int arraysize)
{
int left, right;
int pivot;
......@@ -6585,7 +6584,6 @@ void DelaunayTriangle::segmentintersection(struct mesh *m,
vertex leftvertex, rightvertex;
vertex newvertex;
enum insertvertexresult success;
enum finddirectionresult collinear;
double ex, ey;
double tx, ty;
double etx, ety;
......@@ -6657,7 +6655,7 @@ void DelaunayTriangle::segmentintersection(struct mesh *m,
/* Inserting the vertex may have caused edge flips. We wish to rediscover
*/
/* the edge connecting endpoint1 to the new intersection vertex. */
collinear = finddirection(m, b, splittri, endpoint1);
finddirection(m, b, splittri, endpoint1);
dest(*splittri, rightvertex);
apex(*splittri, leftvertex);
if ((leftvertex[0] == endpoint1[0]) && (leftvertex[1] == endpoint1[1]))
......@@ -7770,7 +7768,6 @@ void DelaunayTriangle::carveholes(struct mesh *m,
int regions)
{
struct otri searchtri;
struct otri triangleloop;
struct otri *regiontris;
triangle **holetri;
triangle **regiontri;
......@@ -7940,7 +7937,6 @@ void DelaunayTriangle::carveholes(struct mesh *m,
void DelaunayTriangle::tallyencs(struct mesh *m, struct behavior *b)
{
struct osub subsegloop;
int dummy;
traversalinit(&m->subsegs);
subsegloop.ssorient = 0;
......@@ -7948,7 +7944,7 @@ void DelaunayTriangle::tallyencs(struct mesh *m, struct behavior *b)
while (subsegloop.ss != (subseg *)NULL)
{
/* If the segment is encroached, add it to the list. */
dummy = checkseg4encroach(m, b, &subsegloop);
checkseg4encroach(m, b, &subsegloop);
subsegloop.ss = subsegtraverse(m);
}
}
......@@ -7998,7 +7994,6 @@ void DelaunayTriangle::splitencsegs(struct mesh *m, struct behavior *b, int trif
double split;
double multiplier, divisor;
int acuteorg, acuteorg2, acutedest, acutedest2;
int dummy;
int i;
triangle ptr; /* Temporary variable used by stpivot(). */
subseg sptr; /* Temporary variable used by snext(). */
......@@ -8199,9 +8194,9 @@ void DelaunayTriangle::splitencsegs(struct mesh *m, struct behavior *b, int trif
}
/* Check the two new subsegments to see if they're encroached.
*/
dummy = checkseg4encroach(m, b, &currentenc);
checkseg4encroach(m, b, &currentenc);
snextself(currentenc);
dummy = checkseg4encroach(m, b, &currentenc);
checkseg4encroach(m, b, &currentenc);
}
badsubsegdealloc(m, encloop);
......@@ -8565,7 +8560,7 @@ void DelaunayTriangle::writenodes(struct mesh *m,
(int)(outvertices * m->nextras * sizeof(double)));
}
/* Allocate memory for output vertex markers if necessary. */
if ((*pointmarkerlist == (int *)NULL))
if (*pointmarkerlist == (int *)NULL)
{
*pointmarkerlist = (int *)trimalloc((int)(outvertices * sizeof(int)));
}
......@@ -8719,7 +8714,7 @@ void DelaunayTriangle::writepoly(struct mesh *m,
(int *)trimalloc((int)(m->subsegs.items * 2 * sizeof(int)));
}
/* Allocate memory for output segment markers if necessary. */
if ((*segmentmarkerlist == (int *)NULL))
if (*segmentmarkerlist == (int *)NULL)
{
*segmentmarkerlist =
(int *)trimalloc((int)(m->subsegs.items * sizeof(int)));
......@@ -8911,4 +8906,3 @@ void DelaunayTriangle::triangulate(char *triswitches)
}
}
......@@ -1016,7 +1016,7 @@ private:
void triangulatepolygon(struct mesh *m, struct behavior *b, struct otri *firstedge, struct otri *lastedge, int edgecount, int doflip, int triflaws);
void deletevertex(struct mesh *m, struct behavior *b, struct otri *deltri);
void undovertex(struct mesh *m, struct behavior *b);
void vertexsort(vertex *sortarray, int arraysize);
void vertexsort(vertex *sortarray, unsigned int arraysize);
void vertexmedian(vertex *sortarray, int arraysize, int median, int axis);
void alternateaxes(vertex *sortarray, int arraysize, int axis);
long removeghosts(struct mesh *m, struct behavior *b, struct otri *startghost);
......
......@@ -147,11 +147,11 @@ void VolumeMesh::Process()
set<int> cIds;
vector<EdgeLoopSharedPtr> e =
m_mesh->m_cad->GetSurf(symsurfs[i])->GetEdges();
for (int i = 0; i < e.size(); i++)
for (int k = 0; k < e.size(); k++)
{
for (int j = 0; j < e[i]->edges.size(); j++)
for (int j = 0; j < e[k]->edges.size(); j++)
{
cIds.insert(e[i]->edges[j]->GetId());
cIds.insert(e[k]->edges[j]->GetId());
}
}
......
......@@ -367,8 +367,8 @@ namespace Nektar
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray)
{
if(m_base[0]->Collocation() &&
m_base[1]->Collocation() &&
if(m_base[0]->Collocation() &&
m_base[1]->Collocation() &&
m_base[2]->Collocation())
{
MultiplyByQuadratureMetric(inarray,outarray);
......@@ -460,7 +460,7 @@ namespace Nektar
Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
}
else
{
{
ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
"Insufficient workspace size");
......@@ -470,7 +470,7 @@ namespace Nektar
if(colldir0)
{
// reshuffle data for next operation.
// reshuffle data for next operation.
for(int n = 0; n < nmodes0; ++n)
{
Vmath::Vcopy(nquad1*nquad2,inarray.get()+n,nquad0,
......@@ -487,7 +487,7 @@ namespace Nektar
if(colldir1)
{
// reshuffle data for next operation.
// reshuffle data for next operation.
for(int n = 0; n < nmodes1; ++n)
{
Vmath::Vcopy(nquad2*nmodes0,tmp0.get()+n,nquad1,
......@@ -504,7 +504,7 @@ namespace Nektar
if(colldir2)
{
// reshuffle data for next operation.
// reshuffle data for next operation.
for(int n = 0; n < nmodes2; ++n)
{
Vmath::Vcopy(nmodes0*nmodes1,tmp1.get()+n,nquad2,
......@@ -617,7 +617,7 @@ namespace Nektar
eta[1] = xi[1];
eta[2] = xi[2];
}
/**
* @note for hexahedral expansions _base[0] (i.e. p) modes run fastest.
*/
......@@ -807,7 +807,7 @@ namespace Nektar
int StdHexExp::v_GetFaceNumPoints(const int i) const
{
ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
if (i == 0 || i == 5)
{
return m_base[0]->GetNumPoints()*
......@@ -830,7 +830,7 @@ namespace Nektar
{
ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
ASSERTL2(j == 0 || j == 1, "face direction is out of range");
if (i == 0 || i == 5)
{
return m_base[j]->GetPointsKey();
......@@ -876,7 +876,7 @@ namespace Nektar
dir = k+1;
break;
}
return EvaluateQuadFaceBasisKey(k,
m_base[dir]->GetBasisType(),
m_base[dir]->GetNumPoints(),
......@@ -984,8 +984,8 @@ namespace Nektar
int Q)
{
int i,j;
int nummodesA, nummodesB;
int nummodesA=0, nummodesB=0;
ASSERTL1(GetEdgeBasisType(0) == GetEdgeBasisType(1) &&
GetEdgeBasisType(0) == GetEdgeBasisType(2),
"Method only implemented if BasisType is indentical in "
......@@ -993,7 +993,7 @@ namespace Nektar
ASSERTL1(GetEdgeBasisType(0) == LibUtilities::eModified_A ||
GetEdgeBasisType(0) == LibUtilities::eGLL_Lagrange,
"Method only implemented for Modified_A or GLL_Lagrange BasisType");
const int nummodes0 = m_base[0]->GetNumModes();
const int nummodes1 = m_base[1]->GetNumModes();
const int nummodes2 = m_base[2]->GetNumModes();
......@@ -1016,7 +1016,7 @@ namespace Nektar
nummodesB = nummodes2;
break;
}
bool CheckForZeroedModes = false;
if (P == -1)
......@@ -1029,15 +1029,15 @@ namespace Nektar
{
CheckForZeroedModes = true;
}
bool modified = (GetEdgeBasisType(0) == LibUtilities::eModified_A);
int nFaceCoeffs = P*Q;
if(maparray.num_elements() != nFaceCoeffs)
{
maparray = Array<OneD, unsigned int>(nFaceCoeffs);
}
if(signarray.num_elements() != nFaceCoeffs)
{
signarray = Array<OneD, int>(nFaceCoeffs,1);
......@@ -1046,9 +1046,9 @@ namespace Nektar
{
fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
}
Array<OneD, int> arrayindx(nFaceCoeffs);
for(i = 0; i < Q; i++)
{
for(j = 0; j < P; j++)
......@@ -1067,7 +1067,7 @@ namespace Nektar
int offset = 0;
int jump1 = 1;
int jump2 = 1;
switch(fid)
{
case 5:
......@@ -1115,7 +1115,7 @@ namespace Nektar
offset = nummodes0-1;
jump1 = nummodes0*nummodes1;
jump2 = nummodes0;
}
}
case 4:
......@@ -1127,7 +1127,7 @@ namespace Nektar
default:
ASSERTL0(false,"fid must be between 0 and 5");
}
for(i = 0; i < Q; i++)
{
for(j = 0; j < P; j++)
......@@ -1136,7 +1136,7 @@ namespace Nektar
= i*jump1 + j*jump2 + offset;
}
}
if(CheckForZeroedModes)
{
......@@ -1152,7 +1152,7 @@ namespace Nektar
maparray[arrayindx[i*P+j]] = maparray[0];
}
}
for(i = nummodesB; i < Q; i++)
{
for(j = 0; j < P; j++)
......@@ -1160,14 +1160,14 @@ namespace Nektar
signarray[arrayindx[i*P+j]] = 0.0;
maparray[arrayindx[i*P+j]] = maparray[0];
}
}
}
}
else
{
ASSERTL0(false,"Different trace space face dimention and element face dimention not possible for GLL-Lagrange bases");
}
}
if( (faceOrient==6) || (faceOrient==8) ||
(faceOrient==11) || (faceOrient==12) )
{
......@@ -1182,13 +1182,13 @@ namespace Nektar
signarray[ arrayindx[i*P+j] ] *= -1;
}
}
for(i = 0; i < P; i</