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