Commit 18086950 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* compositeFEM source adapted to AMDiS source layout

* deleted all gcc warnings from compiling compositeFEM
parent d3b88dd1
#include "CFE_Integration.h" #include "CFE_Integration.h"
#include "Mesh.h" #include "Mesh.h"
#include "SurfaceQuadrature.h" #include "SurfaceQuadrature.h"
#include "Traverse.h" #include "Traverse.h"
#include "ScalableQuadrature.h" #include "ScalableQuadrature.h"
#include "SubElInfo.h" #include "SubElInfo.h"
#include "SubPolytope.h" #include "SubPolytope.h"
double namespace AMDiS {
CFE_Integration::integrate_onNegLs(ElementFunction<double> *f,
double
CFE_Integration::integrate_onNegLs(ElementFunction<double> *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_Integration::integrate_onNegLs()"); FUNCNAME("CFE_Integration::integrate_onNegLs()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -172,14 +172,14 @@ CFE_Integration::integrate_onNegLs(ElementFunction<double> *f, ...@@ -172,14 +172,14 @@ CFE_Integration::integrate_onNegLs(ElementFunction<double> *f,
DELETE loc_scalQuad; DELETE loc_scalQuad;
return int_val; return int_val;
} }
double double
CFE_Integration::integrate_onZeroLs(ElementFunction<double> *f, CFE_Integration::integrate_onZeroLs(ElementFunction<double> *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_Integration::integrate_onZeroLs()"); FUNCNAME("CFE_Integration::integrate_onZeroLs()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -272,12 +272,12 @@ CFE_Integration::integrate_onZeroLs(ElementFunction<double> *f, ...@@ -272,12 +272,12 @@ CFE_Integration::integrate_onZeroLs(ElementFunction<double> *f,
DELETE surfQuad; DELETE surfQuad;
return int_val; return int_val;
} }
double double
CFE_Integration::calcSurfaceDet(ElInfo *loc_elInfo, CFE_Integration::calcSurfaceDet(ElInfo *loc_elInfo,
VectorOfFixVecs<DimVec<double> > &surfVert) VectorOfFixVecs<DimVec<double> > &surfVert)
{ {
double surfDet; double surfDet;
int dim = surfVert[0].getSize()-1; int dim = surfVert[0].getSize()-1;
FixVec<WorldVector<double>, VERTEX> worldCoords(dim-1, NO_INIT); FixVec<WorldVector<double>, VERTEX> worldCoords(dim-1, NO_INIT);
...@@ -291,4 +291,6 @@ CFE_Integration::calcSurfaceDet(ElInfo *loc_elInfo, ...@@ -291,4 +291,6 @@ CFE_Integration::calcSurfaceDet(ElInfo *loc_elInfo,
surfDet = ElInfo::calcDet(worldCoords); surfDet = ElInfo::calcDet(worldCoords);
return surfDet; return surfDet;
}
} }
...@@ -4,13 +4,12 @@ ...@@ -4,13 +4,12 @@
#include "ElementFunction.h" #include "ElementFunction.h"
#include "MemoryManager.h" #include "MemoryManager.h"
#include "Quadrature.h" #include "Quadrature.h"
#include "ElementLevelSet.h" #include "ElementLevelSet.h"
using namespace AMDiS; namespace AMDiS {
class CFE_Integration class CFE_Integration
{ {
public: public:
MEMORY_MANAGED(CFE_Integration); MEMORY_MANAGED(CFE_Integration);
...@@ -38,6 +37,8 @@ class CFE_Integration ...@@ -38,6 +37,8 @@ class CFE_Integration
*/ */
static double calcSurfaceDet(ElInfo *loc_elInfo, static double calcSurfaceDet(ElInfo *loc_elInfo,
VectorOfFixVecs<DimVec<double> > &surfVert); VectorOfFixVecs<DimVec<double> > &surfVert);
}; };
}
#endif // AMDIS_CFE_INTEGRATION_H #endif // AMDIS_CFE_INTEGRATION_H
#include "CFE_NormAndErrorFcts.h"
#include <vector> #include <vector>
#include "CFE_NormAndErrorFcts.h"
#include "Mesh.h" #include "Mesh.h"
#include "Traverse.h" #include "Traverse.h"
#include "SubElInfo.h" #include "SubElInfo.h"
double CFE_NormAndErrorFcts::L2_err_abs = 0.0; namespace AMDiS {
double CFE_NormAndErrorFcts::L2_u_norm = 0.0;
double CFE_NormAndErrorFcts::H1_err_abs = 0.0;
double CFE_NormAndErrorFcts::H1_u_norm = 0.0;
double double CFE_NormAndErrorFcts::L2_err_abs = 0.0;
ElementL1Norm_Analyt::calcElNorm(ElInfo *elInfo, double CFE_NormAndErrorFcts::L2_u_norm = 0.0;
double CFE_NormAndErrorFcts::H1_err_abs = 0.0;
double CFE_NormAndErrorFcts::H1_u_norm = 0.0;
double
ElementL1Norm_Analyt::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
const WorldVector<double> *worldCoordsAtQP; const WorldVector<double> *worldCoordsAtQP;
...@@ -26,13 +26,13 @@ ElementL1Norm_Analyt::calcElNorm(ElInfo *elInfo, ...@@ -26,13 +26,13 @@ ElementL1Norm_Analyt::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementL2Norm_Analyt::calcElNorm(ElInfo *elInfo, ElementL2Norm_Analyt::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
const WorldVector<double> *worldCoordsAtQP; const WorldVector<double> *worldCoordsAtQP;
...@@ -43,13 +43,13 @@ ElementL2Norm_Analyt::calcElNorm(ElInfo *elInfo, ...@@ -43,13 +43,13 @@ ElementL2Norm_Analyt::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementH1Norm_Analyt::calcElNorm(ElInfo *elInfo, ElementH1Norm_Analyt::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
double norm_grd2; double norm_grd2;
const WorldVector<double> *worldCoordsAtQP; const WorldVector<double> *worldCoordsAtQP;
...@@ -66,13 +66,13 @@ ElementH1Norm_Analyt::calcElNorm(ElInfo *elInfo, ...@@ -66,13 +66,13 @@ ElementH1Norm_Analyt::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementL1Norm_DOF::calcElNorm(ElInfo *elInfo, ElementL1Norm_DOF::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
const double *dofAtQPs = dofVec->getVecAtQPs(elInfo, const double *dofAtQPs = dofVec->getVecAtQPs(elInfo,
q, q,
...@@ -85,13 +85,13 @@ ElementL1Norm_DOF::calcElNorm(ElInfo *elInfo, ...@@ -85,13 +85,13 @@ ElementL1Norm_DOF::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementL2Norm_DOF::calcElNorm(ElInfo *elInfo, ElementL2Norm_DOF::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
const double *dofAtQPs = dofVec->getVecAtQPs(elInfo, const double *dofAtQPs = dofVec->getVecAtQPs(elInfo,
q, q,
...@@ -104,13 +104,13 @@ ElementL2Norm_DOF::calcElNorm(ElInfo *elInfo, ...@@ -104,13 +104,13 @@ ElementL2Norm_DOF::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementH1Norm_DOF::calcElNorm(ElInfo *elInfo, ElementH1Norm_DOF::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
double norm_grd2; double norm_grd2;
const WorldVector<double> *grdDofAtQPs = dofVec->getGrdAtQPs(elInfo, const WorldVector<double> *grdDofAtQPs = dofVec->getGrdAtQPs(elInfo,
...@@ -129,13 +129,13 @@ ElementH1Norm_DOF::calcElNorm(ElInfo *elInfo, ...@@ -129,13 +129,13 @@ ElementH1Norm_DOF::calcElNorm(ElInfo *elInfo,
double nrm = det * val; double nrm = det * val;
return nrm; return nrm;
} }
double double
ElementL2Err::calcElNorm(ElInfo *elInfo, ElementL2Err::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
double val_nrm = 0.0; double val_nrm = 0.0;
const double *uhAtQPs = uh->getVecAtQPs(elInfo, const double *uhAtQPs = uh->getVecAtQPs(elInfo,
...@@ -158,13 +158,13 @@ ElementL2Err::calcElNorm(ElInfo *elInfo, ...@@ -158,13 +158,13 @@ ElementL2Err::calcElNorm(ElInfo *elInfo,
nrmU += fac * det * val_nrm; nrmU += fac * det * val_nrm;
return err; return err;
} }
double double
ElementH1Err::calcElNorm(ElInfo *elInfo, ElementH1Err::calcElNorm(ElInfo *elInfo,
const double &det, const double &det,
const double &fac) const double &fac)
{ {
double val = 0.0; double val = 0.0;
double val_nrm = 0.0; double val_nrm = 0.0;
double norm_err_grd2; double norm_err_grd2;
...@@ -200,15 +200,15 @@ ElementH1Err::calcElNorm(ElInfo *elInfo, ...@@ -200,15 +200,15 @@ ElementH1Err::calcElNorm(ElInfo *elInfo,
nrmGrdU += fac * det * val_nrm; nrmGrdU += fac * det * val_nrm;
return err; return err;
} }
double double
CFE_NormAndErrorFcts::Norm_IntNoBound(ElementNorm *elNorm, CFE_NormAndErrorFcts::Norm_IntNoBound(ElementNorm *elNorm,
ElementLevelSet *elLS, ElementLevelSet *elLS,
Flag fillFlag, Flag fillFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::Norm_IntNoBound()"); FUNCNAME("CFE_NormAndErrorFcts::Norm_IntNoBound()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -249,15 +249,15 @@ CFE_NormAndErrorFcts::Norm_IntNoBound(ElementNorm *elNorm, ...@@ -249,15 +249,15 @@ CFE_NormAndErrorFcts::Norm_IntNoBound(ElementNorm *elNorm,
} // end of: mesh traverse } // end of: mesh traverse
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::Norm_IntBound(ElementNorm *elNorm, CFE_NormAndErrorFcts::Norm_IntBound(ElementNorm *elNorm,
ElementLevelSet *elLS, ElementLevelSet *elLS,
Flag fillFlag, Flag fillFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::Norm_IntBound()"); FUNCNAME("CFE_NormAndErrorFcts::Norm_IntBound()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -364,15 +364,15 @@ CFE_NormAndErrorFcts::Norm_IntBound(ElementNorm *elNorm, ...@@ -364,15 +364,15 @@ CFE_NormAndErrorFcts::Norm_IntBound(ElementNorm *elNorm,
DELETE scalQuad; DELETE scalQuad;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::Norm_Int(ElementNorm *elNorm, CFE_NormAndErrorFcts::Norm_Int(ElementNorm *elNorm,
ElementLevelSet *elLS, ElementLevelSet *elLS,
Flag fillFlag, Flag fillFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::Norm_Int()"); FUNCNAME("CFE_NormAndErrorFcts::Norm_Int()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -511,15 +511,15 @@ CFE_NormAndErrorFcts::Norm_Int(ElementNorm *elNorm, ...@@ -511,15 +511,15 @@ CFE_NormAndErrorFcts::Norm_Int(ElementNorm *elNorm,
DELETE scalQuad; DELETE scalQuad;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::Norm_Bound(ElementNorm *elNorm, CFE_NormAndErrorFcts::Norm_Bound(ElementNorm *elNorm,
ElementLevelSet *elLS, ElementLevelSet *elLS,
Flag fillFlag, Flag fillFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::Norm_Bound()"); FUNCNAME("CFE_NormAndErrorFcts::Norm_Bound()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -615,15 +615,15 @@ CFE_NormAndErrorFcts::Norm_Bound(ElementNorm *elNorm, ...@@ -615,15 +615,15 @@ CFE_NormAndErrorFcts::Norm_Bound(ElementNorm *elNorm,
DELETE scalQuad; DELETE scalQuad;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::Norm_Complete(ElementNorm *elNorm, CFE_NormAndErrorFcts::Norm_Complete(ElementNorm *elNorm,
ElementLevelSet *elLS, ElementLevelSet *elLS,
Flag fillFlag, Flag fillFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::Norm_Complete()"); FUNCNAME("CFE_NormAndErrorFcts::Norm_Complete()");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -731,16 +731,16 @@ CFE_NormAndErrorFcts::Norm_Complete(ElementNorm *elNorm, ...@@ -731,16 +731,16 @@ CFE_NormAndErrorFcts::Norm_Complete(ElementNorm *elNorm,
DELETE scalQuad; DELETE scalQuad;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::L1Norm_Analyt( CFE_NormAndErrorFcts::L1Norm_Analyt(
AbstractFunction<double, WorldVector<double> > *f, AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int domainFlag, int domainFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::L1Norm_Analyt"); FUNCNAME("CFE_NormAndErrorFcts::L1Norm_Analyt");
ElementL1Norm_Analyt *elNorm = NEW ElementL1Norm_Analyt(q, f); ElementL1Norm_Analyt *elNorm = NEW ElementL1Norm_Analyt(q, f);
...@@ -753,7 +753,7 @@ CFE_NormAndErrorFcts::L1Norm_Analyt( ...@@ -753,7 +753,7 @@ CFE_NormAndErrorFcts::L1Norm_Analyt(
Mesh::FILL_COORDS | Mesh::FILL_COORDS |
Mesh::FILL_DET; Mesh::FILL_DET;
double nrm; double nrm = 0.0;
switch(domainFlag) { switch(domainFlag) {
case -3: nrm = Norm_IntNoBound(elNorm, elLS, fillFlag, deg, q); case -3: nrm = Norm_IntNoBound(elNorm, elLS, fillFlag, deg, q);
break; break;
...@@ -772,16 +772,16 @@ CFE_NormAndErrorFcts::L1Norm_Analyt( ...@@ -772,16 +772,16 @@ CFE_NormAndErrorFcts::L1Norm_Analyt(
DELETE elNorm; DELETE elNorm;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::L2NormSquare_Analyt( CFE_NormAndErrorFcts::L2NormSquare_Analyt(
AbstractFunction<double, WorldVector<double> > *f, AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int domainFlag, int domainFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::L2NormSquare_Analyt"); FUNCNAME("CFE_NormAndErrorFcts::L2NormSquare_Analyt");
ElementL2Norm_Analyt *elNorm = NEW ElementL2Norm_Analyt(q, f); ElementL2Norm_Analyt *elNorm = NEW ElementL2Norm_Analyt(q, f);
...@@ -794,7 +794,7 @@ CFE_NormAndErrorFcts::L2NormSquare_Analyt( ...@@ -794,7 +794,7 @@ CFE_NormAndErrorFcts::L2NormSquare_Analyt(
Mesh::FILL_COORDS | Mesh::FILL_COORDS |
Mesh::FILL_DET; Mesh::FILL_DET;
double nrm; double nrm = 0.0;
switch(domainFlag) { switch(domainFlag) {
case -3: nrm = Norm_IntNoBound(elNorm, elLS, fillFlag, deg, q); case -3: nrm = Norm_IntNoBound(elNorm, elLS, fillFlag, deg, q);
break; break;
...@@ -813,27 +813,27 @@ CFE_NormAndErrorFcts::L2NormSquare_Analyt( ...@@ -813,27 +813,27 @@ CFE_NormAndErrorFcts::L2NormSquare_Analyt(
DELETE elNorm; DELETE elNorm;
return nrm; return nrm;
} }
double double
CFE_NormAndErrorFcts::L2Norm_Analyt( CFE_NormAndErrorFcts::L2Norm_Analyt(
AbstractFunction<double, WorldVector<double> > *f, AbstractFunction<double, WorldVector<double> > *f,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int domainFlag, int domainFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
return sqrt(L2NormSquare_Analyt(f, elLS, domainFlag, deg, q)); return sqrt(L2NormSquare_Analyt(f, elLS, domainFlag, deg, q));
} }
double double
CFE_NormAndErrorFcts::H1NormSquare_Analyt( CFE_NormAndErrorFcts::H1NormSquare_Analyt(
AbstractFunction<WorldVector<double>, WorldVector<double> > *grd, AbstractFunction<WorldVector<double>, WorldVector<double> > *grd,
ElementLevelSet *elLS, ElementLevelSet *elLS,
int domainFlag, int domainFlag,
int deg, int deg,
Quadrature *q) Quadrature *q)
{ {
FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_Analyt"); FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_Analyt");
int dim = elLS->getDim(); int dim = elLS->getDim();
...@@ -846,7 +846,7 @@ CFE_NormAndErrorFcts::H1NormSquare_Analyt( ...@@ -846,7