diff --git a/AMDiS/src/AMDiS_fwd.h b/AMDiS/src/AMDiS_fwd.h index 1f64ae99a39342f09a061b97650ef5ab92d0ac2f..bc416d3903e6a13c17f44df4fe5f9674c1bbec91 100644 --- a/AMDiS/src/AMDiS_fwd.h +++ b/AMDiS/src/AMDiS_fwd.h @@ -52,6 +52,7 @@ namespace AMDiS { class ITL_BasePreconditioner; class LeafDataPeriodic; class LevelAdmin; + class Line; class MacroElement; class MacroInfo; class Marker; @@ -80,9 +81,13 @@ namespace AMDiS { class RCNeighbourList; class RefinementManager; class RobinBC; + class SubElInfo; + class SurfaceOperator; class SMIAdapter; class SystemVector; + class Tetrahedron; class TraverseStack; + class Triangle; class VertexInfo; class VertexVector; diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc index 7fa9f8e6b87cbf3eb479a9540535af63cb17a8b8..e168dced5b17420f9ce109179e3a4fb597a602a0 100644 --- a/AMDiS/src/DOFMatrix.cc +++ b/AMDiS/src/DOFMatrix.cc @@ -222,6 +222,17 @@ namespace AMDiS { DegreeOfFreedom col = colIndices[j]; double entry = elMat[i][j]; + /* + if (MPI::COMM_WORLD.Get_rank() == 0 && (row >= 156 || col >= 156)) + std::cout << "PROB 0: " << row << " " << col << std::endl; + if (MPI::COMM_WORLD.Get_rank() == 1 && (row >= 151 || col >= 151)) + std::cout << "PROB 1: " << row << " " << col << std::endl; + if (MPI::COMM_WORLD.Get_rank() == 2 && (row >= 146 || col >= 146)) + std::cout << "PROB 2: " << row << " " << col << std::endl; + if (MPI::COMM_WORLD.Get_rank() == 3 && (row >= 153 || col >= 153)) + std::cout << "PROB 3: " << row << " " << col << std::endl; + */ + if (add) ins[row][col] += sign * entry; else diff --git a/AMDiS/src/ParallelDomainProblem.cc b/AMDiS/src/ParallelDomainProblem.cc index c33532070c2d7d1c11827df5eca9a5f26deeb5f3..0489a8916e306b41e3d7cb0b15d4821cc11a0243 100644 --- a/AMDiS/src/ParallelDomainProblem.cc +++ b/AMDiS/src/ParallelDomainProblem.cc @@ -88,11 +88,9 @@ namespace AMDiS { // === Global refinements. === -// refinementManager->globalRefine(mesh, 1); + refinementManager->globalRefine(mesh, 12); -// updateLocalGlobalNumbering(nRankDOFs, nOverallDOFs); - -// exit(0); + updateLocalGlobalNumbering(nRankDOFs, nOverallDOFs); // === Create petsc matrix. === @@ -155,6 +153,8 @@ namespace AMDiS { void ParallelDomainProblemBase::solvePetscMatrix(DOFVector<double> *vec) { + clock_t t = clock(); + KSP ksp; PC pc; @@ -220,7 +220,9 @@ namespace AMDiS { } for (int i = 0; i < static_cast<int>(sendBuffers.size()); i++) - delete [] sendBuffers[i]; + delete [] sendBuffers[i]; + + std::cout << "SOLUTION = " << TIME_USED(t,clock()) << std::endl; } @@ -513,8 +515,8 @@ namespace AMDiS { sendIt = sendNewDofs.begin(); sendIt != sendNewDofs.end(); ++sendIt, i++) { - int nSendDOFs = sendIt->second.size() * 2; - sendBuffers[i] = new int[nSendDOFs]; + int nSendDofs = sendIt->second.size() * 2; + sendBuffers[i] = new int[nSendDofs]; int c = 0; for (std::map<const DegreeOfFreedom*, DegreeOfFreedom>::iterator dofIt = sendIt->second.begin(); @@ -526,7 +528,7 @@ namespace AMDiS { sendDofs[sendIt->first].push_back(dofIt->first); } - mpiComm.Isend(sendBuffers[i], nSendDOFs, MPI_INT, sendIt->first, 0); + mpiComm.Isend(sendBuffers[i], nSendDofs, MPI_INT, sendIt->first, 0); } i = 0; @@ -602,32 +604,6 @@ namespace AMDiS { delete [] recvBuffers[i]; } - -#if 1 - // === Create local information from sendDofs and recvDofs - - for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator - it = sendDofs.begin(); - it != sendDofs.end(); - ++it) - for (std::vector<const DegreeOfFreedom*>::iterator dofIt = it->second.begin(); - dofIt != it->second.end(); - dofIt++) { - // std::cout << "AND SET S " << (*dofIt)[0] << " = " << mapGlobalLocalDOFs[(*dofIt)[0]] << std::endl; - // const_cast<DegreeOfFreedom*>(*dofIt)[0] = mapGlobalLocalDOFs[(*dofIt)[0]]; - } - - for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator - it = recvDofs.begin(); - it != recvDofs.end(); - ++it) - for (std::vector<const DegreeOfFreedom*>::iterator dofIt = it->second.begin(); - dofIt != it->second.end(); - dofIt++) { - // std::cout << "AND SET R " << (*dofIt)[0] << " = " << mapGlobalLocalDOFs[(*dofIt)[0]] << std::endl; - // const_cast<DegreeOfFreedom*>(*dofIt)[0] = mapGlobalLocalDOFs[(*dofIt)[0]]; - } -#endif } @@ -656,8 +632,8 @@ namespace AMDiS { // === Traverse on interior boundaries and move all not ranked owned DOFs from === // === rankDOFs to boundaryDOFs === - std::map<int, std::vector<const DegreeOfFreedom*> > sendNewDOFs; - std::map<int, std::vector<const DegreeOfFreedom*> > recvNewDOFs; + std::map<int, std::vector<const DegreeOfFreedom*> > sendNewDofs = sendDofs; + std::map<int, std::vector<const DegreeOfFreedom*> > recvNewDofs = recvDofs; for (std::map<int, std::vector<AtomicBoundary> >::iterator it = myIntBoundary.boundary.begin(); @@ -699,7 +675,7 @@ namespace AMDiS { boundDOFs); for (int i = 0; i < static_cast<int>(boundDOFs.size()); i++) { newBoundaryDOFs[boundDOFs[i]] = mpiRank; - sendNewDOFs[it->first].push_back(boundDOFs[i]); + sendNewDofs[it->first].push_back(boundDOFs[i]); } } } @@ -748,7 +724,7 @@ namespace AMDiS { for (int i = 0; i < static_cast<int>(boundDOFs.size()); i++) { rankDOFs.erase(boundDOFs[i]); newBoundaryDOFs[boundDOFs[i]] = it->first; - recvNewDOFs[it->first].push_back(boundDOFs[i]); + recvNewDofs[it->first].push_back(boundDOFs[i]); } } @@ -787,13 +763,72 @@ namespace AMDiS { // === Send new DOF indices. === - for (int rank = 0; rank < mpiSize; rank++) { - if (rank == mpiRank) - continue; + std::vector<int*> sendBuffers(sendNewDofs.size()); + std::vector<int*> recvBuffers(recvNewDofs.size()); + + i = 0; + for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator + sendIt = sendNewDofs.begin(); + sendIt != sendNewDofs.end(); + ++sendIt, i++) { + int nSendDofs = sendIt->second.size(); + sendBuffers[i] = new int[nSendDofs]; + int c = 0; + for (std::vector<const DegreeOfFreedom*>::iterator dofIt = sendIt->second.begin(); + dofIt != sendIt->second.end(); + ++dofIt) + sendBuffers[i][c++] = (*dofIt)[0] + rstart; + mpiComm.Isend(sendBuffers[i], nSendDofs, MPI_INT, sendIt->first, 0); + } + + i = 0; + for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator + recvIt = recvNewDofs.begin(); + recvIt != recvNewDofs.end(); ++recvIt, i++) { + int nRecvDofs = recvIt->second.size(); + recvBuffers[i] = new int[nRecvDofs]; + + mpiComm.Irecv(recvBuffers[i], nRecvDofs, MPI_INT, recvIt->first, 0); + } + + mpiComm.Barrier(); + + i = 0; + for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator + sendIt = sendNewDofs.begin(); + sendIt != sendNewDofs.end(); + ++sendIt) + delete [] sendBuffers[i++]; + + i = 0; + int newDofIndex = nRankDOFs; + for (std::map<int, std::vector<const DegreeOfFreedom*> >::iterator + recvIt = recvNewDofs.begin(); + recvIt != recvNewDofs.end(); ++recvIt) { + int j = 0; + for (std::vector<const DegreeOfFreedom*>::iterator dofIt = recvIt->second.begin(); + dofIt != recvIt->second.end(); + ++dofIt) { + const_cast<DegreeOfFreedom*>(*dofIt)[0] = newDofIndex; +// if (mpiRank == 1) +// std::cout << "SET TO " << newDofIndex << std::endl; + + mapLocalGlobalDOFs[newDofIndex] = recvBuffers[i][j]; + mapGlobalLocalDOFs[recvBuffers[i][j]] = newDofIndex; + isRankDOF[newDofIndex] = false; + newDofIndex++; + j++; + } + + delete [] recvBuffers[i++]; } + // === Update list of dofs that must be communicated for solution exchange. === + + sendDofs = sendNewDofs; + recvDofs = recvNewDofs; } diff --git a/AMDiS/src/Recovery.h b/AMDiS/src/Recovery.h index f65c322d13bfe024af78f378fb99565202b7fa17..4927955bc1591d89c19d627c468ab80e5d90b1b5 100644 --- a/AMDiS/src/Recovery.h +++ b/AMDiS/src/Recovery.h @@ -31,10 +31,6 @@ using namespace std; using namespace AMDiS; -// ============================================================================ -// ===== class Monomial ======================================================= -// ============================================================================ - class Monomial : public BinaryAbstractFunction<double, WorldVector<double>, WorldVector<double> > { @@ -46,9 +42,9 @@ public: exponent(expon) { degree_ = exponent[0]; - for (int i=1; i<exponent.size(); i++) + for (int i = 1; i<exponent.size(); i++) degree_ += exponent[i]; - }; + } virtual ~Monomial() {}; @@ -60,39 +56,40 @@ public: result *= pow(y[i] - z[i], exponent[i]); return result; - }; + } private: WorldVector<int> exponent; }; -// ============================================================================ -// ===== class RecoveryStructure ============================================== -// ============================================================================ - class RecoveryStructure { public: // construtor, destructor // constructor RecoveryStructure() : coords(NULL), - A(NULL), rec_uh(NULL), rec_grdUh(NULL), + A(NULL), + rec_uh(NULL), + rec_grdUh(NULL), neighbors(NULL) - {}; + {} // Destructor? ~RecoveryStructure() { clear(); - }; - - RecoveryStructure(const RecoveryStructure& rhs) : - coords(NULL), - A(NULL), rec_uh(NULL), rec_grdUh(NULL), - neighbors(NULL) { + } + + RecoveryStructure(const RecoveryStructure& rhs) + : coords(NULL), + A(NULL), + rec_uh(NULL), + rec_grdUh(NULL), + neighbors(NULL) + { *this=rhs; - }; + } RecoveryStructure& operator=(const RecoveryStructure& rhs); diff --git a/AMDiS/src/RecoveryEstimator.h b/AMDiS/src/RecoveryEstimator.h index 3b6799bafeffb611c08dc9f7c2842c8da07258be..ead7f5e43a50871ebf1861d04dda82b69572d3ea 100644 --- a/AMDiS/src/RecoveryEstimator.h +++ b/AMDiS/src/RecoveryEstimator.h @@ -27,161 +27,120 @@ namespace AMDiS { - // ============================================================================ - // ===== class RecoveryEstimator ============================================ - // ============================================================================ - - /** \brief - * Error estimator using the recovery gradient of the finite element solution. - */ + /// Error estimator using the recovery gradient of the finite element solution. class RecoveryEstimator : public Estimator { public: - /** \brief - * Creator class. - */ + /// Creator class. class Creator : public EstimatorCreator { public: - Creator() : EstimatorCreator(), uh(NULL) {}; + Creator() + : EstimatorCreator(), + uh(NULL) + {} - virtual ~Creator() {}; + virtual ~Creator() {} inline void setSolution(DOFVector<double> *uh_) { uh = uh_; - }; + } - /** \brief - * Returns a new Estimator object. - */ + /// Returns a new Estimator object. Estimator* create() { return new RecoveryEstimator(name, uh, row); - }; + } protected: DOFVector<double> *uh; }; - /** \brief - * constructor - */ + /// constructor RecoveryEstimator(std::string name, DOFVector<double> *uh, int r = -1); - /** \brief - * destructor. - */ - virtual ~RecoveryEstimator() {}; + /// destructor. + virtual ~RecoveryEstimator() {} - /** \brief - * implements \ref Estimator::estimate(). - */ + /// implements \ref Estimator::estimate(). virtual double estimate(double timestep = 0.0); - /*----- Setting functions -----*/ - - // Sets uh. + /// Sets uh. inline void setUh(DOFVector<double> *uh) { uh_ = uh; - }; + } - // Sets f. + /// Sets f. inline void setFct(AbstractFunction<double, WorldVector<double> > *fct) { f_vec = fct; - }; + } + /// inline void setFct(AbstractFunction<double, double> *fct) { f_scal = fct; - }; + } - // Sets auxiliar vector. + /// Sets auxiliar vector. inline void setAuxVec(DOFVector<double> *uh) { aux_vec = uh; - }; - + } - /*----- Getting functions -----*/ - // Gets recovery gradient. + /// Gets recovery gradient. inline DOFVector<WorldVector<double> >* getRecGrd() { return rec_grd; - }; + } - // Gets higher-order recovery solution. + /// Gets higher-order recovery solution. inline DOFVector<double>* getRecUh() { return rec_uh; - }; - + } - protected: // protected members - /** \brief - * finite element solution - */ + protected: + /// finite element solution DOFVector<double> *uh_; - /** \brief - * absolute or relative error? - */ + /// absolute or relative error? int relative_; - /** \brief - * constant for scaling the estimator - */ + /// constant for scaling the estimator double C; - /** \brief - * recovery method - */ + /// recovery method int method; - /** \brief - * Working finite element space - */ + /// Working finite element space const FiniteElemSpace *feSpace; - /** \brief - * Degree of corresponding basic functions - */ + /// Degree of corresponding basic functions int degree; - /** \brief - * Basis functions for recovery vector. - */ + /// Basis functions for recovery vector. const BasisFunction *rec_basFcts; - /** \brief - * Recovery gradient - */ + /// Recovery gradient DOFVector<WorldVector<double> > *rec_grd; - /** \brief - * Higher-order recovery solution - */ + /// Higher-order recovery solution DOFVector<double> *rec_uh; - /** \brief - * Diffusion coefficient (for flux recovery) - */ + /// Diffusion coefficient (for flux recovery) AbstractFunction<double, WorldVector<double> > *f_vec; AbstractFunction<double, double> *f_scal; - /** \brief - * auxiliar vector - */ + /// auxiliar vector DOFVector<double> *aux_vec; - /** \brief - * Recovery structure. - */ + /// Recovery structure. Recovery *rec_struct; }; diff --git a/AMDiS/src/RefinementManager.h b/AMDiS/src/RefinementManager.h index 69fab8829ea750c708cf451657397bbe8dde6d10..82013c82f66056adc2001fac7bfb6eb87eb21cc8 100644 --- a/AMDiS/src/RefinementManager.h +++ b/AMDiS/src/RefinementManager.h @@ -24,19 +24,10 @@ #include "Global.h" #include "Flag.h" +#include "AMDiS_fwd.h" namespace AMDiS { - class Element; - class Line; - class Triangle; - class Tetrahedron; - class Mesh; - class ElInfo; - class TraverseStack; - class RCNeighbourList; - - /** \ingroup Adaption * \brief * Base class of RefinementManager1d, RefinementManager2d, RefinementManager3d. @@ -60,7 +51,8 @@ namespace AMDiS { * Generates new coordinates on curved boundaries. Can be overriden by * sub classes if used. */ - virtual void setNewCoords() { + virtual void setNewCoords() + { FUNCNAME("RefinementManager::setNewCoords"); ERROR_EXIT("called for base class!\n"); } @@ -78,11 +70,13 @@ namespace AMDiS { Flag globalRefine(Mesh *aMesh, int mark); /// Set \ref newCoords - inline void newCoord(bool nc) { + inline void newCoord(bool nc) + { newCoords = nc; } - inline bool newCoord() { + inline bool newCoord() + { return newCoords; } @@ -90,21 +84,25 @@ namespace AMDiS { * Implements the refinement of el_info->el. Can be overriden by sub * classes if used. */ - virtual ElInfo* refineFunction(ElInfo* ) { + virtual ElInfo* refineFunction(ElInfo*) + { FUNCNAME("RefinementManager::refineFunction()"); ERROR_EXIT("called for base class!\n"); return NULL; } - inline void setMesh(Mesh *m) { + inline void setMesh(Mesh *m) + { mesh = m; } - inline void setStack(TraverseStack *s) { + inline void setStack(TraverseStack *s) + { stack = s; } - inline TraverseStack *getStack() { + inline TraverseStack *getStack() + { return stack; } diff --git a/AMDiS/src/RefinementManager1d.h b/AMDiS/src/RefinementManager1d.h index ae95b126c6371418555aa227a944650f2d82589b..f556eb3a897513b487cb4faf160b432bbff3c326 100644 --- a/AMDiS/src/RefinementManager1d.h +++ b/AMDiS/src/RefinementManager1d.h @@ -31,37 +31,25 @@ namespace AMDiS { class RefinementManager1d : public RefinementManager { public: - /** \brief - * Calls base class constructor. - */ + /// Calls base class constructor. RefinementManager1d() : RefinementManager() - {}; + {} - /** \brief - * destructor - */ - virtual ~RefinementManager1d() {}; + /// destructor + virtual ~RefinementManager1d() {} - /** \brief - * Implements RefinementManager::refineMesh. - */ + /// Implements RefinementManager::refineMesh. Flag refineMesh(Mesh *aMesh); - /** \brief - * Implements RefinementManager::setNewCoords - */ + /// Implements RefinementManager::setNewCoords void setNewCoords(); protected: - /** \brief - * Used by refineMesh while mesh traversal - */ + /// Used by refineMesh while mesh traversal static int recursiveRefineFunction(ElInfo* el_info); - /** \brief - * Used by \ref setNewCoords - */ + /// Used by \ref setNewCoords static int newCoordsFct(ElInfo *el_info); }; diff --git a/AMDiS/src/RefinementManager3d.h b/AMDiS/src/RefinementManager3d.h index 0494d1b74b11f806e98a5e0c609b11ec8e4f7175..b2561609ac2203ad7f49087f8ad61ed385b784f8 100644 --- a/AMDiS/src/RefinementManager3d.h +++ b/AMDiS/src/RefinementManager3d.h @@ -31,27 +31,19 @@ namespace AMDiS { class RefinementManager3d : public RefinementManager { public: - /** \brief - * Calls base class constructor. - */ + /// Calls base class constructor. RefinementManager3d() : RefinementManager() {} - /** \brief - * destructor - */ + /// destructor virtual ~RefinementManager3d() {} protected: - /** \brief - * Used by \ref setNewCoords - */ + /// Used by \ref setNewCoords int newCoordsFct(ElInfo *el_info); - /** \brief - * Implements RefinementManager::setNewCoords - */ + /// Implements RefinementManager::setNewCoords void setNewCoords(); /** \brief @@ -65,32 +57,22 @@ namespace AMDiS { int getRefinePatch(ElInfo **el_info, DegreeOfFreedom *edge[2], int dir, RCNeighbourList* refineList, int *n_neigh); - /** \brief - * Refines all elements in the patch. - */ + /// Refines all elements in the patch. DegreeOfFreedom refinePatch(DegreeOfFreedom *edge[2], RCNeighbourList* refineList, int n_neigh, bool bound); - /** \brief - * Implements RefinementManager::refineFunction. - */ + /// Implements RefinementManager::refineFunction. ElInfo* refineFunction(ElInfo* el_info); - /** \brief - * Refines one Tetrahedron. - */ + /// Refines one Tetrahedron. void bisectTetrahedron(RCNeighbourList* refineList, int index, DegreeOfFreedom *dof[3], DegreeOfFreedom *edge[2]); - /** \brief - * Used by \ref bisectTetrahedron - */ + /// Used by \ref bisectTetrahedron void fillPatchConnectivity(RCNeighbourList* ref_list, int index); private: - /** \brief - * Refinement patch - */ + /// Refinement patch static RCNeighbourList* refList; }; diff --git a/AMDiS/src/ResidualEstimator.h b/AMDiS/src/ResidualEstimator.h index 1b4842106bdabd951f3c657818ad3522c3219aeb..97ddbc1cb8ef888f34126a8ff09370e7d80d9656 100644 --- a/AMDiS/src/ResidualEstimator.h +++ b/AMDiS/src/ResidualEstimator.h @@ -48,18 +48,12 @@ namespace AMDiS { Quadrature *quad, double *result); - /** \brief - * Returns pow(det,2.0/dim). Not Member of - * Estimator to avoid multiple instantiation. - */ - inline double h2_from_det(double det, int dim) { + /// Returns pow(det,2.0/dim). Not Member of Estimator to avoid multiple instantiation. + inline double h2_from_det(double det, int dim) + { return pow(det, 2.0 / dim); } - // ============================================================================ - // ===== class ResidualEstimator ============================================== - // ============================================================================ - /** * \ingroup Estimator * @@ -69,9 +63,7 @@ namespace AMDiS { class ResidualEstimator : public Estimator { public: - /** \brief - * Creator class used in the OEMSolverMap. - */ + /// Creator class used in the OEMSolverMap. class Creator : public EstimatorCreator { public: @@ -79,18 +71,14 @@ namespace AMDiS { virtual ~Creator() {} - /** \brief - * Returns a new ODirSolver object. - */ - Estimator* create() { + /// Returns a new ODirSolver object. + Estimator* create() + { return new ResidualEstimator(name, row); } }; - - /** \brief - * Constructor. - */ + /// Constructor. ResidualEstimator(std::string name, int r); virtual void init(double timestep); @@ -100,24 +88,16 @@ namespace AMDiS { virtual void exit(bool output = true); protected: - /** \brief - * Constant in front of element residual - */ + /// Constant in front of element residual double C0; - /** \brief - * Constant in front of edge/face residual - */ + /// Constant in front of edge/face residual double C1; - /** \brief - * Constant in front of coarsening term - */ + /// Constant in front of coarsening term double C2; - /** \brief - * Constant in front of the time - */ + /// Constant in front of the time double C3; /// Number of systems, e.g., number of variables in the equation. diff --git a/AMDiS/src/ResidualParallelEstimator.h b/AMDiS/src/ResidualParallelEstimator.h index d05cd0fc7523f4361d069f35f6108795faad6f76..3dac6ff0b88377d9985e82b738dad3c49ea17621 100644 --- a/AMDiS/src/ResidualParallelEstimator.h +++ b/AMDiS/src/ResidualParallelEstimator.h @@ -42,9 +42,7 @@ namespace AMDiS { class ResidualParallelEstimator : public Estimator { public: - /** \brief - * Creator class used in the OEMSolverMap. - */ + /// Creator class used in the OEMSolverMap. class Creator : public EstimatorCreator { public: @@ -52,49 +50,35 @@ namespace AMDiS { virtual ~Creator() {} - /** \brief - * Returns a new ODirSolver object. - */ - Estimator* create() { + /// Returns a new ODirSolver object. + Estimator* create() + { return new ResidualParallelEstimator(name, row); } }; - /** \brief - * Constructor. - */ + /// Constructor. ResidualParallelEstimator(std::string name, int r); - /** \brief - * Destructor. - */ + /// Destructor. ~ResidualParallelEstimator(); - /** \brief - * - */ + /// virtual void addSystem(DOFMatrix *matrix_, DOFVector<double> *uh_, DOFVector<double> *fh_, DOFVector<double> *uhOld_ = NULL); - /** \brief - * - */ + /// virtual void addUhOldToSystem(int system, DOFVector<double> *uhOld_); - /** \brief - * - */ + /// virtual double estimate(double timestep); private: std::vector<ResidualEstimator*> seqEstimators_; - - /** \brief - * Constant in fromt of the time - */ + /// Constant in fromt of the time double C3; }; diff --git a/AMDiS/src/RobinBC.h b/AMDiS/src/RobinBC.h index 5f910a39c514bb64d14febd72e208591d5af061a..3b7996bfd798719c4fbfbcd52ab9f847131c921c 100644 --- a/AMDiS/src/RobinBC.h +++ b/AMDiS/src/RobinBC.h @@ -25,15 +25,10 @@ #include "BoundaryCondition.h" #include "AbstractFunction.h" #include "DOFMatrix.h" +#include "AMDiS.h" namespace AMDiS { - class SurfaceOperator; - - // ============================================================================ - // ===== class RobinBC ======================================================== - // ============================================================================ - /** * \ingroup Assembler * @@ -46,67 +41,50 @@ namespace AMDiS { class RobinBC : public BoundaryCondition { public: - /** \brief - * Constructor. \f$ j \f$ and \f$ alpha \f$ are given as AbstractFunction - * objects. - */ + /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as AbstractFunction objects. RobinBC(BoundaryType type, AbstractFunction<double, WorldVector<double> > *j, AbstractFunction<double, WorldVector<double> > *alpha, FiniteElemSpace *rowFESpace, FiniteElemSpace *colFESpace = NULL); - /** \brief - * Constructor. \f$ j \f$ and \f$ alpha \f$ are given as DOFVectors. - */ + /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as DOFVectors. RobinBC(BoundaryType type, DOFVectorBase<double> *j, DOFVectorBase<double> *alpha, FiniteElemSpace *rowFESpace, FiniteElemSpace *colFESpace = NULL); - /** \brief - * Constructor. \f$ j \f$ and \f$ alpha \f$ are given as Operator objects. - */ + /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as Operator objects. RobinBC(BoundaryType type, Operator* jOp, Operator* alphaOp, FiniteElemSpace *rowFESpace, FiniteElemSpace *colFESpace = NULL); - /** \brief - * Implements BoundaryCondition::fillBoundaryCondition(); - */ - virtual void fillBoundaryCondition(DOFMatrix* matrix, - ElInfo* elInfo, + /// Implements BoundaryCondition::fillBoundaryCondition(); + virtual void fillBoundaryCondition(DOFMatrix* matrix, + ElInfo* elInfo, const DegreeOfFreedom* dofIndices, - const BoundaryType* localBound, - int nBasFcts); + const BoundaryType* localBound, + int nBasFcts); - /** \brief - * Implements BoundaryCondition::fillBoundaryCondition(); - */ - virtual void fillBoundaryCondition(DOFVectorBase<double>* vector, - ElInfo* elInfo, + /// Implements BoundaryCondition::fillBoundaryCondition(); + virtual void fillBoundaryCondition(DOFVectorBase<double>* vector, + ElInfo* elInfo, const DegreeOfFreedom* dofIndices, - const BoundaryType* localBound, - int nBasFcts); + const BoundaryType* localBound, + int nBasFcts); - /** \brief - * Implements BoundaryCondition::boundResidual(); - */ + /// Implements BoundaryCondition::boundResidual(); virtual double boundResidual(ElInfo *elInfo, DOFMatrix *matrix, const DOFVectorBase<double> *dv); protected: - /** \brief - * Surface operators for each element side for the Neumann part. - */ + /// Surface operators for each element side for the Neumann part. DimVec<SurfaceOperator*>* neumannOperators; - /** \brief - * Surface operators for each element side for the Robin part. - */ + /// Surface operators for each element side for the Robin part. DimVec<SurfaceOperator*>* robinOperators; VectorOfFixVecs<DimVec<double> >**coords; @@ -120,7 +98,7 @@ namespace AMDiS { FiniteElemSpace *rowFESpace, FiniteElemSpace *colFESpace = NULL) : RobinBC(type, j, NULL, rowFESpace, colFESpace) - {}; + {} }; } diff --git a/AMDiS/src/SMIAdapter.h b/AMDiS/src/SMIAdapter.h index 64507ea1a83fbf92d1df1abf42722e6c2cdf20f5..2659712a4319e684994e17d3d16a31558ddf3165 100644 --- a/AMDiS/src/SMIAdapter.h +++ b/AMDiS/src/SMIAdapter.h @@ -34,15 +34,11 @@ namespace AMDiS { #define SMI_NEIGH_QUANTITY 10001 #define SMI_OPP_V_QUANTITY 20002 - /** \brief - * SMI adapter for an AMDiS mesh. - */ + /// SMI adapter for an AMDiS mesh. class SMIAdapter { public: - /** \brief - * constructor - */ + /// constructor SMIAdapter(int smiApplicationId, int smiMeshId, FiniteElemSpace *feSpace, @@ -51,22 +47,14 @@ namespace AMDiS { bool (*elementFct)(ElInfo *elInfo) = NULL, bool (*surfaceFct)(ElInfo *elInfo, int side) = NULL); - /** \brief - * destructor - */ - virtual ~SMIAdapter() {}; + /// destructor + virtual ~SMIAdapter() {} - /** \brief - * Add DOFVector<double> as smi quantity. - */ + /// Add DOFVector<double> as smi quantity. void addQuantity(int quantityId, DOFVector<double> *dofVector); - /** \brief - * Add DOFVector<double> as smi quantity. - */ - void addQuantity(int quantityId, - int quantityDim, - DOFVector<double> **dofVector); + /// Add DOFVector<double> as smi quantity. + void addQuantity(int quantityId, int quantityDim, DOFVector<double> **dofVector); /** \brief * If called before the first call of \ref transferMeshToSMI() @@ -79,23 +67,15 @@ namespace AMDiS { * \param neighbours array of the neighbour element indices * \param oppVertices array of the corresponding opp vertices */ - void getNeighbourInfo(int elementIndex, - int *neighbours, - int *oppVertices); + void getNeighbourInfo(int elementIndex, int *neighbours, int *oppVertices); - /** \brief - * Transfer mesh data from AMDiS to SMI. - */ + /// Transfer mesh data from AMDiS to SMI. void transferMeshToSMI(); - /** \brief - * Transfer quantity values from AMDiS to SMI. - */ + /// Transfer quantity values from AMDiS to SMI. void transferQuantitiesToSMI(int quantityID = -1); - /** \brief - * Transfer quantity values from SMI to AMDiS. - */ + /// Transfer quantity values from SMI to AMDiS. void getQuantitiesFromSMI(int quantityID = -1); void setIndexMappings(std::map<DegreeOfFreedom, DegreeOfFreedom> *newNodeIndex, @@ -107,55 +87,43 @@ namespace AMDiS { oldNodeIndex_ = oldNodeIndex; newElementIndex_ = newElementIndex; oldElementIndex_ = oldElementIndex; - }; + } protected: - /** \brief - * SMI application id - */ + ///SMI application id int smiApplicationId_; - /** \brief - * SMI mesh id - */ + /// SMI mesh id int smiMeshId_; - /** \brief - * FESpace containing the mesh - */ + /// FESpace containing the mesh FiniteElemSpace *feSpace_; - /** \brief - * smi element type of all elements in the mesh - */ + /// smi element type of all elements in the mesh int elementType_; - /** \brief - * mapping from quantity ids to DOFVector pointers - */ + /// mapping from quantity ids to DOFVector pointers std::map<int, std::vector<DOFVector<double>*> > dofVectors_; - /** \brief - * element region the adapter is defined on - */ + /// element region the adapter is defined on int elementRegion_; - /** \brief - * surface region the adapter is defined on - */ + /// surface region the adapter is defined on int surfaceRegion_; - /** \brief - * store neighbourhood information? - */ + /// store neighbourhood information? bool addNeighbourInfo_; std::map<DegreeOfFreedom, DegreeOfFreedom> *newNodeIndex_; + std::map<DegreeOfFreedom, DegreeOfFreedom> *oldNodeIndex_; + std::map<int, int> *newElementIndex_; + std::map<int, int> *oldElementIndex_; bool (*elementFct_)(ElInfo*); + bool (*surfaceFct_)(ElInfo*, int); }; diff --git a/AMDiS/src/ScalableQuadrature.h b/AMDiS/src/ScalableQuadrature.h index 00b084f370523feafc1f46c4b9f669aa42c37a38..e99457bc04e2b1cb1684585e6b52b7245cc418af 100644 --- a/AMDiS/src/ScalableQuadrature.h +++ b/AMDiS/src/ScalableQuadrature.h @@ -5,11 +5,10 @@ #include "Quadrature.h" #include "FixVec.h" +#include "AMDiS_fwd.h" namespace AMDiS { - class SubElInfo; - // =============================================================================== // Class Description: // The class \ref ScalableQuadrature holds the functionality for the manipulation @@ -43,7 +42,8 @@ namespace AMDiS { ScalableQuadrature(Quadrature *quadrature); /// Destructor - ~ScalableQuadrature() { + ~ScalableQuadrature() + { delete oldLambda; } @@ -57,7 +57,8 @@ 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 const double getOldLambda(int a, int b) const + { if (oldLambda) return (*oldLambda)[a][b]; else @@ -65,7 +66,8 @@ namespace AMDiS { } /// Get the a-th original quadrature point. - inline DimVec<double>* getOldLambda(int a) const { + inline DimVec<double>* getOldLambda(int a) const + { if (oldLambda) { return &((*oldLambda)[a]); } else { @@ -78,7 +80,8 @@ namespace AMDiS { * Returns, if the scaled quadrature point is within the target element (true), * or outside of the element (false). */ - inline bool isValid(int iq) const { + inline bool isValid(int iq) const + { return valid[iq]; } diff --git a/AMDiS/src/SecondOrderAssembler.h b/AMDiS/src/SecondOrderAssembler.h index 158084613e4a263d967a028850a43298831009a2..34fcfe08403ace53ed7468d1e615045da88249a7 100644 --- a/AMDiS/src/SecondOrderAssembler.h +++ b/AMDiS/src/SecondOrderAssembler.h @@ -63,7 +63,8 @@ namespace AMDiS { void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat); /// Implements SubAssembler::calculateElementVector(). - void calculateElementVector(const ElInfo *, ElementVector&) { + void calculateElementVector(const ElInfo *, ElementVector&) + { ERROR_EXIT("should not be called\n"); } }; @@ -86,7 +87,8 @@ namespace AMDiS { void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat); /// Implements SubAssembler::calculateElementVector(). - void calculateElementVector(const ElInfo *, ElementVector&) { + void calculateElementVector(const ElInfo *, ElementVector&) + { ERROR_EXIT("should not be called\n"); } @@ -117,7 +119,8 @@ namespace AMDiS { void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat); /// Implements SubAssembler::calculateElementVector(). - void calculateElementVector(const ElInfo *, ElementVector&) { + void calculateElementVector(const ElInfo *, ElementVector&) + { ERROR_EXIT("should not be called\n"); } diff --git a/AMDiS/src/Serializable.h b/AMDiS/src/Serializable.h index 1968c45aac7fc2ead529ed90951ec2fdf4afaa4f..9bba368dffbd5ca1589772cba53b2cf1014d01ef 100644 --- a/AMDiS/src/Serializable.h +++ b/AMDiS/src/Serializable.h @@ -27,10 +27,6 @@ namespace AMDiS { - // =============================================================================== - // ===== class Serializable ====================================================== - // =============================================================================== - /** \brief * Interface for JAVA-like serialization of objects. Serializable objects can be * written to an out stream and read from an in stream. So i.e. they can be stored @@ -39,20 +35,15 @@ namespace AMDiS { class Serializable { public: - /** \brief - * Streams the object to output stream out. - */ + /// Streams the object to output stream out. virtual void serialize(std::ostream &out) = 0; - /** \brief - * Reads the object from input stream in. - */ + /// Reads the object from input stream in. virtual void deserialize(std::istream &in) = 0; - /** \brief - * Returns the type name for this serializable object. - */ - virtual std::string getTypeName() const { + /// Returns the type name for this serializable object. + virtual std::string getTypeName() const + { return ""; } diff --git a/AMDiS/src/Serializer.h b/AMDiS/src/Serializer.h index ae935f93386ed646bf96e996d82b0717ff257ae8..e1818a3a7c0277a172b440f721e44a242c69b917 100644 --- a/AMDiS/src/Serializer.h +++ b/AMDiS/src/Serializer.h @@ -74,7 +74,8 @@ namespace AMDiS { void writeDelayedFiles() {} - bool isWritingDelayed() { + bool isWritingDelayed() + { return false; } @@ -95,27 +96,33 @@ namespace AMDiS { class SerializerUtil { public: - static void serializeInt(std::ostream &out, int* ptrInt) { + static void serializeInt(std::ostream &out, int* ptrInt) + { out.write(reinterpret_cast<const char*>(ptrInt), sizeof(int)); } - static void serializeDouble(std::ostream &out, double* ptrInt) { + static void serializeDouble(std::ostream &out, double* ptrInt) + { out.write(reinterpret_cast<const char*>(ptrInt), sizeof(double)); } - static void serializeBool(std::ostream &out, bool* ptrBool) { + static void serializeBool(std::ostream &out, bool* ptrBool) + { out.write(reinterpret_cast<const char*>(ptrBool), sizeof(bool)); } - static void deserializeInt(std::istream &in, int* ptrInt) { + static void deserializeInt(std::istream &in, int* ptrInt) + { in.read(reinterpret_cast<char*>(ptrInt), sizeof(int)); } - static void deserializeDouble(std::istream &in, double* ptrInt) { + static void deserializeDouble(std::istream &in, double* ptrInt) + { in.read(reinterpret_cast<char*>(ptrInt), sizeof(double)); } - static void deserializeBool(std::istream &in, bool* ptrBool) { + static void deserializeBool(std::istream &in, bool* ptrBool) + { in.read(reinterpret_cast<char*>(ptrBool), sizeof(bool)); } diff --git a/AMDiS/src/SolutionDataStorage.h b/AMDiS/src/SolutionDataStorage.h index 5cf2fa867ce38c5d63f52eb3163fad748a602d5b..c5a7ffb0bc26ab9a9a4da03ca38824d896b35609 100644 --- a/AMDiS/src/SolutionDataStorage.h +++ b/AMDiS/src/SolutionDataStorage.h @@ -24,7 +24,6 @@ namespace AMDiS { }; - /** \brief * Class to store solution data for one timestep. * @@ -107,16 +106,16 @@ namespace AMDiS { */ void getData(T** ptrSolution, double *ptrTimestamp) { - if (serialized) { + if (serialized) deserialize(); - } *ptrSolution = solution; *ptrTimestamp = timestamp; } /// Returns \ref serialized. - bool isSerialized() { + bool isSerialized() + { return serialized; } @@ -164,9 +163,8 @@ namespace AMDiS { out.write(reinterpret_cast<const char*>(&found), sizeof(int)); // Only in case this fe space was not serialized before, write it to the file. - if (found == -1) { + if (found == -1) serializeFeSpace(out, fe[i]); - } } } @@ -239,10 +237,7 @@ namespace AMDiS { } public: - /** \brief - * Here, all the solutions (i.e. either DOFVectors or SystemVectors) - * are stored. - */ + /// Here, all the solutions (i.e. either DOFVectors or SystemVectors) are stored. T* solution; /** \brief @@ -267,6 +262,7 @@ namespace AMDiS { /// If solution data is serialied, here the corresponding filename is stored. std::string filename; + /// int id; }; @@ -294,9 +290,7 @@ namespace AMDiS { */ SolutionDataStorage(std::string name); - /** \brief - * Destructor. Deletes all stored solutions and deletes all serialized files. - */ + /// Destructor. Deletes all stored solutions and deletes all serialized files. ~SolutionDataStorage(); /// Add a solution and its timestamp to the storage. @@ -313,12 +307,14 @@ namespace AMDiS { * the fe Space is fixed, the fe Space for all solutions is stored at * position 0. */ - typename SolutionHelper<T>::type getFeSpace(int i = 0) { + typename SolutionHelper<T>::type getFeSpace(int i = 0) + { return solutions[i]->feSpace; } /// Returns \ref poped. - bool isPoped() { + bool isPoped() + { return poped; } @@ -338,16 +334,13 @@ namespace AMDiS { void clear(std::string name); protected: - /** \brief - * - */ - int addMemoryUsage(FiniteElemSpace* feSpace) { + /// + int addMemoryUsage(FiniteElemSpace* feSpace) + { memoryUsage += feSpace->getMesh()->calcMemoryUsage(); } - /** \brief - * - */ + /// int addMemoryUsage(std::vector<FiniteElemSpace*> feSpaces) { // Is used to determine equal meshes for different components. std::vector<Mesh*> meshes; @@ -360,34 +353,22 @@ namespace AMDiS { } } - /** \brief - * Number of MBytes of memory that can be used for solution storage. - */ + /// Number of MBytes of memory that can be used for solution storage. int maxMemoryUsage; - /** \brief - * If true, it is allowed to write solutions also to disk. - */ + /// If true, it is allowed to write solutions also to disk. bool useDisk; - /** \brief - * Directory, where solutions can be written temporarly. - */ + /// Directory, where solutions can be written temporarly. std::string writeDirectory; - /** \brief - * Position of the latest valid solution. - */ + /// Position of the latest valid solution. int lastPos; - /** \brief - * If true, the last operation on the data storage was pop. - */ + /// If true, the last operation on the data storage was pop. bool poped; - /** \brief - * Counts the memory usage of all solutions stored in memory. - */ + /// Counts the memory usage of all solutions stored in memory. int memoryUsage; /** \brief @@ -396,16 +377,13 @@ namespace AMDiS { */ std::vector<SolutionData<T>* > solutions; - /** \brief - * - */ + /// std::map<std::string, std::vector<WorldVector<double > > > containers; - /** \brief - * - */ + /// std::map<std::string, int> containersPos; + /// int idcounter; }; diff --git a/AMDiS/src/SolverMatrix.h b/AMDiS/src/SolverMatrix.h index 0460c07cb185e043226ad52f31f9a31336710179..a4c4761bcc17b666d9cdbda5ee9293ba8e15d84f 100644 --- a/AMDiS/src/SolverMatrix.h +++ b/AMDiS/src/SolverMatrix.h @@ -47,7 +47,10 @@ namespace AMDiS { matrix= &A.getBaseMatrix(); } - const DOFMatrix::base_matrix_type& getMatrix() const { return *matrix; } + const DOFMatrix::base_matrix_type& getMatrix() const + { + return *matrix; + } private: const DOFMatrix::base_matrix_type* matrix; @@ -76,7 +79,10 @@ namespace AMDiS { ins[block_starts[rb]][block_starts[cb]] << A[rb][cb]->getBaseMatrix(); } - const DOFMatrix::base_matrix_type& getMatrix() const { return matrix; } + const DOFMatrix::base_matrix_type& getMatrix() const + { + return matrix; + } private: DOFMatrix::base_matrix_type matrix; diff --git a/AMDiS/src/StandardProblemIteration.h b/AMDiS/src/StandardProblemIteration.h index 4a5b595781034a7faef597cf59c46198e4bd6838..0b95a75d08d289ace80c0290d3460b76dbe6e4e2 100644 --- a/AMDiS/src/StandardProblemIteration.h +++ b/AMDiS/src/StandardProblemIteration.h @@ -48,12 +48,14 @@ namespace AMDiS { virtual void endIteration(AdaptInfo *adaptInfo); /// Implementation of \ref ProblemIterationInterface::getNumProblems() - int getNumProblems() { + int getNumProblems() + { return 1; } /// Implementation of \ref ProblemIterationInterface::getProblem(int) - ProblemStatBase *getProblem(int number = 0) { + ProblemStatBase *getProblem(int number = 0) + { return problem; } diff --git a/AMDiS/src/SubAssembler.h b/AMDiS/src/SubAssembler.h index 1cadb91b1d1cff8949c5c81d4624578bbf43f87f..97a3e0f3c19eb6103025baaf70afce507f5eb883 100644 --- a/AMDiS/src/SubAssembler.h +++ b/AMDiS/src/SubAssembler.h @@ -57,17 +57,20 @@ namespace AMDiS { ElementVector& vec) = 0; /// Returns \ref terms - inline std::vector<OperatorTerm*> *getTerms() { + inline std::vector<OperatorTerm*> *getTerms() + { return &terms[omp_get_thread_num()]; } /// Returns \ref quadrature. - inline Quadrature *getQuadrature() { + inline Quadrature *getQuadrature() + { return quadrature; } /// Sets \ref quadrature to q. - inline void setQuadrature(Quadrature* q) { + inline void setQuadrature(Quadrature* q) + { quadrature = q; } @@ -117,12 +120,14 @@ namespace AMDiS { Quadrature *quad = NULL); /// Returns \ref psiFast. - const FastQuadrature *getPsiFast() const { + const FastQuadrature *getPsiFast() const + { return psiFast; } // Returns \ref phiFast. - const FastQuadrature *getPhiFast() const { + const FastQuadrature *getPhiFast() const + { return phiFast; } diff --git a/AMDiS/src/SubElInfo.h b/AMDiS/src/SubElInfo.h index 1ba496cc5eb71c57304a7dd747caa0d9c7de18e6..de48bdc5e69645f2f41bef4eeb585d58b55f02b7 100644 --- a/AMDiS/src/SubElInfo.h +++ b/AMDiS/src/SubElInfo.h @@ -7,22 +7,19 @@ #include "FixVec.h" namespace AMDiS { - // ============================================================================ - // ===== class SubElInfo ====================================================== - // ============================================================================ - // - // Class description: - // The class \ref SubElInfo holds all information on a subelement (element to - // which it belongs, its vertices in barycentric coordinates with respect to - // the element, corresponding determinant, ...). - // - // Main routines: - // SubElInfo() - Creates a \ref SubElInfo for a subelement of the element - // \ref elInfo. The vertices of the subelement given in - // barycentric coordinates with respect to element are handed over - // to this routine. The determinant corresponding to subelement - // is calculated. - // ============================================================================ + + /** \brief + * The class \ref SubElInfo holds all information on a subelement (element to + * which it belongs, its vertices in barycentric coordinates with respect to + * the element, corresponding determinant, ...). + * + * Main routines: + * SubElInfo() - Creates a \ref SubElInfo for a subelement of the element + * \ref elInfo. The vertices of the subelement given in + * barycentric coordinates with respect to element are handed over + * to this routine. The determinant corresponding to subelement + * is calculated. + */ class SubElInfo { public: @@ -30,12 +27,14 @@ namespace AMDiS { SubElInfo(VectorOfFixVecs<DimVec<double> > *lambda, const ElInfo *elInfo); /// Destructor - ~SubElInfo() { + ~SubElInfo() + { delete lambda; } /// Get b-th coordinate of the a-th vertex of subelement (barycentriccoordinates). - inline const double getLambda(int a, int b) const { + inline const double getLambda(int a, int b) const + { if (lambda) return (*lambda)[a][b]; else @@ -43,17 +42,20 @@ namespace AMDiS { } /// Get coordinates of a-th vertex of subelement (barycentric coordinates). - inline const DimVec<double>& getLambda(int a) const { + inline const DimVec<double>& getLambda(int a) const + { return (*lambda)[a]; } /// Get coordinates of all vertices of subelement (barycentric coordinates). - inline VectorOfFixVecs<DimVec<double> > *getLambda() const { + inline VectorOfFixVecs<DimVec<double> > *getLambda() const + { return lambda; } /// Get determinant corresponding to subelement. - inline const double getDet() const { + inline const double getDet() const + { return det; } diff --git a/AMDiS/src/SubQuadrature.h b/AMDiS/src/SubQuadrature.h index 4362d434953b50dcff182bb838b2ce48464923fc..78f3ed98eaacd3853650f46d57cf7d02eab270b0 100644 --- a/AMDiS/src/SubQuadrature.h +++ b/AMDiS/src/SubQuadrature.h @@ -41,14 +41,14 @@ namespace AMDiS { quad_(quad), subDim_(quad_->getDim()) { - if(dim == subDim_) lambda = quad_->getLambda(); + if (dim == subDim_) + lambda = quad_->getLambda(); } inline void scaleQuadrature(VectorOfFixVecs<DimVec<double> > &coords) { - if(!lambda || (lambda == quad_->getLambda())) { + if (!lambda || (lambda == quad_->getLambda())) lambda = new VectorOfFixVecs<DimVec<double> >(dim, n_points, NO_INIT); - } TEST_EXIT_DBG(coords.getSize() == (subDim_ + 1)) ("invalid number of scale coords or invalid quadrature dim\n"); @@ -59,17 +59,16 @@ namespace AMDiS { DimVec<double> origin = quad_->getLambda(i); for (int j = 0; j < dim + 1; j++) (*lambda)[i][j] = 0.0; - for (int j = 0; j < dim + 1; j++) { - for (int k = 0; k < subDim_ + 1; k++) { + for (int j = 0; j < dim + 1; j++) + for (int k = 0; k < subDim_ + 1; k++) (*lambda)[i][j] += origin[k] * coords[k][j]; - } - } } - }; + } - inline int getSubDim() { + inline int getSubDim() + { return subDim_; - }; + } protected: Quadrature *quad_; diff --git a/AMDiS/src/SurfaceAssembler.h b/AMDiS/src/SurfaceAssembler.h index 31f330f315d95d413f22e05457a5b1c0fbc2c1bf..f320f57365362a05ebc56226e2162b08383ce1b4 100644 --- a/AMDiS/src/SurfaceAssembler.h +++ b/AMDiS/src/SurfaceAssembler.h @@ -50,39 +50,43 @@ namespace AMDiS { SubQuadrature *subQuadrature; - if(rowQuad11_) { + if (rowQuad11_) { subQuadrature = new SubQuadrature(rowQuad11_, rowDim_); rowQuad11_ = colQuad11_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo11_ = colQPInfo11_ = QPInfo::provideQPInfo(rowQuad11_, NULL); } - if(rowQuad10_) { + if (rowQuad10_) { subQuadrature = new SubQuadrature(rowQuad10_, rowDim_); rowQuad10_ = colQuad10_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo10_ = colQPInfo10_ = QPInfo::provideQPInfo(rowQuad10_, NULL); } - if(rowQuad01_) { + if (rowQuad01_) { subQuadrature = new SubQuadrature(rowQuad01_, rowDim_); rowQuad01_ = colQuad01_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo01_ = colQPInfo01_ = QPInfo::provideQPInfo(rowQuad01_, NULL); } - if(rowQuad00_) { + if (rowQuad00_) { subQuadrature = new SubQuadrature(rowQuad00_, rowDim_); rowQuad00_ = colQuad00_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo00_ = colQPInfo00_ = QPInfo::provideQPInfo(rowQuad00_, NULL); } - }; + } /// Destructor ~SurfaceAssembler() { - if (rowQuad11_) delete rowQuad11_; - if (rowQuad10_) delete rowQuad10_; - if (rowQuad01_) delete rowQuad01_; - if (rowQuad00_) delete rowQuad00_; + if (rowQuad11_) + delete rowQuad11_; + if (rowQuad10_) + delete rowQuad10_; + if (rowQuad01_) + delete rowQuad01_; + if (rowQuad00_) + delete rowQuad00_; } /// Adapt surface quadratures to \ref coords. @@ -109,9 +113,8 @@ namespace AMDiS { FixVec<WorldVector<double>, VERTEX> worldCoords(rowDim_ - 1, NO_INIT); // transform barycentric coords to world coords - for (int i = 0; i < rowDim_; i++) { + for (int i = 0; i < rowDim_; i++) elInfo1->coordToWorld(coords_[i], &worldCoords[i]); - } // set determinant for world coords of the side det_ = elInfo1->calcDet(worldCoords);