Commit 93e7dbf0 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

removed DELETE and NEW

parent 4652297c
...@@ -22,25 +22,25 @@ namespace AMDiS { ...@@ -22,25 +22,25 @@ namespace AMDiS {
{ {
FUNCNAME("BasisFunction::BasisFunction()"); FUNCNAME("BasisFunction::BasisFunction()");
nDOF = NEW DimVec<int>(dim, DEFAULT_VALUE, -1); nDOF = new DimVec<int>(dim, DEFAULT_VALUE, -1);
dow = Global::getGeo(WORLD); dow = Global::getGeo(WORLD);
grdTmpVec1.resize(omp_get_overall_max_threads()); grdTmpVec1.resize(omp_get_overall_max_threads());
grdTmpVec2.resize(omp_get_overall_max_threads()); grdTmpVec2.resize(omp_get_overall_max_threads());
for (int i = 0; i < omp_get_overall_max_threads(); i++) { for (int i = 0; i < omp_get_overall_max_threads(); i++) {
grdTmpVec1[i] = NEW DimVec<double>(dim, DEFAULT_VALUE, 0.0); grdTmpVec1[i] = new DimVec<double>(dim, DEFAULT_VALUE, 0.0);
grdTmpVec2[i] = NEW DimVec<double>(dim, DEFAULT_VALUE, 0.0); grdTmpVec2[i] = new DimVec<double>(dim, DEFAULT_VALUE, 0.0);
} }
} }
BasisFunction::~BasisFunction() BasisFunction::~BasisFunction()
{ {
DELETE nDOF; delete nDOF;
for (int i = 0; i < static_cast<int>(grdTmpVec1.size()); i++) { for (int i = 0; i < static_cast<int>(grdTmpVec1.size()); i++) {
DELETE grdTmpVec1[i]; delete grdTmpVec1[i];
DELETE grdTmpVec2[i]; delete grdTmpVec2[i];
} }
} }
......
...@@ -22,7 +22,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p) ...@@ -22,7 +22,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p)
pT->resize(n); pT->resize(n);
} }
else else
pT = NEW Vector<double>(n); pT = new Vector<double>(n);
p = pT; p = pT;
} }
...@@ -75,7 +75,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, ...@@ -75,7 +75,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
x->resize(n); x->resize(n);
if (!x) if (!x)
x = NEW Vector<double>(n); x = new Vector<double>(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = NULL; static Vector<double> *pT = NULL;
...@@ -83,10 +83,10 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, ...@@ -83,10 +83,10 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
if (pT && pT->getSize() != n) if (pT && pT->getSize() != n)
DELETE pT; delete pT;
if (!pT) if (!pT)
pT = NEW Vector<double>(n); pT = new Vector<double>(n);
p = pT; p = pT;
...@@ -129,14 +129,14 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b, ...@@ -129,14 +129,14 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
x->resize(n); x->resize(n);
if (!x) if (!x)
x = NEW Vector<WorldVector<double> >(n); x = new Vector<WorldVector<double> >(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = NULL; static Vector<double> *pT = NULL;
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
pT = NEW Vector<double>(n); pT = new Vector<double>(n);
p = pT; p = pT;
success = factorization(A, p); success = factorization(A, p);
......
...@@ -41,7 +41,7 @@ namespace AMDiS { ...@@ -41,7 +41,7 @@ namespace AMDiS {
/****************************************************************************/ /****************************************************************************/
/* get a list for storing all elements at the coarsening edge and fill it */ /* get a list for storing all elements at the coarsening edge and fill it */
/****************************************************************************/ /****************************************************************************/
coarsenList = NEW RCNeighbourList(mesh->getMaxEdgeNeigh()); coarsenList = new RCNeighbourList(mesh->getMaxEdgeNeigh());
coarsenList->setCoarseningManager(this); coarsenList->setCoarseningManager(this);
/****************************************************************************/ /****************************************************************************/
...@@ -98,7 +98,7 @@ namespace AMDiS { ...@@ -98,7 +98,7 @@ namespace AMDiS {
} }
} }
DELETE coarsenList; delete coarsenList;
return 0; return 0;
} }
......
...@@ -21,23 +21,23 @@ namespace AMDiS { ...@@ -21,23 +21,23 @@ namespace AMDiS {
{ {
OEMSolverCreator *creator; OEMSolverCreator *creator;
creator = NEW CGSolver::Creator; creator = new CGSolver::Creator;
addCreator("cg", creator); addCreator("cg", creator);
creator = NEW BiCGSolver::Creator; creator = new BiCGSolver::Creator;
addCreator("bicg", creator); addCreator("bicg", creator);
creator = NEW BiCGStab::Creator; creator = new BiCGStab::Creator;
addCreator("bicgstab", creator); addCreator("bicgstab", creator);
creator = NEW BiCGStab2::Creator; creator = new BiCGStab2::Creator;
addCreator("bicgstab2", creator); addCreator("bicgstab2", creator);
creator = NEW BiCGStabEll::Creator; creator = new BiCGStabEll::Creator;
addCreator("bicgstab_ell", creator); addCreator("bicgstab_ell", creator);
#ifdef HAVE_UMFPACK #ifdef HAVE_UMFPACK
creator = NEW UmfPackSolver::Creator; creator = new UmfPackSolver::Creator;
addCreator("umfpack", creator); addCreator("umfpack", creator);
#endif #endif
} }
...@@ -47,16 +47,16 @@ namespace AMDiS { ...@@ -47,16 +47,16 @@ namespace AMDiS {
{ {
CreatorInterface<ITL_BasePreconditioner> *creator; CreatorInterface<ITL_BasePreconditioner> *creator;
creator = NEW DiagonalPreconditioner::Creator; creator = new DiagonalPreconditioner::Creator;
addCreator("diag", creator); addCreator("diag", creator);
creator = NEW ILUPreconditioner::Creator; creator = new ILUPreconditioner::Creator;
addCreator("ilu", creator); addCreator("ilu", creator);
creator = NEW ICPreconditioner::Creator; creator = new ICPreconditioner::Creator;
addCreator("ic", creator); addCreator("ic", creator);
creator = NEW IdentityPreconditioner::Creator; creator = new IdentityPreconditioner::Creator;
addCreator("no", creator); addCreator("no", creator);
} }
...@@ -66,10 +66,10 @@ namespace AMDiS { ...@@ -66,10 +66,10 @@ namespace AMDiS {
{ {
NonLinSolverCreator<DOFVector<double> > *creator; NonLinSolverCreator<DOFVector<double> > *creator;
creator = NEW Newton<DOFVector<double> >::Creator; creator = new Newton<DOFVector<double> >::Creator;
addCreator("newton", creator); addCreator("newton", creator);
creator = NEW NewtonS<DOFVector<double> >::Creator; creator = new NewtonS<DOFVector<double> >::Creator;
addCreator("newton_fs", creator); addCreator("newton_fs", creator);
} }
#endif #endif
...@@ -81,10 +81,10 @@ namespace AMDiS { ...@@ -81,10 +81,10 @@ namespace AMDiS {
{ {
NonLinSolverCreator<SystemVector> *creator; NonLinSolverCreator<SystemVector> *creator;
creator = NEW Newton<SystemVector>::Creator; creator = new Newton<SystemVector>::Creator;
addCreator("newton", creator); addCreator("newton", creator);
creator = NEW NewtonS<SystemVector>::Creator; creator = new NewtonS<SystemVector>::Creator;
addCreator("newton_fs", creator); addCreator("newton_fs", creator);
} }
#endif #endif
...@@ -94,10 +94,10 @@ namespace AMDiS { ...@@ -94,10 +94,10 @@ namespace AMDiS {
{ {
EstimatorCreator *creator; EstimatorCreator *creator;
creator = NEW ResidualEstimator::Creator; creator = new ResidualEstimator::Creator;
addCreator("residual", creator); addCreator("residual", creator);
creator = NEW RecoveryEstimator::Creator; creator = new RecoveryEstimator::Creator;
addCreator("recovery", creator); addCreator("recovery", creator);
} }
...@@ -106,25 +106,25 @@ namespace AMDiS { ...@@ -106,25 +106,25 @@ namespace AMDiS {
{ {
CreatorInterface<ElementData> *creator; CreatorInterface<ElementData> *creator;
creator = NEW LeafDataEstimatable::Creator; creator = new LeafDataEstimatable::Creator;
addCreator("LeafDataEstimatable", creator); addCreator("LeafDataEstimatable", creator);
creator = NEW LeafDataEstimatableVec::Creator; creator = new LeafDataEstimatableVec::Creator;
addCreator("LeafDataEstimatableVec", creator); addCreator("LeafDataEstimatableVec", creator);
creator = NEW LeafDataCoarsenable::Creator; creator = new LeafDataCoarsenable::Creator;
addCreator("LeafDataCoarsenable", creator); addCreator("LeafDataCoarsenable", creator);
creator = NEW LeafDataCoarsenableVec::Creator; creator = new LeafDataCoarsenableVec::Creator;
addCreator("LeafDataCoarsenableVec", creator); addCreator("LeafDataCoarsenableVec", creator);
creator = NEW LeafDataPeriodic::Creator; creator = new LeafDataPeriodic::Creator;
addCreator("LeafDataPeriodic", creator); addCreator("LeafDataPeriodic", creator);
creator = NEW SurfaceRegion_ED::Creator; creator = new SurfaceRegion_ED::Creator;
addCreator("SurfaceRegion_ED", creator); addCreator("SurfaceRegion_ED", creator);
creator = NEW ElementRegion_ED::Creator; creator = new ElementRegion_ED::Creator;
addCreator("ElementRegion_ED", creator); addCreator("ElementRegion_ED", creator);
} }
......
...@@ -8,6 +8,6 @@ namespace AMDiS { ...@@ -8,6 +8,6 @@ namespace AMDiS {
typename std::map< std::string, CreatorInterface<BaseClass>* >::iterator it; typename std::map< std::string, CreatorInterface<BaseClass>* >::iterator it;
for (it = creatorMap.begin(); it != creatorMap.end(); ++it) for (it = creatorMap.begin(); it != creatorMap.end(); ++it)
DELETE it->second; delete it->second;
} }
} }
...@@ -48,7 +48,7 @@ namespace AMDiS { ...@@ -48,7 +48,7 @@ namespace AMDiS {
if (rowFESpace && rowFESpace->getAdmin()) if (rowFESpace && rowFESpace->getAdmin())
(const_cast<DOFAdmin*>(rowFESpace->getAdmin()))->addDOFIndexed(this); (const_cast<DOFAdmin*>(rowFESpace->getAdmin()))->addDOFIndexed(this);
boundaryManager = NEW BoundaryManager(rowFESpace_); boundaryManager = new BoundaryManager(rowFESpace_);
nRow = rowFESpace->getBasisFcts()->getNumber(); nRow = rowFESpace->getBasisFcts()->getNumber();
nCol = colFESpace->getBasisFcts()->getNumber(); nCol = colFESpace->getBasisFcts()->getNumber();
...@@ -158,7 +158,7 @@ namespace AMDiS { ...@@ -158,7 +158,7 @@ namespace AMDiS {
matrix = rhs.matrix; matrix = rhs.matrix;
if (rhs.boundaryManager) { if (rhs.boundaryManager) {
boundaryManager = NEW BoundaryManager(*rhs.boundaryManager); boundaryManager = new BoundaryManager(*rhs.boundaryManager);
} else { } else {
boundaryManager = NULL; boundaryManager = NULL;
} }
......
...@@ -24,11 +24,11 @@ namespace AMDiS { ...@@ -24,11 +24,11 @@ namespace AMDiS {
// === get admin === // === get admin ===
localAdmin_ = const_cast<DOFAdmin*>(feSpace->getAdmin()); localAdmin_ = const_cast<DOFAdmin*>(feSpace->getAdmin());
// === create vertex info vector === // === create vertex info vector ===
vertexInfos_ = NEW DOFVector< std::list<VertexInfo> >(feSpace, "vertex infos"); vertexInfos_ = new DOFVector< std::list<VertexInfo> >(feSpace, "vertex infos");
interpPointInd_ = NEW DOFVector<int>(feSpace, "interpolation point indices"); interpPointInd_ = new DOFVector<int>(feSpace, "interpolation point indices");
interpPointCoords_ = NEW DOFVector< std::list<WorldVector<double> > >(feSpace, "interpolation point coordinates"); interpPointCoords_ = new DOFVector< std::list<WorldVector<double> > >(feSpace, "interpolation point coordinates");
dofCoords_ = NEW DOFVector< std::list<WorldVector<double> > >(feSpace, "dof coords"); dofCoords_ = new DOFVector< std::list<WorldVector<double> > >(feSpace, "dof coords");
dim_ = mesh_->getDim(); dim_ = mesh_->getDim();
...@@ -47,16 +47,16 @@ namespace AMDiS { ...@@ -47,16 +47,16 @@ namespace AMDiS {
valueDataCollected_ = false; valueDataCollected_ = false;
periodicDataCollected_ = false; periodicDataCollected_ = false;
vertexCoords = NEW WorldVector<double>; vertexCoords = new WorldVector<double>;
} }
DataCollector::~DataCollector() DataCollector::~DataCollector()
{ {
DELETE vertexInfos_; delete vertexInfos_;
DELETE interpPointInd_; delete interpPointInd_;
DELETE interpPointCoords_; delete interpPointCoords_;
DELETE dofCoords_; delete dofCoords_;
DELETE vertexCoords; delete vertexCoords;
} }
void DataCollector::fillAllData() void DataCollector::fillAllData()
......
...@@ -32,16 +32,16 @@ namespace AMDiS { ...@@ -32,16 +32,16 @@ namespace AMDiS {
ElInfo2d::ElInfo2d(Mesh *aMesh) ElInfo2d::ElInfo2d(Mesh *aMesh)
: ElInfo(aMesh) : ElInfo(aMesh)
{ {
e1 = NEW WorldVector<double>; e1 = new WorldVector<double>;
e2 = NEW WorldVector<double>; e2 = new WorldVector<double>;
normal = NEW WorldVector<double>; normal = new WorldVector<double>;
} }
ElInfo2d::~ElInfo2d() ElInfo2d::~ElInfo2d()
{ {
DELETE e1; delete e1;
DELETE e2; delete e2;
DELETE normal; delete normal;
} }
void ElInfo2d::fillMacroInfo(const MacroElement * mel) void ElInfo2d::fillMacroInfo(const MacroElement * mel)
......
...@@ -16,7 +16,7 @@ namespace AMDiS { ...@@ -16,7 +16,7 @@ namespace AMDiS {
ElInfoStack::~ElInfoStack() ElInfoStack::~ElInfoStack()
{ {
for (int i = 0; i < static_cast<int>(elInfoStack_.size()); i++) { for (int i = 0; i < static_cast<int>(elInfoStack_.size()); i++) {
DELETE elInfoStack_[i]; delete elInfoStack_[i];
} }
} }
......
...@@ -53,17 +53,17 @@ namespace AMDiS { ...@@ -53,17 +53,17 @@ namespace AMDiS {
Element::~Element() Element::~Element()
{ {
if (child[0]) if (child[0])
DELETE child[0]; delete child[0];
if (child[1]) if (child[1])
DELETE child[1]; delete child[1];
if (newCoord) if (newCoord)
DELETE newCoord; delete newCoord;
if (elementData) { if (elementData) {
elementData->deleteDecorated(); elementData->deleteDecorated();
DELETE elementData; delete elementData;
} }
} }
...@@ -75,7 +75,7 @@ namespace AMDiS { ...@@ -75,7 +75,7 @@ namespace AMDiS {
if (elementData->isOfType(typeID)) { if (elementData->isOfType(typeID)) {
ElementData *tmp = elementData; ElementData *tmp = elementData;
elementData = elementData->getDecorated(); elementData = elementData->getDecorated();
DELETE tmp; delete tmp;
tmp = NULL; tmp = NULL;
return true; return true;
} else { } else {
...@@ -126,18 +126,18 @@ namespace AMDiS { ...@@ -126,18 +126,18 @@ namespace AMDiS {
Element *el; Element *el;
if (isLine()) { if (isLine()) {
el = NEW Line(NULL); el = new Line(NULL);
} else if (isTriangle()) { } else if (isTriangle()) {
el = NEW Triangle(NULL); el = new Triangle(NULL);
} else { } else {
el = NEW Tetrahedron(NULL); el = new Tetrahedron(NULL);
} }
el->mesh = mesh; el->mesh = mesh;
el->index = index; el->index = index;
el->mark = mark; el->mark = mark;
if (newCoord) { if (newCoord) {
WorldVector<double> *nc = NEW WorldVector<double>(); WorldVector<double> *nc = new WorldVector<double>();
*nc = *newCoord; *nc = *newCoord;
el->newCoord = nc; el->newCoord = nc;
} }
...@@ -361,7 +361,7 @@ namespace AMDiS { ...@@ -361,7 +361,7 @@ namespace AMDiS {
void Element::eraseNewCoord() { void Element::eraseNewCoord() {
if (newCoord != NULL) { if (newCoord != NULL) {
DELETE newCoord; delete newCoord;
newCoord = NULL; newCoord = NULL;
} }
} }
...@@ -445,16 +445,16 @@ namespace AMDiS { ...@@ -445,16 +445,16 @@ namespace AMDiS {
if (typeName != "NULL") { if (typeName != "NULL") {
if (typeName == "Line") { if (typeName == "Line") {
child[0] = NEW Line(NULL); child[0] = new Line(NULL);
child[1] = NEW Line(NULL); child[1] = new Line(NULL);
} }
if (typeName == "Triangle") { if (typeName == "Triangle") {
child[0] = NEW Triangle(NULL); child[0] = new Triangle(NULL);
child[1] = NEW Triangle(NULL); child[1] = new Triangle(NULL);
} }
if (typeName == "Tetrahedron") { if (typeName == "Tetrahedron") {
child[0] = NEW Tetrahedron(NULL); child[0] = new Tetrahedron(NULL);
child[1] = NEW Tetrahedron(NULL); child[1] = new Tetrahedron(NULL);
} }
child[0]->deserialize(in); child[0]->deserialize(in);
child[1]->deserialize(in); child[1]->deserialize(in);
...@@ -505,7 +505,7 @@ namespace AMDiS { ...@@ -505,7 +505,7 @@ namespace AMDiS {
if (typeName != "NULL") { if (typeName != "NULL") {
if (typeName == "WorldVector") { if (typeName == "WorldVector") {
newCoord = NEW WorldVector<double>; newCoord = new WorldVector<double>;
newCoord->deserialize(in); newCoord->deserialize(in);
} else { } else {
ERROR_EXIT("unexpected type name\n"); ERROR_EXIT("unexpected type name\n");
......
...@@ -372,7 +372,7 @@ namespace AMDiS { ...@@ -372,7 +372,7 @@ namespace AMDiS {
bool remove = elementData->refineElementData(this, child1, child2, elType); bool remove = elementData->refineElementData(this, child1, child2, elType);
if (remove) { if (remove) {
ElementData *tmp = elementData->getDecorated(); ElementData *tmp = elementData->getDecorated();
DELETE elementData; delete elementData;
elementData = tmp; elementData = tmp;
} }
} }
...@@ -384,13 +384,13 @@ namespace AMDiS { ...@@ -384,13 +384,13 @@ namespace AMDiS {
childData = child1->getElementData(); childData = child1->getElementData();
if (childData) {