Commit 57812341 authored by David Moxey's avatar David Moxey

Fix more compiler warnings and test crashes on macOS

parent 39c02583
......@@ -6,6 +6,12 @@ RelWithDebInfo MinSizeRel.")
PROJECT(Nektar++ C CXX)
CMAKE_POLICY(SET CMP0022 NEW)
# Defer to use _ROOT variables to avoid Zlib warning
IF (POLICY CMP0074)
CMAKE_POLICY(SET CMP0074 OLD)
ENDIF()
# Nektar++ requires C++11. Try to infer this for older CMake versions (less than
# 3.1.0)
IF ("${CMAKE_VERSION}" VERSION_LESS "3.1")
......
......@@ -648,6 +648,8 @@ GeometrySharedPtr CreateGeom(vector<NekDouble> coords, ShapeType shapeType)
volume = MemoryManager<HexGeom>::AllocateSharedPtr(0, &tmp2[0]);
break;
}
default:
break;
}
return volume;
......
......@@ -87,9 +87,10 @@ void ProcessInterpField::Process(po::variables_map &vm)
std::vector<std::string> files;
// set up session file for from field
char *dummyPrgName = const_cast<char *>("FieldConvert");
ParseUtils::GenerateVector(m_config["fromxml"].as<string>(), files);
fromField->m_session =
LibUtilities::SessionReader::CreateInstance(0, 0, files);
LibUtilities::SessionReader::CreateInstance(1, &dummyPrgName, files);
// Set up range based on min and max of local parallel partition
SpatialDomains::DomainRangeShPtr rng =
......
......@@ -108,9 +108,11 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
FieldSharedPtr fromField = std::shared_ptr<Field>(new Field());
std::vector<std::string> files;
ParseUtils::GenerateVector(m_config["fromxml"].as<string>(), files);
// set up session file for from field
char *dummyPrgName = const_cast<char *>("FieldConvert");
fromField->m_session =
LibUtilities::SessionReader::CreateInstance(0, 0, files);
LibUtilities::SessionReader::CreateInstance(1, &dummyPrgName, files);
// Set up range based on min and max of local parallel partition
SpatialDomains::DomainRangeShPtr rng =
MemoryManager<SpatialDomains::DomainRange>::AllocateSharedPtr();
......
......@@ -40,6 +40,12 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/Timer.h>
// Define variable to avoid deprecated warning in Boost 1.69.
#include <boost/version.hpp>
#if BOOST_VERSION >= 106900 && BOOST_VERSION < 107000
#define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include <boost/random/mersenne_twister.hpp> // for mt19937
#include <boost/random/variate_generator.hpp> // for variate_generator
#include <boost/random/normal_distribution.hpp>
......
......@@ -249,7 +249,7 @@ namespace Nektar
m_size[0] = rhs.m_size[0];
m_size[1] = rhs.m_size[1];
m_transpose = rhs.m_transpose;
m_storageType = m_storageType;
m_storageType = rhs.m_storageType;
return *this;
}
......
......@@ -2090,7 +2090,7 @@ namespace Nektar
int P1,
int P2)
{
int n,m,j;
int n,j;
int nFaceCoeffs;
int nBndCoeffs = NumBndryCoeffs();
......@@ -2189,6 +2189,9 @@ namespace Nektar
}
}
break;
default:
ASSERTL0(false, "Invalid shape type.");
break;
}
......
......@@ -164,8 +164,10 @@ void Driver::v_InitObject(ostream &out)
LinNSCondFile += "_LinNS.xml";
LinNSFilename.push_back(meshfile);
LinNSFilename.push_back(LinNSCondFile);
char *dummyPrgName = const_cast<char*>("IncNavierStokesSolver");
session_LinNS = LibUtilities::SessionReader::CreateInstance(
0, NULL, LinNSFilename, m_session->GetComm());
1, &dummyPrgName, LinNSFilename, m_session->GetComm());
SpatialDomains::MeshGraphSharedPtr graph_linns =
SpatialDomains::MeshGraph::Read(session_LinNS);
......
......@@ -736,7 +736,7 @@ void MeshPartition::PartitionGraph(int nParts, bool overlapping)
std::map<int, std::vector<int>> procMap;
for (boost::tie(vertit, vertit_end) = boost::vertices(m_graph);
vertit != vertit_end, i < nLocal; ++vertit, ++i)
vertit != vertit_end && i < nLocal; ++vertit, ++i)
{
int toProc = part[i];
numToSend[toProc]++;
......
......@@ -36,6 +36,12 @@
#include <iostream>
// Define variable to avoid deprecated warning in Boost 1.69.
#include <boost/version.hpp>
#if BOOST_VERSION >= 106900 && BOOST_VERSION < 107000
#define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include <boost/random/normal_distribution.hpp>
#include <boost/random/variate_generator.hpp>
......
......@@ -37,6 +37,12 @@
#ifndef NEKTAR_SOLVERS_ACOUSTICSOLVER_EQUATIONSYSTEMS_ACOUSTICSYSTEM_H
#define NEKTAR_SOLVERS_ACOUSTICSOLVER_EQUATIONSYSTEMS_ACOUSTICSYSTEM_H
// Define variable to avoid deprecated warning in Boost 1.69.
#include <boost/version.hpp>
#if BOOST_VERSION >= 106900 && BOOST_VERSION < 107000
#define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include <boost/random/mersenne_twister.hpp>
#include <SolverUtils/Advection/Advection.h>
......
......@@ -565,8 +565,6 @@ namespace Nektar
std::string::size_type indxBeg = womStr.find_first_of(':') + 1;
string filename = womStr.substr(indxBeg,string::npos);
NekComplexDouble coef;
TiXmlDocument doc(filename);
bool loadOkay = doc.LoadFile();
......
......@@ -68,8 +68,6 @@ void AInflow::v_DoBoundary(
{
NekDouble A;
NekDouble u;
NekDouble A_u;
NekDouble u_u;
NekDouble A_r;
NekDouble u_r;
NekDouble A_l;
......
......@@ -69,8 +69,6 @@ void UInflow::v_DoBoundary(
{
NekDouble A;
NekDouble u;
NekDouble A_u;
NekDouble u_u;
NekDouble A_r;
NekDouble u_r;
NekDouble A_l;
......
......@@ -2605,7 +2605,7 @@ void MMFSWE::RossbyWave(unsigned int field, Array<OneD, NekDouble> &outfield)
// disturbancees of Rossby-Haurwitz Wave
NekDouble x0d, y0d, z0d, phi0, theta0;
NekDouble rad_earth = 6.37122 * 1000000;
//NekDouble rad_earth = 6.37122 * 1000000;
phi0 = 40.0 * m_pi / 180.0;
theta0 = 50.0 * m_pi / 180.0;
......
......@@ -44,6 +44,8 @@ namespace Nektar
class MetricFile : public Metric
{
public:
virtual ~MetricFile() {}
static MetricSharedPtr create(TiXmlElement *metric, bool generate)
{
return MetricSharedPtr(new MetricFile(metric, generate));
......
......@@ -64,6 +64,8 @@ namespace Nektar
class MetricRegex : public Metric
{
public:
virtual ~MetricRegex() {}
static MetricSharedPtr create(TiXmlElement *metric, bool generate)
{
return MetricSharedPtr(new MetricRegex(metric, generate));
......
......@@ -71,7 +71,7 @@ void InputNekpp::Process()
vector<string> filename;
filename.push_back(m_config["infile"].as<string>());
char *prgname = "NekMesh";
char *prgname = const_cast<char *>("NekMesh");
LibUtilities::SessionReaderSharedPtr pSession =
LibUtilities::SessionReader::CreateInstance(1, &prgname, filename);
SpatialDomains::MeshGraphSharedPtr graph =
......
......@@ -219,7 +219,7 @@ void OutputNekpp::Process()
filenames[0] = filename;
}
char *prgname = "NekMesh";
char *prgname = const_cast<char *>("NekMesh");
LibUtilities::SessionReaderSharedPtr vSession =
LibUtilities::SessionReader::CreateInstance(1, &prgname, filenames,
m_mesh->m_comm);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment