Commit c8eeb55d authored by Gyorgy Farkas's avatar Gyorgy Farkas

Virtual destructors were added in abstract base classes

parent bf049b27
......@@ -66,7 +66,7 @@ MACRO(SET_COMMON_PROPERTIES name)
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX -g)
SET_TARGET_PROPERTIES(${name} PROPERTIES MINSIZEREL_POSTFIX -ms)
SET_TARGET_PROPERTIES(${name} PROPERTIES RELWITHDEBINFO_POSTFIX -rg)
IF (MSVC)
# Enable production-level warnings
TARGET_COMPILE_OPTIONS(${name} PRIVATE /W4)
......@@ -84,6 +84,7 @@ MACRO(SET_COMMON_PROPERTIES name)
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# For GNU compilers add pedantic warnings
TARGET_COMPILE_OPTIONS(${name} PRIVATE -Wpedantic)
TARGET_COMPILE_OPTIONS(${name} PRIVATE -Wnon-virtual-dtor)
ENDIF()
# Temporarily disable warnings about comparing signed and unsigned
TARGET_COMPILE_OPTIONS(${name} PRIVATE -Wno-sign-compare)
......@@ -92,7 +93,7 @@ MACRO(SET_COMMON_PROPERTIES name)
IF (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
TARGET_COMPILE_OPTIONS(${name} PRIVATE -fpermissive)
ENDIF()
# Disable dignostic about partially overloaded virtual functions
IF (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
TARGET_COMPILE_OPTIONS(${name} PRIVATE -diag-disable 654)
......@@ -117,19 +118,19 @@ MACRO(SET_COMMON_PROPERTIES name)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_DEBUG")
IF ( NEKTAR_FULL_DEBUG )
SET(CMAKE_CXX_FLAGS_DEBUG
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_FULLDEBUG")
ENDIF( NEKTAR_FULL_DEBUG)
# Define version
SET_PROPERTY(TARGET ${name}
APPEND PROPERTY COMPILE_DEFINITIONS
NEKTAR_VERSION=\"${NEKTAR_VERSION}\")
SET(CMAKE_CXX_FLAGS_RELEASE
SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -DNEKTAR_RELEASE")
ENDIF(NOT ${CMAKE_CXX_FLAGS_DEBUG} MATCHES ".*DNEKTAR_DEBUG.*")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
# The static libraries must be compiled with position independent
# code on 64 bit Linux.
......
......@@ -186,6 +186,8 @@ public:
}
virtual void Process(po::variables_map &vm) = 0;
virtual ~Module() = default;
virtual std::string GetModuleName() = 0;
virtual std::string GetModuleDescription()
......
......@@ -43,43 +43,43 @@ namespace Nektar
{
template <typename Dim, typename DataType>
class Array;
namespace LibUtilities
{
/**
* The NektarFFT class is a virtual class to manage the use of the FFT to do Fwd/Bwd transformations
* and convolutions. The function here defined will link to a proper implementation of the FFT algorithm.
* Depending on the user definition the functions can link to a class which is a wrapper around the FFTW
* Depending on the user definition the functions can link to a class which is a wrapper around the FFTW
* library or to a specific FFT implementation.
*/
class NektarFFT;
// A shared pointer to the NektarFFT object
typedef std::shared_ptr<NektarFFT> NektarFFTSharedPtr;
/// Datatype of the NekFactory used to instantiate classes derived from
/// the NektarFFT class.
typedef LibUtilities::NekFactory< std::string, NektarFFT, int> NektarFFTFactory;
LIB_UTILITIES_EXPORT NektarFFTFactory& GetNektarFFTFactory();
class NektarFFT
{
public:
/// Initialises NektarFFT class members.
LIB_UTILITIES_EXPORT NektarFFT(int N);
// Distructor
LIB_UTILITIES_EXPORT ~NektarFFT();
LIB_UTILITIES_EXPORT virtual ~NektarFFT();
/**
* m_N is the dimension of the Fourier transform.
* It means that the coefficient vector and the vector of the variable in physical
* space have size m_N. It is becasue everything is managed just with real data.
*/
int m_N;
/**
* Forward transformation to pass from physical to coefficient space using the FFT.
* This method will take the place of the Matrix-Vector multiplication
......@@ -90,7 +90,7 @@ namespace Nektar
* outarray = vector in coefficient space (length N)
*/
LIB_UTILITIES_EXPORT void FFTFwdTrans(Array<OneD,NekDouble> &phy, Array<OneD,NekDouble> &coef);
/**
* Backward transformation to pass from coefficient to physical space using the FFT.
* This method will take the place of the Matrix-Vector multiplication
......@@ -101,16 +101,16 @@ namespace Nektar
* outarray = vector in physical space (length N)
*/
LIB_UTILITIES_EXPORT void FFTBwdTrans(Array<OneD,NekDouble> &coef, Array<OneD,NekDouble> &phys);
protected:
virtual void v_FFTFwdTrans(Array<OneD,NekDouble> &phys, Array<OneD,NekDouble> &coef);
virtual void v_FFTBwdTrans(Array<OneD,NekDouble> &coef, Array<OneD,NekDouble> &phys);
private:
};
}//end namespace LibUtilities
}//end of namespace Nektar
......
......@@ -63,6 +63,8 @@ public:
NEKMESH_EXPORT Element(
ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes);
NEKMESH_EXPORT virtual ~Element() = default;
/// Returns the ID of the element (or associated edge or face for
/// boundary elements).
NEKMESH_EXPORT unsigned int GetId() const
......@@ -249,7 +251,7 @@ public:
return it->second;
}
}
/// Is this element connected to a boundary
/// Is this element connected to a boundary
NEKMESH_EXPORT bool HasBoundaryLinks()
{
return m_boundaryLinks.size() > 0;
......
......@@ -159,6 +159,8 @@ namespace NekMesh
NEKMESH_EXPORT Module(MeshSharedPtr p_m) : m_mesh(p_m) {}
NEKMESH_EXPORT virtual void Process() = 0;
NEKMESH_EXPORT virtual ~Module() = default;
NEKMESH_EXPORT void RegisterConfig(std::string key,
std::string value = std::string());
NEKMESH_EXPORT void PrintConfig();
......
......@@ -45,6 +45,8 @@ namespace SolverUtils
class FluidInterface
{
public:
virtual ~FluidInterface() = default;
/// Extract array with velocity from physfield
SOLVER_UTILS_EXPORT virtual void GetVelocity(
const Array<OneD, const Array<OneD, NekDouble> > &physfield,
......
......@@ -64,7 +64,9 @@ namespace Nektar
{
public:
Metric(TiXmlElement *metric, bool generate);
virtual ~Metric() = default;
/// Perform the test, given the standard output and error streams
bool Test (std::istream& pStdout, std::istream& pStderr);
/// Perform the test, given the standard output and error streams
......@@ -89,10 +91,10 @@ namespace Nektar
bool m_generate;
/// Pointer to XML structure containing metric definition.
TiXmlElement *m_metric;
virtual bool v_Test (std::istream& pStdout,
virtual bool v_Test (std::istream& pStdout,
std::istream& pStderr) = 0;
virtual void v_Generate (std::istream& pStdout,
virtual void v_Generate (std::istream& pStdout,
std::istream& pSrderr) = 0;
};
......
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