Commit 5fb3baff authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some minor correction to eliminate warnings and pedantic errors

parent af1268e7
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config.h */
#pragma once #pragma once
/** \brief current AMDiS version */ /** \brief current AMDiS version */
...@@ -35,4 +59,4 @@ ...@@ -35,4 +59,4 @@
error: not supported compiler error: not supported compiler
#endif #endif
#include "config/Config_defaults.h" #include "config/Config_defaults.h"
\ No newline at end of file
...@@ -84,7 +84,7 @@ namespace AMDiS { ...@@ -84,7 +84,7 @@ namespace AMDiS {
virtual ~NullCreator() {} virtual ~NullCreator() {}
/// Implementation of \ref CreatorInterface::isNullCreator() /// Implementation of \ref CreatorInterface::isNullCreator()
bool isNullCreator() override virtual bool isNullCreator() override
{ {
return true; return true;
} }
......
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_clang.h */
#pragma once #pragma once
#define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#define COMPILER_VERSION "Clang: CLANG_VERSION"
#define COMPILER_NAME "clang"
#define COMPILER_VERSION CLANG_VERSION
// alignement specification // alignement specification
// ------------------------ // ------------------------
...@@ -21,6 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -21,6 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
// -------------- // --------------
#if __cplusplus > 199711L #if __cplusplus > 199711L
// __has_feature(cxx_rvalue_references)
#if CLANG_VERSION >= 20900 #if CLANG_VERSION >= 20900
#define HAS_VARIADIC_TEMPLATES 1 #define HAS_VARIADIC_TEMPLATES 1
#endif #endif
...@@ -57,4 +84,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -57,4 +84,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_TYPED_ENUMS 1 #define HAS_TYPED_ENUMS 1
#endif #endif
#endif #endif
\ No newline at end of file
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_defaults.h */
#pragma once #pragma once
#ifndef COMPILER_NAME #ifndef COMPILER_NAME
...@@ -66,4 +90,4 @@ typedef size_t aligned_size_t; ...@@ -66,4 +90,4 @@ typedef size_t aligned_size_t;
#ifndef HAS_TYPED_ENUMS #ifndef HAS_TYPED_ENUMS
#define HAS_TYPED_ENUMS 0 #define HAS_TYPED_ENUMS 0
#endif #endif
\ No newline at end of file
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_gcc.h */
#pragma once #pragma once
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#define COMPIER_NAME "gcc" #define COMPILER_NAME "gcc"
#define COMPILER_VERSION GCC_VERSION #define COMPILER_VERSION GCC_VERSION
// alignement specification // alignement specification
...@@ -31,7 +55,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -31,7 +55,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_ALIAS_TEMPLATES 1 #define HAS_ALIAS_TEMPLATES 1
#endif #endif
#if __cpp_decltype >= 200707 #if GCC_VERSION >= 40300
#define HAS_DECLTYPE 1 #define HAS_DECLTYPE 1
#endif #endif
...@@ -59,4 +83,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -59,4 +83,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_TYPED_ENUMS 1 #define HAS_TYPED_ENUMS 1
#endif #endif
#endif #endif
\ No newline at end of file
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_intel.h */
#pragma once #pragma once
// MMmm (M...major, m...minor) // MMmm (M...major, m...minor)
#define INTEL_VERSION __INTEL_COMPILER #define INTEL_VERSION __INTEL_COMPILER
#define COMPIER_NAME "icc" #define COMPILER_NAME "icc"
#define COMPILER_VERSION INTEL_VERSION #define COMPILER_VERSION INTEL_VERSION
// alignement specification // alignement specification
...@@ -60,4 +84,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; ...@@ -60,4 +84,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#define HAS_TYPED_ENUMS 1 #define HAS_TYPED_ENUMS 1
#endif #endif
#endif #endif
\ No newline at end of file
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_msc.h */
#pragma once #pragma once
#define MSC_VERSION _MSV_VER #define MSC_VERSION _MSV_VER
...@@ -6,7 +30,7 @@ ...@@ -6,7 +30,7 @@
// MSC_VERSION == 1600 (Visual Studio 2010) // MSC_VERSION == 1600 (Visual Studio 2010)
// MSC_VERSION == 1500 (Visual Studio 2008) // MSC_VERSION == 1500 (Visual Studio 2008)
#define COMPIER_NAME "msc" #define COMPILER_NAME "msc"
#define COMPILER_VERSION MSC_VERSION #define COMPILER_VERSION MSC_VERSION
// alignement specification // alignement specification
...@@ -63,4 +87,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; ...@@ -63,4 +87,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#define HAS_TYPED_ENUMS 1 #define HAS_TYPED_ENUMS 1
#endif #endif
#endif #endif
\ No newline at end of file
/******************************************************************************
*
* AMDiS - Adaptive multidimensional simulations
*
* Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
* Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
*
* Authors:
* Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This file is part of AMDiS
*
* See also license.opensource.txt in the distribution.
*
******************************************************************************/
/** \file Config_pgi.h */
#pragma once #pragma once
#define PGI_VERSION (__PGIC__ * 10000 + __PGIC_MINOR * 100 + __PGIC_PATCHLEVEL__) #define PGI_VERSION (__PGIC__ * 10000 + __PGIC_MINOR * 100 + __PGIC_PATCHLEVEL__)
#define COMPIER_NAME "pgi" #define COMPILER_NAME "pgi"
#define COMPILER_VERSION PGI_VERSION #define COMPILER_VERSION PGI_VERSION
\ No newline at end of file
...@@ -66,7 +66,7 @@ namespace AMDiS ...@@ -66,7 +66,7 @@ namespace AMDiS
}; };
template<typename F> template<typename F>
struct functor_degree<F, typename std::enable_if<boost::is_base_of<FunctorBase, F>::value>::type > struct functor_degree<F, typename enable_if< boost::is_base_of<FunctorBase, F> >::type >
{ {
template<typename... Int> template<typename... Int>
static int eval(F f, Int... d) { return f.getDegree(d...); } static int eval(F f, Int... d) { return f.getDegree(d...); }
...@@ -217,9 +217,9 @@ namespace AMDiS ...@@ -217,9 +217,9 @@ namespace AMDiS
{ {
// result of generator-functions (used for enable_if constructs) // result of generator-functions (used for enable_if constructs)
template<typename F, typename... Terms> template<typename F, typename... Terms>
struct FunctionN : boost::enable_if struct FunctionN : enable_if
< <
typename boost::mpl::and_< typename traits::is_valid_arg<Terms>::type... >::type, typename and_< typename traits::is_valid_arg<Terms>::type... >::type,
expressions::FunctionN< F, typename traits::to_expr<Terms>::type...> expressions::FunctionN< F, typename traits::to_expr<Terms>::type...>
> {}; > {};
......
...@@ -187,7 +187,7 @@ namespace AMDiS ...@@ -187,7 +187,7 @@ namespace AMDiS
Eye() { Eye() {
M = 0; M = 0;
for (size_t i = 0; i < Global::getGeo(WORLD); ++i) for (size_t i = 0; i < (size_t)Global::getGeo(WORLD); ++i)
M[i][i] = 1; M[i][i] = 1;
} }
......
...@@ -134,14 +134,15 @@ namespace AMDiS ...@@ -134,14 +134,15 @@ namespace AMDiS
inline typename result_of::UnaryExpr<Functor, Term>::type inline typename result_of::UnaryExpr<Functor, Term>::type
unary_expr(const Term& t) unary_expr(const Term& t)
{ {
return function_< Functor< typename Term::value_type > >(t); typedef Functor< typename Term::value_type > F;
return function_(F(), t);
} }
template<class Functor, typename Term> template<class F, typename Term>
inline typename result_of::UnaryExprFull<Functor, Term>::type inline typename result_of::UnaryExprFull<F, Term>::type
unary_expr_full(const Term& t) unary_expr_full(const Term& t)
{ {
return function_< Functor >(t); return function_(F(), t);
} }
...@@ -152,9 +153,8 @@ namespace AMDiS ...@@ -152,9 +153,8 @@ namespace AMDiS
{ {
typedef typename traits::to_expr<Term1>::to Expr1; typedef typename traits::to_expr<Term1>::to Expr1;
typedef typename traits::to_expr<Term2>::to Expr2; typedef typename traits::to_expr<Term2>::to Expr2;
return function_ typedef Functor< typename Expr1::type::value_type, typename Expr2::type::value_type > F;
< Functor< typename Expr1::type::value_type, typename Expr2::type::value_type > > return function_(F(), Expr1::get(t1), Expr2::get(t2));
(Expr1::get(t1), Expr2::get(t2));
} }
......
...@@ -107,4 +107,4 @@ namespace AMDiS { namespace io { ...@@ -107,4 +107,4 @@ namespace AMDiS { namespace io {
#endif #endif
} }
} } } }
\ No newline at end of file
...@@ -204,7 +204,7 @@ namespace AMDiS { namespace io { ...@@ -204,7 +204,7 @@ namespace AMDiS { namespace io {
void writeParallelFile(string name, int nRanks, void writeParallelFile(string name, int nRanks,
string fnPrefix, string fnPostfix, string fnPrefix, string fnPostfix,
vector<string> &componentNames, const vector<string> &componentNames,
::AMDiS::io::VtkWriter::Vtuformat format, ::AMDiS::io::VtkWriter::Vtuformat format,
bool highPrecision, bool highPrecision,
bool writeAsVector bool writeAsVector
......
...@@ -176,4 +176,4 @@ namespace mtl ...@@ -176,4 +176,4 @@ namespace mtl
} // end namespace mtl } // end namespace mtl
#endif // AMDIS_BLOCK_MTL_MATRIX_H #endif // AMDIS_BLOCK_MTL_MATRIX_H
\ No newline at end of file
...@@ -103,7 +103,7 @@ namespace AMDiS { ...@@ -103,7 +103,7 @@ namespace AMDiS {
} }
/// Implementation of \ref ITL_PreconditionerBase::init() /// Implementation of \ref ITL_PreconditionerBase::init()
void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix) override virtual void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix) override
{ {
if (precon) if (precon)
delete precon; delete precon;
...@@ -111,7 +111,7 @@ namespace AMDiS { ...@@ -111,7 +111,7 @@ namespace AMDiS {
} }
/// Implementation of \ref PreconditionerInterface::exit() /// Implementation of \ref PreconditionerInterface::exit()
void exit() override virtual void exit() override
{ {
if (precon) { if (precon) {
delete precon; delete precon;
...@@ -120,14 +120,14 @@ namespace AMDiS { ...@@ -120,14 +120,14 @@ namespace AMDiS {
} }
/// Implementation of \ref ITL_PreconditionerBase::solve() /// Implementation of \ref ITL_PreconditionerBase::solve()
void solve(const VectorType& vin, VectorType& vout) const override virtual void solve(const VectorType& vin, VectorType& vout) const override
{ {
assert(precon != NULL); assert(precon != NULL);
precon->solve(vin, vout); precon->solve(vin, vout);
} }
/// Implementation of \ref ITL_PreconditionerBase::adjoint_solve() /// Implementation of \ref ITL_PreconditionerBase::adjoint_solve()
void adjoint_solve(const VectorType& vin, VectorType& vout) const override virtual void adjoint_solve(const VectorType& vin, VectorType& vout) const override
{ {
assert(precon != NULL); assert(precon != NULL);
precon->adjoint_solve(vin, vout); precon->adjoint_solve(vin, vout);
......
...@@ -83,7 +83,7 @@ namespace AMDiS { ...@@ -83,7 +83,7 @@ namespace AMDiS {
/// Implementation of \ref RunnerBase::init() /// Implementation of \ref RunnerBase::init()
void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix) override virtual void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix) override
{ {
preconPair.l->init(A, fullMatrix); preconPair.l->init(A, fullMatrix);
preconPair.r->init(A, fullMatrix); preconPair.r->init(A, fullMatrix);
...@@ -91,7 +91,7 @@ namespace AMDiS { ...@@ -91,7 +91,7 @@ namespace AMDiS {
/// Implementation of \ref RunnerBase::solve() /// Implementation of \ref RunnerBase::solve()
int solve(const MatrixType& A , VectorType& x, const VectorType& b) override virtual int solve(const MatrixType& A , VectorType& x, const VectorType& b) override
{ FUNCNAME("ITL_Runner::solve()"); { FUNCNAME("ITL_Runner::solve()");
TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n"); TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n");
...@@ -133,7 +133,7 @@ namespace AMDiS { ...@@ -133,7 +133,7 @@ namespace AMDiS {
/// Implementation of \ref RunnerBase::adjoint_solve() /// Implementation of \ref RunnerBase::adjoint_solve()
int adjoint_solve(const MatrixType& A , VectorType& x, const VectorType& b) override virtual int adjoint_solve(const MatrixType& A , VectorType& x, const VectorType& b) override
{ FUNCNAME("ITL_Runner::adjoint_solve()"); { FUNCNAME("ITL_Runner::adjoint_solve()");
TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n"); TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n");
...@@ -170,7 +170,7 @@ namespace AMDiS { ...@@ -170,7 +170,7 @@ namespace AMDiS {
/// Implementation of \ref RunnerInterface::exit() /// Implementation of \ref RunnerInterface::exit()
void exit() override virtual void exit() override
{ {
preconPair.l->exit(); preconPair.l->exit();
preconPair.r->exit(); preconPair.r->exit();
...@@ -178,14 +178,14 @@ namespace AMDiS { ...@@ -178,14 +178,14 @@ namespace AMDiS {
/// Implementation of \ref RunnerInterface::getLeftPrecon() /// Implementation of \ref RunnerInterface::getLeftPrecon()
PreconditionerInterface* getLeftPrecon() override virtual PreconditionerInterface* getLeftPrecon() override
{ {
return preconPair.l; return preconPair.l;
} }
/// Implementation of \ref RunnerInterface::getRightPrecon() /// Implementation of \ref RunnerInterface::getRightPrecon()
PreconditionerInterface* getRightPrecon() override virtual PreconditionerInterface* getRightPrecon() override
{ {
return preconPair.r; return preconPair.r;
} }
......
...@@ -108,27 +108,27 @@ namespace AMDiS { ...@@ -108,27 +108,27 @@ namespace AMDiS {
} }
/// Implementation of \ref ITL_PreconditionerBase::init() /// Implementation of \ref ITL_PreconditionerBase::init()
void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix_) override virtual void init(const SolverMatrix<Matrix<DOFMatrix*> >& A, const MatrixType& fullMatrix_) override
{ {
fullMatrix = &fullMatrix_; fullMatrix = &fullMatrix_;
runner->init(A, fullMatrix_); runner->init(A, fullMatrix_);
}