diff --git a/AMDiS/src/AbstractFunction.h b/AMDiS/src/AbstractFunction.h index 2dae656d4ee8857f641df5aa0dc5b94e1185fef3..cd6cc151914ef9084643fa764156ca12ee86e6de 100644 --- a/AMDiS/src/AbstractFunction.h +++ b/AMDiS/src/AbstractFunction.h @@ -49,7 +49,8 @@ namespace AMDiS { virtual ~AbstractFunction() {} /// Returns \ref degree_. - inline int getDegree() const { + inline int getDegree() const + { return degree_; } @@ -80,7 +81,8 @@ namespace AMDiS { virtual ~BinaryAbstractFunction() {} /// Returns \ref degree_. - inline int getDegree() const { + inline int getDegree() const + { return degree_; } @@ -113,7 +115,8 @@ namespace AMDiS { virtual ~TertiaryAbstractFunction() {} /// Returns \ref degree_. - inline int getDegree() const { + inline int getDegree() const + { return degree_; } @@ -148,7 +151,8 @@ namespace AMDiS { virtual ~QuartAbstractFunction() {} /// Returns \ref degree_. - inline int getDegree() const { + inline int getDegree() const + { return degree_; } diff --git a/AMDiS/src/AdaptInstationary.h b/AMDiS/src/AdaptInstationary.h index 393964d2c666ef3290f5e608522522f1120bd232..559bf40fa97b4e451e9c1d7759dc525fd568b908 100644 --- a/AMDiS/src/AdaptInstationary.h +++ b/AMDiS/src/AdaptInstationary.h @@ -56,12 +56,14 @@ namespace AMDiS { virtual ~AdaptInstationary(); /// Sets \ref strategy to aStrategy - inline void setStrategy(int aStrategy) { + inline void setStrategy(int aStrategy) + { strategy = aStrategy; } /// Returns \ref strategy - const int getStrategy() const { + const int getStrategy() const + { return strategy; } diff --git a/AMDiS/src/BallProject.h b/AMDiS/src/BallProject.h index 9361ed2bf0221474f78c56a43912e9c4942ae451..ab15be8252fed86ae8f8c3f14d9f8759573ce44e 100644 --- a/AMDiS/src/BallProject.h +++ b/AMDiS/src/BallProject.h @@ -45,7 +45,8 @@ namespace AMDiS { virtual ~BallProject() {} /// Implementation of Projection::project(); - void project(WorldVector<double> &x) { + void project(WorldVector<double> &x) + { x -= center_; double norm = sqrt(x*x); TEST_EXIT(norm != 0.0)("can't project vector x\n"); diff --git a/AMDiS/src/BasisFunction.h b/AMDiS/src/BasisFunction.h index b654d14bfb053b3621c6456de877beea1cc86902..b48adf2ad49c5198821576faca1a44a10c3f5372 100644 --- a/AMDiS/src/BasisFunction.h +++ b/AMDiS/src/BasisFunction.h @@ -90,12 +90,14 @@ namespace AMDiS { public: /// compares two BasisFunction objects. - virtual bool operator==(const BasisFunction& a) const { + virtual bool operator==(const BasisFunction& a) const + { return a.getName() == name; } /// Returns !(*this == b) - inline bool operator!=(const BasisFunction& b) const { + inline bool operator!=(const BasisFunction& b) const + { return !(operator == (b)); } @@ -134,22 +136,26 @@ namespace AMDiS { virtual void getBound(const ElInfo*, BoundaryType *) const {}; /// Returns \ref degree of BasisFunction - inline const int getDegree() const { + inline const int getDegree() const + { return degree; } /// Returns \ref dim of BasisFunction - inline const int getDim() const { + inline const int getDim() const + { return dim; } /// Returns \ref nBasFcts which is the number of local basis functions - inline const int getNumber() const { + inline const int getNumber() const + { return nBasFcts; } /// Returns \ref name of BasisFunction - inline const std::string& getName() const { + inline const std::string& getName() const + { return name; } @@ -157,7 +163,8 @@ namespace AMDiS { int getNumberOfDOFs(int i) const; /// Returns \ref nDOF - inline DimVec<int>* getNumberOfDOFs() const { + inline DimVec<int>* getNumberOfDOFs() const + { return nDOF; } @@ -197,17 +204,20 @@ namespace AMDiS { WorldVector<double> *vec) = 0; /// Returns the i-th local basis function - inline BasFctType *getPhi(int i) const { + inline BasFctType *getPhi(int i) const + { return (*phi)[i]; } /// Returns the gradient of the i-th local basis function - inline GrdBasFctType *getGrdPhi(int i) const { + inline GrdBasFctType *getGrdPhi(int i) const + { return (*grdPhi)[i]; } /// Returns the second derivative of the i-th local basis function - inline D2BasFctType *getD2Phi(int i) const { + inline D2BasFctType *getD2Phi(int i) const + { return (*d2Phi)[i]; } diff --git a/AMDiS/src/CoarseningManager.h b/AMDiS/src/CoarseningManager.h index 2950709fb2f8f54e2a6e38783caf46df6f718a8b..b9c7bfbd8250aaa2eae3a9b716716e4320342a19 100644 --- a/AMDiS/src/CoarseningManager.h +++ b/AMDiS/src/CoarseningManager.h @@ -50,7 +50,10 @@ namespace AMDiS { virtual ~CoarseningManager() {} /// Returns the Mesh the CoarseningManager belongs to. - inline Mesh* getMesh() { return mesh; } + inline Mesh* getMesh() + { + return mesh; + } /** \brief * Tries to coarsen every element of mesh at least mark times. First @@ -75,7 +78,10 @@ namespace AMDiS { * how one element of the mesh is coarsened. The method can be overriden * by sub classes, if used. */ - virtual int coarsenFunction(ElInfo *) { return 0; }; + virtual int coarsenFunction(ElInfo *) + { + return 0; + } /** \brief * Propagate coarsening information over the whole hierarchy diff --git a/AMDiS/src/CoarseningManager1d.h b/AMDiS/src/CoarseningManager1d.h index d84367b6a98fd2857830e09830e90e1a3b852823..2f9ee142c3f9df118188f38ab208f3fb63cba469 100644 --- a/AMDiS/src/CoarseningManager1d.h +++ b/AMDiS/src/CoarseningManager1d.h @@ -49,7 +49,8 @@ namespace AMDiS { protected: /// Not needed in this sub class - int coarsenFunction(ElInfo *) { + int coarsenFunction(ElInfo *) + { FUNCNAME("CoarseningManager1d::coarsenFunction"); ERROR_EXIT("not used for dim = 1"); return 0; diff --git a/AMDiS/src/ComponentTraverseInfo.h b/AMDiS/src/ComponentTraverseInfo.h index 0656bdb95a094ca1ce845549208f7a8875b3f4fc..f5e27e1b44e2532a704ec4e8feda06a8a3d421f5 100644 --- a/AMDiS/src/ComponentTraverseInfo.h +++ b/AMDiS/src/ComponentTraverseInfo.h @@ -38,46 +38,56 @@ namespace AMDiS { status(0) {} - void setFESpace(FiniteElemSpace *row, FiniteElemSpace *col = NULL) { + void setFESpace(FiniteElemSpace *row, FiniteElemSpace *col = NULL) + { rowFESpace = row; colFESpace = col; } - void setAuxFESpaces(std::vector<const FiniteElemSpace*> feSpaces) { + void setAuxFESpaces(std::vector<const FiniteElemSpace*> feSpaces) + { auxFESpaces = feSpaces; } - void addAuxFESpace(const FiniteElemSpace *fe) { + void addAuxFESpace(const FiniteElemSpace *fe) + { auxFESpaces.push_back(fe); } - bool hasFESpace() { + bool hasFESpace() + { return rowFESpace != NULL; } void updateStatus(); - int getNumAuxFESpaces() { + int getNumAuxFESpaces() + { return auxFESpaces.size(); } - FiniteElemSpace *getRowFESpace() { + FiniteElemSpace *getRowFESpace() + { return rowFESpace; } - FiniteElemSpace *getColFESpace() { + FiniteElemSpace *getColFESpace() + { return colFESpace; } - const FiniteElemSpace *getAuxFESpace(int i) { + const FiniteElemSpace *getAuxFESpace(int i) + { return ((i < static_cast<int>(auxFESpaces.size())) ? auxFESpaces[i] : NULL); } - void setAuxFESpace(const FiniteElemSpace* fe, int pos) { + void setAuxFESpace(const FiniteElemSpace* fe, int pos) + { auxFESpaces[pos] = fe; } - int getStatus() { + int getStatus() + { return status; } @@ -124,47 +134,54 @@ namespace AMDiS { resize(n); } - void resize(int n) { + void resize(int n) + { nComponents = n; matrixComponents.resize(n); vectorComponents.resize(n); - for (int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) matrixComponents[i].resize(n); - } } - void updateStatus() { + void updateStatus() + { for (int i = 0; i < nComponents; i++) { - for (int j = 0; j < nComponents; j++) { + for (int j = 0; j < nComponents; j++) matrixComponents[i][j].updateStatus(); - } + vectorComponents[i].updateStatus(); } } - SingleComponentInfo &getMatrix(int row, int col) { + SingleComponentInfo &getMatrix(int row, int col) + { return matrixComponents[row][col]; } - SingleComponentInfo &getVector(int row) { + SingleComponentInfo &getVector(int row) + { return vectorComponents[row]; } - int getStatus(int row, int col) { + int getStatus(int row, int col) + { return matrixComponents[row][col].getStatus(); } - int getStatus(int row) { + int getStatus(int row) + { return vectorComponents[row].getStatus(); } - const FiniteElemSpace* getAuxFESpace(int row, int col) { + const FiniteElemSpace* getAuxFESpace(int row, int col) + { return matrixComponents[row][col].getAuxFESpace(0); } - const FiniteElemSpace* getAuxFESpace(int row) { + const FiniteElemSpace* getAuxFESpace(int row) + { return vectorComponents[row].getAuxFESpace(0); } diff --git a/AMDiS/src/ConditionalEstimator.h b/AMDiS/src/ConditionalEstimator.h index a4ee8418097faafffd167e5e02114ae7cfc2b07a..76441d34d31a4b7e843e091ba1b91e8fd9a46b80 100644 --- a/AMDiS/src/ConditionalEstimator.h +++ b/AMDiS/src/ConditionalEstimator.h @@ -47,11 +47,13 @@ namespace AMDiS { double estimate(double timestep); - inline int getElementCount() { + inline int getElementCount() + { return elementCount_; } - inline Estimator *getDecoratedEstimator() { + inline Estimator *getDecoratedEstimator() + { return decoratedEstimator_; } diff --git a/AMDiS/src/ConditionalMarker.h b/AMDiS/src/ConditionalMarker.h index f66b4ce403cd8a14bc5fd0caa3a750b448ebf057..85f294917f8fc98b705e89df02316b148729f613 100644 --- a/AMDiS/src/ConditionalMarker.h +++ b/AMDiS/src/ConditionalMarker.h @@ -93,9 +93,8 @@ namespace AMDiS { if (elData->getPartitionStatus() == OUT) { Element *element = elInfo->getElement(); - if (element->getMark() > 0) { - element->setMark(0); - } + if (element->getMark() > 0) + element->setMark(0); } int minLevel = @@ -103,9 +102,8 @@ namespace AMDiS { localCoarseGridLevel_ : globalCoarseGridLevel_; - if (elData->getLevel() + elInfo->getElement()->getMark() < minLevel) { + if (elData->getLevel() + elInfo->getElement()->getMark() < minLevel) elInfo->getElement()->setMark(-(elData->getLevel() - minLevel)); - } } } diff --git a/AMDiS/src/CouplingTimeInterface.h b/AMDiS/src/CouplingTimeInterface.h index 49731d36c00b1971938c93871b61b52adf3a08ea..b64650b68640640107fec2960857bb7dd70f70ff 100644 --- a/AMDiS/src/CouplingTimeInterface.h +++ b/AMDiS/src/CouplingTimeInterface.h @@ -74,7 +74,8 @@ namespace AMDiS { } /// Solves the initial problem. - virtual void transferInitialSolution(AdaptInfo *adaptInfo) { + virtual void transferInitialSolution(AdaptInfo *adaptInfo) + { int size = static_cast<int>(interfaces_.size()); for (int i = 0; i < size; i++) interfaces_[i]->transferInitialSolution(adaptInfo); diff --git a/AMDiS/src/CreatorInterface.h b/AMDiS/src/CreatorInterface.h index 2c9b9fac64d290ca95c0e60712f2dd6dc332114f..ba2b411601ef85a4e10781d11d8acae1b32fa4e4 100644 --- a/AMDiS/src/CreatorInterface.h +++ b/AMDiS/src/CreatorInterface.h @@ -50,7 +50,8 @@ namespace AMDiS { */ virtual BaseClass* create() = 0; - virtual BaseClass* create(const DOFMatrix::base_matrix_type& A) { + virtual BaseClass* create(const DOFMatrix::base_matrix_type& A) + { return 0; } @@ -58,7 +59,8 @@ namespace AMDiS { virtual void free(BaseClass *) {} /// - virtual bool isNullCreator() { + virtual bool isNullCreator() + { return false; } }; @@ -71,12 +73,14 @@ namespace AMDiS { class NullCreator : public CreatorInterface<BaseClass> { /// Creates no object. - BaseClass* create() { + BaseClass* create() + { return NULL; } /// - virtual bool isNullCreator() { + virtual bool isNullCreator() + { return true; } }; diff --git a/AMDiS/src/CreatorMap.h b/AMDiS/src/CreatorMap.h index 8a122a025fe335536e540b6b6db0f6c07d5e2707..1c64d507ddbada5a4ac140ed40a61af2901d8e3d 100644 --- a/AMDiS/src/CreatorMap.h +++ b/AMDiS/src/CreatorMap.h @@ -52,7 +52,8 @@ namespace AMDiS { } /// Creates a object of the type corresponding to key. - static CreatorInterface<BaseClass>* getCreator(std::string key) { + static CreatorInterface<BaseClass>* getCreator(std::string key) + { FUNCNAME("CreatorMap::getCreator()"); init(); CreatorInterface<BaseClass> *creator = creatorMap[key]; @@ -66,7 +67,8 @@ namespace AMDiS { protected: /// Constructor is protected because derived maps should be singleton. - static void init() { + static void init() + { if (!initialized) { initialized = true; NullCreator<BaseClass> *nullCreator = new NullCreator<BaseClass>; diff --git a/AMDiS/src/DOFContainer.h b/AMDiS/src/DOFContainer.h index 8dc0416d2d52c1910d3212afcf587aade2f085e0..39f310e50d5c54dbcec80d9c173fd0d96b6bf0a2 100644 --- a/AMDiS/src/DOFContainer.h +++ b/AMDiS/src/DOFContainer.h @@ -44,7 +44,7 @@ namespace AMDiS { */ virtual DegreeOfFreedom& operator[](int i) = 0; - virtual void freeDOFIndex(DegreeOfFreedom dof) {}; + virtual void freeDOFIndex(DegreeOfFreedom dof) {} /** \brief * Used by DOFAdmin to actualize the DOF indices in this container after diff --git a/AMDiS/src/DOFIterator.h b/AMDiS/src/DOFIterator.h index 56129e36ff8a3200fe45d98a48d3332d564d4560..449e8a04b961d29290b3487deb21f13abfdfe337 100644 --- a/AMDiS/src/DOFIterator.h +++ b/AMDiS/src/DOFIterator.h @@ -91,14 +91,13 @@ namespace AMDiS { { position = 0; dofFreeIterator = dofFree->begin(); - if (dofFreeIterator == dofFree->end()) { + if (dofFreeIterator == dofFree->end()) return; - } + goToBeginOfIteratedObject(); - if (type != ALL_DOFS) { + if (type != ALL_DOFS) if (*dofFreeIterator == (type == USED_DOFS)) operator++(); - } } /** \brief diff --git a/AMDiS/src/DOFMatrix.h b/AMDiS/src/DOFMatrix.h index 5771b2c1136ddd09be4163a4983cbac88b5181fb..cc680eab408d8fd3e4c824d248b6ce98d67bb7b2 100644 --- a/AMDiS/src/DOFMatrix.h +++ b/AMDiS/src/DOFMatrix.h @@ -117,12 +117,14 @@ namespace AMDiS { virtual void freeDOFContent(int index); /// Returns \ref coupleMatrix. - inline bool isCoupleMatrix() { + inline bool isCoupleMatrix() + { return coupleMatrix; } /// Returns \ref coupleMatrix. - inline void setCoupleMatrix(bool c) { + inline void setCoupleMatrix(bool c) + { coupleMatrix = c; } @@ -139,27 +141,33 @@ namespace AMDiS { */ void addOperator(Operator *op, double* factor = NULL, double* estFactor = NULL); - inline std::vector<double*>::iterator getOperatorFactorBegin() { + inline std::vector<double*>::iterator getOperatorFactorBegin() + { return operatorFactor.begin(); } - inline std::vector<double*>::iterator getOperatorFactorEnd() { + inline std::vector<double*>::iterator getOperatorFactorEnd() + { return operatorFactor.end(); } - inline std::vector<double*>::iterator getOperatorEstFactorBegin() { + inline std::vector<double*>::iterator getOperatorEstFactorBegin() + { return operatorEstFactor.begin(); } - inline std::vector<double*>::iterator getOperatorEstFactorEnd() { + inline std::vector<double*>::iterator getOperatorEstFactorEnd() + { return operatorEstFactor.end(); } - inline std::vector<Operator*>::iterator getOperatorsBegin() { + inline std::vector<Operator*>::iterator getOperatorsBegin() + { return operators.begin(); } - inline std::vector<Operator*>::iterator getOperatorsEnd() { + inline std::vector<Operator*>::iterator getOperatorsEnd() + { return operators.end(); } @@ -250,27 +258,32 @@ namespace AMDiS { * Returns whether restriction should be performed after coarsening * (false by default) */ - virtual bool coarseRestrict() { + virtual bool coarseRestrict() + { return false; } /// Returns const \ref rowFESpace - const FiniteElemSpace* getRowFESpace() const { + const FiniteElemSpace* getRowFESpace() const + { return rowFESpace; } /// Returns const \ref colFESpace - const FiniteElemSpace* getColFESpace() const { + const FiniteElemSpace* getColFESpace() const + { return colFESpace; } /// Returns const \ref rowFESpace - const FiniteElemSpace* getFESpace() const { + const FiniteElemSpace* getFESpace() const + { return rowFESpace; } /// Returns number of rows (\ref matrix.size()) - inline int getSize() const { + inline int getSize() const + { return num_rows(matrix); } @@ -278,17 +291,20 @@ namespace AMDiS { * Returns the number of used rows (equal to number of used DOFs in * the row FE space). */ - inline int getUsedSize() const { + inline int getUsedSize() const + { return rowFESpace->getAdmin()->getUsedSize(); } /// Returns \ref name - inline const std::string& getName() const { + inline const std::string& getName() const + { return name; } /// Resizes \ref matrix to n rows - inline void resize(int n) { + inline void resize(int n) + { TEST_EXIT_DBG(n >= 0)("Can't resize DOFMatrix to negative size\n"); } @@ -322,28 +338,34 @@ namespace AMDiS { bool symmetric(); - inline std::vector<Operator*> getOperators() { + inline std::vector<Operator*> getOperators() + { return operators; } - inline std::vector<double*> getOperatorFactor() { + inline std::vector<double*> getOperatorFactor() + { return operatorFactor; } - inline std::vector<double*> getOperatorEstFactor() { + inline std::vector<double*> getOperatorEstFactor() + { return operatorEstFactor; } - inline BoundaryManager* getBoundaryManager() const { + inline BoundaryManager* getBoundaryManager() const + { return boundaryManager; } /// Returns a pointer to \ref applyDBCs. - std::set<int>* getApplyDBCs() { + std::set<int>* getApplyDBCs() + { return &applyDBCs; } - inline void setBoundaryManager(BoundaryManager *bm) { + inline void setBoundaryManager(BoundaryManager *bm) + { boundaryManager = bm; } @@ -426,7 +448,8 @@ namespace AMDiS { #ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Sets the petsc application ordering object to map dof indices. - void useApplicationOrdering(AO *ao) { + void useApplicationOrdering(AO *ao) + { applicationOrdering = ao; } #endif diff --git a/AMDiS/src/DOFVector.h b/AMDiS/src/DOFVector.h index 123c8c49603f9eb5ce01e4a1cc6b9d61702a29c4..834b1cba305f44de3d9c222deb23ca73aefe2326 100644 --- a/AMDiS/src/DOFVector.h +++ b/AMDiS/src/DOFVector.h @@ -100,7 +100,8 @@ namespace AMDiS { WorldMatrix<T> *d2AtQPs) const; /// Returns the FE space the DOF vector is defined on. - inline const FiniteElemSpace* getFESpace() const { + inline const FiniteElemSpace* getFESpace() const + { return feSpace; } @@ -140,28 +141,34 @@ namespace AMDiS { operatorEstFactor.push_back(estFactor); } - inline std::vector<double*>::iterator getOperatorFactorBegin() { + inline std::vector<double*>::iterator getOperatorFactorBegin() + { return operatorFactor.begin(); } - inline std::vector<double*>::iterator getOperatorFactorEnd() { + inline std::vector<double*>::iterator getOperatorFactorEnd() + { return operatorFactor.end(); } - inline std::vector<double*>::iterator getOperatorEstFactorBegin() { + inline std::vector<double*>::iterator getOperatorEstFactorBegin() + { return operatorEstFactor.begin(); } - inline std::vector<double*>::iterator getOperatorEstFactorEnd() { + inline std::vector<double*>::iterator getOperatorEstFactorEnd() + { return operatorEstFactor.end(); } - inline std::vector<Operator*>::iterator getOperatorsBegin() { + inline std::vector<Operator*>::iterator getOperatorsBegin() + { return operators.begin(); } - inline std::vector<Operator*>::iterator getOperatorsEnd() { + inline std::vector<Operator*>::iterator getOperatorsEnd() + { return operators.end(); } @@ -175,28 +182,34 @@ namespace AMDiS { */ T evalUh(const DimVec<double>& lambda, DegreeOfFreedom* ind); - inline std::vector<Operator*>& getOperators() { + inline std::vector<Operator*>& getOperators() + { return operators; } - inline std::vector<double*>& getOperatorFactor() { + inline std::vector<double*>& getOperatorFactor() + { return operatorFactor; } - inline std::vector<double*>& getOperatorEstFactor() { + inline std::vector<double*>& getOperatorEstFactor() + { return operatorEstFactor; } /// Returns \ref name - inline const std::string& getName() const { + inline const std::string& getName() const + { return name; } - inline BoundaryManager* getBoundaryManager() const { + inline BoundaryManager* getBoundaryManager() const + { return boundaryManager; } - inline void setBoundaryManager(BoundaryManager *bm) { + inline void setBoundaryManager(BoundaryManager *bm) + { boundaryManager = bm; } @@ -289,11 +302,13 @@ namespace AMDiS { : feSpace(feSpace_) {} - DOFVector<T> *create() { + DOFVector<T> *create() + { return new DOFVector<T>(feSpace, ""); } - void free(DOFVector<T> *vec) { + void free(DOFVector<T> *vec) + { delete vec; } @@ -316,24 +331,26 @@ namespace AMDiS { void init(const FiniteElemSpace* f, std::string n); /// Copy Constructor - DOFVector(const DOFVector& rhs) { + DOFVector(const DOFVector& rhs) + { *this = rhs; name = rhs.name + "copy"; - if (feSpace && feSpace->getAdmin()) { + if (feSpace && feSpace->getAdmin()) (dynamic_cast<DOFAdmin*>(feSpace->getAdmin()))->addDOFIndexed(this); - } } /// Destructor virtual ~DOFVector(); /// Returns iterator to the begin of \ref vec - typename std::vector<T>::iterator begin() { + typename std::vector<T>::iterator begin() + { return vec.begin(); } /// Returns iterator to the end of \ref vec - typename std::vector<T>::iterator end() { + typename std::vector<T>::iterator end() + { return vec.end(); } @@ -345,12 +362,14 @@ namespace AMDiS { std::vector<DegreeOfFreedom> &newDof); /// Sets \ref coarsenOperation to op - inline void setCoarsenOperation(CoarsenOperation op) { + inline void setCoarsenOperation(CoarsenOperation op) + { coarsenOperation = op; } /// Returns \ref coarsenOperation - inline CoarsenOperation getCoarsenOperation() { + inline CoarsenOperation getCoarsenOperation() + { return coarsenOperation; } @@ -361,36 +380,42 @@ namespace AMDiS { inline void refineInterpol(RCNeighbourList&, int) {} /// Returns \ref vec - std::vector<T>& getVector() { + std::vector<T>& getVector() + { return vec; } /// Returns size of \ref vec - inline int getSize() const { + inline int getSize() const + { return vec.size(); } /// Returns used size of the vector. - inline int getUsedSize() const { + inline int getUsedSize() const + { return feSpace->getAdmin()->getUsedSize(); } /// Resizes \ref vec to n - inline void resize(int n) { + inline void resize(int n) + { FUNCNAME("DOFVector<T>::resize()"); TEST_EXIT_DBG((n >= 0))("Can't resize DOFVector to negative size\n"); vec.resize(n); } /// Resizes \ref vec to n and inits new values with init - inline void resize(int n, T init) { + inline void resize(int n, T init) + { FUNCNAME("DOFVector<T>::resize()"); TEST_EXIT_DBG((n >= 0))("Can't resize DOFVector to negative size\n"); vec.resize(n, init); } /// Returns \ref vec[i] - inline const T& operator[](DegreeOfFreedom i) const { + inline const T& operator[](DegreeOfFreedom i) const + { FUNCNAME("DOFVector<T>::operator[]"); TEST_EXIT_DBG((i>= 0) && (i < static_cast<int>(vec.size()))) ("Illegal vector index %d.\n",i); @@ -398,7 +423,8 @@ namespace AMDiS { } /// Returns \ref vec[i] - inline T& operator[](DegreeOfFreedom i) { + inline T& operator[](DegreeOfFreedom i) + { FUNCNAME("DOFVector<T>::operator[]"); TEST_EXIT_DBG((i >= 0) && (i < static_cast<int>(vec.size()))) ("Illegal vector index %d.\n",i); @@ -412,7 +438,8 @@ namespace AMDiS { double L1Norm(Quadrature* q = NULL) const; /// Calculates L2 norm of this DOFVector - inline double L2Norm(Quadrature* q = NULL) const { + inline double L2Norm(Quadrature* q = NULL) const + { return sqrt(L2NormSquare()); } @@ -420,7 +447,8 @@ namespace AMDiS { double L2NormSquare(Quadrature* q = NULL) const; /// Calculates H1 norm of this DOFVector - inline double H1Norm(Quadrature* q = NULL) const { + inline double H1Norm(Quadrature* q = NULL) const + { return sqrt(H1NormSquare()); } @@ -434,7 +462,8 @@ namespace AMDiS { double squareNrm2() const; /// Calculates l2 norm of this DOFVector - inline double l2norm() const { + inline double l2norm() const + { return nrm2(); } @@ -442,7 +471,8 @@ namespace AMDiS { T asum() const; /// Calculates the l1 norm of this DOFVector - inline double l1norm() const { + inline double l1norm() const + { return asum(); } @@ -456,7 +486,8 @@ namespace AMDiS { void set(T val); /// Assignment operator for setting complete vector to a certain value d - inline DOFVector<T>& operator=(T d) { + inline DOFVector<T>& operator=(T d) + { set(d); return *this; } @@ -494,14 +525,16 @@ namespace AMDiS { void interpol(DOFVector<T> *v, double factor); /// Writes the data of the DOFVector to an output stream. - void serialize(std::ostream &out) { + void serialize(std::ostream &out) + { unsigned int size = vec.size(); out.write(reinterpret_cast<const char*>(&size), sizeof(unsigned int)); out.write(reinterpret_cast<const char*>(&(vec[0])), size * sizeof(T)); } /// Reads data of an DOFVector from an input stream. - void deserialize(std::istream &in) { + void deserialize(std::istream &in) + { unsigned int size; in.read(reinterpret_cast<char*>(&size), sizeof(unsigned int)); vec.resize(size); @@ -516,7 +549,8 @@ namespace AMDiS { #ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Sets the petsc application ordering object to map dof indices. - void useApplicationOrdering(AO *ao) { + void useApplicationOrdering(AO *ao) + { applicationOrdering = ao; } #endif @@ -576,11 +610,13 @@ namespace AMDiS { template<> void DOFVector<double>::coarseRestrict(RCNeighbourList&, int); - inline double min(const DOFVector<double>& v) { + inline double min(const DOFVector<double>& v) + { return v.min(); } - inline double max(const DOFVector<double>& v) { + inline double max(const DOFVector<double>& v) + { return v.max(); } @@ -604,7 +640,8 @@ namespace AMDiS { } /// Deregisters itself at DOFAdmin. - ~DOFVectorDOF() { + ~DOFVectorDOF() + { feSpace->getAdmin()->removeDOFContainer(this); } @@ -612,21 +649,25 @@ namespace AMDiS { * Implements DOFContainer::operator[]() by calling * DOFVEctor<DegreeOfFreedom>::operator[]() */ - DegreeOfFreedom& operator[](DegreeOfFreedom i) { + DegreeOfFreedom& operator[](DegreeOfFreedom i) + { return DOFVector<DegreeOfFreedom>::operator[](i); } - const DegreeOfFreedom& operator[](DegreeOfFreedom i) const { + const DegreeOfFreedom& operator[](DegreeOfFreedom i) const + { return DOFVector<DegreeOfFreedom>::operator[](i); } /// Implements DOFIndexedBase::getSize() - int getSize() const { + int getSize() const + { return DOFVector<DegreeOfFreedom>::getSize(); } /// Implements DOFIndexedBase::resize() - void resize(int size) { + void resize(int size) + { DOFVector<DegreeOfFreedom>::resize(size); } @@ -638,22 +679,26 @@ namespace AMDiS { template<typename T> - double norm(DOFVector<T> *vec) { + double norm(DOFVector<T> *vec) + { return vec->nrm2(); } template<typename T> - double L2Norm(DOFVector<T> *vec) { + double L2Norm(DOFVector<T> *vec) + { return vec->L2Norm(); } template<typename T> - double H1Norm(DOFVector<T> *vec) { + double H1Norm(DOFVector<T> *vec) + { return vec->H1Norm(); } template<typename T> - void print(DOFVector<T> *vec) { + void print(DOFVector<T> *vec) +{ vec->print(); } @@ -702,7 +747,8 @@ namespace AMDiS { void xpay(double a,const DOFVector<T>& x,DOFVector<T>& y); template<typename T> - inline void scal(T a, DOFVector<T>& y) { + inline void scal(T a, DOFVector<T>& y) + { y *= a; } @@ -731,17 +777,20 @@ namespace AMDiS { template<typename T> - inline void set(DOFVector<T>& vec, T d) { + inline void set(DOFVector<T>& vec, T d) + { vec.set(d); } template<typename T> - inline void setValue(DOFVector<T>& vec, T d) { + inline void setValue(DOFVector<T>& vec, T d) + { vec.set(d); } template<typename T> - inline int size(DOFVector<T> *vec) { + inline int size(DOFVector<T> *vec) + { return vec->getUsedSize(); } diff --git a/AMDiS/src/DualTraverse.h b/AMDiS/src/DualTraverse.h index 7d55e8846c6ac58e932923638e15784c51131b00..fc2d1ae4edfba168ce6f66a1a9b7d2e87f60bcc3 100644 --- a/AMDiS/src/DualTraverse.h +++ b/AMDiS/src/DualTraverse.h @@ -66,15 +66,18 @@ namespace AMDiS { return true; } - virtual bool skipEl1(ElInfo *elInfo) { + virtual bool skipEl1(ElInfo *elInfo) + { return false; } - virtual bool skipEl2(ElInfo *elInfo) { + virtual bool skipEl2(ElInfo *elInfo) + { return false; } - inline void setFillSubElemMat(bool b, const BasisFunction *fcts) { + inline void setFillSubElemMat(bool b, const BasisFunction *fcts) + { fillSubElemMat = b; basisFcts = fcts; } diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h index 45b3bc92c9b912517f379b5509f80f42f09d7277..3ec7e4911eecb7e51f26ae184dd31d1eca8894b1 100644 --- a/AMDiS/src/ElInfo.h +++ b/AMDiS/src/ElInfo.h @@ -64,7 +64,8 @@ namespace AMDiS { * Assignement operator. * \param rhs right hand side. */ - ElInfo& operator=(const ElInfo& rhs) { + ElInfo& operator=(const ElInfo& rhs) + { mesh_ = rhs.mesh_; element_ = rhs.element_; parent_ = rhs.parent_; @@ -87,37 +88,44 @@ namespace AMDiS { */ /// Get ElInfo's \ref mesh_ - inline Mesh* getMesh() const { + inline Mesh* getMesh() const + { return mesh_; } /// Get ElInfo's \ref macroElement_ - inline MacroElement* getMacroElement() const { + inline MacroElement* getMacroElement() const + { return macroElement_; } /// Get ElInfo's \ref element - inline Element* getElement() const { + inline Element* getElement() const + { return element_; } /// Get ElInfo's \ref parent_ - inline Element* getParent() const { + inline Element* getParent() const + { return parent_; } /// Get ElInfo's \ref fillFlag_ - inline Flag getFillFlag() const { + inline Flag getFillFlag() const + { return fillFlag_; } /// Get ElInfo's \ref level - inline int getLevel() const { + inline int getLevel() const + { return level; } /// Get ElInfo's \ref iChild - inline int getIChild() const { + inline int getIChild() const + { return iChild; } @@ -125,7 +133,8 @@ namespace AMDiS { * Get ElInfo's \ref coord_[i]. This is a WorldVector<double> filled with the * coordinates of the i-th vertex of element \ref el. */ - inline WorldVector<double>& getCoord(int i) { + inline WorldVector<double>& getCoord(int i) + { return coord_[i]; } @@ -133,7 +142,8 @@ namespace AMDiS { * Get ElInfo's \ref coord_[i]. This is a WorldVector<double> filled with the * coordinates of the i-th vertex of element \ref el. */ - inline const WorldVector<double>& getCoord(int i) const { + inline const WorldVector<double>& getCoord(int i) const + { return coord_[i]; } @@ -141,7 +151,8 @@ namespace AMDiS { * Get ElInfo's \ref coord_. This is a FixVec<WorldVector<double> > filled with the * coordinates of the all vertice of element \ref el. */ - inline FixVec<WorldVector<double>, VERTEX>& getCoords() { + inline FixVec<WorldVector<double>, VERTEX>& getCoords() + { return coord_; } @@ -149,17 +160,20 @@ namespace AMDiS { * Get ElInfo's \ref coord_. This is a FixVec<WorldVector<double> > filled with the * coordinates of the all vertice of element \ref el. */ - inline const FixVec<WorldVector<double>, VERTEX>& getCoords() const { + inline const FixVec<WorldVector<double>, VERTEX>& getCoords() const + { return coord_; } /// Get ElInfo's \ref oppCoord_[i] - inline WorldVector<double>& getOppCoord(int i) { + inline WorldVector<double>& getOppCoord(int i) + { return oppCoord_[i]; } /// Get ElInfo's \ref boundary_[i] - inline BoundaryType getBoundary(int i) const { + inline BoundaryType getBoundary(int i) const + { return boundary_[i]; } @@ -167,41 +181,49 @@ namespace AMDiS { BoundaryType getBoundary(GeoIndex pos, int i); /// Get ElInfo's \ref neighbour_[i] - inline Element* getNeighbour(int i) const { + inline Element* getNeighbour(int i) const + { return neighbour_[i]; } /// Get ElInfo's \ref neighbourCoord_[i] - inline FixVec<WorldVector<double>, VERTEX> getNeighbourCoord(int i) const { + inline FixVec<WorldVector<double>, VERTEX> getNeighbourCoord(int i) const + { return neighbourCoord_[i]; } /// Get ElInfo's \ref oppVertex_[i] - inline unsigned char getOppVertex(int i) const { + inline unsigned char getOppVertex(int i) const + { return oppVertex_[i]; } - virtual int getSideOfNeighbour(int i) { + virtual int getSideOfNeighbour(int i) + { return oppVertex_[i]; } /// Get ElInfo's \ref det_ - inline double getDet() const { + inline double getDet() const + { return det_; } /// Returns \ref grdLambda - inline const DimVec<WorldVector<double> >& getGrdLambda() const { + inline const DimVec<WorldVector<double> >& getGrdLambda() const + { return grdLambda; } /// Returns \ref projection_[i] - inline Projection *getProjection(int i) const { + inline Projection *getProjection(int i) const + { return projection_[i]; } /// Returns \ref parametric_ - inline bool getParametric() { + inline bool getParametric() + { return parametric_; } @@ -218,62 +240,74 @@ namespace AMDiS { */ /// Set ElInfo's \ref mesh_ - inline void setMesh(Mesh* aMesh) { + inline void setMesh(Mesh* aMesh) + { mesh_ = aMesh; } /// Set ElInfo's \ref macroElement_ - inline void setMacroElement(MacroElement* mel) { + inline void setMacroElement(MacroElement* mel) + { macroElement_ = mel; } /// Set ElInfo's \ref element - inline void setElement(Element* elem) { + inline void setElement(Element* elem) + { element_ = elem; } /// Set ElInfo's \ref parent_ - inline void setParent(Element* elem) { + inline void setParent(Element* elem) + { parent_ = elem; } /// Set ElInfo's \ref fillFlag_ - inline void setFillFlag(Flag flag) { + inline void setFillFlag(Flag flag) + { fillFlag_ = flag; } /// Sets ElInfo's \ref coord_[i]. - inline void setCoord(int i,WorldVector<double>& coord) { + inline void setCoord(int i,WorldVector<double>& coord) + { coord_[i] = coord; } /// Sets ElInfo's \ref coord. - inline void setCoords(FixVec<WorldVector<double>,VERTEX >& coords) { + inline void setCoords(FixVec<WorldVector<double>,VERTEX >& coords) + { coord_ = coords; } /// Set ElInfo's \ref level - inline void setLevel(int l) { + inline void setLevel(int l) + { level = l; } /// Set ElInfo's \ref boundary_[i] - inline void setBoundary(int i, BoundaryType t) { + inline void setBoundary(int i, BoundaryType t) + { boundary_[i] = newBound(boundary_[i], t); } /// Set \ref projection_[i] = p - inline void setProjection(int i, Projection *p) { + inline void setProjection(int i, Projection *p) + { projection_[i] = p; } /// Set \ref det_ = d - inline void setDet(double d) { + inline void setDet(double d) + { det_ = d; } /// Set \ref parametric_ = param - inline void setParametric(bool param) { + inline void setParametric(bool param) + { parametric_ = param; } diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h index e91edfba580073265b1b8c38ea15066793b4c448..bee73440fd70bb014d1695d7469b0b04aff582da 100644 --- a/AMDiS/src/ElInfo1d.h +++ b/AMDiS/src/ElInfo1d.h @@ -57,7 +57,8 @@ namespace AMDiS { /// 1-dimensional realisation of ElInfo's getElementNormal method. double getElementNormal( WorldVector<double> &normal) const; - int getSideOfNeighbour(int i) { + int getSideOfNeighbour(int i) + { return (i + 1) % 2; } diff --git a/AMDiS/src/ElInfo3d.h b/AMDiS/src/ElInfo3d.h index b4412a08acfa2446198773dcc56b8aa5f763c057..9560e0600b0f592c790366b011a328eb598f9036 100644 --- a/AMDiS/src/ElInfo3d.h +++ b/AMDiS/src/ElInfo3d.h @@ -42,7 +42,8 @@ namespace AMDiS { } /// Assignment operator - ElInfo3d& operator=(const ElInfo3d& rhs) { + ElInfo3d& operator=(const ElInfo3d& rhs) + { ElInfo::operator=(rhs); el_type = rhs.el_type; orientation = rhs.orientation; @@ -68,22 +69,26 @@ namespace AMDiS { void update(); /// get ElInfo's \ref el_type - inline unsigned char getType() const { + inline unsigned char getType() const + { return el_type; } /// get ElInfo's \ref orientation - inline signed char getOrientation() const { + inline signed char getOrientation() const + { return orientation; } /// set ElInfo's \ref el_type to t - inline void setType(unsigned char t) { + inline void setType(unsigned char t) + { el_type = t; } /// set ElInfo's \ref orientation to o - inline void setOrientation(signed char o) { + inline void setOrientation(signed char o) + { orientation = o; } diff --git a/AMDiS/src/Element.h b/AMDiS/src/Element.h index de0bc81d601b1140e17567945d96a78447f1b563..305d9fa220c9b9d67b0d3c8fc1cdae40bf63c3b3 100644 --- a/AMDiS/src/Element.h +++ b/AMDiS/src/Element.h @@ -92,17 +92,20 @@ namespace AMDiS { */ /// Returns \ref child[0] - inline Element* getFirstChild() const { + inline Element* getFirstChild() const + { return child[0]; } /// Returns \ref child[1] - inline Element* getSecondChild() const { + inline Element* getSecondChild() const + { return child[1]; } /// Returns \ref child[i], i=0,1 - inline Element* getChild(int i) const { + inline Element* getChild(int i) const + { TEST_EXIT_DBG(i==0 || i==1)("i must be 0 or 1\n"); return child[i]; } @@ -111,27 +114,32 @@ namespace AMDiS { * Returns true if Element is a leaf element (\ref child[0] == NULL), returns * false otherwise. */ - inline const bool isLeaf() const { + inline const bool isLeaf() const + { return (child[0] == NULL); } /// Returns \ref dof[i][j] which is the j-th DOF of the i-th node of Element. - const DegreeOfFreedom getDOF(int i, int j) const { + const DegreeOfFreedom getDOF(int i, int j) const + { return dof[i][j]; } /// Returns \ref dof[i] which is a pointer to the DOFs of the i-th node. - const DegreeOfFreedom* getDOF(int i) const { + const DegreeOfFreedom* getDOF(int i) const + { return dof[i]; } /// Returns a pointer to the DOFs of this Element - const DegreeOfFreedom** getDOF() const { + const DegreeOfFreedom** getDOF() const + { return const_cast<const DegreeOfFreedom**>(dof); } /// Returns \ref mesh of Element - inline Mesh* getMesh() const { + inline Mesh* getMesh() const + { return mesh; } @@ -156,7 +164,8 @@ namespace AMDiS { * Returns Element's coarsening error estimation, if Element is a leaf * element and if it has leaf data and if this leaf data are coarsenable. */ - inline double getCoarseningEstimation(int row) { + inline double getCoarseningEstimation(int row) + { if (isLeaf()) { TEST_EXIT_DBG(elementData)("leaf element without leaf data\n"); ElementData *ld = elementData->getElementData(COARSENABLE); @@ -192,23 +201,27 @@ namespace AMDiS { virtual int getGeo(GeoIndex i) const = 0; /// Returns Element's \ref mark - inline const signed char getMark() const { + inline const signed char getMark() const + { return mark; } /// Returns \ref newCoord[i] - inline double getNewCoord(int i) const { + inline double getNewCoord(int i) const + { TEST_EXIT_DBG(newCoord)("newCoord = NULL\n"); return (*newCoord)[i]; } /// Returns Element's \ref index - inline int getIndex() const { + inline int getIndex() const + { return index; } /// Returns \ref newCoord - inline WorldVector<double>* getNewCoord() const { + inline WorldVector<double>* getNewCoord() const + { return newCoord; } @@ -219,17 +232,20 @@ namespace AMDiS { */ /// Sets \ref child[0] - virtual void setFirstChild(Element *aChild) { + virtual void setFirstChild(Element *aChild) + { child[0] = aChild; } /// Sets \ref child[1] - virtual void setSecondChild(Element *aChild) { + virtual void setSecondChild(Element *aChild) + { child[1] = aChild; } /// Sets \ref elementData of Element - void setElementData(ElementData* ed) { + void setElementData(ElementData* ed) + { elementData = ed; } @@ -237,17 +253,20 @@ namespace AMDiS { * Sets \ref newCoord of Element. Needed by refinement, if Element has a * boundary edge on a curved boundary. */ - inline void setNewCoord(WorldVector<double>* coord) { + inline void setNewCoord(WorldVector<double>* coord) + { newCoord = coord; } /// Sets \ref mesh. - inline void setMesh(Mesh *m) { + inline void setMesh(Mesh *m) + { mesh = m; } /// Sets the pointer to the DOFs of the i-th node of Element - DegreeOfFreedom* setDOF(int pos, DegreeOfFreedom* p) { + DegreeOfFreedom* setDOF(int pos, DegreeOfFreedom* p) + { dof[pos] = p; return dof[pos]; } @@ -289,18 +308,21 @@ namespace AMDiS { } /// Sets Elements \ref mark = mark + 1; - inline void incrementMark() { + inline void incrementMark() + { mark++; } /// Sets Elements \ref mark = mark - 1; - inline void decrementMark() { + inline void decrementMark() + { if (0 < mark) mark--; } /// Sets Element's \ref mark - inline void setMark(signed char m) { + inline void setMark(signed char m) + { mark = m; } @@ -367,7 +389,8 @@ namespace AMDiS { int oppVertex(FixVec<DegreeOfFreedom*, DIMEN> pdof) const; /// Refines Element's leaf data - inline void refineElementData(Element* child1, Element* child2, int elType = 0) { + inline void refineElementData(Element* child1, Element* child2, int elType = 0) + { if (elementData) { bool remove = elementData->refineElementData(this, child1, child2, elType); if (remove) { @@ -379,7 +402,8 @@ namespace AMDiS { } /// Coarsens Element's leaf data - inline void coarsenElementData(Element* child1, Element* child2, int elType = 0) { + inline void coarsenElementData(Element* child1, Element* child2, int elType = 0) + { ElementData *childData; childData = child1->getElementData(); if (childData) { @@ -396,15 +420,17 @@ namespace AMDiS { } /// Returns pointer to \ref elementData - inline ElementData* getElementData() const { + inline ElementData* getElementData() const + { return elementData; } /// - inline ElementData* getElementData(int typeID) const { - if (elementData) { + inline ElementData* getElementData(int typeID) const + { + if (elementData) return elementData->getElementData(typeID); - } + return NULL; } @@ -421,7 +447,8 @@ namespace AMDiS { unsigned char elementTyp = 255); /// Returns whether Element's \ref newCoord is set - inline bool isNewCoordSet() const { + inline bool isNewCoordSet() const + { return (newCoord != NULL); } @@ -442,7 +469,8 @@ namespace AMDiS { void setDOFPtrs(); /// Sets Element's \ref index. Used by friend class Mesh. - inline void setIndex(int i) { + inline void setIndex(int i) + { index = i; } diff --git a/AMDiS/src/ElementData.h b/AMDiS/src/ElementData.h index c2e35053234ff86814d541e8b4a738c0c6b363cb..e58dc1c237e09782a847bee848312f1373bd80a5 100644 --- a/AMDiS/src/ElementData.h +++ b/AMDiS/src/ElementData.h @@ -76,7 +76,8 @@ namespace AMDiS { int elTypeParent); /// Returns a copy of this ElementData object including all decorated data. - virtual ElementData *clone() const { + virtual ElementData *clone() const + { if (decorated_) return decorated_->clone(); @@ -84,7 +85,8 @@ namespace AMDiS { } /// Returns the id of element data type. - virtual const int getTypeID() const { + virtual const int getTypeID() const + { return 0; } @@ -101,7 +103,8 @@ namespace AMDiS { virtual void deserialize(std::istream& in); /// Returns first element data in the chain which is of the spcified type. - inline ElementData *getElementData(int typeID) { + inline ElementData *getElementData(int typeID) + { if (this->isOfType(typeID)) { return this; } else { @@ -111,7 +114,8 @@ namespace AMDiS { return NULL; } - inline ElementData *getDecorated(int typeID) { + inline ElementData *getDecorated(int typeID) + { if (decorated_) return decorated_->getElementData(typeID); @@ -127,14 +131,16 @@ namespace AMDiS { /// Delets the whole \ref decorated_ chain. void deleteDecorated(); - inline ElementData *getDecorated() { + inline ElementData *getDecorated() + { return decorated_; } - inline void setDecorated(ElementData *d) { + inline void setDecorated(ElementData *d) + { if (getTypeID() == 1) if (d != NULL) - std::cout<<"leafdata decorated with nonzero"<<std::endl; + std::cout << "leafdata decorated with nonzero" << std::endl; decorated_ = d; } diff --git a/AMDiS/src/ElementFunction.h b/AMDiS/src/ElementFunction.h index 7d4c6b775746ae99d8f9e742878ed0c863b25cba..d5d04a72e2704e58d95cd43b672c8ead56a930b4 100644 --- a/AMDiS/src/ElementFunction.h +++ b/AMDiS/src/ElementFunction.h @@ -42,7 +42,8 @@ namespace AMDiS { virtual ~ElementFunction() {} /// sets \ref elInfo_; - inline void setElInfo(const ElInfo *elInfo) { + inline void setElInfo(const ElInfo *elInfo) + { elInfo_ = elInfo; } @@ -63,7 +64,8 @@ namespace AMDiS { {} /// evaluation at given coordinates. - T operator()(const DimVec<double>& bary) const { + T operator()(const DimVec<double>& bary) const + { WorldVector<double> worldCoords; this->elInfo_->coordToWorld(bary, &worldCoords); return (*fct_)(worldCoords); diff --git a/AMDiS/src/ElementRegion_ED.h b/AMDiS/src/ElementRegion_ED.h index 0a04513d63a720c1beb6d66c1c03b2979518aa10..1bad3f68b393a42df2ed104a34134199e27efdbf 100644 --- a/AMDiS/src/ElementRegion_ED.h +++ b/AMDiS/src/ElementRegion_ED.h @@ -40,7 +40,8 @@ namespace AMDiS { class Creator : public CreatorInterface<ElementData> { public: - ElementData* create() { + ElementData* create() + { return new ElementRegion_ED; } }; @@ -70,16 +71,23 @@ namespace AMDiS { return false; } - ElementData *clone() const { + ElementData *clone() const + { ElementRegion_ED *newObj = new ElementRegion_ED; newObj->region_ = region_; newObj->decorated_ = ElementData::clone(); return newObj; } - inline std::string getTypeName() const { return "ElementRegion_ED"; } + inline std::string getTypeName() const + { + return "ElementRegion_ED"; + } - inline const int getTypeID() const { return ELEMENT_REGION; } + inline const int getTypeID() const + { + return ELEMENT_REGION; + } void serialize(std::ostream& out) { @@ -93,9 +101,15 @@ namespace AMDiS { in.read(reinterpret_cast<char*>(®ion_), sizeof(int)); } - inline void setRegion(int region) { region_ = region; } + inline void setRegion(int region) + { + region_ = region; + } - inline int getRegion() const { return region_; } + inline int getRegion() const + { + return region_; + } protected: int region_; diff --git a/AMDiS/src/EmptyElementData.h b/AMDiS/src/EmptyElementData.h index 283672c6cd7e5786dc8884fbb65eeb512daa6810..8ebc8fc90891099a6a0d56823a163125b020be29 100644 --- a/AMDiS/src/EmptyElementData.h +++ b/AMDiS/src/EmptyElementData.h @@ -43,7 +43,8 @@ namespace AMDiS { class Creator : public CreatorInterface<ElementData> { public: - ElementData* create() { + ElementData* create() + { return new EmptyElementData; } }; @@ -63,15 +64,22 @@ namespace AMDiS { return false; } - ElementData *clone() const { + ElementData *clone() const + { EmptyElementData *newObj = new EmptyElementData; newObj->decorated_ = ElementData::clone(); return newObj; } - inline std::string getTypeName() const { return "EmptyElementData"; } + inline std::string getTypeName() const + { + return "EmptyElementData"; + } - inline const int getTypeID() const { return EMPTY_ED; } + inline const int getTypeID() const + { + return EMPTY_ED; + } void serialize(std::ostream& out) { diff --git a/AMDiS/src/Error.h b/AMDiS/src/Error.h index 158c91f1b15f0997e5df9c083b9ecfb0d1bca1a8..810cc908f546000a4885529e7a0c4ad7b4a230b6 100644 --- a/AMDiS/src/Error.h +++ b/AMDiS/src/Error.h @@ -36,15 +36,18 @@ namespace AMDiS { class Error { public: - static void setWriteLeafData() { + static void setWriteLeafData() + { writeInLeafData = true; } - static void unsetWriteLeafData() { + static void unsetWriteLeafData() + { writeInLeafData = false; } - static bool writeLeafData() { + static bool writeLeafData() + { return writeInLeafData; } @@ -82,7 +85,8 @@ namespace AMDiS { public: AbstrFctErrU() : AbstractFunction<T, DimVec<double> >(0) {}; - inline T operator()(const DimVec<double> & x) const { + inline T operator()(const DimVec<double> & x) const + { return Error<T>::errUFct(x); } }; @@ -94,7 +98,8 @@ namespace AMDiS { public: AbstrFctGrdErrU() : AbstractFunction<WorldVector<T>, DimVec<double> >(0) {}; - inline WorldVector<T> operator()(const DimVec<double> & x) const { + inline WorldVector<T> operator()(const DimVec<double> & x) const + { return Error<T>::grdErrUFct(x); } }; diff --git a/AMDiS/src/Estimator.h b/AMDiS/src/Estimator.h index b51717810f950b03f04e73924aa0b546485b9dd0..fb2843790424cb1e98eeaeeb4e6500c413fb504c 100755 --- a/AMDiS/src/Estimator.h +++ b/AMDiS/src/Estimator.h @@ -228,12 +228,14 @@ namespace AMDiS { virtual ~EstimatorCreator() {} /// Sets \ref name - void setName(std::string name_) { + void setName(std::string name_) + { name = name_; } /// Sets \ref row - void setRow(int r) { + void setRow(int r) + { row = r; }