Commit 7d1f4b51 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Changed introduction comments.

parent 0382ae63
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == TU Dresden ==
// == ==
// == Institut fr Wissenschaftliches Rechnen ==
// == Zellescher Weg 12-14 ==
// == 01069 Dresden ==
// == germany ==
// == ==
// ============================================================================
// == ==
// == https://gforge.zih.tu-dresden.de/projects/amdis/ ==
// == ==
// ============================================================================
/** \file CFE_Integration.h */
#ifndef AMDIS_CFE_INTEGRATION_H #ifndef AMDIS_CFE_INTEGRATION_H
#define AMDIS_CFE_INTEGRATION_H #define AMDIS_CFE_INTEGRATION_H
...@@ -10,10 +31,7 @@ namespace AMDiS { ...@@ -10,10 +31,7 @@ namespace AMDiS {
class CFE_Integration class CFE_Integration
{ {
public: public:
/** /// Calculates integral of function f on domain where level set function is negative.
* Calculates integral of function f on domain where level set function
* is negative.
*/
static double integrate_onNegLs(ElementFunction<double> *f, static double integrate_onNegLs(ElementFunction<double> *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int deg = 1, int deg = 1,
...@@ -29,9 +47,7 @@ namespace AMDiS { ...@@ -29,9 +47,7 @@ namespace AMDiS {
int deg = 1, int deg = 1,
Quadrature *q = NULL); Quadrature *q = NULL);
protected: protected:
/** /// Calculates determinant for surface given through surfVert.
* Calculates determinant for surface given through surfVert.
*/
static double calcSurfaceDet(ElInfo *loc_elInfo, static double calcSurfaceDet(ElInfo *loc_elInfo,
VectorOfFixVecs<DimVec<double> > &surfVert); VectorOfFixVecs<DimVec<double> > &surfVert);
}; };
......
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == TU Dresden ==
// == ==
// == Institut fr Wissenschaftliches Rechnen ==
// == Zellescher Weg 12-14 ==
// == 01069 Dresden ==
// == germany ==
// == ==
// ============================================================================
// == ==
// == https://gforge.zih.tu-dresden.de/projects/amdis/ ==
// == ==
// ============================================================================
/** \file CFE_NormAndErrorFcts.h */
#ifndef AMDIS_CFE_NORMANDERRORFCTS_H #ifndef AMDIS_CFE_NORMANDERRORFCTS_H
#define AMDIS_CFE_NORMANDERRORFCTS_H #define AMDIS_CFE_NORMANDERRORFCTS_H
...@@ -15,222 +36,168 @@ namespace AMDiS { ...@@ -15,222 +36,168 @@ namespace AMDiS {
class ElementNorm class ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementNorm(Quadrature *q_) ElementNorm(Quadrature *q_)
: q(q_), : q(q_),
nQPts(0) nQPts(0)
{ {
if (q) if (q)
nQPts = q->getNumPoints(); nQPts = q->getNumPoints();
}; }
/** /// Destructor.
* Destructor. virtual ~ElementNorm() {}
*/
virtual ~ElementNorm()
{};
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
virtual double calcElNorm(ElInfo *elInfo, virtual double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0) = 0; const double &fac = 1.0) = 0;
/** /// Sets quadrature to q_.
* Sets quadrature to q_. inline void setQuadrature(Quadrature *q_)
*/ {
inline void setQuadrature(Quadrature *q_) {
q = q_; q = q_;
nQPts = q->getNumPoints(); nQPts = q->getNumPoints();
}; }
protected: protected:
/** /// Quadrature formula.
* Quadrature formula.
*/
Quadrature *q; Quadrature *q;
/** /// Number of quadrature points.
* Number of quadrature points.
*/
int nQPts; int nQPts;
}; };
class ElementL1Norm_Analyt : public ElementNorm class ElementL1Norm_Analyt : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementL1Norm_Analyt(Quadrature *q_, ElementL1Norm_Analyt(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *f_) AbstractFunction<double, WorldVector<double> > *f_)
: ElementNorm(q_), : ElementNorm(q_),
f(f_) f(f_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// Abstract function for which norm is calculated.
* Abstract function for which norm is calculated.
*/
AbstractFunction<double, WorldVector<double> > *f; AbstractFunction<double, WorldVector<double> > *f;
}; };
class ElementL2Norm_Analyt : public ElementNorm class ElementL2Norm_Analyt : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementL2Norm_Analyt(Quadrature *q_, ElementL2Norm_Analyt(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *f_) AbstractFunction<double, WorldVector<double> > *f_)
: ElementNorm(q_), : ElementNorm(q_),
f(f_) f(f_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// Abstract function for which norm is calculated.
* Abstract function for which norm is calculated.
*/
AbstractFunction<double, WorldVector<double> > *f; AbstractFunction<double, WorldVector<double> > *f;
}; };
class ElementH1Norm_Analyt : public ElementNorm class ElementH1Norm_Analyt : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementH1Norm_Analyt(Quadrature *q_, ElementH1Norm_Analyt(Quadrature *q_,
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd_, AbstractFunction<WorldVector<double>, WorldVector<double> > *grd_,
int dim_) int dim_)
: ElementNorm(q_), : ElementNorm(q_),
grd(grd_), grd(grd_),
dim(dim_) dim(dim_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// Abstract function for which norm is calculated.
* Abstract function for which norm is calculated.
*/
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd; AbstractFunction<WorldVector<double>, WorldVector<double> > *grd;
/** /// Mesh dimension.
* Mesh dimension.
*/
int dim; int dim;
}; };
class ElementL1Norm_DOF : public ElementNorm class ElementL1Norm_DOF : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementL1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_) ElementL1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_)
: ElementNorm(q_), : ElementNorm(q_),
dofVec(dofVec_) dofVec(dofVec_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// DOF vector for which norm is calculated.
* DOF vector for which norm is calculated.
*/
DOFVector<double> *dofVec; DOFVector<double> *dofVec;
}; };
class ElementL2Norm_DOF : public ElementNorm class ElementL2Norm_DOF : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementL2Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_) ElementL2Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_)
: ElementNorm(q_), : ElementNorm(q_),
dofVec(dofVec_) dofVec(dofVec_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// DOF vector for which norm is calculated.
* DOF vector for which norm is calculated.
*/
DOFVector<double> *dofVec; DOFVector<double> *dofVec;
}; };
class ElementH1Norm_DOF : public ElementNorm class ElementH1Norm_DOF : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementH1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_, int dim_) ElementH1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_, int dim_)
: ElementNorm(q_), : ElementNorm(q_),
dofVec(dofVec_), dofVec(dofVec_),
dim(dim_) dim(dim_)
{}; {}
/** /// Calculates element norm on elInfo.
* Calculates element norm on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
protected: protected:
/** /// DOF vector for which norm is calculated.
* DOF vector for which norm is calculated.
*/
DOFVector<double> *dofVec; DOFVector<double> *dofVec;
/** /// Mesh dimension.
* Mesh dimension.
*/
int dim; int dim;
}; };
class ElementL2Err : public ElementNorm class ElementL2Err : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementL2Err(Quadrature *q_, ElementL2Err(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *u_, AbstractFunction<double, WorldVector<double> > *u_,
DOFVector<double> *uh_, DOFVector<double> *uh_,
...@@ -240,49 +207,37 @@ namespace AMDiS { ...@@ -240,49 +207,37 @@ namespace AMDiS {
uh(uh_), uh(uh_),
relErr(relErr_), relErr(relErr_),
nrmU(0.0) nrmU(0.0)
{}; {}
/** /// Calculates element error on elInfo.
* Calculates element error on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
/** /// Get norm of u.
* Get norm of u. inline double getNormU() const
*/ {
inline double getNormU() const {
return nrmU; return nrmU;
}; }
protected: protected:
/** /// Abstract function for which error is calculated.
* Abstract function for which error is calculated.
*/
AbstractFunction<double, WorldVector<double> > *u; AbstractFunction<double, WorldVector<double> > *u;
/** /// DOF vector for which error is calculated.
* DOF vector for which error is calculated.
*/
DOFVector<double> *uh; DOFVector<double> *uh;
/** /// Indicates whether relative (1) or absolute error (0) is calculated.
* Indicates whether relative (1) or absolute error (0) is calculated.
*/
int relErr; int relErr;
/** /// Norm of u in case relative error is calculated.
* Norm of u in case relative error is calculated.
*/
double nrmU; double nrmU;
}; };
class ElementH1Err : public ElementNorm class ElementH1Err : public ElementNorm
{ {
public: public:
/** /// Constructor.
* Constructor.
*/
ElementH1Err(Quadrature *q_, ElementH1Err(Quadrature *q_,
AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu_, AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu_,
DOFVector<double> *uh_, DOFVector<double> *uh_,
...@@ -294,52 +249,36 @@ namespace AMDiS { ...@@ -294,52 +249,36 @@ namespace AMDiS {
relErr(relErr_), relErr(relErr_),
nrmGrdU(0.0), nrmGrdU(0.0),
dim(dim_) dim(dim_)
{}; {}
/** /// Calculates element error on elInfo.
* Calculates element error on elInfo.
*/
double calcElNorm(ElInfo *elInfo, double calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac = 1.0); const double &fac = 1.0);
/** /// Get norm of grdu.
* Get norm of grdu. inline double getNormGrdU() const
*/ {
inline double getNormGrdU() const {
return nrmGrdU; return nrmGrdU;
}; }
protected: protected:
/** /// Abstract function for which norm is calculated.
* Abstract function for which norm is calculated.
*/
AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu; AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu;
/** /// DOF vector for which error is calculated.
* DOF vector for which error is calculated.
*/
DOFVector<double> *uh; DOFVector<double> *uh;
/** /// Indicates whether relative (1) or absolute error (0) is calculated.
* Indicates whether relative (1) or absolute error (0) is calculated.
*/
int relErr; int relErr;
/** /// Norm of grdu in case relative error is calculated.
* Norm of grdu in case relative error is calculated.
*/
double nrmGrdU; double nrmGrdU;
/** /// Mesh dimension.
* Mesh dimension.
*/
int dim; int dim;
}; };
/////////////////////////////////////////////////////////////////////////////
///// class CFE_NormAndErrorFcts ////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
class CFE_NormAndErrorFcts class CFE_NormAndErrorFcts
{ {
public: public:
...@@ -361,32 +300,27 @@ namespace AMDiS { ...@@ -361,32 +300,27 @@ namespace AMDiS {
// 0 : all elements cut by the zero level set // 0 : all elements cut by the zero level set
// 1 : complete mesh // 1 : complete mesh
// ======================================================================== // ========================================================================
static double L1Norm_Analyt( static double L1Norm_Analyt(AbstractFunction<double, WorldVector<double> > *f,