Commit 225b2887 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

DELETE/NEW in compositeFEM

parent 3a7156a4
...@@ -38,7 +38,7 @@ namespace AMDiS { ...@@ -38,7 +38,7 @@ namespace AMDiS {
q = Quadrature::provideQuadrature(dim, deg); q = Quadrature::provideQuadrature(dim, deg);
} }
numQuadPts = q->getNumPoints(); numQuadPts = q->getNumPoints();
loc_scalQuad = NEW ScalableQuadrature(q); loc_scalQuad = new ScalableQuadrature(q);
numScalQuadPts = loc_scalQuad->getNumPoints(); numScalQuadPts = loc_scalQuad->getNumPoints();
...@@ -82,7 +82,7 @@ namespace AMDiS { ...@@ -82,7 +82,7 @@ namespace AMDiS {
} }
} }
subPolytope = NEW SubPolytope(loc_elInfo, subPolytope = new SubPolytope(loc_elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
vertex_interior); vertex_interior);
...@@ -101,7 +101,7 @@ namespace AMDiS { ...@@ -101,7 +101,7 @@ namespace AMDiS {
// of the element and not an intersection point. Thus the level set // of the element and not an intersection point. Thus the level set
// function value of this vertex really is unequal to zero.) // function value of this vertex really is unequal to zero.)
subPolytope = NEW SubPolytope(loc_elInfo, subPolytope = new SubPolytope(loc_elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
0); 0);
...@@ -147,7 +147,7 @@ namespace AMDiS { ...@@ -147,7 +147,7 @@ namespace AMDiS {
} }
// Free data. // Free data.
DELETE subPolytope; delete subPolytope;
} }
else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) { else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) {
...@@ -169,7 +169,7 @@ namespace AMDiS { ...@@ -169,7 +169,7 @@ namespace AMDiS {
} // end of: mesh traverse } // end of: mesh traverse
DELETE loc_scalQuad; delete loc_scalQuad;
return int_val; return int_val;
} }
...@@ -206,7 +206,7 @@ namespace AMDiS { ...@@ -206,7 +206,7 @@ namespace AMDiS {
if (!q) { if (!q) {
q = Quadrature::provideQuadrature(dim-1, deg); q = Quadrature::provideQuadrature(dim-1, deg);
} }
surfQuad = NEW SurfaceQuadrature(q, tmpPts); surfQuad = new SurfaceQuadrature(q, tmpPts);
numQuadPts = surfQuad->getNumPoints(); numQuadPts = surfQuad->getNumPoints();
...@@ -269,7 +269,7 @@ namespace AMDiS { ...@@ -269,7 +269,7 @@ namespace AMDiS {
} // end of: mesh traverse } // end of: mesh traverse
DELETE surfQuad; delete surfQuad;
return int_val; return int_val;
} }
......
...@@ -274,7 +274,7 @@ namespace AMDiS { ...@@ -274,7 +274,7 @@ namespace AMDiS {
if (!q) { if (!q) {
q = Quadrature::provideQuadrature(dim, deg); q = Quadrature::provideQuadrature(dim, deg);
} }
scalQuad = NEW ScalableQuadrature(q); scalQuad = new ScalableQuadrature(q);
nScalQPts = scalQuad->getNumPoints(); nScalQPts = scalQuad->getNumPoints();
...@@ -311,7 +311,7 @@ namespace AMDiS { ...@@ -311,7 +311,7 @@ namespace AMDiS {
// of the element and not an intersection point. Thus the level set // of the element and not an intersection point. Thus the level set
// function value of this vertex really is unequal to zero.) // function value of this vertex really is unequal to zero.)
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
0); 0);
...@@ -342,7 +342,7 @@ namespace AMDiS { ...@@ -342,7 +342,7 @@ namespace AMDiS {
nrm += el_norm; nrm += el_norm;
// Free data. // Free data.
DELETE subPolytope; delete subPolytope;
} }
else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) { else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) {
...@@ -360,7 +360,7 @@ namespace AMDiS { ...@@ -360,7 +360,7 @@ namespace AMDiS {
} // end of: mesh traverse } // end of: mesh traverse
DELETE scalQuad; delete scalQuad;
return nrm; return nrm;
} }
...@@ -390,7 +390,7 @@ namespace AMDiS { ...@@ -390,7 +390,7 @@ namespace AMDiS {
if (!q) { if (!q) {
q = Quadrature::provideQuadrature(dim, deg); q = Quadrature::provideQuadrature(dim, deg);
} }
scalQuad = NEW ScalableQuadrature(q); scalQuad = new ScalableQuadrature(q);
nScalQPts = scalQuad->getNumPoints(); nScalQPts = scalQuad->getNumPoints();
...@@ -429,7 +429,7 @@ namespace AMDiS { ...@@ -429,7 +429,7 @@ namespace AMDiS {
} }
} }
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
vertex_interior); vertex_interior);
...@@ -450,7 +450,7 @@ namespace AMDiS { ...@@ -450,7 +450,7 @@ namespace AMDiS {
// of the element and not an intersection point. Thus the level set // of the element and not an intersection point. Thus the level set
// function value of this vertex really is unequal to zero.) // function value of this vertex really is unequal to zero.)
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
0); 0);
...@@ -488,7 +488,7 @@ namespace AMDiS { ...@@ -488,7 +488,7 @@ namespace AMDiS {
} }
// Free data. // Free data.
DELETE subPolytope; delete subPolytope;
} }
else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) { else if (elStatus == ElementLevelSet::LEVEL_SET_INTERIOR) {
...@@ -507,7 +507,7 @@ namespace AMDiS { ...@@ -507,7 +507,7 @@ namespace AMDiS {
} // end of: mesh traverse } // end of: mesh traverse
DELETE scalQuad; delete scalQuad;
return nrm; return nrm;
} }
...@@ -536,7 +536,7 @@ namespace AMDiS { ...@@ -536,7 +536,7 @@ namespace AMDiS {
if (!q) { if (!q) {
q = Quadrature::provideQuadrature(dim, deg); q = Quadrature::provideQuadrature(dim, deg);
} }
scalQuad = NEW ScalableQuadrature(q); scalQuad = new ScalableQuadrature(q);
nScalQPts = scalQuad->getNumPoints(); nScalQPts = scalQuad->getNumPoints();
...@@ -573,7 +573,7 @@ namespace AMDiS { ...@@ -573,7 +573,7 @@ namespace AMDiS {
// of the element and not an intersection point. Thus the level set // of the element and not an intersection point. Thus the level set
// function value of this vertex really is unequal to zero.) // function value of this vertex really is unequal to zero.)
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
0); 0);
...@@ -604,14 +604,14 @@ namespace AMDiS { ...@@ -604,14 +604,14 @@ namespace AMDiS {
nrm += el_norm; nrm += el_norm;
// Free data. // Free data.
DELETE subPolytope; delete subPolytope;
} }
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} // end of: mesh traverse } // end of: mesh traverse
DELETE scalQuad; delete scalQuad;
return nrm; return nrm;
} }
...@@ -640,7 +640,7 @@ namespace AMDiS { ...@@ -640,7 +640,7 @@ namespace AMDiS {
if (!q) { if (!q) {
q = Quadrature::provideQuadrature(dim, deg); q = Quadrature::provideQuadrature(dim, deg);
} }
scalQuad = NEW ScalableQuadrature(q); scalQuad = new ScalableQuadrature(q);
nScalQPts = scalQuad->getNumPoints(); nScalQPts = scalQuad->getNumPoints();
...@@ -677,7 +677,7 @@ namespace AMDiS { ...@@ -677,7 +677,7 @@ namespace AMDiS {
// of the element and not an intersection point. Thus the level set // of the element and not an intersection point. Thus the level set
// function value of this vertex really is unequal to zero.) // function value of this vertex really is unequal to zero.)
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPts, intersecPts,
numIntersecPts, numIntersecPts,
0); 0);
...@@ -708,7 +708,7 @@ namespace AMDiS { ...@@ -708,7 +708,7 @@ namespace AMDiS {
nrm += el_norm; nrm += el_norm;
// Free data. // Free data.
DELETE subPolytope; delete subPolytope;
} }
else { else {
...@@ -727,7 +727,7 @@ namespace AMDiS { ...@@ -727,7 +727,7 @@ namespace AMDiS {
} // end of: mesh traverse } // end of: mesh traverse
DELETE scalQuad; delete scalQuad;
return nrm; return nrm;
} }
...@@ -742,7 +742,7 @@ namespace AMDiS { ...@@ -742,7 +742,7 @@ namespace AMDiS {
{ {
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);
int dim = elLS->getDim(); int dim = elLS->getDim();
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
...@@ -768,7 +768,7 @@ namespace AMDiS { ...@@ -768,7 +768,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -783,7 +783,7 @@ namespace AMDiS { ...@@ -783,7 +783,7 @@ namespace AMDiS {
{ {
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);
int dim = elLS->getDim(); int dim = elLS->getDim();
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
...@@ -809,7 +809,7 @@ namespace AMDiS { ...@@ -809,7 +809,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -836,7 +836,7 @@ namespace AMDiS { ...@@ -836,7 +836,7 @@ namespace AMDiS {
FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_Analyt"); FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_Analyt");
int dim = elLS->getDim(); int dim = elLS->getDim();
ElementH1Norm_Analyt *elNorm = NEW ElementH1Norm_Analyt(q, grd, dim); ElementH1Norm_Analyt *elNorm = new ElementH1Norm_Analyt(q, grd, dim);
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
("doesn't work for dimension of problem != dimension of world!\n"); ("doesn't work for dimension of problem != dimension of world!\n");
...@@ -861,7 +861,7 @@ namespace AMDiS { ...@@ -861,7 +861,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -886,7 +886,7 @@ namespace AMDiS { ...@@ -886,7 +886,7 @@ namespace AMDiS {
{ {
FUNCNAME("CFE_NormAndErrorFcts::L1Norm_DOF"); FUNCNAME("CFE_NormAndErrorFcts::L1Norm_DOF");
ElementL1Norm_DOF *elNorm = NEW ElementL1Norm_DOF(q, dof); ElementL1Norm_DOF *elNorm = new ElementL1Norm_DOF(q, dof);
int dim = elLS->getDim(); int dim = elLS->getDim();
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
...@@ -912,7 +912,7 @@ namespace AMDiS { ...@@ -912,7 +912,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -926,7 +926,7 @@ namespace AMDiS { ...@@ -926,7 +926,7 @@ namespace AMDiS {
{ {
FUNCNAME("CFE_NormAndErrorFcts::L2NormSquare_DOF"); FUNCNAME("CFE_NormAndErrorFcts::L2NormSquare_DOF");
ElementL2Norm_DOF *elNorm = NEW ElementL2Norm_DOF(q, dof); ElementL2Norm_DOF *elNorm = new ElementL2Norm_DOF(q, dof);
int dim = elLS->getDim(); int dim = elLS->getDim();
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
...@@ -952,7 +952,7 @@ namespace AMDiS { ...@@ -952,7 +952,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -977,7 +977,7 @@ namespace AMDiS { ...@@ -977,7 +977,7 @@ namespace AMDiS {
FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_DOF"); FUNCNAME("CFE_NormAndErrorFcts::H1NormSquare_DOF");
int dim = elLS->getDim(); int dim = elLS->getDim();
ElementH1Norm_DOF *elNorm = NEW ElementH1Norm_DOF(q, dof, dim); ElementH1Norm_DOF *elNorm = new ElementH1Norm_DOF(q, dof, dim);
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
("doesn't work for dimension of problem != dimension of world!\n"); ("doesn't work for dimension of problem != dimension of world!\n");
...@@ -1003,7 +1003,7 @@ namespace AMDiS { ...@@ -1003,7 +1003,7 @@ namespace AMDiS {
break; break;
} }
DELETE elNorm; delete elNorm;
return nrm; return nrm;
} }
...@@ -1030,7 +1030,7 @@ namespace AMDiS { ...@@ -1030,7 +1030,7 @@ namespace AMDiS {
{ {
FUNCNAME("CFE_NormAndErrorFcts::L2Err()"); FUNCNAME("CFE_NormAndErrorFcts::L2Err()");
ElementL2Err *elNorm = NEW ElementL2Err(q, u, uh, relErr); ElementL2Err *elNorm = new ElementL2Err(q, u, uh, relErr);
int dim = elLS->getDim(); int dim = elLS->getDim();
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
...@@ -1064,7 +1064,7 @@ namespace AMDiS { ...@@ -1064,7 +1064,7 @@ namespace AMDiS {
else else
err = L2_err_abs; err = L2_err_abs;
DELETE elNorm; delete elNorm;
return err; return err;
} }
...@@ -1082,7 +1082,7 @@ namespace AMDiS { ...@@ -1082,7 +1082,7 @@ namespace AMDiS {
FUNCNAME("CFE_NormAndErrorFcts::H1Err()"); FUNCNAME("CFE_NormAndErrorFcts::H1Err()");
int dim = elLS->getDim(); int dim = elLS->getDim();
ElementH1Err *elNorm = NEW ElementH1Err(q, u, uh, relErr, dim); ElementH1Err *elNorm = new ElementH1Err(q, u, uh, relErr, dim);
TEST_EXIT(dim == Global::getGeo(WORLD)) TEST_EXIT(dim == Global::getGeo(WORLD))
("doesn't work for dimension of problem != dimension of world!\n"); ("doesn't work for dimension of problem != dimension of world!\n");
...@@ -1116,7 +1116,7 @@ namespace AMDiS { ...@@ -1116,7 +1116,7 @@ namespace AMDiS {
else else
err = H1_err_abs; err = H1_err_abs;
DELETE elNorm; delete elNorm;
return err; return err;
} }
......
...@@ -52,7 +52,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo, ...@@ -52,7 +52,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo,
*/ */
if(!subElementAssembler) { if(!subElementAssembler) {
subElementAssembler = NEW SubElementAssembler(this, subElementAssembler = new SubElementAssembler(this,
rowFESpace, rowFESpace,
colFESpace); colFESpace);
} }
...@@ -61,7 +61,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo, ...@@ -61,7 +61,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo,
* Get intersection points. * Get intersection points.
*/ */
intersecPoints = elLS->getElIntersecPoints(); intersecPoints = elLS->getElIntersecPoints();
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPoints, intersecPoints,
elLS->getNumElIntersecPoints()); elLS->getNumElIntersecPoints());
...@@ -115,7 +115,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo, ...@@ -115,7 +115,7 @@ CompositeFEMOperator::getElementMatrix(const ElInfo *elInfo,
if (!assembler[myRank]) { if (!assembler[myRank]) {
assembler[myRank] = assembler[myRank] =
NEW StandardAssembler(this, NULL, NULL, NULL, NULL, rowFESpace, colFESpace); new StandardAssembler(this, NULL, NULL, NULL, NULL, rowFESpace, colFESpace);
} }
if (elLS->getLevelSetDomain() == if (elLS->getLevelSetDomain() ==
...@@ -190,7 +190,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo, ...@@ -190,7 +190,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo,
*/ */
if(!subElementAssembler) { if(!subElementAssembler) {
subElementAssembler = NEW SubElementAssembler(this, subElementAssembler = new SubElementAssembler(this,
rowFESpace, rowFESpace,
colFESpace); colFESpace);
} }
...@@ -199,7 +199,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo, ...@@ -199,7 +199,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo,
* Get intersection points. * Get intersection points.
*/ */
intersecPoints = elLS->getElIntersecPoints(); intersecPoints = elLS->getElIntersecPoints();
subPolytope = NEW SubPolytope(elInfo, subPolytope = new SubPolytope(elInfo,
intersecPoints, intersecPoints,
elLS->getNumElIntersecPoints()); elLS->getNumElIntersecPoints());
...@@ -250,7 +250,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo, ...@@ -250,7 +250,7 @@ CompositeFEMOperator::getElementVector(const ElInfo *elInfo,
if (!assembler[myRank]) { if (!assembler[myRank]) {
assembler[myRank] = assembler[myRank] =
NEW StandardAssembler(this, NULL, NULL, NULL, NULL, rowFESpace, colFESpace); new StandardAssembler(this, NULL, NULL, NULL, NULL, rowFESpace, colFESpace);
} }
if (elLS->getLevelSetDomain() == if (elLS->getLevelSetDomain() ==
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
~CompositeFEMOperator() ~CompositeFEMOperator()
{ {
if (subElementAssembler) if (subElementAssembler)
DELETE subElementAssembler;