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

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
#define AMDIS_CFE_INTEGRATION_H
......@@ -10,10 +31,7 @@ namespace AMDiS {
class CFE_Integration
{
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,
ElementLevelSet *elLS,
int deg = 1,
......@@ -29,9 +47,7 @@ namespace AMDiS {
int deg = 1,
Quadrature *q = NULL);
protected:
/**
* Calculates determinant for surface given through surfVert.
*/
/// Calculates determinant for surface given through surfVert.
static double calcSurfaceDet(ElInfo *loc_elInfo,
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
#define AMDIS_CFE_NORMANDERRORFCTS_H
......@@ -15,222 +36,168 @@ namespace AMDiS {
class ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementNorm(Quadrature *q_)
: q(q_),
nQPts(0)
{
if (q)
nQPts = q->getNumPoints();
};
}
/**
* Destructor.
*/
virtual ~ElementNorm()
{};
/// Destructor.
virtual ~ElementNorm() {}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
virtual double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0) = 0;
/**
* Sets quadrature to q_.
*/
inline void setQuadrature(Quadrature *q_) {
/// Sets quadrature to q_.
inline void setQuadrature(Quadrature *q_)
{
q = q_;
nQPts = q->getNumPoints();
};
}
protected:
/**
* Quadrature formula.
*/
/// Quadrature formula.
Quadrature *q;
/**
* Number of quadrature points.
*/
/// Number of quadrature points.
int nQPts;
};
class ElementL1Norm_Analyt : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementL1Norm_Analyt(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *f_)
: ElementNorm(q_),
f(f_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* Abstract function for which norm is calculated.
*/
/// Abstract function for which norm is calculated.
AbstractFunction<double, WorldVector<double> > *f;
};
class ElementL2Norm_Analyt : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementL2Norm_Analyt(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *f_)
: ElementNorm(q_),
f(f_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* Abstract function for which norm is calculated.
*/
/// Abstract function for which norm is calculated.
AbstractFunction<double, WorldVector<double> > *f;
};
class ElementH1Norm_Analyt : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementH1Norm_Analyt(Quadrature *q_,
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd_,
int dim_)
: ElementNorm(q_),
grd(grd_),
dim(dim_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* Abstract function for which norm is calculated.
*/
/// Abstract function for which norm is calculated.
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd;
/**
* Mesh dimension.
*/
/// Mesh dimension.
int dim;
};
class ElementL1Norm_DOF : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementL1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_)
: ElementNorm(q_),
dofVec(dofVec_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* DOF vector for which norm is calculated.
*/
/// DOF vector for which norm is calculated.
DOFVector<double> *dofVec;
};
class ElementL2Norm_DOF : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementL2Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_)
: ElementNorm(q_),
dofVec(dofVec_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* DOF vector for which norm is calculated.
*/
/// DOF vector for which norm is calculated.
DOFVector<double> *dofVec;
};
class ElementH1Norm_DOF : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementH1Norm_DOF(Quadrature *q_, DOFVector<double> *dofVec_, int dim_)
: ElementNorm(q_),
dofVec(dofVec_),
dim(dim_)
{};
{}
/**
* Calculates element norm on elInfo.
*/
/// Calculates element norm on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
protected:
/**
* DOF vector for which norm is calculated.
*/
/// DOF vector for which norm is calculated.
DOFVector<double> *dofVec;
/**
* Mesh dimension.
*/
/// Mesh dimension.
int dim;
};
class ElementL2Err : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementL2Err(Quadrature *q_,
AbstractFunction<double, WorldVector<double> > *u_,
DOFVector<double> *uh_,
......@@ -240,49 +207,37 @@ namespace AMDiS {
uh(uh_),
relErr(relErr_),
nrmU(0.0)
{};
{}
/**
* Calculates element error on elInfo.
*/
/// Calculates element error on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
/**
* Get norm of u.
*/
inline double getNormU() const {
/// Get norm of u.
inline double getNormU() const
{
return nrmU;
};
}
protected:
/**
* Abstract function for which error is calculated.
*/
/// Abstract function for which error is calculated.
AbstractFunction<double, WorldVector<double> > *u;
/**
* DOF vector for which error is calculated.
*/
/// DOF vector for which error is calculated.
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;
/**
* Norm of u in case relative error is calculated.
*/
/// Norm of u in case relative error is calculated.
double nrmU;
};
class ElementH1Err : public ElementNorm
{
public:
/**
* Constructor.
*/
/// Constructor.
ElementH1Err(Quadrature *q_,
AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu_,
DOFVector<double> *uh_,
......@@ -294,52 +249,36 @@ namespace AMDiS {
relErr(relErr_),
nrmGrdU(0.0),
dim(dim_)
{};
{}
/**
* Calculates element error on elInfo.
*/
/// Calculates element error on elInfo.
double calcElNorm(ElInfo *elInfo,
const double &det,
const double &fac = 1.0);
/**
* Get norm of grdu.
*/
inline double getNormGrdU() const {
/// Get norm of grdu.
inline double getNormGrdU() const
{
return nrmGrdU;
};
}
protected:
/**
* Abstract function for which norm is calculated.
*/
/// Abstract function for which norm is calculated.
AbstractFunction<WorldVector<double>, WorldVector<double> > *grdu;
/**
* DOF vector for which error is calculated.
*/
/// DOF vector for which error is calculated.
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;
/**
* Norm of grdu in case relative error is calculated.
*/
/// Norm of grdu in case relative error is calculated.
double nrmGrdU;
/**
* Mesh dimension.
*/
/// Mesh dimension.
int dim;
};
/////////////////////////////////////////////////////////////////////////////
///// class CFE_NormAndErrorFcts ////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
class CFE_NormAndErrorFcts
{
public:
......@@ -361,32 +300,27 @@ namespace AMDiS {
// 0 : all elements cut by the zero level set
// 1 : complete mesh
// ========================================================================
static double L1Norm_Analyt(
AbstractFunction<double, WorldVector<double> > *f,
static double L1Norm_Analyt(AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS,
int domainFlag,
int deg = 1,
Quadrature* q = NULL);
static double L2Norm_Analyt(
AbstractFunction<double, WorldVector<double> > *f,
static double L2Norm_Analyt(AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS,
int domainFlag,
int deg = 2,
Quadrature* q = NULL);
static double L2NormSquare_Analyt(
AbstractFunction<double, WorldVector<double> > *f,
static double L2NormSquare_Analyt(AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS,
int domainFlag,
int deg = 2,
Quadrature* q = NULL);
static double H1Norm_Analyt(
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd,
static double H1Norm_Analyt(AbstractFunction<WorldVector<double>, WorldVector<double> > *grd,
ElementLevelSet *elLS,
int domainFlag,
int deg = 0,
Quadrature* q = NULL);
static double H1NormSquare_Analyt(
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd,
static double H1NormSquare_Analyt(AbstractFunction<WorldVector<double>, WorldVector<double> > *grd,
ElementLevelSet *elLS,
int domainFlag,
int deg = 0,
......@@ -519,9 +453,7 @@ namespace AMDiS {
int deg,
Quadrature* q);
/**
* Calculate norm on subpolytope.
*/
/// Calculate norm on subpolytope.
static double calcSubPolNorm(ElInfo *elInfo,
SubPolytope *subPolytope,
ElementNorm *elNorm,
......@@ -529,24 +461,16 @@ namespace AMDiS {
const double &subPolFac = 1.0);
protected:
/**
* Absolute L2 error (last L2 error calculation !).
*/
/// Absolute L2 error (last L2 error calculation !).
static double L2_err_abs;
/**
* L2 norm of correct solution u (last L2 error calculation !).
*/
/// L2 norm of correct solution u (last L2 error calculation !).
static double L2_u_norm;
/**
* Absolute H1 error (last H1 error calculation !).
*/
/// Absolute H1 error (last H1 error calculation !).
static double H1_err_abs;
/**
* H1 norm of correct solution u (last H1 error calculation !).
*/
/// H1 norm of correct solution u (last H1 error calculation !).
static double H1_u_norm;
};
......
// ============================================================================
// == ==
// == 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 CompositeFEMMethods.h */
#ifndef AMDIS_COMPOSITEFEMMETHODS_H
#define AMDIS_COMPOSITEFEMMETHODS_H
......@@ -10,11 +31,8 @@ using namespace AMDiS;
class CompositeFEMMethods
{
public:
/**
* Set all dof-values on domain with positive level set function values
* to val.
*/
public:
/// Set all dof-values on domain with positive level set function values to val.
static void setPosLsToVal(
DOFVector<double> *dof,
const double &val,
......
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == TU Dresden ==
// == ==
// == Institut für Wissenschaftliches Rechnen ==
// == Zellescher Weg 12-14 ==
// == 01069 Dresden ==
// == germany ==