Commit c3474ca2 authored by Thomas Witkowski's avatar Thomas Witkowski

Some source code refactoring, no real changes.

parent ee319d21
......@@ -33,6 +33,8 @@ namespace AMDiS {
class CoarseningManager;
class DiagonalPreconditioner;
class DOFAdmin;
class DOFContainer;
class DOFIndexedBase;
class DOFMatrix;
class Element;
class ElementMatrix;
......@@ -63,6 +65,7 @@ namespace AMDiS {
class RefinementManager;
class RobinBC;
class SystemVector;
class VertexInfo;
class VertexVector;
template<typename ReturnType, typename ArgumentType> class AbstractFunction;
......
......@@ -23,7 +23,6 @@
#define AMDIS_ABSTRACTFUNCTION_H
#include "Global.h"
#include "MemoryManager.h"
namespace AMDiS {
......
......@@ -22,7 +22,6 @@
#ifndef AMDIS_ADAPTINFO_H
#define AMDIS_ADAPTINFO_H
#include "MemoryManager.h"
#include "MatrixVector.h"
#include "Parameters.h"
#include "Serializable.h"
......
......@@ -26,7 +26,6 @@
#include <ctime>
#include <queue>
#include "Flag.h"
#include "MemoryManager.h"
#include "AdaptInfo.h"
#include "AdaptBase.h"
#include "AMDiS_fwd.h"
......
......@@ -31,7 +31,6 @@
#include <string>
#include "Flag.h"
#include "MemoryManager.h"
#include "AdaptInfo.h"
#include "AdaptBase.h"
#include "AMDiS_fwd.h"
......
......@@ -32,7 +32,6 @@
#include <vector>
#include "FixVec.h"
#include "MemoryManager.h"
#include "ZeroOrderAssembler.h"
#include "FirstOrderAssembler.h"
#include "SecondOrderAssembler.h"
......
......@@ -24,7 +24,6 @@
#include <map>
#include "Global.h"
#include "MemoryManager.h"
namespace AMDiS {
......
......@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_1D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace AMDiS {
// ============================================================================
// ===== class CoarseningManager1d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 1-dimensional meshes.
......@@ -38,17 +33,13 @@ namespace AMDiS {
class CoarseningManager1d : public CoarseningManager
{
public:
MEMORY_MANAGED(CoarseningManager1d);
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager1d()
: CoarseningManager()
{}
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager1d() : CoarseningManager() {};
/** \brief
* destructor
*/
virtual ~CoarseningManager1d() {};
/// destructor
virtual ~CoarseningManager1d() {}
/** \brief
* Overloads CoarseningManager::coarsenMesh. In 1d a simple recursive
......@@ -57,18 +48,14 @@ namespace AMDiS {
Flag coarsenMesh(Mesh *aMesh);
protected:
/** \brief
* Not needed in this sub class
*/
/// Not needed in this sub class
int coarsenFunction(ElInfo *) {
FUNCNAME("CoarseningManager1d::coarsenFunction");
ERROR_EXIT("not used for dim = 1");
return 0;
};
}
/** \brief
* Needed instead of coarsenFunction in 1d.
*/
/// Needed instead of coarsenFunction in 1d.
int coarsenRecursive(Line *parent);
};
......
......@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_2D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace AMDiS {
// ============================================================================
// ===== class CoarseningManager2d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 2-dimensional meshes.
......@@ -38,25 +33,17 @@ namespace AMDiS {
class CoarseningManager2d : public CoarseningManager
{
public:
MEMORY_MANAGED(CoarseningManager2d);
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager2d() : CoarseningManager() {
// FUNCNAME("CoarseningManager2d::CoarseningManager2d");
// TEST_EXIT(mesh->getDim()==2)("mesh->dim != 2\n");
};
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager2d()
: CoarseningManager()
{}
/** \brief
* destructor
*/
virtual ~CoarseningManager2d() {};
/// destructor
virtual ~CoarseningManager2d() {}
protected:
/** \brief
* Implements CoarseningManager::coarsenFunction
*/
/// Implements CoarseningManager::coarsenFunction
virtual int coarsenFunction(ElInfo *el_info);
/** \brief
......
......@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_3D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace AMDiS {
// ============================================================================
// ===== class CoarseningManager3d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 3-dimensional meshes.
......@@ -38,22 +33,16 @@ namespace AMDiS {
class CoarseningManager3d : public CoarseningManager
{
public:
MEMORY_MANAGED(CoarseningManager3d);
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager3d() : CoarseningManager() {};
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager3d()
: CoarseningManager()
{}
/** \brief
* destructor
*/
virtual ~CoarseningManager3d() {};
/// destructor
virtual ~CoarseningManager3d() {}
protected:
/** \brief
* Implements CoarseningManager::coarsenFunction
*/
/// Implements CoarseningManager::coarsenFunction
int coarsenFunction(ElInfo *el_info);
/** \brief
......
......@@ -30,10 +30,6 @@
namespace AMDiS {
// ============================================================================
// ===== class ConditionalEstimator ==============================================
// ============================================================================
/**
* \ingroup Estimator
*
......@@ -43,45 +39,21 @@ namespace AMDiS {
class ConditionalEstimator : public Estimator
{
public:
MEMORY_MANAGED(ConditionalEstimator);
ConditionalEstimator(Estimator *decorated)
: decoratedEstimator_(decorated),
elementCount_(0),
row_(decorated ? decorated->getRow() : 0)
{};
{}
double estimate(double timestep);
inline int getElementCount() {
return elementCount_;
};
// inline double getErrorSum() const {
// return decoratedEstimator_->getErrorSum();
// };
// inline void setErrorSum(double sum) {
// decoratedEstimator_->setErrorSum(sum);
// };
// inline double getErrorMax() const {
// return decoratedEstimator_->getErrorMax();
// };
// inline double getTimeEst() const {
// return decoratedEstimator_->getTimeEst();
// };
// inline void setErrorMax(double m) {
// decoratedEstimator_->setErrorMax(m);
// };
// inline Norm getErrorNorm() {
// return decoratedEstimator_->getErrorNorm();
// };
}
inline Estimator *getDecoratedEstimator() { return decoratedEstimator_; };
inline Estimator *getDecoratedEstimator() {
return decoratedEstimator_;
}
protected:
Estimator *decoratedEstimator_;
......
......@@ -25,17 +25,12 @@
#include "mpi.h"
#include "Marker.h"
#include "Marker.h"
#include "MemoryManager.h"
#include "PartitionElementData.h"
#include "Traverse.h"
#include "ElInfo.h"
namespace AMDiS {
// ===========================================================================
// ===== class ESMarker ======================================================
// ===========================================================================
/**
* \ingroup Adaption
*
......@@ -45,11 +40,7 @@ namespace AMDiS {
class ConditionalMarker : public Marker
{
public:
MEMORY_MANAGED(ConditionalMarker);
/** \brief
* Constructor.
*/
/// Constructor.
ConditionalMarker(const std::string name,
int row,
Marker *decoratedMarker,
......@@ -59,18 +50,18 @@ namespace AMDiS {
decoratedMarker_(decoratedMarker),
globalCoarseGridLevel_(globalCoarseGridLevel),
localCoarseGridLevel_(localCoarseGridLevel)
{};
{}
/** \brief
* Implementation of MarkScal::initMarking().
*/
virtual void initMarking(AdaptInfo *adaptInfo, Mesh *mesh) {
if(decoratedMarker_)
/// Implementation of MarkScal::initMarking().
virtual void initMarking(AdaptInfo *adaptInfo, Mesh *mesh)
{
if (decoratedMarker_)
decoratedMarker_->initMarking(adaptInfo, mesh);
};
}
virtual void finishMarking(AdaptInfo *adaptInfo) {
if(decoratedMarker_) {
virtual void finishMarking(AdaptInfo *adaptInfo)
{
if (decoratedMarker_) {
int tmp = decoratedMarker_->getElMarkRefine();
MPI::COMM_WORLD.Allreduce(&tmp,
&elMarkRefine,
......@@ -85,10 +76,12 @@ namespace AMDiS {
MPI_SUM);
decoratedMarker_->finishMarking(adaptInfo);
}
};
}
void markElement(AdaptInfo *adaptInfo, ElInfo *elInfo) {
void markElement(AdaptInfo *adaptInfo, ElInfo *elInfo)
{
FUNCNAME("ConditionalMarker::markElement()");
if (decoratedMarker_) {
PartitionElementData *elData =
dynamic_cast<PartitionElementData*>(elInfo->getElement()->
......@@ -110,11 +103,11 @@ namespace AMDiS {
localCoarseGridLevel_ :
globalCoarseGridLevel_;
if(elData->getLevel() + elInfo->getElement()->getMark() < minLevel) {
if (elData->getLevel() + elInfo->getElement()->getMark() < minLevel) {
elInfo->getElement()->setMark(-(elData->getLevel() - minLevel));
}
}
};
}
protected:
Marker *decoratedMarker_;
......
......@@ -22,16 +22,12 @@
#ifndef AMDIS_COUPLINGTIMEINTERFACE_H
#define AMDIS_COUPLINGTIMEINTERFACE_H
#include <vector>
#include "Flag.h"
#include "ProblemTimeInterface.h"
#include <vector>
namespace AMDiS {
// ============================================================================
// ===== class CouplingTimeInterface ==========================================
// ============================================================================
/**
* \ingroup Problem
*
......@@ -40,64 +36,52 @@ namespace AMDiS {
class CouplingTimeInterface : public ProblemTimeInterface
{
public:
void addTimeInterface(ProblemTimeInterface *interface) {
void addTimeInterface(ProblemTimeInterface *interface)
{
interfaces_.push_back(interface);
};
}
/** \brief
* Executes all needed operations when the simulation time changes.
*/
virtual void setTime(AdaptInfo *adaptInfo) {
int i, size = static_cast<int>(interfaces_.size());
for(i = 0; i < size; i++) {
/// Executes all needed operations when the simulation time changes.
virtual void setTime(AdaptInfo *adaptInfo)
{
int size = static_cast<int>(interfaces_.size());
for (int i = 0; i < size; i++)
interfaces_[i]->setTime(adaptInfo);
}
};
}
/** \brief
* Called at the beginning of each timestep
*/
virtual void initTimestep(AdaptInfo *adaptInfo) {
int i, size = static_cast<int>(interfaces_.size());
for(i = 0; i < size; i++) {
/// Called at the beginning of each timestep
virtual void initTimestep(AdaptInfo *adaptInfo)
{
int size = static_cast<int>(interfaces_.size());
for (int i = 0; i < size; i++)
interfaces_[i]->initTimestep(adaptInfo);
}
};
}
/** \brief
* Called at the end of each timestep.
*/
virtual void closeTimestep(AdaptInfo *adaptInfo) {
/// Called at the end of each timestep.
virtual void closeTimestep(AdaptInfo *adaptInfo)
{
int i, size = static_cast<int>(interfaces_.size());
for(i = 0; i < size; i++) {
for (int i = 0; i < size; i++)
interfaces_[i]->closeTimestep(adaptInfo);
}
};
}
/** \brief
* Solves the initial problem.
*/
virtual void solveInitialProblem(AdaptInfo *adaptInfo) {
int i, size = static_cast<int>(interfaces_.size());
for(i = 0; i < size; i++) {
/// Solves the initial problem.
virtual void solveInitialProblem(AdaptInfo *adaptInfo)
{
int size = static_cast<int>(interfaces_.size());
for (int i = 0; i < size; i++)
interfaces_[i]->solveInitialProblem(adaptInfo);
}
};
}
/** \brief
* Solves the initial problem.
*/
/// Solves the initial problem.
virtual void transferInitialSolution(AdaptInfo *adaptInfo) {
int i, size = static_cast<int>(interfaces_.size());
for(i = 0; i < size; i++) {
int size = static_cast<int>(interfaces_.size());
for (int i = 0; i < size; i++)
interfaces_[i]->transferInitialSolution(adaptInfo);
}
};
}
protected:
/** \brief
* vector of coupled time interfaces
*/
/// vector of coupled time interfaces
std::vector<ProblemTimeInterface*> interfaces_;
};
......
......@@ -50,16 +50,14 @@ namespace AMDiS {
*/
virtual BaseClass* create() = 0;
virtual BaseClass* create(const DOFMatrix::base_matrix_type& A) { return 0; }
virtual BaseClass* create(const DOFMatrix::base_matrix_type& A) {
return 0;
}
/** \brief
* Can be implemented by sub classes.
*/
/// Can be implemented by sub classes.
virtual void free(BaseClass *) {}
/** \brief
*
*/
///
virtual bool isNullCreator() {
return false;
}
......@@ -72,16 +70,12 @@ namespace AMDiS {
template<typename BaseClass>
class NullCreator : public CreatorInterface<BaseClass>
{
/** \brief
* Creates no object.
*/
BaseClass* create() {
/// Creates no object.
BaseClass* create() {
return NULL;
}
/** \brief
*
*/
///
virtual bool isNullCreator() {
return true;
}
......
......@@ -24,10 +24,6 @@
namespace AMDiS {
// ==============================================================================
// ===== class CylinderProject ==================================================
// ==============================================================================
/** \brief
* Projects world coordinates to the surface of a cylinder with given center,
* radius and direction. Can be used as boundary or volume projection.
......@@ -35,9 +31,7 @@ namespace AMDiS {
class CylinderProject : public Projection
{
public:
/** \brief
* Constructor.
*/
/// Constructor.
CylinderProject(int id,
ProjectionType type,
WorldVector<double> &c,
......@@ -50,17 +44,14 @@ namespace AMDiS {
{
double norm = sqrt(direction_*direction_);
direction_ *= 1.0 / norm;
};
}
/** \brief
* Destructor.
*/
virtual ~CylinderProject() {};
/// Destructor.
virtual ~CylinderProject() {}
/** \brief
* Implementation of Projection::project();
*/
void project(WorldVector<double> &x) {
/// Implementation of Projection::project();
void project(WorldVector<double> &x)
{
x -= center_;
WorldVector<double> v1 = direction_; v1 *= (x*direction_);
WorldVector<double> v2 = x; v2 -= v1;
......@@ -69,22 +60,16 @@ namespace AMDiS {
v2 *= 1.0 / norm;
x = v2; x *= radius_; x += v1;
x += center_;
};
}
protected:
/** \brief
* Center of the cylinder.
*/
/// Center of the cylinder.
WorldVector<double> center_;
/** \brief
* Direction of the cylinder.
*/
/// Direction of the cylinder.
WorldVector<double> direction_;
/** \brief
* Radius of the cylinder.
*/
/// Radius of the cylinder.
double radius_;
};
......
......@@ -28,27 +28,17 @@
#ifndef AMDIS_DOFADMIN_H
#define AMDIS_DOFADMIN_H
#include <vector>
#include <memory>
#include <list>
#include "Global.h"
#include "FixVec.h"
#include "MemoryManager.h"
#include "Serializable.h"
#include "OpenMP.h"
#include <vector>
#include <memory>
#include <list>
#include "AMDiS_fwd.h"
namespace AMDiS {
class Mesh;
class FiniteElemSpace;
class ElInfo;
class DOFAdmin;
class BasisFunction;
class DOFIndexedBase;
class DOFContainer;
template<typename T> class DOFVector;
/** \ingroup DOFAdministration
* \brief
* Holds all data about one set of DOFs. It includes information about used and
......@@ -58,8 +48,6 @@ namespace AMDiS {
class DOFAdmin : public Serializable
{
public:
MEMORY_MANAGED(DOFAdmin);
DOFAdmin();
/// Constructor
......
......@@ -26,10 +26,6 @@
namespace AMDiS {
// ===========================================================================
// ===== class DOFContainer ==================================================
// ===========================================================================
/** \ingroup DOFAdministration
* \brief
* DOFContainer is the base class for objects that stores DOF indices.
......@@ -40,7 +36,7 @@ namespace AMDiS {
class DOFContainer
{
public:
virtual ~DOFContainer() {};
virtual ~DOFContainer() {}
/** \brief
* Returns the DOF index at position i. Must be overriden by a concrete
......@@ -54,20 +50,17 @@ namespace AMDiS {
* Used by DOFAdmin to actualize the DOF indices in this container after
* DOF compression.
*/
virtual void compressDOFContainer(int size, std::vector<DegreeOfFreedom> &newDOF)
{
int i, j;
for(i=0; i < size; i++) {
if((j = newDOF[operator[](i)]) >= 0) {
for (int i = 0; i < size; i++) {
int j = newDOF[operator[](i)];
if (j >= 0)
operator[](i) = j;
} else {
else
ERROR_EXIT("invalid dof in dof container\n");
}
}
};
}
};
}
#endif
......@@ -29,11 +29,6 @@
namespace AMDiS {
// ============================================================================
// ===== class DOFIndexedBase =================================================
// ============================================================================
/** \ingroup DOFAdministration
* \brief
* Interface for objects that stores information indexed by DOF indices
......@@ -80,10 +75,6 @@ namespace AMDiS {
virtual const FiniteElemSpace* getFESpace() const = 0;
};
// ============================================================================
// ===== class DOFIndexed =====================================================
// ============================================================================
/** \ingroup DOFAdministration
* \brief
* Templated interface for DOFIndexed objects.
......
......@@ -22,35 +22,19 @@
#ifndef AMDIS_DOFITERATOR_H
#define AMDIS_DOFITERATOR_H
// ============================================================================
// ===== includes =============================================================
// ============================================================================
#include "DOFAdmin.h"
//#include "DOFIndexed.h"
#include "FiniteElemSpace.h"
#include "MemoryManager.h"
#include "AMDiS_fwd.h"
namespace AMDiS {
template<typename T> class DOFIndexed;
// ============================================================================
// ===== definitions ==========================================================
// ============================================================================
/** \brief
* Possible types of DOFIterator
*/
/// Possible types of DOFIterator
typedef enum {
USED_DOFS = 0, /**< iterate only used DOFs */
FREE_DOFS = 1, /**< iterate only free DOFs */
ALL_DOFS = 2 /**< iterate all DOFs */
} DOFIteratorType;
// ============================================================================
// ===== class DOFIteratorBase ================================================
// ============================================================================
/** \ingroup DOFAdministration