From 2e10969e9c50c6a05829b032114606ad10be57f2 Mon Sep 17 00:00:00 2001 From: Simon Praetorius <simon.praetorius@tu-dresden.de> Date: Fri, 15 Feb 2013 18:47:39 +0000 Subject: [PATCH] MS Windows compatibility and Warnings removed --- AMDiS/src/AdaptInfo.h | 6 +- AMDiS/src/AdaptInstationary.h | 2 +- AMDiS/src/BasisFunction.h | 6 +- AMDiS/src/DOFAdmin.h | 14 ++--- AMDiS/src/DOFVector.h | 58 +++++++++---------- AMDiS/src/DOFVector.hh | 2 +- AMDiS/src/ElInfo.h | 2 +- AMDiS/src/ElInfo1d.cc | 2 +- AMDiS/src/ElInfo1d.h | 2 +- AMDiS/src/ElInfo2d.cc | 2 +- AMDiS/src/ElInfo2d.h | 2 +- AMDiS/src/ElInfo3d.cc | 2 +- AMDiS/src/ElInfo3d.h | 2 +- AMDiS/src/Element.h | 4 +- AMDiS/src/ElementData.h | 2 +- AMDiS/src/ElementRegion_ED.h | 2 +- AMDiS/src/Flag.h | 2 +- AMDiS/src/Global.cc | 4 ++ AMDiS/src/Global.h | 10 ++++ AMDiS/src/Initfile.cc | 2 +- AMDiS/src/LeafData.h | 10 ++-- AMDiS/src/Mesh.h | 22 +++---- AMDiS/src/MeshStructure_ED.h | 2 +- AMDiS/src/QPsiPhi.cc | 14 ++--- AMDiS/src/QPsiPhi.h | 56 +++++++++--------- AMDiS/src/Quadrature.cc | 2 +- AMDiS/src/Quadrature.h | 6 +- AMDiS/src/RCNeighbourList.h | 2 +- AMDiS/src/ScalableQuadrature.h | 2 +- AMDiS/src/SubElInfo.h | 4 +- AMDiS/src/SurfaceRegion_ED.h | 2 +- AMDiS/src/compositeFEM/ElementLevelSet.h | 4 +- AMDiS/src/io/ArhReader.cc | 2 +- AMDiS/src/io/ElementFileWriter.cc | 2 +- AMDiS/src/io/MacroInfo.cc | 22 +++---- AMDiS/src/reinit/ElementLevelSet.h | 2 +- AMDiS/src/reinit/ElementUpdate_3d.cc | 2 +- AMDiS/src/reinit/ElementUpdate_3d.h | 2 +- AMDiS/src/time/RosenbrockAdaptInstationary.cc | 4 +- 39 files changed, 152 insertions(+), 138 deletions(-) diff --git a/AMDiS/src/AdaptInfo.h b/AMDiS/src/AdaptInfo.h index 8357f513..50e88f7a 100644 --- a/AMDiS/src/AdaptInfo.h +++ b/AMDiS/src/AdaptInfo.h @@ -617,13 +617,13 @@ namespace AMDiS { } /// Returns \ref refineBisections - inline const int getRefineBisections(int index) const + inline int getRefineBisections(int index) const { return scalContents[index]->refineBisections; } /// Returns \ref coarseBisections - inline const int getCoarseBisections(int index) const + inline int getCoarseBisections(int index) const { return scalContents[index]->coarseBisections; } @@ -679,7 +679,7 @@ namespace AMDiS { } /// Returns true, if the adaptive procedure was deserialized from a file. - const bool isDeserialized() const + bool isDeserialized() const { return deserialized; } diff --git a/AMDiS/src/AdaptInstationary.h b/AMDiS/src/AdaptInstationary.h index d9146a7e..878c5a4e 100644 --- a/AMDiS/src/AdaptInstationary.h +++ b/AMDiS/src/AdaptInstationary.h @@ -83,7 +83,7 @@ namespace AMDiS { } /// Returns \ref strategy - const int getStrategy() const + int getStrategy() const { return strategy; } diff --git a/AMDiS/src/BasisFunction.h b/AMDiS/src/BasisFunction.h index 553fd896..7c1bc384 100644 --- a/AMDiS/src/BasisFunction.h +++ b/AMDiS/src/BasisFunction.h @@ -125,19 +125,19 @@ namespace AMDiS { virtual void getBound(const ElInfo*, BoundaryType *) const {} /// Returns \ref degree of BasisFunction - inline const int getDegree() const + inline int getDegree() const { return degree; } /// Returns \ref dim of BasisFunction - inline const int getDim() const + inline int getDim() const { return dim; } /// Returns \ref nBasFcts which is the number of local basis functions - inline const int getNumber() const + inline int getNumber() const { return nBasFcts; } diff --git a/AMDiS/src/DOFAdmin.h b/AMDiS/src/DOFAdmin.h index f57dac7d..1dbdb960 100644 --- a/AMDiS/src/DOFAdmin.h +++ b/AMDiS/src/DOFAdmin.h @@ -121,25 +121,25 @@ namespace AMDiS { */ /// Returns \ref sizeUsed. - inline const int getUsedSize() const + inline int getUsedSize() const { return sizeUsed; } /// Returns \ref size - inline const int getSize() const + inline int getSize() const { return size; } /// Returns \ref usedCount - inline const int getUsedDofs() const + inline int getUsedDofs() const { return usedCount; } /// Returns \ref holeCount - inline const int getHoleCount() const + inline int getHoleCount() const { return holeCount; } @@ -151,7 +151,7 @@ namespace AMDiS { } /// Returns \ref nDof[i], i.e., the number of DOFs for the position i. - inline const int getNumberOfDofs(int i) const + inline int getNumberOfDofs(int i) const { return nDof[i]; } @@ -163,7 +163,7 @@ namespace AMDiS { } /// Returns \ref nPreDof[i] - inline const int getNumberOfPreDofs(int i) const + inline int getNumberOfPreDofs(int i) const { return nPreDof[i]; } @@ -187,7 +187,7 @@ namespace AMDiS { } /// Returns if the given DOF is free. - inline const bool isDofFree(int i) const + inline bool isDofFree(int i) const { return dofFree[i]; } diff --git a/AMDiS/src/DOFVector.h b/AMDiS/src/DOFVector.h index d18da641..a141c5c8 100644 --- a/AMDiS/src/DOFVector.h +++ b/AMDiS/src/DOFVector.h @@ -154,33 +154,33 @@ namespace AMDiS { operatorEstFactor.push_back(estFactor); } - inline vector<double*>::iterator getOperatorFactorBegin() + inline std::vector<double*>::iterator getOperatorFactorBegin() { return operatorFactor.begin(); } - inline vector<double*>::iterator getOperatorFactorEnd() + inline std::vector<double*>::iterator getOperatorFactorEnd() { return operatorFactor.end(); } - inline vector<double*>::iterator getOperatorEstFactorBegin() + inline std::vector<double*>::iterator getOperatorEstFactorBegin() { return operatorEstFactor.begin(); } - inline vector<double*>::iterator getOperatorEstFactorEnd() + inline std::vector<double*>::iterator getOperatorEstFactorEnd() { return operatorEstFactor.end(); } - inline vector<Operator*>::iterator getOperatorsBegin() + inline std::vector<Operator*>::iterator getOperatorsBegin() { return operators.begin(); } - inline vector<Operator*>::iterator getOperatorsEnd() + inline std::vector<Operator*>::iterator getOperatorsEnd() { return operators.end(); } @@ -193,17 +193,17 @@ namespace AMDiS { /// and \f$ m \f$ is the number of basis functions T evalUh(const DimVec<double>& lambda, DegreeOfFreedom* ind); - inline vector<Operator*>& getOperators() + inline std::vector<Operator*>& getOperators() { return operators; } - inline vector<double*>& getOperatorFactor() + inline std::vector<double*>& getOperatorFactor() { return operatorFactor; } - inline vector<double*>& getOperatorEstFactor() + inline std::vector<double*>& getOperatorEstFactor() { return operatorEstFactor; } @@ -251,13 +251,13 @@ namespace AMDiS { ElementVector elementVector; /// - vector<Operator*> operators; + std::vector<Operator*> operators; /// - vector<double*> operatorFactor; + std::vector<double*> operatorFactor; /// - vector<double*> operatorEstFactor; + std::vector<double*> operatorEstFactor; /// BoundaryManager *boundaryManager; @@ -345,7 +345,7 @@ namespace AMDiS { void init(const FiniteElemSpace* f, string n); /// Copy Constructor - DOFVector(const DOFVector& rhs) + DOFVector(const DOFVector& rhs) : DOFVectorBase<T>() { *this = rhs; this->name = rhs.name + "copy"; @@ -357,25 +357,25 @@ namespace AMDiS { virtual ~DOFVector(); /// Returns iterator to the begin of \ref vec - typename vector<T>::iterator begin() + typename std::vector<T>::iterator begin() { return vec.begin(); } /// Returns iterator to the end of \ref vec - typename vector<T>::iterator end() + typename std::vector<T>::iterator end() { return vec.end(); } /// Returns const_iterator to the begin of \ref vec - typename vector<T>::const_iterator begin() const + typename std::vector<T>::const_iterator begin() const { return vec.begin(); } /// Returns const_iterator to the end of \ref vec - typename vector<T>::const_iterator end() const + typename std::vector<T>::const_iterator end() const { return vec.end(); } @@ -383,7 +383,7 @@ namespace AMDiS { /// Used by DOFAdmin to compress this DOFVector. Implementation of /// \ref DOFIndexedBase::compress() virtual void compressDOFIndexed(int first, int last, - vector<DegreeOfFreedom> &newDof); + std::vector<DegreeOfFreedom> &newDof); /// Sets \ref coarsenOperation to op inline void setCoarsenOperation(CoarsenOperation op) @@ -404,7 +404,7 @@ namespace AMDiS { inline void refineInterpol(RCNeighbourList&, int) {} /// Returns \ref vec - vector<T>& getVector() + std::vector<T>& getVector() { return vec; } @@ -597,7 +597,7 @@ namespace AMDiS { /// Determine the DegreeOfFreedom that has coords with minimal euclidean /// distance to WorldVector p. return true if DOF is found, and false /// otherwise. - const bool getDofIdxAtPoint(WorldVector<double> &p, + bool getDofIdxAtPoint(WorldVector<double> &p, DegreeOfFreedom &idx, ElInfo *oldElInfo = NULL, bool useOldElInfo = false) const; @@ -630,7 +630,7 @@ namespace AMDiS { protected: /// Data container - vector<T> vec; + std::vector<T> vec; /// Specifies what operation should be performed after coarsening CoarsenOperation coarsenOperation; @@ -846,7 +846,7 @@ namespace AMDiS { } template<typename T> - inline void checkFeSpace(const FiniteElemSpace* feSpace, const vector<T>& vec) + inline void checkFeSpace(const FiniteElemSpace* feSpace, const std::vector<T>& vec) { TEST_EXIT_DBG(feSpace)("feSpace is NULL\n"); TEST_EXIT_DBG(feSpace->getAdmin())("admin is NULL\n"); @@ -859,8 +859,8 @@ namespace AMDiS { WorldVector<DOFVector<double>*> *result); template<typename T> - vector<DOFVector<double>*> *transform(DOFVector<typename GradientType<T>::type> *vec, - vector<DOFVector<double>*> *res); + std::vector<DOFVector<double>*> *transform(DOFVector<typename GradientType<T>::type> *vec, + std::vector<DOFVector<double>*> *res); /// Computes the integral: \f$ \int f(\vec{x})\,\text{d}\vec{x}\f$ @@ -931,14 +931,14 @@ namespace AMDiS { BinaryAbstractFunction<TOut, T, WorldVector<double> > *fct); /// Computes the integral: \f$ \int f(\{v_i(\vec{x})\}_i)\,\text{d}\vec{x}\f$ - double integrateGeneral(const vector<DOFVector<double>*> &vecs, - AbstractFunction<double, vector<double> > *fct); + double integrateGeneral(const std::vector<DOFVector<double>*> &vecs, + AbstractFunction<double, std::vector<double> > *fct); /// Computes the integral: /// \f$ \int f(\{v_i(\vec{x})\}_i,\{\nabla w_i(\vec{x})\}_i)\,\text{d}\vec{x}\f$ - double integrateGeneralGradient(const vector<DOFVector<double>*> &vecs, - const vector<DOFVector<double>*> &grds, - BinaryAbstractFunction<double, vector<double>, vector<WorldVector<double> > > *fct); + double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs, + const std::vector<DOFVector<double>*> &grds, + BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double> > > *fct); } diff --git a/AMDiS/src/DOFVector.hh b/AMDiS/src/DOFVector.hh index 59dab4b0..fc964550 100644 --- a/AMDiS/src/DOFVector.hh +++ b/AMDiS/src/DOFVector.hh @@ -947,7 +947,7 @@ namespace AMDiS { template<typename T> - const bool DOFVector<T>::getDofIdxAtPoint(WorldVector<double> &p, + bool DOFVector<T>::getDofIdxAtPoint(WorldVector<double> &p, DegreeOfFreedom &idx, ElInfo *oldElInfo, bool useOldElInfo) const diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h index 241e765a..776ddcdc 100644 --- a/AMDiS/src/ElInfo.h +++ b/AMDiS/src/ElInfo.h @@ -385,7 +385,7 @@ namespace AMDiS { /// with respect to \ref element of a point with world coordinates world. /// The barycentric coordinates are stored in lambda. /// pure virtual => must be overriden in sub-class. - virtual const int worldToCoord(const WorldVector<double>& world, + virtual int worldToCoord(const WorldVector<double>& world, DimVec<double>* lambda) const = 0; /// Fills this ElInfo with macro element information of mel. diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc index ffeb8388..385bd7cf 100644 --- a/AMDiS/src/ElInfo1d.cc +++ b/AMDiS/src/ElInfo1d.cc @@ -143,7 +143,7 @@ namespace AMDiS { return sqrt(adet2); } - const int ElInfo1d::worldToCoord(const WorldVector<double>& x, + int ElInfo1d::worldToCoord(const WorldVector<double>& x, DimVec<double>* lambda) const { FUNCNAME("ElInfo1d::worldToCoord()"); diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h index dc2ba3e5..bb79aec8 100644 --- a/AMDiS/src/ElInfo1d.h +++ b/AMDiS/src/ElInfo1d.h @@ -47,7 +47,7 @@ namespace AMDiS { void fillMacroInfo(const MacroElement*); /// 1-dimensional realisation of ElInfo's worldToCoord method. - const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; + int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; /// 1-dimensional realisation of ElInfo's calcGrdLambda method. double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc index dea65894..1656a9c7 100644 --- a/AMDiS/src/ElInfo2d.cc +++ b/AMDiS/src/ElInfo2d.cc @@ -661,7 +661,7 @@ namespace AMDiS { } - const int ElInfo2d::worldToCoord(const WorldVector<double>& xy, + int ElInfo2d::worldToCoord(const WorldVector<double>& xy, DimVec<double>* lambda) const { FUNCNAME("ElInfo::worldToCoord()"); diff --git a/AMDiS/src/ElInfo2d.h b/AMDiS/src/ElInfo2d.h index 8a373875..c7628110 100644 --- a/AMDiS/src/ElInfo2d.h +++ b/AMDiS/src/ElInfo2d.h @@ -48,7 +48,7 @@ namespace AMDiS { void fillMacroInfo(const MacroElement*); /// 2-dimensional realisation of ElInfo's worldToCoord method. - const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; + int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; /// 2-dimensional realisation of ElInfo's calcGrdLambda method. double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); diff --git a/AMDiS/src/ElInfo3d.cc b/AMDiS/src/ElInfo3d.cc index 4be60559..b6d792b2 100644 --- a/AMDiS/src/ElInfo3d.cc +++ b/AMDiS/src/ElInfo3d.cc @@ -318,7 +318,7 @@ namespace AMDiS { } - const int ElInfo3d::worldToCoord(const WorldVector<double>& xy, + int ElInfo3d::worldToCoord(const WorldVector<double>& xy, DimVec<double>* lambda) const { FUNCNAME("ElInfo::worldToCoord()"); diff --git a/AMDiS/src/ElInfo3d.h b/AMDiS/src/ElInfo3d.h index 38327ca1..cd5f6f32 100644 --- a/AMDiS/src/ElInfo3d.h +++ b/AMDiS/src/ElInfo3d.h @@ -60,7 +60,7 @@ namespace AMDiS { void fillMacroInfo(const MacroElement *); /// 3-dimensional realisation of ElInfo's worldToCoord method. - const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; + int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const; /// 3-dimensional realisation of ElInfo's calcGrdLambda method. double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam); diff --git a/AMDiS/src/Element.h b/AMDiS/src/Element.h index 57024e44..6c206d5d 100644 --- a/AMDiS/src/Element.h +++ b/AMDiS/src/Element.h @@ -111,7 +111,7 @@ namespace AMDiS { /// Returns true if Element is a leaf element (\ref child[0] == NULL), returns /// false otherwise. - inline const bool isLeaf() const + inline bool isLeaf() const { return (child[0] == NULL); } @@ -204,7 +204,7 @@ namespace AMDiS { virtual int getGeo(GeoIndex i) const = 0; /// Returns Element's \ref mark - inline const int getMark() const + inline int getMark() const { return mark; } diff --git a/AMDiS/src/ElementData.h b/AMDiS/src/ElementData.h index 09fb8e30..0fed27f7 100644 --- a/AMDiS/src/ElementData.h +++ b/AMDiS/src/ElementData.h @@ -86,7 +86,7 @@ namespace AMDiS { } /// Returns the id of element data type. - virtual const int getTypeID() const + virtual int getTypeID() const { return 0; } diff --git a/AMDiS/src/ElementRegion_ED.h b/AMDiS/src/ElementRegion_ED.h index 18490c6c..9f752749 100644 --- a/AMDiS/src/ElementRegion_ED.h +++ b/AMDiS/src/ElementRegion_ED.h @@ -64,7 +64,7 @@ namespace AMDiS { return "ElementRegion_ED"; } - inline const int getTypeID() const + inline int getTypeID() const { return ELEMENT_REGION; } diff --git a/AMDiS/src/Flag.h b/AMDiS/src/Flag.h index 84997865..d3492af6 100644 --- a/AMDiS/src/Flag.h +++ b/AMDiS/src/Flag.h @@ -110,7 +110,7 @@ namespace AMDiS { flags &= ~f.flags; } - inline const unsigned long getFlags() const + inline unsigned long getFlags() const { return flags; } diff --git a/AMDiS/src/Global.cc b/AMDiS/src/Global.cc index c570cd82..cdd04bae 100644 --- a/AMDiS/src/Global.cc +++ b/AMDiS/src/Global.cc @@ -349,6 +349,7 @@ namespace AMDiS { void processMemUsage(double& vm_usage, double& resident_set, bool inMegaByte) { +#ifndef _WIN32 using std::ios_base; using std::ifstream; using std::string; @@ -383,6 +384,9 @@ namespace AMDiS { vm_usage /= 1024.0; resident_set /= 1024.0; } +#else + ERROR("Function not available under MS Windows\n"); +#endif } diff --git a/AMDiS/src/Global.h b/AMDiS/src/Global.h index d11c33c9..bbe98dff 100644 --- a/AMDiS/src/Global.h +++ b/AMDiS/src/Global.h @@ -52,6 +52,12 @@ #include <float.h> #include <time.h> +#ifdef _WIN32 +#include <io.h> +#else +#include <unistd.h> +#endif + #if HAVE_PARALLEL_DOMAIN_AMDIS #include <mpi.h> #endif @@ -133,7 +139,11 @@ namespace AMDiS { /// check for file existence inline bool file_exists(const std::string filename) { +#ifdef _WIN32 + return _access(filename.c_str(), 0) == 0; +#else return access(filename.c_str(), F_OK) == 0; +#endif }; /// trim std::string diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc index f1369ed9..927dd68e 100644 --- a/AMDiS/src/Initfile.cc +++ b/AMDiS/src/Initfile.cc @@ -65,7 +65,7 @@ namespace AMDiS { /// Fill an initfile from an input stream void Initfile::read(istream& in) { - unsigned line_length = 512; + const unsigned line_length = 512; char swap[line_length]; in.getline(swap, line_length); while (in.good() || in.gcount() > 0) { diff --git a/AMDiS/src/LeafData.h b/AMDiS/src/LeafData.h index 4837f655..ad97e585 100644 --- a/AMDiS/src/LeafData.h +++ b/AMDiS/src/LeafData.h @@ -112,7 +112,7 @@ namespace AMDiS { return "LeafDataEstimatable"; } - inline const int getTypeID() const + inline int getTypeID() const { return ESTIMATABLE; } @@ -198,7 +198,7 @@ namespace AMDiS { return "LeafDataEstimatableVec"; } - inline const int getTypeID() const + inline int getTypeID() const { return ESTIMATABLE; } @@ -294,7 +294,7 @@ namespace AMDiS { return "LeafDataCoarsenable"; } - inline const int getTypeID() const + inline int getTypeID() const { return COARSENABLE; } @@ -379,7 +379,7 @@ namespace AMDiS { return "LeafDataCoarsenableVec"; } - inline const int getTypeID() const + inline int getTypeID() const { return COARSENABLE; } @@ -484,7 +484,7 @@ namespace AMDiS { return "LeafDataPeriodic"; } - inline const int getTypeID() const + inline int getTypeID() const { return PERIODIC; } diff --git a/AMDiS/src/Mesh.h b/AMDiS/src/Mesh.h index be2eff48..708b24f8 100644 --- a/AMDiS/src/Mesh.h +++ b/AMDiS/src/Mesh.h @@ -96,49 +96,49 @@ namespace AMDiS { } /// Returns \ref nDofEl of the mesh - inline const int getNumberOfAllDofs() const + inline int getNumberOfAllDofs() const { return nDofEl; } /// Returns \ref nNodeEl of the mesh - inline const int getNumberOfNodes() const + inline int getNumberOfNodes() const { return nNodeEl; } /// Returns \ref nVertices of the mesh - inline const int getNumberOfVertices() const + inline int getNumberOfVertices() const { return nVertices; } /// Returns \ref nEdges of the mesh - inline const int getNumberOfEdges() const + inline int getNumberOfEdges() const { return nEdges; } /// Returns \ref nFaces of the mesh - inline const int getNumberOfFaces() const + inline int getNumberOfFaces() const { return nFaces; } /// Returns \ref nLeaves of the mesh - inline const int getNumberOfLeaves() const + inline int getNumberOfLeaves() const { return nLeaves; } /// Returns \ref nElements of the mesh - inline const int getNumberOfElements() const + inline int getNumberOfElements() const { return nElements; } /// Returns \ref maxEdgeNeigh of the mesh - inline const int getMaxEdgeNeigh() const + inline int getMaxEdgeNeigh() const { return maxEdgeNeigh; } @@ -156,7 +156,7 @@ namespace AMDiS { } /// Returns nDof[i] of the mesh - inline const int getNumberOfDofs(int i) const + inline int getNumberOfDofs(int i) const { TEST_EXIT_DBG(i <= dim)("Wrong index: %d %d\n", i, dim); return nDof[i]; @@ -199,14 +199,14 @@ namespace AMDiS { /// Returns the size of \ref admin which is the number of the DOFAdmins /// belonging to this mesh - const int getNumberOfDOFAdmin() const + int getNumberOfDOFAdmin() const { return admin.size(); } /// Returns the size of \ref macroElements which is the number of /// of macro elements of this mesh - const int getNumberOfMacros() const + int getNumberOfMacros() const { return macroElements.size(); } diff --git a/AMDiS/src/MeshStructure_ED.h b/AMDiS/src/MeshStructure_ED.h index fb288947..d23d70bf 100644 --- a/AMDiS/src/MeshStructure_ED.h +++ b/AMDiS/src/MeshStructure_ED.h @@ -84,7 +84,7 @@ namespace AMDiS { return true; } - virtual const int getTypeID() const + virtual int getTypeID() const { return MESH_STRUCTURE; } diff --git a/AMDiS/src/QPsiPhi.cc b/AMDiS/src/QPsiPhi.cc index 263845ed..b578684f 100644 --- a/AMDiS/src/QPsiPhi.cc +++ b/AMDiS/src/QPsiPhi.cc @@ -176,7 +176,7 @@ namespace AMDiS { } - const bool Q11PsiPhi::operator==(const Q11PsiPhi& q11pp) const + bool Q11PsiPhi::operator==(const Q11PsiPhi& q11pp) const { return (q11pp.psi == psi && q11pp.phi == phi && q11pp.quadrature == quadrature); } @@ -337,7 +337,7 @@ namespace AMDiS { } } - const bool Q10PsiPhi::operator==(const Q10PsiPhi& q10pp) const + bool Q10PsiPhi::operator==(const Q10PsiPhi& q10pp) const { return (q10pp.psi == psi && q10pp.phi == phi && q10pp.quadrature == quadrature); } @@ -498,7 +498,7 @@ namespace AMDiS { } } - const bool Q01PsiPhi::operator==(const Q01PsiPhi& q01pp) const + bool Q01PsiPhi::operator==(const Q01PsiPhi& q01pp) const { return (q01pp.psi == psi && q01pp.phi == phi && q01pp.quadrature == quadrature); } @@ -543,7 +543,7 @@ namespace AMDiS { /* first order term: */ /****************************************************************************/ - const double Q00PsiPhi::getValue(unsigned int i,unsigned int j) const + double Q00PsiPhi::getValue(unsigned int i,unsigned int j) const { if ((values)&&(values[i])) return values[i][j]; return 0.; @@ -621,7 +621,7 @@ namespace AMDiS { delete [] values; } - const bool Q00PsiPhi::operator==(const Q00PsiPhi& q00pp) const + bool Q00PsiPhi::operator==(const Q00PsiPhi& q00pp) const { return (q00pp.psi == psi && q00pp.phi == phi && q00pp.quadrature == quadrature); } @@ -702,7 +702,7 @@ namespace AMDiS { delete [] values; } - const bool Q0Psi::operator==(const Q0Psi& q0p) const + bool Q0Psi::operator==(const Q0Psi& q0p) const { return (q0p.psi == psi && q0p.quadrature == quadrature); } @@ -825,7 +825,7 @@ namespace AMDiS { } - const bool Q1Psi::operator==(const Q1Psi& q1p) const + bool Q1Psi::operator==(const Q1Psi& q1p) const { return (q1p.psi == psi && q1p.quadrature == quadrature); } diff --git a/AMDiS/src/QPsiPhi.h b/AMDiS/src/QPsiPhi.h index 455af55a..fe97e312 100644 --- a/AMDiS/src/QPsiPhi.h +++ b/AMDiS/src/QPsiPhi.h @@ -119,16 +119,16 @@ namespace AMDiS { const Quadrature*); /// Compares two Q11PsiPhi objects. - const bool operator==(const Q11PsiPhi&) const; + bool operator==(const Q11PsiPhi&) const; /// Compares two Q11PsiPhi objects. - const bool operator!=(const Q11PsiPhi& q11pp) const + bool operator!=(const Q11PsiPhi& q11pp) const { return !(operator==(q11pp)); } /// Returns \ref values[i][j][k] - inline const double getValue(unsigned int i, + inline double getValue(unsigned int i, unsigned int j, unsigned int v) const { @@ -140,7 +140,7 @@ namespace AMDiS { } /// Returns \ref nrEntries[i][j] - inline const int getNumberEntries(unsigned int i, unsigned int j) const + inline int getNumberEntries(unsigned int i, unsigned int j) const { if (nrEntries && nrEntries[i]) return nrEntries[i][j]; @@ -155,7 +155,7 @@ namespace AMDiS { } /// Returns \ref k[i1][i2][i3] - inline const int getK(unsigned int i1, + inline int getK(unsigned int i1, unsigned int i2, unsigned int i3) const { @@ -166,7 +166,7 @@ namespace AMDiS { } /// Returns \ref l[i][j][v] - inline const int getL(unsigned int i, unsigned int j, unsigned int v) const + inline int getL(unsigned int i, unsigned int j, unsigned int v) const { if (l && l[i] && l[i][j] && (static_cast<int>(v) < nrEntries[i][j])) return l[i][j][v]; @@ -276,16 +276,16 @@ namespace AMDiS { const Quadrature*); /// Compares two Q10PsiPhi objects. - const bool operator==(const Q10PsiPhi&) const; + bool operator==(const Q10PsiPhi&) const; /// Compares two Q10PsiPhi objects. - const bool operator!=(const Q10PsiPhi& q10pp) const + bool operator!=(const Q10PsiPhi& q10pp) const { return !(operator==(q10pp)); } /// Returns \ref values[i][j][k] - inline const double getValue(unsigned int i, + inline double getValue(unsigned int i, unsigned int j, unsigned int v) const { @@ -297,7 +297,7 @@ namespace AMDiS { } /// Returns \ref nrEntries[i][j] - inline const int getNumberEntries(unsigned int i, unsigned int j) const + inline int getNumberEntries(unsigned int i, unsigned int j) const { if (nrEntries && nrEntries[i]) return nrEntries[i][j]; @@ -312,7 +312,7 @@ namespace AMDiS { } /// Returns \ref k[i1][i2][i3] - inline const int getK(unsigned int i1, + inline int getK(unsigned int i1, unsigned int i2, unsigned int i3) const { @@ -409,16 +409,16 @@ namespace AMDiS { const Quadrature*); /// Compares two Q01PsiPhi objects. - const bool operator==(const Q01PsiPhi&) const; + bool operator==(const Q01PsiPhi&) const; /// Compares two Q01PsiPhi objects. - const bool operator!=(const Q01PsiPhi& q01pp) const + bool operator!=(const Q01PsiPhi& q01pp) const { return !(operator==(q01pp)); } /// Returns \ref values[i][j][k] - inline const double getValue(unsigned int i, + inline double getValue(unsigned int i, unsigned int j, unsigned int v) const { @@ -430,7 +430,7 @@ namespace AMDiS { } /// Returns \ref nrEntries[i][j] - inline const int getNumberEntries(unsigned int i, unsigned int j) const + inline int getNumberEntries(unsigned int i, unsigned int j) const { if (nrEntries && nrEntries[i]) return nrEntries[i][j]; @@ -445,7 +445,7 @@ namespace AMDiS { } /// Returns \ref k[i1][i2][i3] - inline const int getK(unsigned int i1, + inline int getK(unsigned int i1, unsigned int i2, unsigned int i3) const; @@ -468,7 +468,7 @@ namespace AMDiS { } /// Returns \ref k[i][j][v] - inline const int getL(unsigned int i, + inline int getL(unsigned int i, unsigned int j, unsigned int v) const { @@ -565,16 +565,16 @@ namespace AMDiS { const Quadrature*); /// Compares two Q00PsiPhi objects. - const bool operator==(const Q00PsiPhi&) const; + bool operator==(const Q00PsiPhi&) const; /// Compares two Q00PsiPhi objects. - const bool operator!=(const Q00PsiPhi& q00pp) const + bool operator!=(const Q00PsiPhi& q00pp) const { return !(operator==(q00pp)); } /// Returns \ref values[i][j] - const double getValue(unsigned int i, unsigned int j) const; + double getValue(unsigned int i, unsigned int j) const; /// Returns \ref values[i] const double *getValVec(unsigned int i) const; @@ -614,16 +614,16 @@ namespace AMDiS { static Q0Psi* provideQ0Psi(const BasisFunction *, const Quadrature*); /// Compares two Q0Psi objects. - const bool operator==(const Q0Psi&) const; + bool operator==(const Q0Psi&) const; /// Compares two Q0Psi objects. - const bool operator!=(const Q0Psi& q0p) const + bool operator!=(const Q0Psi& q0p) const { return !(operator==(q0p)); } /// Returns \ref value - inline const double getValue(int i) const + inline double getValue(int i) const { return values[i]; } @@ -658,16 +658,16 @@ namespace AMDiS { const Quadrature*); /// Compares two Q1Psi objects. - const bool operator==(const Q1Psi&) const; + bool operator==(const Q1Psi&) const; /// Compares two Q1Psi objects. - const bool operator!=(const Q1Psi& q1p) const + bool operator!=(const Q1Psi& q1p) const { return !(operator==(q1p)); } /// Returns \ref values[i][j] - inline const double getValue(unsigned int i, + inline double getValue(unsigned int i, unsigned int j) const { if (values && values[i] && (static_cast<int>(j) < nrEntries[i])) @@ -677,7 +677,7 @@ namespace AMDiS { } /// Returns \ref nrEntries[i] - inline const int getNumberEntries(unsigned int i) const + inline int getNumberEntries(unsigned int i) const { return (nrEntries ? nrEntries[i] : 0); } @@ -689,7 +689,7 @@ namespace AMDiS { } /// Returns \ref k[i1][i2] - inline const int + inline int getK(unsigned int i1, unsigned int i2) const { if (k && k[i1] && (static_cast<int>(i2) < nrEntries[i1])) diff --git a/AMDiS/src/Quadrature.cc b/AMDiS/src/Quadrature.cc index 53169448..c81ccf50 100644 --- a/AMDiS/src/Quadrature.cc +++ b/AMDiS/src/Quadrature.cc @@ -1622,7 +1622,7 @@ namespace AMDiS { } - const double FastQuadrature::getSecDer(int q,int i ,int j, int m) const + double FastQuadrature::getSecDer(int q,int i ,int j, int m) const { return (D2Phi) ? (*D2Phi)[q][i][j][m] : 0.0; } diff --git a/AMDiS/src/Quadrature.h b/AMDiS/src/Quadrature.h index 8424a213..88453b8e 100644 --- a/AMDiS/src/Quadrature.h +++ b/AMDiS/src/Quadrature.h @@ -369,13 +369,13 @@ namespace AMDiS { } /// Returns (*\ref D2Phi)[q][i][j][m] - const double getSecDer(int q, int i, int j, int m) const; + double getSecDer(int q, int i, int j, int m) const; /// Returns (*\ref D2Phi)[q] const VectorOfFixVecs<DimMat<double> > *getSecDer(int q) const; /// Returns (*\ref grdPhi)[q][i][j] - inline const double getGradient(int q, int i ,int j) const + inline double getGradient(int q, int i ,int j) const { return (!grdPhi.empty()) ? grdPhi[q][i][j] : 0.0; } @@ -397,7 +397,7 @@ namespace AMDiS { } /// Returns \ref phi[q][i] - inline const double getPhi(int q, int i) const + inline double getPhi(int q, int i) const { return phi[q][i]; } diff --git a/AMDiS/src/RCNeighbourList.h b/AMDiS/src/RCNeighbourList.h index a4886d0a..cdc7281c 100644 --- a/AMDiS/src/RCNeighbourList.h +++ b/AMDiS/src/RCNeighbourList.h @@ -70,7 +70,7 @@ namespace AMDiS { } /// Returns \ref rclist[i].flag - inline const bool isPatchCoarse(int i) const + inline bool isPatchCoarse(int i) const { return rclist[i]->flag; } diff --git a/AMDiS/src/ScalableQuadrature.h b/AMDiS/src/ScalableQuadrature.h index c6d63434..10ac21b0 100644 --- a/AMDiS/src/ScalableQuadrature.h +++ b/AMDiS/src/ScalableQuadrature.h @@ -77,7 +77,7 @@ namespace AMDiS { void scaleQuadrature(DimMat<double> *scalMat); /// Get b-th coordinate of the a-th original quadrature point. - inline const double getOldLambda(int a, int b) const + inline double getOldLambda(int a, int b) const { if (oldLambda) return (*oldLambda)[a][b]; diff --git a/AMDiS/src/SubElInfo.h b/AMDiS/src/SubElInfo.h index 03640056..5ea226d9 100644 --- a/AMDiS/src/SubElInfo.h +++ b/AMDiS/src/SubElInfo.h @@ -53,7 +53,7 @@ namespace AMDiS { } /// Get b-th coordinate of the a-th vertex of subelement (barycentriccoordinates). - inline const double getLambda(int a, int b) const + inline double getLambda(int a, int b) const { if (lambda) return (*lambda)[a][b]; @@ -74,7 +74,7 @@ namespace AMDiS { } /// Get determinant corresponding to subelement. - inline const double getDet() const + inline double getDet() const { return det; } diff --git a/AMDiS/src/SurfaceRegion_ED.h b/AMDiS/src/SurfaceRegion_ED.h index f427fab7..b87f2e75 100644 --- a/AMDiS/src/SurfaceRegion_ED.h +++ b/AMDiS/src/SurfaceRegion_ED.h @@ -65,7 +65,7 @@ namespace AMDiS { return "SurfaceRegion_ED"; } - inline const int getTypeID() const + inline int getTypeID() const { return SURFACE_REGION; } diff --git a/AMDiS/src/compositeFEM/ElementLevelSet.h b/AMDiS/src/compositeFEM/ElementLevelSet.h index 4fd0fa78..acf4dc05 100644 --- a/AMDiS/src/compositeFEM/ElementLevelSet.h +++ b/AMDiS/src/compositeFEM/ElementLevelSet.h @@ -167,7 +167,7 @@ public: const bool doCalcIntersecPts_ = true); /// Gets value of level set function at point given in barycentric coordinates. - inline const double calcLevelSetFct(const DimVec<double>& bary) + inline double calcLevelSetFct(const DimVec<double>& bary) { return (*lSFct)(bary); } @@ -246,7 +246,7 @@ public: } /// Get i-th component of vector elVertexLevelSetVec. - inline const double getElVertLevelSetVec(const int i) const + inline double getElVertLevelSetVec(const int i) const { return elVertexLevelSetVec[i]; } diff --git a/AMDiS/src/io/ArhReader.cc b/AMDiS/src/io/ArhReader.cc index e125376b..c9c082b9 100644 --- a/AMDiS/src/io/ArhReader.cc +++ b/AMDiS/src/io/ArhReader.cc @@ -133,7 +133,7 @@ namespace AMDiS { for (std::set<int>::iterator it = readArhFiles.begin(); it != readArhFiles.end(); ++it) { - string arhFilename = directory.native() + "/" + arhPrefix; + string arhFilename = directory.string() + "/" + arhPrefix; if (nProc == 1) arhFilename += ".arh"; else diff --git a/AMDiS/src/io/ElementFileWriter.cc b/AMDiS/src/io/ElementFileWriter.cc index 2806f919..79783757 100644 --- a/AMDiS/src/io/ElementFileWriter.cc +++ b/AMDiS/src/io/ElementFileWriter.cc @@ -409,7 +409,7 @@ namespace AMDiS { int idx = elInfo->getElement()->getIndex(); for (int j = 0; j < nComponents; j++) { - double val = (vec != NULL ? (*vec)[idx] : ((*vecs)[idx].size()==dataLength ? (*vecs)[idx][i*nComponents+j] : 0.0)); + double val = (vec != NULL ? (*vec)[idx] : (static_cast<int>((*vecs)[idx].size())==dataLength ? (*vecs)[idx][i*nComponents+j] : 0.0)); // Write value for each vertex of each element. if (fabs(val) < 1.e-40) diff --git a/AMDiS/src/io/MacroInfo.cc b/AMDiS/src/io/MacroInfo.cc index 4367338e..e110f38a 100644 --- a/AMDiS/src/io/MacroInfo.cc +++ b/AMDiS/src/io/MacroInfo.cc @@ -227,7 +227,7 @@ namespace AMDiS { file = fopen(filename.c_str(), "r"); TEST_EXIT(file)("cannot open file %s\n", filename.c_str()); - int result; + int result, n_; for (int i_key = 0; i_key < n_keys; i_key++) { @@ -283,7 +283,7 @@ namespace AMDiS { case 4: // block "vertex coordinates" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); for (int i = 0; i < nVertices; i++) { for (j = 0; j <Global::getGeo(WORLD) ; j++) { result = fscanf(file, "%lf", &dbl); @@ -297,7 +297,7 @@ namespace AMDiS { case 5: // block "element vertices" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); // === Global number of vertices on a single element. === @@ -315,7 +315,7 @@ namespace AMDiS { case 6: // block "element boundaries" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); // === MEL boundary pointers. === @@ -341,7 +341,7 @@ namespace AMDiS { case 7: // block "element neighbours" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); // === Fill MEL neighbour pointers: === // === if they are specified in the file: read them from file, === @@ -368,7 +368,7 @@ namespace AMDiS { case 8: // block "element type" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); // === MEL elType === @@ -389,7 +389,7 @@ namespace AMDiS { case 9: // block "projections" { - fscanf(file, "%*s"); + n_ = fscanf(file, "%*s"); int nFaces = mesh->getGeo(FACE); int nEdgesAtBoundary = 0; @@ -427,7 +427,7 @@ namespace AMDiS { case 10: // block "element region" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); // === MEL regions. === @@ -448,7 +448,7 @@ namespace AMDiS { case 11: // block "surface region" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); for (int i = 0; i < nElements; i++) { result = read_indices(file, *ind); TEST_EXIT(result) @@ -471,12 +471,12 @@ namespace AMDiS { case 12: // line "mesh name" - fscanf(file, "%*s %*s %*s"); + n_ = fscanf(file, "%*s %*s %*s"); break; case 13: // line "time" - fscanf(file, "%*s %*s"); + n_ = fscanf(file, "%*s %*s"); break; } } diff --git a/AMDiS/src/reinit/ElementLevelSet.h b/AMDiS/src/reinit/ElementLevelSet.h index 0a45ca5c..772767a9 100644 --- a/AMDiS/src/reinit/ElementLevelSet.h +++ b/AMDiS/src/reinit/ElementLevelSet.h @@ -235,7 +235,7 @@ class ElementLevelSet } /// Get i-th component of vector elVertexLevelSetVec. - inline const double getElVertLevelSetVec(const int i) const + inline double getElVertLevelSetVec(const int i) const { return elVertexLevelSetVec[i]; } diff --git a/AMDiS/src/reinit/ElementUpdate_3d.cc b/AMDiS/src/reinit/ElementUpdate_3d.cc index aa138582..e8369647 100644 --- a/AMDiS/src/reinit/ElementUpdate_3d.cc +++ b/AMDiS/src/reinit/ElementUpdate_3d.cc @@ -459,7 +459,7 @@ ElementUpdate_3d::rotateElement( return true; } -const int +int ElementUpdate_3d::calcPosition(const WorldVector<double> &B2, const WorldVector<double> &C2, const WorldVector<double> &D2) diff --git a/AMDiS/src/reinit/ElementUpdate_3d.h b/AMDiS/src/reinit/ElementUpdate_3d.h index 0ee43969..eb768f69 100644 --- a/AMDiS/src/reinit/ElementUpdate_3d.h +++ b/AMDiS/src/reinit/ElementUpdate_3d.h @@ -93,7 +93,7 @@ public: * Note: Limited to triangles with angles not greater than Pi/2 * (acute triangles). */ - const int calcPosition(const WorldVector<double> &B2, + int calcPosition(const WorldVector<double> &B2, const WorldVector<double> &C2, const WorldVector<double> &D2); diff --git a/AMDiS/src/time/RosenbrockAdaptInstationary.cc b/AMDiS/src/time/RosenbrockAdaptInstationary.cc index 0cb1b938..2873208a 100644 --- a/AMDiS/src/time/RosenbrockAdaptInstationary.cc +++ b/AMDiS/src/time/RosenbrockAdaptInstationary.cc @@ -126,7 +126,7 @@ namespace AMDiS { adaptInfo->setTime(adaptInfo->getTime() - dbgTimesteps[studyTimestep]); studyTimestep++; - TEST_EXIT(studyTimestep < dbgTimesteps.size())("Should not happen!\n"); + TEST_EXIT(studyTimestep < static_cast<int>(dbgTimesteps.size()))("Should not happen!\n"); adaptInfo->setTimestep(dbgTimesteps[studyTimestep]); } @@ -236,7 +236,7 @@ namespace AMDiS { if (fixFirstTimesteps > 0) fixFirstTimesteps--; } while (rejected || - (dbgTimestepStudy && (studyTimestep + 1 < dbgTimesteps.size()))); + (dbgTimestepStudy && (studyTimestep + 1 < static_cast<int>(dbgTimesteps.size())))); rosenbrockStat->acceptTimestep(); -- GitLab