Commit 4ede6d7a authored by gsell's avatar gsell
Browse files

cleanup: fix GCC 9.2 warnings and some cleanup

parent 269b7b0d
......@@ -80,6 +80,8 @@ class SquarePolynomialVector {
*/
SquarePolynomialVector (const SquarePolynomialVector& pv);
SquarePolynomialVector& operator=(const SquarePolynomialVector&) = default;
/** Construct polynomial vector passing polynomial coefficients as a matrix.
*/
SquarePolynomialVector (int pointDimension,
......
......@@ -1207,6 +1207,12 @@ move_g_1(DragtFinnMap<N> &f, DragtFinnMap<N> &g) {
DragtFinnMap<N> h;
FLieGenerator<double, N> g_neg = - g_1;
/*
:FIXME: Is there a better solution for C++ < C++17
C++17 provides a fallthrough attribute
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
switch(order) {
case 6:
......@@ -1348,7 +1354,7 @@ move_g_1(DragtFinnMap<N> &f, DragtFinnMap<N> &g) {
// for order > 6 the method is not implemented.
break;
}
#pragma GCC diagnostic pop
// Move first-order terms in g_1 across h_2 and combine with f_1.
f.assign(f_1 + g_1.transform(f_mat));
}
......
......@@ -31,6 +31,7 @@ namespace mslang {
height_m(urc[1] - llc[1])
{ }
BoundingBox& operator=(const BoundingBox&) = default;
bool doesIntersect(const BoundingBox &bb) const;
bool isInside(const Vector_t &X) const;
bool isInside(const BoundingBox &b) const;
......
......@@ -14,14 +14,6 @@
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#if defined __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunsequenced"
#elif defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsequence-point"
#endif
#include <algorithm>
#include <cmath>
#include <functional>
......@@ -653,8 +645,10 @@ namespace matheval {
} // namespace matheval
#if defined __clang__
# pragma clang diagnostic pop
#elif defined __GNUC__
# pragma GCC diagnostic pop
#endif
\ No newline at end of file
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -13,7 +13,6 @@
// ------------------------------------------------------------------------
//#define DEBUG_INTERSECT_RAY_BOUNDARY
#ifdef HAVE_SAAMG_SOLVER
#include "Solvers/ArbitraryDomain.h"
#include "Structure/BoundaryGeometry.h"
......@@ -26,7 +25,7 @@
ArbitraryDomain::ArbitraryDomain( BoundaryGeometry * bgeom,
Vector_t nr,
Vector_t hr,
Vector_t /*hr*/,
std::string interpl){
bgeom_m = bgeom;
minCoords_m = bgeom->getmincoords();
......@@ -517,7 +516,7 @@ void ArbitraryDomain::getBoundaryStencil(int idx, int idy, int idz, double &W, d
assert(C > 0);
}
void ArbitraryDomain::constantInterpolation(int idx, int idy, int idz, double& W, double& E, double& S, double& N, double& F, double& B, double& C, double &scaleFactor) {
void ArbitraryDomain::constantInterpolation(int idx, int idy, int idz, double& W, double& E, double& S, double& N, double& F, double& B, double& C, double& /*scaleFactor*/) {
W = -1/(hr[0]*hr[0]);
E = -1/(hr[0]*hr[0]);
......@@ -726,4 +725,11 @@ inline void ArbitraryDomain::rotateZAxisWithQuaternion(Vector_t & v, Quaternion_
+ quaternion(3) * quaternion(3));
}
#endif //#ifdef HAVE_SAAMG_SOLVER
\ No newline at end of file
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -130,7 +130,7 @@ void BoxCornerDomain::compute(Vector_t hr){
*/
}
void BoxCornerDomain::compute(Vector_t hr, NDIndex<3> localId){
void BoxCornerDomain::compute(Vector_t /*hr*/, NDIndex<3> /*localId*/){
}
void BoxCornerDomain::getBoundaryStencil(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B, double &C, double &scaleFactor) {
......
......@@ -75,7 +75,7 @@ public:
/// we do not need this
int getNumXY(int z) { return -1;}
int getNumXY(int /*z*/) { return -1;}
/// as a function of z, determine the hight (B) of the geometry
......@@ -179,7 +179,7 @@ private:
inline double getXIntersection(double cx, int z) {
inline double getXIntersection(double cx, int /*z*/) {
if(cx < 0)
return -A_m;
else
......
#ifdef HAVE_SAAMG_SOLVER
//
// Header file for elliptic domain
//
// Copyright (c) 2008-2020
// Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved.
//
// OPAL is licensed under GNU GPL version 3.
//
#include "Solvers/EllipticDomain.h"
......@@ -660,5 +668,10 @@ void EllipticDomain::quadraticInterpolation(int x, int y, int z, double &W, doub
}
}
#endif //#ifdef HAVE_SAAMG_SOLVER
\ No newline at end of file
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
#ifndef ELLIPTICAL_DOMAIN_H
#define ELLIPTICAL_DOMAIN_H
#ifdef HAVE_SAAMG_SOLVER
#include <vector>
#include <map>
......@@ -37,7 +36,7 @@ public:
return ((xx * xx / (SemiMajor * SemiMajor) + yy * yy / (SemiMinor * SemiMinor) < 1) && z != 0 && z != nr[2] - 1);
}
int getNumXY(int z) { return nxy_m; }
int getNumXY(int /*z*/) { return nxy_m; }
/// set semi-minor
void setSemiMinor(double sm) {SemiMinor = sm;}
/// set semi-major
......@@ -115,5 +114,12 @@ private:
};
#endif //#ifdef HAVE_SAAMG_SOLVER
#endif //#ifdef ELLIPTICAL_DOMAIN_H
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
#ifdef HAVE_SAAMG_SOLVER
//#define DBG_STENCIL
#include "Solvers/MGPoissonSolver.h"
......@@ -7,7 +7,6 @@
#include "ArbitraryDomain.h"
#include "EllipticDomain.h"
#include "BoxCornerDomain.h"
//#include "RectangularDomain.h"
#include "Track/Track.h"
#include "Physics/Physics.h"
......@@ -17,8 +16,6 @@
#include "AbstractObjects/OpalData.h"
#include "Utilities/Options.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_CrsMatrix.h"
......@@ -42,8 +39,6 @@
#include "Isorropia_EpetraRedistributor.hpp"
#include "Isorropia_EpetraPartitioner.hpp"
#pragma GCC diagnostic pop
#include <algorithm>
using Teuchos::RCP;
......@@ -172,7 +167,7 @@ MGPoissonSolver::~MGPoissonSolver() {
problem_ptr = Teuchos::null;
}
void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr, double zshift) {
void MGPoissonSolver::computePotential(Field_t& /*rho*/, Vector_t /*hr*/, double /*zshift*/) {
throw OpalException("MGPoissonSolver", "not implemented yet");
}
......@@ -496,7 +491,7 @@ void MGPoissonSolver::IPPLToMap3D(NDIndex<3> localId) {
Map = new Epetra_Map(-1, NumMyElements, &MyGlobalElements[0], 0, Comm);
}
void MGPoissonSolver::ComputeStencil(Vector_t hr, Teuchos::RCP<Epetra_Vector> RHS) {
void MGPoissonSolver::ComputeStencil(Vector_t /*hr*/, Teuchos::RCP<Epetra_Vector> RHS) {
A->PutScalar(0.0);
......@@ -594,4 +589,10 @@ Inform &MGPoissonSolver::print(Inform &os) const {
return os;
}
#endif /* HAVE_SAAMG_SOLVER */
\ No newline at end of file
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
////////////////////////////////////////////////////////////////////////////
//
// This class contains methods for solving Poisson's equation for the
// space charge portion of the calculation.
////////////////////////////////////////////////////////////////////////////
#ifdef HAVE_SAAMG_SOLVER
//
// Copyright (c) 2008-2020
// Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved.
//
// OPAL is licensed under GNU GPL version 3.
//
#ifndef MG_POISSON_SOLVER_H_
#define MG_POISSON_SOLVER_H_
......@@ -14,26 +18,26 @@
//////////////////////////////////////////////////////////////
#include "ml_include.h"
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
#if !defined(HAVE_ML_EPETRA)
#error Epetra support missing in Trilinos installation!
#endif
#if defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS) && defined(HAVE_ML_AZTECOO)
#if !defined(HAVE_ML_TEUCHOS)
#error Teuchos support missing in Trilinos installation!
#endif
#if !defined(HAVE_ML_AZTECOO)
#error Aztecoo support missing in Trilinos installation!
#endif
#include "Epetra_MpiComm.h"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_CrsMatrix.h"
#include "Epetra_MpiComm.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include "Teuchos_ParameterList.hpp"
// #include "BelosLinearProblem.hpp"
// #include "BelosRCGSolMgr.hpp"
#include "Algorithms/PartBunch.h"
#include "BelosTypes.hpp"
......@@ -64,13 +68,6 @@ namespace ML_Epetra {
int * options, double * params, const bool OverWrite);
}
#pragma GCC diagnostic pop
// using Teuchos::RCP;
// using Teuchos::rcp;
// using namespace ML_Epetra;
// using namespace Isorropia;
//////////////////////////////////////////////////////////////
typedef UniformCartesian<3, double> Mesh_t;
typedef ParticleSpatialLayout<double, 3>::SingleParticlePos_t Vector_t;
......@@ -114,13 +111,13 @@ public:
/// force Solver to recompute Epetra_Map
void recomputeMap() { hasParallelDecompositionChanged_m = true; }
double getXRangeMin(unsigned short level) { return bp->getXRangeMin(); }
double getXRangeMax(unsigned short level) { return bp->getXRangeMax(); }
double getYRangeMin(unsigned short level) { return bp->getYRangeMin(); }
double getYRangeMax(unsigned short level) { return bp->getYRangeMax(); }
double getZRangeMin(unsigned short level) { return bp->getZRangeMin(); }
double getZRangeMax(unsigned short level) { return bp->getZRangeMax(); }
void test(PartBunchBase<double, 3> *bunch) { }
double getXRangeMin(unsigned short /*level*/) { return bp->getXRangeMin(); }
double getXRangeMax(unsigned short /*level*/) { return bp->getXRangeMax(); }
double getYRangeMin(unsigned short /*level*/) { return bp->getYRangeMin(); }
double getYRangeMax(unsigned short /*level*/) { return bp->getYRangeMax(); }
double getZRangeMin(unsigned short /*level*/) { return bp->getZRangeMin(); }
double getZRangeMax(unsigned short /*level*/) { return bp->getZRangeMax(); }
void test(PartBunchBase<double, 3>* /*bunch*/) { }
/// useful load balance information
void printLoadBalanceStats();
......@@ -326,39 +323,17 @@ protected:
};
inline Inform &operator<<(Inform &os, const MGPoissonSolver &fs) {
return fs.print(os);
}
#else
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_MPI
#include "mpi.h"
#endif
int main(int argc, char *argv[]) {
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
#endif
puts("Please configure ML with:");
puts("--enable-epetra");
puts("--enable-teuchos");
puts("--enable-aztecoo");
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(EXIT_SUCCESS);
}
#endif /* #if defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS) && defined(HAVE_ML_AZTECOO) */
#endif /* #ifndef MG_POISSON_SOLVER_H_ */
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
#endif /* #ifdef HAVE_SAAMG_SOLVER */
......@@ -24,7 +24,7 @@ void RectangularDomain::compute(Vector_t hr){
nxy_m = nr[0] * nr[1];
}
int RectangularDomain::getNumXY(int z) {
int RectangularDomain::getNumXY(int /*z*/) {
return nxy_m;
}
......
#ifndef RECTANGULAR_DOMAIN_H
#define RECTANGULAR_DOMAIN_H
#ifdef HAVE_SAAMG_SOLVER
#include <vector>
#include <string>
......@@ -32,7 +31,7 @@ public:
/// returns type of boundary condition
std::string getType() {return "Rectangular";}
/// queries if a given (x,y,z) coordinate lies inside the domain
inline bool isInside(int x, int y, int z) {
inline bool isInside(int x, int y, int /*z*/) {
double xx = (x - (nr[0] - 1) / 2.0) * hr[0];
double yy = (y - (nr[1] - 1) / 2.0) * hr[1];
return (xx <= a_m && yy < b_m);
......@@ -78,5 +77,13 @@ private:
};
#endif //#ifdef HAVE_SAAMG_SOLVER
#endif //#ifdef RECTANGULAR_DOMAIN_H
#endif
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
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