Commit 2e10969e authored by Praetorius, Simon's avatar Praetorius, Simon

MS Windows compatibility and Warnings removed

parent 3484b9be
......@@ -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;
}
......
......@@ -83,7 +83,7 @@ namespace AMDiS {
}
/// Returns \ref strategy
const int getStrategy() const
int getStrategy() const
{
return strategy;
}
......
......@@ -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;
}
......
......@@ -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];
}
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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.
......
......@@ -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()");
......
......@@ -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);
......
......@@ -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()");
......
......@@ -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);
......
......@@ -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()");
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -86,7 +86,7 @@ namespace AMDiS {
}
/// Returns the id of element data type.
virtual const int getTypeID() const
virtual int getTypeID() const
{
return 0;
}
......
......@@ -64,7 +64,7 @@ namespace AMDiS {
return "ElementRegion_ED";
}
inline const int getTypeID() const
inline int getTypeID() const
{
return ELEMENT_REGION;
}
......
......@@ -110,7 +110,7 @@ namespace AMDiS {
flags &= ~f.flags;
}
inline const unsigned long getFlags() const
inline unsigned long getFlags() const
{
return flags;
}
......
......@@ -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
}
......
......@@ -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
......
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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();
}
......
......@@ -84,7 +84,7 @@ namespace AMDiS {
return true;
}
virtual const int getTypeID() const
virtual int getTypeID() const
{
return MESH_STRUCTURE;
}
......
......@@ -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: */
/*************************************