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

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
/** \brief current AMDiS version */
......@@ -35,4 +59,4 @@
error: not supported compiler
#endif
#include "config/Config_defaults.h"
\ No newline at end of file
#include "config/Config_defaults.h"
......@@ -84,7 +84,7 @@ namespace AMDiS {
virtual ~NullCreator() {}
/// Implementation of \ref CreatorInterface::isNullCreator()
bool isNullCreator() override
virtual bool isNullCreator() override
{
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
#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
// ------------------------
......@@ -21,6 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
// --------------
#if __cplusplus > 199711L
// __has_feature(cxx_rvalue_references)
#if CLANG_VERSION >= 20900
#define HAS_VARIADIC_TEMPLATES 1
#endif
......@@ -57,4 +84,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_TYPED_ENUMS 1
#endif
#endif
\ No newline at end of file
#endif
/******************************************************************************
*
* 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
#ifndef COMPILER_NAME
......@@ -66,4 +90,4 @@ typedef size_t aligned_size_t;
#ifndef HAS_TYPED_ENUMS
#define HAS_TYPED_ENUMS 0
#endif
\ No newline at end of file
#endif
/******************************************************************************
*
* 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
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#define COMPIER_NAME "gcc"
#define COMPILER_NAME "gcc"
#define COMPILER_VERSION GCC_VERSION
// alignement specification
......@@ -31,7 +55,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_ALIAS_TEMPLATES 1
#endif
#if __cpp_decltype >= 200707
#if GCC_VERSION >= 40300
#define HAS_DECLTYPE 1
#endif
......@@ -59,4 +83,4 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
#define HAS_TYPED_ENUMS 1
#endif
#endif
\ No newline at end of file
#endif
/******************************************************************************
*
* 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
// MMmm (M...major, m...minor)
#define INTEL_VERSION __INTEL_COMPILER
#define COMPIER_NAME "icc"
#define COMPILER_NAME "icc"
#define COMPILER_VERSION INTEL_VERSION
// alignement specification
......@@ -60,4 +84,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#define HAS_TYPED_ENUMS 1
#endif
#endif
\ No newline at end of file
#endif
/******************************************************************************
*
* 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
#define MSC_VERSION _MSV_VER
......@@ -6,7 +30,7 @@
// MSC_VERSION == 1600 (Visual Studio 2010)
// MSC_VERSION == 1500 (Visual Studio 2008)
#define COMPIER_NAME "msc"
#define COMPILER_NAME "msc"
#define COMPILER_VERSION MSC_VERSION
// alignement specification
......@@ -63,4 +87,4 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#define HAS_TYPED_ENUMS 1
#endif
#endif
\ No newline at end of file
#endif
/******************************************************************************
*
* 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
#define PGI_VERSION (__PGIC__ * 10000 + __PGIC_MINOR * 100 + __PGIC_PATCHLEVEL__)
#define COMPIER_NAME "pgi"
#define COMPILER_VERSION PGI_VERSION
\ No newline at end of file
#define COMPILER_NAME "pgi"
#define COMPILER_VERSION PGI_VERSION
......@@ -66,7 +66,7 @@ namespace AMDiS
};
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>
static int eval(F f, Int... d) { return f.getDegree(d...); }
......@@ -217,9 +217,9 @@ namespace AMDiS
{
// result of generator-functions (used for enable_if constructs)
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...>
> {};
......
......@@ -187,7 +187,7 @@ namespace AMDiS
Eye() {
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;
}
......
......@@ -134,14 +134,15 @@ namespace AMDiS
inline typename result_of::UnaryExpr<Functor, Term>::type
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>
inline typename result_of::UnaryExprFull<Functor, Term>::type
template<class F, typename Term>
inline typename result_of::UnaryExprFull<F, Term>::type
unary_expr_full(const Term& t)
{
return function_< Functor >(t);
return function_(F(), t);
}
......@@ -152,9 +153,8 @@ namespace AMDiS
{
typedef typename traits::to_expr<Term1>::to Expr1;
typedef typename traits::to_expr<Term2>::to Expr2;
return function_
< Functor< typename Expr1::type::value_type, typename Expr2::type::value_type > >
(Expr1::get(t1), Expr2::get(t2));
typedef Functor< typename Expr1::type::value_type, typename Expr2::type::value_type > F;
return function_(F(), Expr1::get(t1), Expr2::get(t2));
}
......
......@@ -107,4 +107,4 @@ namespace AMDiS { namespace io {
#endif
}
} }
\ No newline at end of file
} }
......@@ -204,7 +204,7 @@ namespace AMDiS { namespace io {
void writeParallelFile(string name, int nRanks,
string fnPrefix, string fnPostfix,
vector<string> &componentNames,
const vector<string> &componentNames,
::AMDiS::io::VtkWriter::Vtuformat format,
bool highPrecision,
bool writeAsVector
......
......@@ -176,4 +176,4 @@ namespace mtl
} // end namespace mtl
#endif // AMDIS_BLOCK_MTL_MATRIX_H
\ No newline at end of file
#endif // AMDIS_BLOCK_MTL_MATRIX_H
......@@ -103,7 +103,7 @@ namespace AMDiS {
}
/// 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)
delete precon;
......@@ -111,7 +111,7 @@ namespace AMDiS {
}
/// Implementation of \ref PreconditionerInterface::exit()
void exit() override
virtual void exit() override
{
if (precon) {
delete precon;
......@@ -120,14 +120,14 @@ namespace AMDiS {
}
/// 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);
precon->solve(vin, vout);
}
/// 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);
precon->adjoint_solve(vin, vout);
......
......@@ -83,7 +83,7 @@ namespace AMDiS {
/// 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.r->init(A, fullMatrix);
......@@ -91,7 +91,7 @@ namespace AMDiS {
/// 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()");
TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n");
......@@ -133,7 +133,7 @@ namespace AMDiS {
/// 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()");
TEST_EXIT(preconPair.l != NULL)("there is no left preconditioner\n");
......@@ -170,7 +170,7 @@ namespace AMDiS {
/// Implementation of \ref RunnerInterface::exit()
void exit() override
virtual void exit() override
{
preconPair.l->exit();
preconPair.r->exit();
......@@ -178,14 +178,14 @@ namespace AMDiS {
/// Implementation of \ref RunnerInterface::getLeftPrecon()
PreconditionerInterface* getLeftPrecon() override
virtual PreconditionerInterface* getLeftPrecon() override
{
return preconPair.l;
}
/// Implementation of \ref RunnerInterface::getRightPrecon()
PreconditionerInterface* getRightPrecon() override
virtual PreconditionerInterface* getRightPrecon() override
{
return preconPair.r;
}
......
......@@ -108,27 +108,27 @@ namespace AMDiS {
}
/// 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_;
runner->init(A, fullMatrix_);
}
/// Implementation of \ref PreconditionerInterface::init()
void exit() override
virtual void exit() override
{
runner->exit();
}
/// Implementation of \ref ITL_PreconditionerBase::solve()
void solve(const VectorType& b, VectorType& x) const override
virtual void solve(const VectorType& b, VectorType& x) const override
{
initVector(x);
runner->solve(*fullMatrix, x, b);
}
/// Implementation of \ref ITL_PreconditionerBase::adjoint_solve()
void adjoint_solve(const VectorType& b, VectorType& x) const override
virtual void adjoint_solve(const VectorType& b, VectorType& x) const override
{
initVector(x);
runner->adjoint_solve(*fullMatrix, x, b);
......
......@@ -173,11 +173,11 @@ namespace AMDiS {
protected:
/// Implementation of \ref LinearSolverInterface::solveLinearSystem()
int solveLinearSystem(const SolverMatrix<Matrix<DOFMatrix*> >& A,
SystemVector& x,
SystemVector& b,
bool createMatrixData,
bool storeMatrixData) override
virtual int solveLinearSystem(const SolverMatrix<Matrix<DOFMatrix*> >& A,
SystemVector& x,
SystemVector& b,
bool createMatrixData,
bool storeMatrixData) override
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MPI::COMM_WORLD.Barrier();
......
......@@ -52,7 +52,7 @@ namespace AMDiS {
}
/// 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
{
if (solver != NULL) {
delete solver;
......@@ -67,7 +67,7 @@ namespace AMDiS {
}
/// 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("Umfpack_Runner::solve()");
TEST_EXIT(solver != NULL)("The umfpack solver was not initialized\n");
......@@ -89,7 +89,7 @@ namespace AMDiS {
}
/// Implementation of \ref RunnerInterface::adjoint_solve()
void exit() override {}
virtual void exit() override {}
~Umfpack_Runner()
{
......
......@@ -156,7 +156,9 @@ public:
if (applyDirichletBC(singularDirichletBC[k], asmMatrix, asmVector))
++num_dbc;
}
MSG_DBG("DBC applied at %d DOFs\n", num_dbc);
#if DEBUG
MSG("DBC applied at %d DOFs\n", num_dbc);
#endif
// update solverMatrix
if (asmMatrix && (singularDirichletBC.size() > 0 || manualPeriodicBC.size() > 0)) {
......@@ -199,7 +201,6 @@ public:
void addDirichletBC(BoundaryType type, int row, int col,
ValueContainer *values)
{
MSG("addDirichletBC(%d, %d)\n", row, col);
BoundaryTypeContainer *bound = new BoundaryTypeContainer(type);
DirichletBcDataList.push_back(
new DirichletBcData<BoundaryTypeContainer, ValueContainer>(
......
......@@ -89,15 +89,15 @@ public:
}
/// This method is called before \ref beginIteration, \ref oneIteration and \ref endIteration.
virtual void initTimestep(AdaptInfo *adaptInfo)
virtual void initTimestep(AdaptInfo *adaptInfo) override
{}
/// calls \ref writeFiles
virtual void closeTimestep(AdaptInfo *adaptInfo);
virtual void closeTimestep(AdaptInfo *adaptInfo) override;
virtual void beginIteration(AdaptInfo *adaptInfo);
virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION);
virtual void endIteration(AdaptInfo *adaptInfo);
virtual void beginIteration(AdaptInfo *adaptInfo) override;
virtual Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo = FULL_ITERATION) override;
virtual void endIteration(AdaptInfo *adaptInfo) override;
/// Calls writeFiles of the problem
virtual void writeFiles(AdaptInfo *adaptInfo, bool force)
......
......@@ -42,15 +42,15 @@ namespace detail {
CahnHilliard(const std::string &name_);
~CahnHilliard() {};
void solveInitialProblem(AMDiS::AdaptInfo *adaptInfo) override;
virtual void solveInitialProblem(AMDiS::AdaptInfo *adaptInfo) override;
double getEpsilon() { return eps; }
int getDoubleWellType() { return doubleWell; }
void fillOperators() override;
void fillBoundaryConditions() override {}
virtual void fillOperators() override;
virtual void fillBoundaryConditions() override {}
void finalizeData() override;
virtual void finalizeData() override;
protected: // protected variables
......
......@@ -24,9 +24,18 @@ namespace AMDiS { namespace base_problems {
CahnHilliardNavierStokes_RB::CahnHilliardNavierStokes_RB(const std::string &name_) :
super(name_),
reinit(NULL),
velocity(NULL),
useMobility(false),
useConservationForm(false),
dim(2),
laplaceType(0),
nonLinTerm(3),
doubleWell(1),
oldTimestep(0.0),
viscosity(1.0),
density(1.0),
c(0.0),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
......@@ -34,16 +43,8 @@ CahnHilliardNavierStokes_RB::CahnHilliardNavierStokes_RB(const std::string &name
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
laplaceType(0),
nonLinTerm(3),
oldTimestep(0.0),
viscosity(1.0),
density(1.0),
c(0.0),
sigma(1.0),
surfaceTension(1.0),
reinit(NULL),
velocity(NULL),
fileWriter(NULL)