From 93e7dbf053230f5894cb537adc92b7fb92f961bb Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Mon, 25 May 2009 10:43:54 +0000 Subject: [PATCH] removed DELETE and NEW --- AMDiS/src/BasisFunction.cc | 12 +-- AMDiS/src/Cholesky.cc | 12 +-- AMDiS/src/CoarseningManager3d.cc | 4 +- AMDiS/src/CreatorMap.cc | 46 +++++----- AMDiS/src/CreatorMap.hh | 2 +- AMDiS/src/DOFMatrix.cc | 4 +- AMDiS/src/DataCollector.cc | 20 ++--- AMDiS/src/ElInfo2d.cc | 12 +-- AMDiS/src/ElInfoStack.cc | 2 +- AMDiS/src/Element.cc | 34 +++---- AMDiS/src/Element.h | 6 +- AMDiS/src/ElementData.cc | 2 +- AMDiS/src/ElementRegion_ED.h | 8 +- AMDiS/src/EmptyElementData.h | 8 +- AMDiS/src/FileWriter.cc | 10 +-- AMDiS/src/FiniteElemSpace.cc | 6 +- AMDiS/src/FirstOrderAssembler.cc | 12 +-- AMDiS/src/FixVec.cc | 2 +- AMDiS/src/FixVec.h | 16 ++-- AMDiS/src/Global.cc | 12 +-- AMDiS/src/Global.h | 4 +- AMDiS/src/GridWriter.hh | 8 +- AMDiS/src/ITL_OEMSolver.h | 4 +- AMDiS/src/ITL_Preconditioner.h | 2 +- AMDiS/src/LeafData.cc | 30 +++---- AMDiS/src/LeafData.h | 16 ++-- AMDiS/src/Line.h | 2 +- AMDiS/src/MacroElement.cc | 8 +- AMDiS/src/MacroReader.cc | 22 ++--- AMDiS/src/Marker.cc | 8 +- AMDiS/src/Mesh.cc | 46 +++++----- AMDiS/src/MeshStructure.cc | 6 +- AMDiS/src/MeshStructure_ED.h | 10 +-- AMDiS/src/MpCCIAdapter.cc | 4 +- AMDiS/src/Newton.h | 8 +- AMDiS/src/NewtonS.h | 8 +- AMDiS/src/Operator.hh | 6 +- AMDiS/src/ParMetisPartitioner.cc | 10 +-- AMDiS/src/ParallelProblem.cc | 44 ++++----- AMDiS/src/PardisoSolver.h | 2 +- AMDiS/src/PartitionElementData.h | 8 +- AMDiS/src/PeriodicBC.cc | 2 +- AMDiS/src/PeriodicConnection.h | 8 +- AMDiS/src/ProblemInstat.cc | 12 +-- AMDiS/src/ProblemNonLin.cc | 4 +- AMDiS/src/ProblemNonLin.h | 4 +- AMDiS/src/QPInfo.cc | 38 ++++---- AMDiS/src/QPsiPhi.cc | 12 +-- AMDiS/src/Quadrature.cc | 118 ++++++++++++------------- AMDiS/src/Quadrature.hh | 12 +-- AMDiS/src/RCNeighbourList.cc | 2 +- AMDiS/src/Recovery.cc | 72 +++++++-------- AMDiS/src/Recovery.h | 10 +-- AMDiS/src/RecoveryEstimator.cc | 10 +-- AMDiS/src/RecoveryEstimator.h | 2 +- AMDiS/src/RefinementManager.cc | 4 +- AMDiS/src/RefinementManager1d.cc | 2 +- AMDiS/src/RefinementManager3d.cc | 10 +-- AMDiS/src/ResidualEstimator.cc | 10 +-- AMDiS/src/ResidualEstimator.h | 2 +- AMDiS/src/ResidualParallelEstimator.cc | 4 +- AMDiS/src/ResidualParallelEstimator.h | 2 +- AMDiS/src/RobinBC.cc | 54 +++++------ AMDiS/src/ScalableQuadrature.cc | 2 +- AMDiS/src/ScalableQuadrature.h | 2 +- AMDiS/src/SolutionDataStorage.h | 8 +- AMDiS/src/SolutionDataStorage.hh | 6 +- AMDiS/src/SubAssembler.cc | 6 +- AMDiS/src/SubElInfo.cc | 2 +- AMDiS/src/SubElInfo.h | 2 +- AMDiS/src/SubQuadrature.h | 2 +- AMDiS/src/SurfaceAssembler.h | 16 ++-- AMDiS/src/SurfaceOperator.h | 8 +- AMDiS/src/SurfaceQuadrature.cc | 4 +- AMDiS/src/SurfaceRegion_ED.h | 8 +- AMDiS/src/SystemVector.h | 16 ++-- AMDiS/src/Tetrahedron.cc | 2 +- AMDiS/src/Tetrahedron.h | 2 +- AMDiS/src/Traverse.cc | 8 +- AMDiS/src/Traverse.h | 4 +- AMDiS/src/TraverseParallel.cc | 4 +- AMDiS/src/Triangle.h | 2 +- AMDiS/src/UmfPackSolver.h | 2 +- AMDiS/src/VtkWriter.cc | 8 +- AMDiS/src/ZeroOrderAssembler.cc | 6 +- 85 files changed, 500 insertions(+), 500 deletions(-) diff --git a/AMDiS/src/BasisFunction.cc b/AMDiS/src/BasisFunction.cc index 10aef95a..ac35530b 100644 --- a/AMDiS/src/BasisFunction.cc +++ b/AMDiS/src/BasisFunction.cc @@ -22,25 +22,25 @@ namespace AMDiS { { FUNCNAME("BasisFunction::BasisFunction()"); - nDOF = NEW DimVec<int>(dim, DEFAULT_VALUE, -1); + nDOF = new DimVec<int>(dim, DEFAULT_VALUE, -1); dow = Global::getGeo(WORLD); grdTmpVec1.resize(omp_get_overall_max_threads()); grdTmpVec2.resize(omp_get_overall_max_threads()); for (int i = 0; i < omp_get_overall_max_threads(); i++) { - grdTmpVec1[i] = NEW DimVec<double>(dim, DEFAULT_VALUE, 0.0); - grdTmpVec2[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); } } BasisFunction::~BasisFunction() { - DELETE nDOF; + delete nDOF; for (int i = 0; i < static_cast<int>(grdTmpVec1.size()); i++) { - DELETE grdTmpVec1[i]; - DELETE grdTmpVec2[i]; + delete grdTmpVec1[i]; + delete grdTmpVec2[i]; } } diff --git a/AMDiS/src/Cholesky.cc b/AMDiS/src/Cholesky.cc index 79242413..50f5ef58 100644 --- a/AMDiS/src/Cholesky.cc +++ b/AMDiS/src/Cholesky.cc @@ -22,7 +22,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p) pT->resize(n); } else - pT = NEW Vector<double>(n); + pT = new Vector<double>(n); p = pT; } @@ -75,7 +75,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, x->resize(n); if (!x) - x = NEW Vector<double>(n); + x = new Vector<double>(n); // Checking vector P. static Vector<double> *pT = NULL; @@ -83,10 +83,10 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, if (!p || (p->getSize() != n)) { if (pT && pT->getSize() != n) - DELETE pT; + delete pT; if (!pT) - pT = NEW Vector<double>(n); + pT = new Vector<double>(n); p = pT; @@ -129,14 +129,14 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b, x->resize(n); if (!x) - x = NEW Vector<WorldVector<double> >(n); + x = new Vector<WorldVector<double> >(n); // Checking vector P. static Vector<double> *pT = NULL; if (!p || (p->getSize() != n)) { - pT = NEW Vector<double>(n); + pT = new Vector<double>(n); p = pT; success = factorization(A, p); diff --git a/AMDiS/src/CoarseningManager3d.cc b/AMDiS/src/CoarseningManager3d.cc index 771c9031..530387d6 100644 --- a/AMDiS/src/CoarseningManager3d.cc +++ b/AMDiS/src/CoarseningManager3d.cc @@ -41,7 +41,7 @@ namespace AMDiS { /****************************************************************************/ /* 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); /****************************************************************************/ @@ -98,7 +98,7 @@ namespace AMDiS { } } - DELETE coarsenList; + delete coarsenList; return 0; } diff --git a/AMDiS/src/CreatorMap.cc b/AMDiS/src/CreatorMap.cc index 42eb703f..e4feef8c 100644 --- a/AMDiS/src/CreatorMap.cc +++ b/AMDiS/src/CreatorMap.cc @@ -21,23 +21,23 @@ namespace AMDiS { { OEMSolverCreator *creator; - creator = NEW CGSolver::Creator; + creator = new CGSolver::Creator; addCreator("cg", creator); - creator = NEW BiCGSolver::Creator; + creator = new BiCGSolver::Creator; addCreator("bicg", creator); - creator = NEW BiCGStab::Creator; + creator = new BiCGStab::Creator; addCreator("bicgstab", creator); - creator = NEW BiCGStab2::Creator; + creator = new BiCGStab2::Creator; addCreator("bicgstab2", creator); - creator = NEW BiCGStabEll::Creator; + creator = new BiCGStabEll::Creator; addCreator("bicgstab_ell", creator); #ifdef HAVE_UMFPACK - creator = NEW UmfPackSolver::Creator; + creator = new UmfPackSolver::Creator; addCreator("umfpack", creator); #endif } @@ -47,16 +47,16 @@ namespace AMDiS { { CreatorInterface<ITL_BasePreconditioner> *creator; - creator = NEW DiagonalPreconditioner::Creator; + creator = new DiagonalPreconditioner::Creator; addCreator("diag", creator); - creator = NEW ILUPreconditioner::Creator; + creator = new ILUPreconditioner::Creator; addCreator("ilu", creator); - creator = NEW ICPreconditioner::Creator; + creator = new ICPreconditioner::Creator; addCreator("ic", creator); - creator = NEW IdentityPreconditioner::Creator; + creator = new IdentityPreconditioner::Creator; addCreator("no", creator); } @@ -66,10 +66,10 @@ namespace AMDiS { { NonLinSolverCreator<DOFVector<double> > *creator; - creator = NEW Newton<DOFVector<double> >::Creator; + creator = new Newton<DOFVector<double> >::Creator; addCreator("newton", creator); - creator = NEW NewtonS<DOFVector<double> >::Creator; + creator = new NewtonS<DOFVector<double> >::Creator; addCreator("newton_fs", creator); } #endif @@ -81,10 +81,10 @@ namespace AMDiS { { NonLinSolverCreator<SystemVector> *creator; - creator = NEW Newton<SystemVector>::Creator; + creator = new Newton<SystemVector>::Creator; addCreator("newton", creator); - creator = NEW NewtonS<SystemVector>::Creator; + creator = new NewtonS<SystemVector>::Creator; addCreator("newton_fs", creator); } #endif @@ -94,10 +94,10 @@ namespace AMDiS { { EstimatorCreator *creator; - creator = NEW ResidualEstimator::Creator; + creator = new ResidualEstimator::Creator; addCreator("residual", creator); - creator = NEW RecoveryEstimator::Creator; + creator = new RecoveryEstimator::Creator; addCreator("recovery", creator); } @@ -106,25 +106,25 @@ namespace AMDiS { { CreatorInterface<ElementData> *creator; - creator = NEW LeafDataEstimatable::Creator; + creator = new LeafDataEstimatable::Creator; addCreator("LeafDataEstimatable", creator); - creator = NEW LeafDataEstimatableVec::Creator; + creator = new LeafDataEstimatableVec::Creator; addCreator("LeafDataEstimatableVec", creator); - creator = NEW LeafDataCoarsenable::Creator; + creator = new LeafDataCoarsenable::Creator; addCreator("LeafDataCoarsenable", creator); - creator = NEW LeafDataCoarsenableVec::Creator; + creator = new LeafDataCoarsenableVec::Creator; addCreator("LeafDataCoarsenableVec", creator); - creator = NEW LeafDataPeriodic::Creator; + creator = new LeafDataPeriodic::Creator; addCreator("LeafDataPeriodic", creator); - creator = NEW SurfaceRegion_ED::Creator; + creator = new SurfaceRegion_ED::Creator; addCreator("SurfaceRegion_ED", creator); - creator = NEW ElementRegion_ED::Creator; + creator = new ElementRegion_ED::Creator; addCreator("ElementRegion_ED", creator); } diff --git a/AMDiS/src/CreatorMap.hh b/AMDiS/src/CreatorMap.hh index 945e5709..ff3700c8 100644 --- a/AMDiS/src/CreatorMap.hh +++ b/AMDiS/src/CreatorMap.hh @@ -8,6 +8,6 @@ namespace AMDiS { typename std::map< std::string, CreatorInterface<BaseClass>* >::iterator it; for (it = creatorMap.begin(); it != creatorMap.end(); ++it) - DELETE it->second; + delete it->second; } } diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc index 04716a56..85e4affa 100644 --- a/AMDiS/src/DOFMatrix.cc +++ b/AMDiS/src/DOFMatrix.cc @@ -48,7 +48,7 @@ namespace AMDiS { if (rowFESpace && rowFESpace->getAdmin()) (const_cast<DOFAdmin*>(rowFESpace->getAdmin()))->addDOFIndexed(this); - boundaryManager = NEW BoundaryManager(rowFESpace_); + boundaryManager = new BoundaryManager(rowFESpace_); nRow = rowFESpace->getBasisFcts()->getNumber(); nCol = colFESpace->getBasisFcts()->getNumber(); @@ -158,7 +158,7 @@ namespace AMDiS { matrix = rhs.matrix; if (rhs.boundaryManager) { - boundaryManager = NEW BoundaryManager(*rhs.boundaryManager); + boundaryManager = new BoundaryManager(*rhs.boundaryManager); } else { boundaryManager = NULL; } diff --git a/AMDiS/src/DataCollector.cc b/AMDiS/src/DataCollector.cc index c711e9d8..4370b3b4 100644 --- a/AMDiS/src/DataCollector.cc +++ b/AMDiS/src/DataCollector.cc @@ -24,11 +24,11 @@ namespace AMDiS { // === get admin === localAdmin_ = const_cast<DOFAdmin*>(feSpace->getAdmin()); // === 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"); - interpPointCoords_ = NEW DOFVector< std::list<WorldVector<double> > >(feSpace, "interpolation point coordinates"); - dofCoords_ = NEW DOFVector< std::list<WorldVector<double> > >(feSpace, "dof coords"); + interpPointInd_ = new DOFVector<int>(feSpace, "interpolation point indices"); + interpPointCoords_ = new DOFVector< std::list<WorldVector<double> > >(feSpace, "interpolation point coordinates"); + dofCoords_ = new DOFVector< std::list<WorldVector<double> > >(feSpace, "dof coords"); dim_ = mesh_->getDim(); @@ -47,16 +47,16 @@ namespace AMDiS { valueDataCollected_ = false; periodicDataCollected_ = false; - vertexCoords = NEW WorldVector<double>; + vertexCoords = new WorldVector<double>; } DataCollector::~DataCollector() { - DELETE vertexInfos_; - DELETE interpPointInd_; - DELETE interpPointCoords_; - DELETE dofCoords_; - DELETE vertexCoords; + delete vertexInfos_; + delete interpPointInd_; + delete interpPointCoords_; + delete dofCoords_; + delete vertexCoords; } void DataCollector::fillAllData() diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc index 8bcea08e..6f1accf3 100644 --- a/AMDiS/src/ElInfo2d.cc +++ b/AMDiS/src/ElInfo2d.cc @@ -32,16 +32,16 @@ namespace AMDiS { ElInfo2d::ElInfo2d(Mesh *aMesh) : ElInfo(aMesh) { - e1 = NEW WorldVector<double>; - e2 = NEW WorldVector<double>; - normal = NEW WorldVector<double>; + e1 = new WorldVector<double>; + e2 = new WorldVector<double>; + normal = new WorldVector<double>; } ElInfo2d::~ElInfo2d() { - DELETE e1; - DELETE e2; - DELETE normal; + delete e1; + delete e2; + delete normal; } void ElInfo2d::fillMacroInfo(const MacroElement * mel) diff --git a/AMDiS/src/ElInfoStack.cc b/AMDiS/src/ElInfoStack.cc index 56c852ee..1486ea4b 100644 --- a/AMDiS/src/ElInfoStack.cc +++ b/AMDiS/src/ElInfoStack.cc @@ -16,7 +16,7 @@ namespace AMDiS { ElInfoStack::~ElInfoStack() { for (int i = 0; i < static_cast<int>(elInfoStack_.size()); i++) { - DELETE elInfoStack_[i]; + delete elInfoStack_[i]; } } diff --git a/AMDiS/src/Element.cc b/AMDiS/src/Element.cc index 947d6700..6bc7b180 100644 --- a/AMDiS/src/Element.cc +++ b/AMDiS/src/Element.cc @@ -53,17 +53,17 @@ namespace AMDiS { Element::~Element() { if (child[0]) - DELETE child[0]; + delete child[0]; if (child[1]) - DELETE child[1]; + delete child[1]; if (newCoord) - DELETE newCoord; + delete newCoord; if (elementData) { elementData->deleteDecorated(); - DELETE elementData; + delete elementData; } } @@ -75,7 +75,7 @@ namespace AMDiS { if (elementData->isOfType(typeID)) { ElementData *tmp = elementData; elementData = elementData->getDecorated(); - DELETE tmp; + delete tmp; tmp = NULL; return true; } else { @@ -126,18 +126,18 @@ namespace AMDiS { Element *el; if (isLine()) { - el = NEW Line(NULL); + el = new Line(NULL); } else if (isTriangle()) { - el = NEW Triangle(NULL); + el = new Triangle(NULL); } else { - el = NEW Tetrahedron(NULL); + el = new Tetrahedron(NULL); } el->mesh = mesh; el->index = index; el->mark = mark; if (newCoord) { - WorldVector<double> *nc = NEW WorldVector<double>(); + WorldVector<double> *nc = new WorldVector<double>(); *nc = *newCoord; el->newCoord = nc; } @@ -361,7 +361,7 @@ namespace AMDiS { void Element::eraseNewCoord() { if (newCoord != NULL) { - DELETE newCoord; + delete newCoord; newCoord = NULL; } } @@ -445,16 +445,16 @@ namespace AMDiS { if (typeName != "NULL") { if (typeName == "Line") { - child[0] = NEW Line(NULL); - child[1] = NEW Line(NULL); + child[0] = new Line(NULL); + child[1] = new Line(NULL); } if (typeName == "Triangle") { - child[0] = NEW Triangle(NULL); - child[1] = NEW Triangle(NULL); + child[0] = new Triangle(NULL); + child[1] = new Triangle(NULL); } if (typeName == "Tetrahedron") { - child[0] = NEW Tetrahedron(NULL); - child[1] = NEW Tetrahedron(NULL); + child[0] = new Tetrahedron(NULL); + child[1] = new Tetrahedron(NULL); } child[0]->deserialize(in); child[1]->deserialize(in); @@ -505,7 +505,7 @@ namespace AMDiS { if (typeName != "NULL") { if (typeName == "WorldVector") { - newCoord = NEW WorldVector<double>; + newCoord = new WorldVector<double>; newCoord->deserialize(in); } else { ERROR_EXIT("unexpected type name\n"); diff --git a/AMDiS/src/Element.h b/AMDiS/src/Element.h index 11f3bdef..de0bc81d 100644 --- a/AMDiS/src/Element.h +++ b/AMDiS/src/Element.h @@ -372,7 +372,7 @@ namespace AMDiS { bool remove = elementData->refineElementData(this, child1, child2, elType); if (remove) { ElementData *tmp = elementData->getDecorated(); - DELETE elementData; + delete elementData; elementData = tmp; } } @@ -384,13 +384,13 @@ namespace AMDiS { childData = child1->getElementData(); if (childData) { childData->coarsenElementData(this, child1, child2, elType); - DELETE childData; + delete childData; child1->setElementData(NULL); } childData = child2->getElementData(); if (childData) { childData->coarsenElementData(this, child2, child1, elType); - DELETE childData; + delete childData; child2->setElementData(NULL); } } diff --git a/AMDiS/src/ElementData.cc b/AMDiS/src/ElementData.cc index 7fb102c0..e0253c5a 100644 --- a/AMDiS/src/ElementData.cc +++ b/AMDiS/src/ElementData.cc @@ -42,7 +42,7 @@ namespace AMDiS { { if (decorated_) { decorated_->deleteDecorated(); - DELETE decorated_; + delete decorated_; } } diff --git a/AMDiS/src/ElementRegion_ED.h b/AMDiS/src/ElementRegion_ED.h index d4a9724d..0a04513d 100644 --- a/AMDiS/src/ElementRegion_ED.h +++ b/AMDiS/src/ElementRegion_ED.h @@ -41,7 +41,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW ElementRegion_ED; + return new ElementRegion_ED; } }; @@ -59,11 +59,11 @@ namespace AMDiS { ElementRegion_ED *ep; - ep = NEW ElementRegion_ED(child1->getElementData()); + ep = new ElementRegion_ED(child1->getElementData()); ep->region_ = region_; child1->setElementData(ep); - ep = NEW ElementRegion_ED(child2->getElementData()); + ep = new ElementRegion_ED(child2->getElementData()); ep->region_ = region_; child2->setElementData(ep); @@ -71,7 +71,7 @@ namespace AMDiS { } ElementData *clone() const { - ElementRegion_ED *newObj = NEW ElementRegion_ED; + ElementRegion_ED *newObj = new ElementRegion_ED; newObj->region_ = region_; newObj->decorated_ = ElementData::clone(); return newObj; diff --git a/AMDiS/src/EmptyElementData.h b/AMDiS/src/EmptyElementData.h index 72a58cea..283672c6 100644 --- a/AMDiS/src/EmptyElementData.h +++ b/AMDiS/src/EmptyElementData.h @@ -44,7 +44,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW EmptyElementData; + return new EmptyElementData; } }; @@ -58,13 +58,13 @@ namespace AMDiS { int elType) { ElementData::refineElementData(parent, child1, child2, elType); - child1->setElementData(NEW EmptyElementData(child1->getElementData())); - child2->setElementData(NEW EmptyElementData(child2->getElementData())); + child1->setElementData(new EmptyElementData(child1->getElementData())); + child2->setElementData(new EmptyElementData(child2->getElementData())); return false; } ElementData *clone() const { - EmptyElementData *newObj = NEW EmptyElementData; + EmptyElementData *newObj = new EmptyElementData; newObj->decorated_ = ElementData::clone(); return newObj; } diff --git a/AMDiS/src/FileWriter.cc b/AMDiS/src/FileWriter.cc index aee4d2c1..a7f24c2e 100644 --- a/AMDiS/src/FileWriter.cc +++ b/AMDiS/src/FileWriter.cc @@ -66,7 +66,7 @@ namespace AMDiS { nTmpSolutions_ = (*vec)[0].getSize(); solutionVecs_.resize(nTmpSolutions_); for (int i = 0; i < nTmpSolutions_; i++) { - solutionVecs_[i] = NEW DOFVector<double>(vec->getFESpace(), ""); + solutionVecs_[i] = new DOFVector<double>(vec->getFESpace(), ""); } // Copy the components of the WorldVectors to different DOFVectors @@ -89,7 +89,7 @@ namespace AMDiS { // some created in the constructor. if (nTmpSolutions_ > 0) { for (int i = 0; i < nTmpSolutions_; i++) { - DELETE solutionVecs_[i]; + delete solutionVecs_[i]; } } } @@ -167,12 +167,12 @@ namespace AMDiS { if (writeElem) { for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) { - dataCollectors[i] = NEW DataCollector(feSpace, solutionVecs_[i], + dataCollectors[i] = new DataCollector(feSpace, solutionVecs_[i], level, flag, writeElem); } } else { for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) { - dataCollectors[i] = NEW DataCollector(feSpace, solutionVecs_[i], + dataCollectors[i] = new DataCollector(feSpace, solutionVecs_[i], traverseLevel, flag | traverseFlag, writeElement); @@ -247,7 +247,7 @@ namespace AMDiS { for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) { - DELETE dataCollectors[i]; + delete dataCollectors[i]; } } diff --git a/AMDiS/src/FiniteElemSpace.cc b/AMDiS/src/FiniteElemSpace.cc index 03d59689..8fd00e8f 100644 --- a/AMDiS/src/FiniteElemSpace.cc +++ b/AMDiS/src/FiniteElemSpace.cc @@ -58,7 +58,7 @@ namespace AMDiS { if (&feSpace == this) return *this; - mesh = NEW Mesh(feSpace.mesh->getName(), feSpace.mesh->getDim()); + mesh = new Mesh(feSpace.mesh->getName(), feSpace.mesh->getDim()); *mesh = *(feSpace.mesh); admin = &(const_cast<DOFAdmin&>(mesh->getDOFAdmin(0))); basFcts = feSpace.basFcts; @@ -92,7 +92,7 @@ namespace AMDiS { ERROR_EXIT("no fespace found for this admin\n"); return NULL; } else { - return NEW FiniteElemSpace(NULL, basFcts, mesh, name_); + return new FiniteElemSpace(NULL, basFcts, mesh, name_); } } @@ -107,7 +107,7 @@ namespace AMDiS { { for (int i = 0; i < static_cast<int>(feSpaces.size()); i++) { if (feSpaces[i]) { - DELETE feSpaces[i]; + delete feSpaces[i]; feSpaces[i] = NULL; } } diff --git a/AMDiS/src/FirstOrderAssembler.cc b/AMDiS/src/FirstOrderAssembler.cc index 2493b16c..5f00577c 100644 --- a/AMDiS/src/FirstOrderAssembler.cc +++ b/AMDiS/src/FirstOrderAssembler.cc @@ -81,19 +81,19 @@ namespace AMDiS { if (!optimized) { newAssembler = (type == GRD_PSI) ? - dynamic_cast<FirstOrderAssembler*>(NEW Stand10(op, assembler, quad)) : - dynamic_cast<FirstOrderAssembler*>(NEW Stand01(op, assembler, quad)); + dynamic_cast<FirstOrderAssembler*>(new Stand10(op, assembler, quad)) : + dynamic_cast<FirstOrderAssembler*>(new Stand01(op, assembler, quad)); } else { if (pwConst) { newAssembler = (type == GRD_PSI) ? - dynamic_cast<FirstOrderAssembler*>(NEW Pre10(op, assembler, quad)) : - dynamic_cast<FirstOrderAssembler*>(NEW Pre01(op, assembler, quad)); + dynamic_cast<FirstOrderAssembler*>(new Pre10(op, assembler, quad)) : + dynamic_cast<FirstOrderAssembler*>(new Pre01(op, assembler, quad)); } else { newAssembler = (type == GRD_PSI) ? - dynamic_cast<FirstOrderAssembler*>(NEW Quad10(op, assembler, quad)) : - dynamic_cast<FirstOrderAssembler*>(NEW Quad01(op, assembler, quad)); + dynamic_cast<FirstOrderAssembler*>(new Quad10(op, assembler, quad)) : + dynamic_cast<FirstOrderAssembler*>(new Quad01(op, assembler, quad)); } } diff --git a/AMDiS/src/FixVec.cc b/AMDiS/src/FixVec.cc index ed37d418..e087e080 100644 --- a/AMDiS/src/FixVec.cc +++ b/AMDiS/src/FixVec.cc @@ -8,7 +8,7 @@ namespace AMDiS { va_list arg; va_start(arg, size); VectorOfFixVecs<DimVec<double> > *result = - NEW VectorOfFixVecs<DimVec<double> >(dim, size, NO_INIT); + new VectorOfFixVecs<DimVec<double> >(dim, size, NO_INIT); for (int i = 0; i < size; i++) { for (int j = 0; j < dim + 1; j++) { (*result)[i][j] = va_arg(arg, double); diff --git a/AMDiS/src/FixVec.h b/AMDiS/src/FixVec.h index 7940a557..7b189d98 100644 --- a/AMDiS/src/FixVec.h +++ b/AMDiS/src/FixVec.h @@ -148,7 +148,7 @@ namespace AMDiS { vec.resize(size); for (int i = 0; i < size; i++) - vec[i] = NEW FixVecType(dim, NO_INIT); + vec[i] = new FixVecType(dim, NO_INIT); } /** \brief @@ -164,7 +164,7 @@ namespace AMDiS { vec.resize(size); for (int i = 0; i < size; i++) - vec[i] = NEW FixVecType(ini[i]); + vec[i] = new FixVecType(ini[i]); } /** \brief @@ -180,7 +180,7 @@ namespace AMDiS { vec.resize(size); for (int i = 0; i < size; i++) - vec[i] = NEW FixVecType(ini); + vec[i] = new FixVecType(ini); } /// Copy constructor @@ -191,14 +191,14 @@ namespace AMDiS { vec.resize(size); for (int i = 0; i < size; i++) - vec[i] = NEW FixVecType(*(rhs.vec[i])); + vec[i] = new FixVecType(*(rhs.vec[i])); } /// Destructor virtual ~VectorOfFixVecs() { for (int i = 0; i < size; i++) - DELETE vec[i]; + delete vec[i]; vec.clear(); } @@ -234,7 +234,7 @@ namespace AMDiS { { vec.resize(newsize); for (int i = size; i < newsize; i++) - vec[i] = NEW FixVecType(dim, NO_INIT); + vec[i] = new FixVecType(dim, NO_INIT); size = newsize; } @@ -288,7 +288,7 @@ namespace AMDiS { TEST_EXIT_DBG(initType == NO_INIT)("wrong initType or wrong initializer\n"); vec = GET_MEMORY(VectorOfFixVecs<FixVecType>*, rows); for (VectorOfFixVecs<FixVecType>** i = &vec[0]; i < &vec[rows]; i++) { - *i = NEW VectorOfFixVecs<FixVecType>(dim, columns, NO_INIT); + *i = new VectorOfFixVecs<FixVecType>(dim, columns, NO_INIT); } } @@ -296,7 +296,7 @@ namespace AMDiS { virtual ~MatrixOfFixVecs() { for (VectorOfFixVecs<FixVecType>** i = &vec[0]; i < &vec[rows]; i++) { - DELETE *i; + delete *i; } FREE_MEMORY(vec, VectorOfFixVecs<FixVecType>*, rows); } diff --git a/AMDiS/src/Global.cc b/AMDiS/src/Global.cc index 62b4a203..11923f55 100644 --- a/AMDiS/src/Global.cc +++ b/AMDiS/src/Global.cc @@ -22,9 +22,9 @@ namespace AMDiS { Element *Global::referenceElement[4] = { NULL, - NEW Line(NULL), - NEW Triangle(NULL), - NEW Tetrahedron(NULL) + new Line(NULL), + new Triangle(NULL), + new Tetrahedron(NULL) }; void Msg::wait(bool w) @@ -326,9 +326,9 @@ namespace AMDiS { void Global::clear() { - DELETE referenceElement[1]; - DELETE referenceElement[2]; - DELETE referenceElement[3]; + delete referenceElement[1]; + delete referenceElement[2]; + delete referenceElement[3]; } int fac(int i) diff --git a/AMDiS/src/Global.h b/AMDiS/src/Global.h index b6778ff3..ccb1a6a1 100644 --- a/AMDiS/src/Global.h +++ b/AMDiS/src/Global.h @@ -417,8 +417,8 @@ namespace AMDiS { }; #define MEMORY_MANAGED(className) ; -#define NEW new -#define DELETE delete +#define new new +#define delete delete #define GET_MEMORY(typename, number) new typename[number] #define FREE_MEMORY(ptr, typename, number) delete [] ptr diff --git a/AMDiS/src/GridWriter.hh b/AMDiS/src/GridWriter.hh index fd6419e4..c15e3341 100644 --- a/AMDiS/src/GridWriter.hh +++ b/AMDiS/src/GridWriter.hh @@ -26,9 +26,9 @@ namespace AMDiS { ("not for DIM != DIM_OF_WORLD\n"); - WorldVector<double> *basis = NEW WorldVector<double>[dim]; + WorldVector<double> *basis = new WorldVector<double>[dim]; double *lengthBasis = GET_MEMORY(double, dim); - WorldVector<double> *step = NEW WorldVector<double>[3]; + WorldVector<double> *step = new WorldVector<double>[3]; for (int i = 0; i < dim; i++) { TEST_EXIT(numPoints[i] > 0)("numPoints < 1\n"); @@ -120,9 +120,9 @@ namespace AMDiS { if (localNumPoints[1] > 1) (*outFile) << std::endl; } - DELETE [] basis; + delete [] basis; FREE_MEMORY(lengthBasis, double, dim); - DELETE [] step; + delete [] step; delete outFile; } diff --git a/AMDiS/src/ITL_OEMSolver.h b/AMDiS/src/ITL_OEMSolver.h index 2e4361f9..3c4c0a1f 100644 --- a/AMDiS/src/ITL_OEMSolver.h +++ b/AMDiS/src/ITL_OEMSolver.h @@ -75,7 +75,7 @@ namespace AMDiS { /// Returns a new CGSolver object. OEMSolver* create() { - return NEW ITL_OEMSolver<ITLSolver>(this->name); + return new ITL_OEMSolver<ITLSolver>(this->name); } }; @@ -123,7 +123,7 @@ namespace AMDiS { /// Returns a new CGSolver object. OEMSolver* create() { - return NEW ITL_OEMSolver_para<ITLSolver>(this->name); + return new ITL_OEMSolver_para<ITLSolver>(this->name); } }; diff --git a/AMDiS/src/ITL_Preconditioner.h b/AMDiS/src/ITL_Preconditioner.h index e77bd221..a4cfd67b 100644 --- a/AMDiS/src/ITL_Preconditioner.h +++ b/AMDiS/src/ITL_Preconditioner.h @@ -101,7 +101,7 @@ namespace AMDiS { * Creates an ITL preconditioner */ ITL_BasePreconditioner *create(const DOFMatrix::base_matrix_type& A) { - return NEW ITL_Preconditioner<Preconditioner>(A); + return new ITL_Preconditioner<Preconditioner>(A); } ITL_BasePreconditioner *create() { diff --git a/AMDiS/src/LeafData.cc b/AMDiS/src/LeafData.cc index f29d3e7f..0ffabbd9 100644 --- a/AMDiS/src/LeafData.cc +++ b/AMDiS/src/LeafData.cc @@ -13,9 +13,9 @@ namespace AMDiS { ElementData::refineElementData(parent, child1, child2, elType); LeafDataEstimatable *child1Data = - NEW LeafDataEstimatable(child1->getElementData()); + new LeafDataEstimatable(child1->getElementData()); LeafDataEstimatable *child2Data = - NEW LeafDataEstimatable(child2->getElementData()); + new LeafDataEstimatable(child2->getElementData()); child1Data->setErrorEstimate(0, errorEstimate / 2.0); child2Data->setErrorEstimate(0, errorEstimate / 2.0); @@ -38,7 +38,7 @@ namespace AMDiS { otherChild->deleteElementData(ESTIMATABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataEstimatable at otherChild"); - parent->setElementData(NEW LeafDataEstimatable(parent->getElementData())); + parent->setElementData(new LeafDataEstimatable(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); } @@ -49,8 +49,8 @@ namespace AMDiS { { ElementData::refineElementData(parent, child1, child2, elType); - child1->setElementData(NEW LeafDataEstimatableVec(child1->getElementData())); - child2->setElementData(NEW LeafDataEstimatableVec(child2->getElementData())); + child1->setElementData(new LeafDataEstimatableVec(child1->getElementData())); + child2->setElementData(new LeafDataEstimatableVec(child2->getElementData())); return true; } @@ -63,7 +63,7 @@ namespace AMDiS { { DBG_VAR(bool test =) otherChild->deleteElementData(ESTIMATABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataEstimatableVec at otherChild"); - parent->setElementData(NEW LeafDataEstimatableVec(parent->getElementData())); + parent->setElementData(new LeafDataEstimatableVec(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); } @@ -73,8 +73,8 @@ namespace AMDiS { int elType) { ElementData::refineElementData(parent, child1, child2, elType); - child1->setElementData(NEW LeafDataCoarsenable(child1->getElementData())); - child2->setElementData(NEW LeafDataCoarsenable(child2->getElementData())); + child1->setElementData(new LeafDataCoarsenable(child1->getElementData())); + child2->setElementData(new LeafDataCoarsenable(child2->getElementData())); return true; } @@ -86,7 +86,7 @@ namespace AMDiS { DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenable at otherChild"); - parent->setElementData(NEW LeafDataCoarsenable(parent->getElementData())); + parent->setElementData(new LeafDataCoarsenable(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); } @@ -96,8 +96,8 @@ namespace AMDiS { int elType) { ElementData::refineElementData(parent, child1, child2, elType); - child1->setElementData(NEW LeafDataCoarsenableVec(child1->getElementData())); - child2->setElementData(NEW LeafDataCoarsenableVec(child2->getElementData())); + child1->setElementData(new LeafDataCoarsenableVec(child1->getElementData())); + child2->setElementData(new LeafDataCoarsenableVec(child2->getElementData())); return true; } @@ -108,7 +108,7 @@ namespace AMDiS { { DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenableVec at otherChild"); - parent->setElementData(NEW LeafDataCoarsenableVec(parent->getElementData())); + parent->setElementData(new LeafDataCoarsenableVec(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); } @@ -141,7 +141,7 @@ namespace AMDiS { // create new leaf data if necessary if (!ld[i]) { - ld[i] = NEW LeafDataPeriodic(child[i]->getElementData()); + ld[i] = new LeafDataPeriodic(child[i]->getElementData()); child[i]->setElementData(ld[i]); } @@ -183,7 +183,7 @@ namespace AMDiS { elementSide = rhs.elementSide; if (rhs.periodicCoords) { int dim = rhs.periodicCoords->getSize() - 1; - periodicCoords = NEW DimVec<WorldVector<double> >(dim, NO_INIT); + periodicCoords = new DimVec<WorldVector<double> >(dim, NO_INIT); for (int i = 0; i < dim + 1; i++) { (*periodicCoords)[i] = (*(rhs.periodicCoords))[i]; } @@ -203,7 +203,7 @@ namespace AMDiS { { if (coords) { int dim = coords->getSize() - 1; - periodicCoords = NEW DimVec<WorldVector<double> >(dim, NO_INIT); + periodicCoords = new DimVec<WorldVector<double> >(dim, NO_INIT); for (int i = 0; i < dim + 1; i++) { (*periodicCoords)[i] = (*coords)[i]; } diff --git a/AMDiS/src/LeafData.h b/AMDiS/src/LeafData.h index d6b32b74..06ba8441 100644 --- a/AMDiS/src/LeafData.h +++ b/AMDiS/src/LeafData.h @@ -56,7 +56,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW LeafDataEstimatable; + return new LeafDataEstimatable; } }; @@ -150,7 +150,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW LeafDataEstimatableVec; + return new LeafDataEstimatableVec; } }; @@ -278,7 +278,7 @@ namespace AMDiS { public: ElementData* create() { - return NEW LeafDataCoarsenable; + return new LeafDataCoarsenable; } }; @@ -379,7 +379,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW LeafDataCoarsenableVec; + return new LeafDataCoarsenableVec; }; }; @@ -491,7 +491,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW LeafDataPeriodic; + return new LeafDataPeriodic; }; }; @@ -515,7 +515,7 @@ namespace AMDiS { const DimVec<WorldVector<double> > *coords); virtual ~PeriodicInfo() { - if(periodicCoords) DELETE periodicCoords; + if(periodicCoords) delete periodicCoords; }; PeriodicInfo(const PeriodicInfo &rhs); @@ -545,11 +545,11 @@ namespace AMDiS { int i, size; in.read(reinterpret_cast<char*>(&size), sizeof(int)); - if(periodicCoords) DELETE periodicCoords; + if(periodicCoords) delete periodicCoords; if(size == 0) { periodicCoords = NULL; } else { - periodicCoords = NEW DimVec<WorldVector<double> >(size-1, NO_INIT); + periodicCoords = new DimVec<WorldVector<double> >(size-1, NO_INIT); for(i = 0; i < size; i++) { (*periodicCoords)[i].deserialize(in); } diff --git a/AMDiS/src/Line.h b/AMDiS/src/Line.h index 626ef370..b5088aac 100644 --- a/AMDiS/src/Line.h +++ b/AMDiS/src/Line.h @@ -102,7 +102,7 @@ namespace AMDiS { * implements Element::clone */ inline Element *clone() { - return NEW Line(mesh); + return new Line(mesh); } /** \brief diff --git a/AMDiS/src/MacroElement.cc b/AMDiS/src/MacroElement.cc index 2e1fe788..c8a9d7d5 100644 --- a/AMDiS/src/MacroElement.cc +++ b/AMDiS/src/MacroElement.cc @@ -27,7 +27,7 @@ namespace AMDiS { MacroElement::~MacroElement() { if (element) - DELETE element; + delete element; } MacroElement& MacroElement::operator=(const MacroElement &el) @@ -100,11 +100,11 @@ namespace AMDiS { TEST_EXIT(typeName == element->getTypeName())("wrong element type name\n"); } else { if (typeName == "Line") - element = NEW Line(NULL); + element = new Line(NULL); if (typeName == "Triangle") - element = NEW Triangle(NULL); + element = new Triangle(NULL); if (typeName == "Tetrahedron") - element = NEW Tetrahedron(NULL); + element = new Tetrahedron(NULL); } element->deserialize(in); diff --git a/AMDiS/src/MacroReader.cc b/AMDiS/src/MacroReader.cc index b002a7b4..f8f12a47 100644 --- a/AMDiS/src/MacroReader.cc +++ b/AMDiS/src/MacroReader.cc @@ -30,7 +30,7 @@ namespace AMDiS { TEST_EXIT(filename)("no file specified; filename NULL pointer\n"); - MacroInfo *macroInfo = NEW MacroInfo(); + MacroInfo *macroInfo = new MacroInfo(); macroInfo->readAMDiSMacro(filename, mesh); std::deque<MacroElement*>::iterator mel = macroInfo->mel.begin(); @@ -132,12 +132,12 @@ namespace AMDiS { LeafDataPeriodic *ldp2 = dynamic_cast<LeafDataPeriodic*>(ld2->getElementData(PERIODIC)); if (!ldp1) { - ldp1 = NEW LeafDataPeriodic(ld1); + ldp1 = new LeafDataPeriodic(ld1); element1->setElementData(ldp1); } if (!ldp2) { - ldp2 = NEW LeafDataPeriodic(ld2); + ldp2 = new LeafDataPeriodic(ld2); element2->setElementData(ldp2); } @@ -155,7 +155,7 @@ namespace AMDiS { VertexVector *associated = mesh->periodicAssociations[boundaryType]; if (!associated) { - associated = NEW VertexVector(mesh->getVertexAdmin(), "vertex vector"); + associated = new VertexVector(mesh->getVertexAdmin(), "vertex vector"); mesh->periodicAssociations[boundaryType] = associated; VertexVector::Iterator it(associated, ALL_DOFS); for (it.reset2(); !it.end(); ++it) { @@ -357,7 +357,7 @@ namespace AMDiS { mesh->setNumberOfVertices(nv); for (int i = 0; i < ne; i++) { - MacroElement *newMacro = NEW MacroElement(mesh->getDim()); + MacroElement *newMacro = new MacroElement(mesh->getDim()); mel.push_back(newMacro); mesh->addMacroElement(mel[i]); } @@ -576,7 +576,7 @@ namespace AMDiS { TEST_EXIT(result == 1) ("cannot read DIM correctly in file %s\n", name); - ind = NEW DimVec<int>(dim, NO_INIT); + ind = new DimVec<int>(dim, NO_INIT); key_def[0] = true; break; @@ -759,7 +759,7 @@ namespace AMDiS { if (j >= 0) { Element *el = mel[i]->getElement(); ElementRegion_ED *elementRegion = - NEW ElementRegion_ED(el->getElementData()); + new ElementRegion_ED(el->getElementData()); elementRegion->setRegion(j); el->setElementData(elementRegion); } @@ -778,7 +778,7 @@ namespace AMDiS { for(j = 0; j < mesh->getGeo(NEIGH); j++) { if((*ind)[j] >= 0) { SurfaceRegion_ED *surfaceRegion = - NEW SurfaceRegion_ED(el->getElementData()); + new SurfaceRegion_ED(el->getElementData()); surfaceRegion->setSide(j); surfaceRegion->setRegion((*ind)[j]); el->setElementData(surfaceRegion); @@ -797,7 +797,7 @@ namespace AMDiS { } if (ind) { - DELETE ind; + delete ind; } fclose(file); @@ -1575,7 +1575,7 @@ namespace AMDiS { void MacroReader::umbVkantMacro(Mesh *mesh, MacroElement* me, int ka, int *) { - MacroElement* macr=NEW MacroElement(mesh->getDim()); + MacroElement* macr=new MacroElement(mesh->getDim()); int i; int n0; DegreeOfFreedom *d[7]; @@ -1686,7 +1686,7 @@ namespace AMDiS { } } } - DELETE macr; + delete macr; } diff --git a/AMDiS/src/Marker.cc b/AMDiS/src/Marker.cc index 68b98c99..7a3aff62 100644 --- a/AMDiS/src/Marker.cc +++ b/AMDiS/src/Marker.cc @@ -12,16 +12,16 @@ namespace AMDiS { case 0: break; case 1: - marker = NEW GRMarker(name, row); + marker = new GRMarker(name, row); break; case 2: - marker = NEW MSMarker(name, row); + marker = new MSMarker(name, row); break; case 3: - marker = NEW ESMarker(name, row); + marker = new ESMarker(name, row); break; case 4: - marker = NEW GERSMarker(name, row); + marker = new GERSMarker(name, row); break; default: ERROR_EXIT("invalid strategy\n"); } diff --git a/AMDiS/src/Mesh.cc b/AMDiS/src/Mesh.cc index c0e2ce50..27ee7537 100644 --- a/AMDiS/src/Mesh.cc +++ b/AMDiS/src/Mesh.cc @@ -99,13 +99,13 @@ namespace AMDiS { // set default element prototype switch(dim) { case 1: - elementPrototype = NEW Line(this); + elementPrototype = new Line(this); break; case 2: - elementPrototype = NEW Triangle(this); + elementPrototype = new Triangle(this); break; case 3: - elementPrototype = NEW Tetrahedron(this); + elementPrototype = new Tetrahedron(this); break; default: ERROR_EXIT("invalid dimension\n"); @@ -124,23 +124,23 @@ namespace AMDiS { it != macroElements.end(); ++it) { (*it)->getElement()->deleteElementDOFs(); - DELETE *it; + delete *it; } Element::deletedDOFs.clear(); if (macroFileInfo != NULL) { - DELETE macroFileInfo; + delete macroFileInfo; } if (elementPrototype) { - DELETE elementPrototype; + delete elementPrototype; } if (elementDataPrototype) { - DELETE elementDataPrototype; + delete elementDataPrototype; } for (int i = 0; i < static_cast<int>(admin.size()); i++) { - DELETE admin[i]; + delete admin[i]; } } @@ -176,7 +176,7 @@ namespace AMDiS { /* ====================== Create new DOFAdmins ================== */ admin.resize(m.admin.size()); for (int i = 0; i < static_cast<int>(admin.size()); i++) { - admin[i] = NEW DOFAdmin(this); + admin[i] = new DOFAdmin(this); *(admin[i]) = *(m.admin[i]); admin[i]->setMesh(this); } @@ -203,7 +203,7 @@ namespace AMDiS { ++it, insertCounter++) { // Create new MacroElement. - MacroElement *el = NEW MacroElement(dim); + MacroElement *el = new MacroElement(dim); // Use copy operator to copy all the data to the new MacroElement. *el = **it; @@ -545,7 +545,7 @@ namespace AMDiS { { FUNCNAME("Mesh::createDOFAdmin()"); - DOFAdmin *localAdmin = NEW DOFAdmin(this, lname); + DOFAdmin *localAdmin = new DOFAdmin(this, lname); for (int i = 0; i < dim+1; i++) localAdmin->setNumberOfDOFs(i,lnDOF[i]); @@ -612,7 +612,7 @@ namespace AMDiS { void Mesh::freeElement(Element* el) { freeDOFPtrs(const_cast<DegreeOfFreedom**>(el->getDOF())); - DELETE el; + delete el; } @@ -638,13 +638,13 @@ namespace AMDiS { { switch(dim) { case 1: - return NEW ElInfo1d(this); + return new ElInfo1d(this); break; case 2: - return NEW ElInfo2d(this); + return new ElInfo2d(this); break; case 3: - return NEW ElInfo3d(this); + return new ElInfo3d(this); break; default: ERROR_EXIT("invalid dim\n"); @@ -693,7 +693,7 @@ namespace AMDiS { for (int i = 0; i <= dim; i++) bary[i] = final_lambda[i]; - DELETE mel_info; + delete mel_info; return inside; } @@ -710,7 +710,7 @@ namespace AMDiS { *elp = el_info->getElement(); - DELETE el_info; + delete el_info; return val; } @@ -837,7 +837,7 @@ namespace AMDiS { *c_el_info = *c_el_info2; ichild = 1 - ichild; } - DELETE c_el_info2; + delete c_el_info2; } outside = c_outside; } else { /* no new_coord */ @@ -863,7 +863,7 @@ namespace AMDiS { inside = findElementAtPointRecursive(c_el_info, c_lambda, outside, final_el_info); - DELETE c_el_info; + delete c_el_info; return inside; } @@ -1016,7 +1016,7 @@ namespace AMDiS { admin.resize(size, NULL); for (int i = 0; i < size; i++) { if (!admin[i]) - admin[i] = NEW DOFAdmin(this); + admin[i] = new DOFAdmin(this); admin[i]->deserialize(in); } @@ -1028,12 +1028,12 @@ namespace AMDiS { for (int i = 0; i < static_cast<int>(macroElements.size()); i++) { if (macroElements[i]) - DELETE macroElements[i]; + delete macroElements[i]; } macroElements.resize(size); for (int i = 0; i < size; i++) { - macroElements[i] = NEW MacroElement(dim); + macroElements[i] = new MacroElement(dim); macroElements[i]->writeNeighboursTo(&(neighbourIndices[i])); macroElements[i]->deserialize(in); } @@ -1132,7 +1132,7 @@ namespace AMDiS { void Mesh::clearMacroFileInfo() { macroFileInfo->clear(nEdges, nVertices); - DELETE macroFileInfo; + delete macroFileInfo; macroFileInfo = NULL; } diff --git a/AMDiS/src/MeshStructure.cc b/AMDiS/src/MeshStructure.cc index cb794625..74d046b8 100644 --- a/AMDiS/src/MeshStructure.cc +++ b/AMDiS/src/MeshStructure.cc @@ -151,7 +151,7 @@ namespace AMDiS { }; if (element->isLeaf() && !isLeafElement()) { - MeshStructure *structure = NEW MeshStructure(); + MeshStructure *structure = new MeshStructure(); cont = skipBranch(structure); structure->commit(); @@ -167,11 +167,11 @@ namespace AMDiS { } if (decorate) { - MeshStructure_ED *elData = NEW MeshStructure_ED(element->getElementData()); + MeshStructure_ED *elData = new MeshStructure_ED(element->getElementData()); elData->setStructure(structure); element->setElementData(elData); } else { - DELETE structure; + delete structure; } } else { cont = nextElement(); diff --git a/AMDiS/src/MeshStructure_ED.h b/AMDiS/src/MeshStructure_ED.h index 2abe5938..54413b68 100644 --- a/AMDiS/src/MeshStructure_ED.h +++ b/AMDiS/src/MeshStructure_ED.h @@ -40,7 +40,7 @@ namespace AMDiS { {}; virtual ~MeshStructure_ED() { - DELETE structure_; + delete structure_; }; virtual bool refineElementData(Element* parent, @@ -60,10 +60,10 @@ namespace AMDiS { structure_->nextElement(); if(!structure_->isLeafElement()) { - MeshStructure *structure1 = NEW MeshStructure(); + MeshStructure *structure1 = new MeshStructure(); structure_->skipBranch(structure1); structure1->commit(); - MeshStructure_ED *elData1 = NEW MeshStructure_ED(child1->getElementData()); + MeshStructure_ED *elData1 = new MeshStructure_ED(child1->getElementData()); elData1->setStructure(structure1); child1->setElementData(elData1); } else { @@ -71,10 +71,10 @@ namespace AMDiS { } if(!structure_->isLeafElement()) { - MeshStructure *structure2 = NEW MeshStructure(); + MeshStructure *structure2 = new MeshStructure(); structure_->skipBranch(structure2); structure2->commit(); - MeshStructure_ED *elData2 = NEW MeshStructure_ED(child2->getElementData()); + MeshStructure_ED *elData2 = new MeshStructure_ED(child2->getElementData()); elData2->setStructure(structure2); child2->setElementData(elData2); } diff --git a/AMDiS/src/MpCCIAdapter.cc b/AMDiS/src/MpCCIAdapter.cc index dbe7b98c..a7b4e3cf 100644 --- a/AMDiS/src/MpCCIAdapter.cc +++ b/AMDiS/src/MpCCIAdapter.cc @@ -39,7 +39,7 @@ namespace AMDiS TEST_EXIT(surfaceRegion == -1)("not yet for surface regions\n"); // create SMI adapter - smiAdapter_ = NEW SMIAdapter(applicationID_, + smiAdapter_ = new SMIAdapter(applicationID_, meshID_, feSpace_, elementRegion, @@ -167,7 +167,7 @@ namespace AMDiS MpCCIAdapter::~MpCCIAdapter() { - DELETE smiAdapter_; + delete smiAdapter_; int error == CCI_Finalize(); TEST_EXIT(error == 0)("CCI_Finalize() failed\n"); } diff --git a/AMDiS/src/Newton.h b/AMDiS/src/Newton.h index 7dba5290..8f3b5740 100644 --- a/AMDiS/src/Newton.h +++ b/AMDiS/src/Newton.h @@ -19,8 +19,8 @@ /** \file Newton.h */ -#ifndef AMDIS_NEWTON_H -#define AMDIS_NEWTON_H +#ifndef AMDIS_newTON_H +#define AMDIS_newTON_H #if 0 @@ -53,7 +53,7 @@ namespace AMDiS { * Returns a new Newton object. */ NonLinSolver<VectorType>* create() { - return NEW Newton(this->name, this->linearSolver, this->nonLinUpdater); + return new Newton(this->name, this->linearSolver, this->nonLinUpdater); }; }; @@ -98,4 +98,4 @@ namespace AMDiS { #endif -#endif // AMDIS_NEWTON_H +#endif // AMDIS_newTON_H diff --git a/AMDiS/src/NewtonS.h b/AMDiS/src/NewtonS.h index 7cbde0ed..828b35b2 100644 --- a/AMDiS/src/NewtonS.h +++ b/AMDiS/src/NewtonS.h @@ -19,8 +19,8 @@ /** \file NewtonS.h */ -#ifndef AMDIS_NEWTONS_H -#define AMDIS_NEWTONS_H +#ifndef AMDIS_newTONS_H +#define AMDIS_newTONS_H #if 0 @@ -55,7 +55,7 @@ namespace AMDiS { * Returns a new NewtonS object. */ NonLinSolver<VectorType>* create() { - return NEW NewtonS(this->name, this->linearSolver, this->nonLinUpdater); + return new NewtonS(this->name, this->linearSolver, this->nonLinUpdater); }; }; @@ -105,4 +105,4 @@ namespace AMDiS { #endif -#endif // AMDIS_NEWTONS_H +#endif // AMDIS_newTONS_H diff --git a/AMDiS/src/Operator.hh b/AMDiS/src/Operator.hh index 8b14eea2..0752563f 100644 --- a/AMDiS/src/Operator.hh +++ b/AMDiS/src/Operator.hh @@ -10,7 +10,7 @@ namespace AMDiS { term->getAuxFESpaces().end()); for (int i = 1; i < omp_get_overall_max_threads(); i++) { - T *newTerm = NEW T(static_cast<const T>(*term)); + T *newTerm = new T(static_cast<const T>(*term)); secondOrder[i].push_back(newTerm); } } @@ -30,7 +30,7 @@ namespace AMDiS { term->getAuxFESpaces().end()); for (int i = 1; i < omp_get_overall_max_threads(); i++) { - T *newTerm = NEW T(static_cast<const T>(*term)); + T *newTerm = new T(static_cast<const T>(*term)); if (type == GRD_PSI) { firstOrderGrdPsi[i].push_back(newTerm); } else { @@ -49,7 +49,7 @@ namespace AMDiS { term->getAuxFESpaces().end()); for (int i = 1; i < omp_get_overall_max_threads(); i++) { - T *newTerm = NEW T(static_cast<const T>(*term)); + T *newTerm = new T(static_cast<const T>(*term)); zeroOrder[i].push_back(newTerm); } } diff --git a/AMDiS/src/ParMetisPartitioner.cc b/AMDiS/src/ParMetisPartitioner.cc index 93ea6ab4..304662b6 100644 --- a/AMDiS/src/ParMetisPartitioner.cc +++ b/AMDiS/src/ParMetisPartitioner.cc @@ -199,7 +199,7 @@ namespace AMDiS { ("mesh already partitioned\n"); PartitionElementData *elData = - NEW PartitionElementData(element->getElementData()); + new PartitionElementData(element->getElementData()); element->setElementData(elData); if (totalElementCounter % mpiSize == mpiRank) { @@ -224,8 +224,8 @@ namespace AMDiS { // === create parmetis mesh === if (parMetisMesh) - DELETE parMetisMesh; - parMetisMesh = NEW ParMetisMesh(mesh_, mpiComm); + delete parMetisMesh; + parMetisMesh = new ParMetisMesh(mesh_, mpiComm); int nElements = parMetisMesh->getNumElements(); @@ -377,7 +377,7 @@ namespace AMDiS { // update ParMETIS mesh to new partitioning if (!parMetisMesh) - parMetisMesh = NEW ParMetisMesh(mesh_, mpiComm); + parMetisMesh = new ParMetisMesh(mesh_, mpiComm); int mpiRank = mpiComm->Get_rank(); int mpiSize = mpiComm->Get_size(); @@ -512,7 +512,7 @@ namespace AMDiS { elInfo = stack.traverseNext(elInfo); } - DELETE parMetisMesh; + delete parMetisMesh; parMetisMesh = NULL; FREE_MEMORY(rankElements, int, sumPartitionElements[mpiRank]); diff --git a/AMDiS/src/ParallelProblem.cc b/AMDiS/src/ParallelProblem.cc index 104b6900..ea1dafe7 100644 --- a/AMDiS/src/ParallelProblem.cc +++ b/AMDiS/src/ParallelProblem.cc @@ -238,7 +238,7 @@ namespace AMDiS { TEST_EXIT(localCoarseGridLevel_ >= globalCoarseGridLevel_) ("local coarse grid level < global coarse grid level\n"); - partitioner = NEW ParMetisPartitioner(mesh, &mpiComm); + partitioner = new ParMetisPartitioner(mesh, &mpiComm); GET_PARAMETER(0, name_ + "->adaptive thresholds", "%d", &adaptiveThresholds_); @@ -263,7 +263,7 @@ namespace AMDiS { ParallelProblem::~ParallelProblem() { - DELETE partitioner; + delete partitioner; } bool ParallelProblem::doPartitioning(AdaptInfo *adaptInfo, double localWeightSum) @@ -550,7 +550,7 @@ namespace AMDiS { { FUNCNAME("ParallelProblem::synchronizeMeshes()"); - MeshStructure *structures = NEW MeshStructure[mpiSize]; + MeshStructure *structures = new MeshStructure[mpiSize]; // build composite mesh structure exchangeMeshStructureCodes(structures); @@ -567,7 +567,7 @@ namespace AMDiS { refinementManager, true); - DELETE [] structures; + delete [] structures; } @@ -1222,7 +1222,7 @@ namespace AMDiS { if (overlap > 1 || openOverlap == false) { // exchange mesh structure codes - MeshStructure *structures = NEW MeshStructure[mpiSize]; + MeshStructure *structures = new MeshStructure[mpiSize]; exchangeMeshStructureCodes(structures); // merge codes @@ -1308,7 +1308,7 @@ namespace AMDiS { } // free memory - DELETE [] structures; + delete [] structures; FREE_MEMORY(recvBuffer, int, sum); FREE_MEMORY(sendBuffer, int, numOverlapElements[mpiRank]); FREE_MEMORY(numOverlapElements, int, mpiSize); @@ -1347,7 +1347,7 @@ namespace AMDiS { usersMarker(NULL) { for (int i = 0; i < mpiSize; i++) { - rankSolution[i] = NEW DOFVector<double>(problem->getFESpace(), "rank solution"); + rankSolution[i] = new DOFVector<double>(problem->getFESpace(), "rank solution"); } if (problemInstat_) { @@ -1358,7 +1358,7 @@ namespace AMDiS { ParallelProblemScal::~ParallelProblemScal() { for (int i = 0; i < mpiSize; i++) { - DELETE rankSolution[i]; + delete rankSolution[i]; } } @@ -1410,14 +1410,14 @@ namespace AMDiS { if (usersEstimator) { problem->setEstimator(usersEstimator); } else { - condEstimator = NEW ConditionalEstimator(oldEstimator); + condEstimator = new ConditionalEstimator(oldEstimator); problem->setEstimator(condEstimator); } if (usersMarker) { problem->setMarker(usersMarker); } else { - ConditionalMarker *newMarker = NEW ConditionalMarker("parallel marker", + ConditionalMarker *newMarker = new ConditionalMarker("parallel marker", -1, oldMarker, globalCoarseGridLevel_, @@ -1462,9 +1462,9 @@ namespace AMDiS { partitioner->deletePartitionData(); if (!usersEstimator) - DELETE problem->getEstimator(); + delete problem->getEstimator(); if (!usersMarker) - DELETE problem->getMarker(); + delete problem->getMarker(); problem->setEstimator(oldEstimator); problem->setMarker(oldMarker); @@ -1545,9 +1545,9 @@ namespace AMDiS { rankSolution.resize(mpiSize); for (int i = 0; i < mpiSize; i++) { - rankSolution[i] = NEW SystemVector("rank solution", feSpaces, nComponents); + rankSolution[i] = new SystemVector("rank solution", feSpaces, nComponents); for (int j = 0; j < nComponents; j++) { - rankSolution[i]->setDOFVector(j, NEW DOFVector<double>(feSpaces[j], + rankSolution[i]->setDOFVector(j, new DOFVector<double>(feSpaces[j], "rank solution")); } } @@ -1563,9 +1563,9 @@ namespace AMDiS { { for (int i = 0; i < mpiSize; i++) { for (int j = 0; j < nComponents; j++) { - DELETE rankSolution[i]->getDOFVector(j); + delete rankSolution[i]->getDOFVector(j); } - DELETE rankSolution[i]; + delete rankSolution[i]; } } @@ -1589,7 +1589,7 @@ namespace AMDiS { problem->setEstimator(usersEstimator); } else { for (int i = 0; i < nComponents; i++) { - condEstimator.push_back(NEW ConditionalEstimator(oldEstimator[i])); + condEstimator.push_back(new ConditionalEstimator(oldEstimator[i])); problem->setEstimator(condEstimator[i], i); } } @@ -1603,7 +1603,7 @@ namespace AMDiS { ("use conditional marker only together with conditional estimator\n"); for (int i = 0; i < nComponents; i++) { ConditionalMarker *newMarker = - NEW ConditionalMarker("parallel marker", + new ConditionalMarker("parallel marker", i, oldMarker[i], globalCoarseGridLevel_, @@ -1641,9 +1641,9 @@ namespace AMDiS { for (int i = 0; i < nComponents; i++) { if (static_cast<int>(usersEstimator.size()) == nComponents) - DELETE problem->getEstimator(i); + delete problem->getEstimator(i); if (static_cast<int>(usersMarker.size()) == nComponents) - DELETE problem->getMarker(i); + delete problem->getMarker(i); problem->setEstimator(oldEstimator[i], i); problem->setMarker(oldMarker[i], i); @@ -1821,7 +1821,7 @@ namespace AMDiS { - MeshStructure *structures = NEW MeshStructure[mpiWorldSize]; + MeshStructure *structures = new MeshStructure[mpiWorldSize]; /* ===== Communication with exchangeMeshStructureCode() ====== */ @@ -1857,7 +1857,7 @@ namespace AMDiS { structures[1].fitMeshToStructure(mesh, refinementManager, false); - DELETE [] structures; + delete [] structures; /* ======= Communication with exchangeRankSolution() ======= */ diff --git a/AMDiS/src/PardisoSolver.h b/AMDiS/src/PardisoSolver.h index 5313c6d3..c0ad4c73 100644 --- a/AMDiS/src/PardisoSolver.h +++ b/AMDiS/src/PardisoSolver.h @@ -60,7 +60,7 @@ namespace AMDiS { * Returns a new UmfPackSolver object. */ OEMSolver<VectorType>* create() { - return NEW PardisoSolver<VectorType>(this->name); + return new PardisoSolver<VectorType>(this->name); }; }; diff --git a/AMDiS/src/PartitionElementData.h b/AMDiS/src/PartitionElementData.h index 4f505c70..1a717cf8 100644 --- a/AMDiS/src/PartitionElementData.h +++ b/AMDiS/src/PartitionElementData.h @@ -50,7 +50,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW PartitionElementData; + return new PartitionElementData; } }; @@ -70,8 +70,8 @@ namespace AMDiS { { ElementData::refineElementData(parent, child1, child2, elType); - PartitionElementData *child1Data = NEW PartitionElementData(child1->getElementData()); - PartitionElementData *child2Data = NEW PartitionElementData(child2->getElementData()); + PartitionElementData *child1Data = new PartitionElementData(child1->getElementData()); + PartitionElementData *child2Data = new PartitionElementData(child2->getElementData()); child1Data->setPartitionStatus(status); child2Data->setPartitionStatus(status); child1Data->setLevel(level + 1); @@ -82,7 +82,7 @@ namespace AMDiS { }; ElementData *clone() const { - PartitionElementData *newObj = NEW PartitionElementData; + PartitionElementData *newObj = new PartitionElementData; newObj->decorated_ = ElementData::clone(); return newObj; }; diff --git a/AMDiS/src/PeriodicBC.cc b/AMDiS/src/PeriodicBC.cc index 37383a05..b6c6e400 100644 --- a/AMDiS/src/PeriodicBC.cc +++ b/AMDiS/src/PeriodicBC.cc @@ -21,7 +21,7 @@ namespace AMDiS { return *it; } } - PeriodicDOFMapping *newMapping = NEW PeriodicDOFMapping(basFcts); + PeriodicDOFMapping *newMapping = new PeriodicDOFMapping(basFcts); mappings_.push_back(newMapping); return newMapping; } diff --git a/AMDiS/src/PeriodicConnection.h b/AMDiS/src/PeriodicConnection.h index 25df52a2..e3c08bec 100644 --- a/AMDiS/src/PeriodicConnection.h +++ b/AMDiS/src/PeriodicConnection.h @@ -33,14 +33,14 @@ namespace AMDiS { el_[0] = el0; el_[1] = el1; - vertices_[0] = NEW DimVec<int>(vertices0); - vertices_[1] = NEW DimVec<int>(vertices1); + vertices_[0] = new DimVec<int>(vertices0); + vertices_[1] = new DimVec<int>(vertices1); child_[0] = child_[1] = NULL; }; ~PeriodicConnection() { - DELETE vertices_[0]; - DELETE vertices_[1]; + delete vertices_[0]; + delete vertices_[1]; }; Element *getElement(int index) { diff --git a/AMDiS/src/ProblemInstat.cc b/AMDiS/src/ProblemInstat.cc index a22a5cde..3eac11a8 100644 --- a/AMDiS/src/ProblemInstat.cc +++ b/AMDiS/src/ProblemInstat.cc @@ -24,7 +24,7 @@ namespace AMDiS { void ProblemInstat::solveInitialProblem(AdaptInfo *adaptInfo) { AdaptStationary initialAdapt((name + "->initial->adapt").c_str(), - NEW StandardProblemIteration(initialProblem), + new StandardProblemIteration(initialProblem), adaptInfo); initialAdapt.adapt(); @@ -58,7 +58,7 @@ namespace AMDiS { ProblemInstatScal::~ProblemInstatScal() { - DELETE oldSolution; + delete oldSolution; } void ProblemInstatScal::initialize(Flag initFlag, @@ -93,7 +93,7 @@ namespace AMDiS { WARNING("oldSolution already created\n"); } else { // create oldSolution - oldSolution = NEW DOFVector<double>(problemStat->getFESpace(), name + "->uOld"); + oldSolution = new DOFVector<double>(problemStat->getFESpace(), name + "->uOld"); oldSolution->setCoarsenOperation(COARSE_INTERPOL); if (problemStat->getEstimator()) { dynamic_cast<Estimator*>(problemStat->getEstimator()) @@ -125,7 +125,7 @@ namespace AMDiS { ProblemInstatVec::~ProblemInstatVec() { - DELETE oldSolution; + delete oldSolution; } void ProblemInstatVec::initialize(Flag initFlag, @@ -161,11 +161,11 @@ namespace AMDiS { } else { int size = problemStat->getNumComponents(); // create oldSolution - oldSolution = NEW SystemVector("old solution", + oldSolution = new SystemVector("old solution", problemStat->getFESpaces(), size); for (int i = 0; i < size; i++) { - oldSolution->setDOFVector(i, NEW DOFVector<double>(problemStat->getFESpace(i), + oldSolution->setDOFVector(i, new DOFVector<double>(problemStat->getFESpace(i), name + "->uOld")); oldSolution->getDOFVector(i)->setCoarsenOperation(COARSE_INTERPOL); diff --git a/AMDiS/src/ProblemNonLin.cc b/AMDiS/src/ProblemNonLin.cc index 6840800d..fd923458 100644 --- a/AMDiS/src/ProblemNonLin.cc +++ b/AMDiS/src/ProblemNonLin.cc @@ -69,7 +69,7 @@ namespace AMDiS { nonLinSolverCreator->setName(name + "->nonlin solver"); nonLinSolverCreator->setNonLinUpdater(updater_); nonLinSolver_ = nonLinSolverCreator->create(); - nonLinSolver_->setVectorCreator(NEW DOFVector<double>::Creator(feSpace)); + nonLinSolver_->setVectorCreator(new DOFVector<double>::Creator(feSpace)); #endif } @@ -163,7 +163,7 @@ namespace AMDiS { nonLinSolverCreator->setName(name + "->nonlin solver"); nonLinSolverCreator->setNonLinUpdater(updater_); nonLinSolver_ = nonLinSolverCreator->create(); - nonLinSolver_->setVectorCreator(NEW SystemVector::Creator("temp", + nonLinSolver_->setVectorCreator(new SystemVector::Creator("temp", componentSpaces, nComponents)); #endif diff --git a/AMDiS/src/ProblemNonLin.h b/AMDiS/src/ProblemNonLin.h index e99c38dd..9699ca0c 100644 --- a/AMDiS/src/ProblemNonLin.h +++ b/AMDiS/src/ProblemNonLin.h @@ -74,7 +74,7 @@ namespace AMDiS { * Used in \ref initialize(). */ virtual void createUpdater() { - updater_ = NEW NonLinUpdaterScal(systemMatrix); + updater_ = new NonLinUpdaterScal(systemMatrix); } /** \brief @@ -200,7 +200,7 @@ namespace AMDiS { * Used in \ref initialize(). */ virtual void createUpdater() { - updater_ = NEW NonLinUpdaterVec(systemMatrix); + updater_ = new NonLinUpdaterVec(systemMatrix); } /** \brief diff --git a/AMDiS/src/QPInfo.cc b/AMDiS/src/QPInfo.cc index f330a62d..86f8f792 100644 --- a/AMDiS/src/QPInfo.cc +++ b/AMDiS/src/QPInfo.cc @@ -25,11 +25,11 @@ namespace AMDiS { { int i; - if(coordsAtQPs_) DELETE [] coordsAtQPs_; + if(coordsAtQPs_) delete [] coordsAtQPs_; if(elementNormalAtQPs_) { for(i = 0; i < numPoints_; i++) { - DELETE elementNormalAtQPs_[i]; + delete elementNormalAtQPs_[i]; } FREE_MEMORY(elementNormalAtQPs_, WorldVector<double>*, @@ -44,7 +44,7 @@ namespace AMDiS { if(grdLambdaAtQPs_) { for(i = 0; i < numPoints_; i++) { - DELETE grdLambdaAtQPs_[i]; + delete grdLambdaAtQPs_[i]; } FREE_MEMORY(grdLambdaAtQPs_, DimVec<WorldVector<double> >*, @@ -64,10 +64,10 @@ namespace AMDiS { if(it->second->valAtQPs_) FREE_MEMORY(it->second->valAtQPs_, double, numPoints_); if(it->second->grdAtQPs_) - DELETE [] it->second->grdAtQPs_; + delete [] it->second->grdAtQPs_; if(it->second->D2AtQPs_) - DELETE [] it->second->D2AtQPs_; - DELETE it->second; + delete [] it->second->D2AtQPs_; + delete it->second; } } @@ -95,7 +95,7 @@ namespace AMDiS { { if(coordsNumPointsValid_ < numPoints) { if(!coordsAtQPs_) { - coordsAtQPs_ = NEW WorldVector<double>[numPoints_]; + coordsAtQPs_ = new WorldVector<double>[numPoints_]; } int i; for(i = 0; i < numPoints; i++) { @@ -120,7 +120,7 @@ namespace AMDiS { // create new info if necessary if(vecQPInfos_[vec] == NULL) { - vecQPInfos_[vec] = NEW VecQPInfo; + vecQPInfos_[vec] = new VecQPInfo; } VecQPInfo *localVecQPInfo = vecQPInfos_[vec]; @@ -159,7 +159,7 @@ namespace AMDiS { // create new info if necessary if(vecQPInfos_[vec] == NULL) { - vecQPInfos_[vec] = NEW VecQPInfo; + vecQPInfos_[vec] = new VecQPInfo; } VecQPInfo *localVecQPInfo = vecQPInfos_[vec]; @@ -169,7 +169,7 @@ namespace AMDiS { // allocate memory if necessary if(localVecQPInfo->grdAtQPs_ == NULL) { - localVecQPInfo->grdAtQPs_ = NEW WorldVector<double>[numPoints_]; + localVecQPInfo->grdAtQPs_ = new WorldVector<double>[numPoints_]; } // fill memory @@ -198,7 +198,7 @@ namespace AMDiS { // create new info if necessary if(vecQPInfos_[vec] == NULL) { - vecQPInfos_[vec] = NEW VecQPInfo; + vecQPInfos_[vec] = new VecQPInfo; } VecQPInfo *localVecQPInfo = vecQPInfos_[vec]; @@ -208,7 +208,7 @@ namespace AMDiS { // allocate memory if necessary if(localVecQPInfo->D2AtQPs_ == NULL) { - localVecQPInfo->D2AtQPs_ = NEW WorldMatrix<double>[numPoints_]; + localVecQPInfo->D2AtQPs_ = new WorldMatrix<double>[numPoints_]; } // fill memory @@ -235,7 +235,7 @@ namespace AMDiS { elementNormalAtQPs_ = GET_MEMORY(WorldVector<double>*, numPoints_); for(i = 0; i < numPoints_; i++) { - elementNormalAtQPs_[i] = NEW WorldVector<double>; + elementNormalAtQPs_[i] = new WorldVector<double>; } } @@ -251,7 +251,7 @@ namespace AMDiS { if(!elementNormalConst_) { elementNormalConst_ = GET_MEMORY(WorldVector<double>*, numPoints_); - elementNormalConst_[0] = NEW WorldVector<double>; + elementNormalConst_[0] = new WorldVector<double>; for(i = 1; i < numPoints_; i++) { elementNormalConst_[i] = elementNormalConst_[0]; @@ -273,7 +273,7 @@ namespace AMDiS { numPoints_); for(i = 0; i < numPoints_; i++) { grdLambdaAtQPs_[i] = - NEW DimVec<WorldVector<double> >(quadrature_->getDim()); + new DimVec<WorldVector<double> >(quadrature_->getDim()); } } @@ -290,7 +290,7 @@ namespace AMDiS { grdLambdaConst_ = GET_MEMORY(DimVec<WorldVector<double> >*, numPoints_); grdLambdaConst_[0] = - NEW DimVec<WorldVector<double> >(quadrature_->getDim()); + new DimVec<WorldVector<double> >(quadrature_->getDim()); for(i = 1; i < numPoints_; i++) { grdLambdaConst_[i] = grdLambdaConst_[0]; @@ -313,7 +313,7 @@ namespace AMDiS { } if(quad) { if(qpInfos_[quad]) return qpInfos_[quad]; - QPInfo *newQPInfo = NEW QPInfo(quad); + QPInfo *newQPInfo = new QPInfo(quad); qpInfos_[quad] = newQPInfo; return newQPInfo; } else { @@ -333,7 +333,7 @@ namespace AMDiS { } TEST_EXIT_DBG(quad)("no quadrature\n"); if(qpInfos_[quad]) { - DELETE qpInfos_[quad]; + delete qpInfos_[quad]; qpInfos_.erase(quad); } } @@ -344,7 +344,7 @@ namespace AMDiS { it, itEnd = qpInfos_.end(); for(it = qpInfos_.begin(); it != itEnd; ++it) { - DELETE it->second; + delete it->second; qpInfos_.erase(it); } } diff --git a/AMDiS/src/QPsiPhi.cc b/AMDiS/src/QPsiPhi.cc index 2ccb4d74..d96acb69 100644 --- a/AMDiS/src/QPsiPhi.cc +++ b/AMDiS/src/QPsiPhi.cc @@ -196,7 +196,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q11PsiPhi *newQ11PsiPhi = NEW Q11PsiPhi(ps,ph,quadrat); + Q11PsiPhi *newQ11PsiPhi = new Q11PsiPhi(ps,ph,quadrat); preList.push_back(newQ11PsiPhi); return newQ11PsiPhi; } else { @@ -357,7 +357,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q10PsiPhi *newQ10PsiPhi = NEW Q10PsiPhi(ps,ph,quadrat); + Q10PsiPhi *newQ10PsiPhi = new Q10PsiPhi(ps,ph,quadrat); preList.push_back(newQ10PsiPhi); return newQ10PsiPhi; } else { @@ -517,7 +517,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q01PsiPhi *newQ01PsiPhi = NEW Q01PsiPhi(ps,ph,quadrat); + Q01PsiPhi *newQ01PsiPhi = new Q01PsiPhi(ps,ph,quadrat); preList.push_back(newQ01PsiPhi); return newQ01PsiPhi; } else { @@ -641,7 +641,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q00PsiPhi *newQ00PsiPhi = NEW Q00PsiPhi(ps,ph,quadrat); + Q00PsiPhi *newQ00PsiPhi = new Q00PsiPhi(ps,ph,quadrat); preList.push_back(newQ00PsiPhi); return newQ00PsiPhi; } else { @@ -717,7 +717,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q0Psi *newQ0Psi = NEW Q0Psi(ps, quadrat); + Q0Psi *newQ0Psi = new Q0Psi(ps, quadrat); preList.push_back(newQ0Psi); return newQ0Psi; } @@ -845,7 +845,7 @@ namespace AMDiS { comp); if (list==preList.end()) { - Q1Psi *newQ1Psi = NEW Q1Psi(ps, quadrat); + Q1Psi *newQ1Psi = new Q1Psi(ps, quadrat); preList.push_back(newQ1Psi); return newQ1Psi; } diff --git a/AMDiS/src/Quadrature.cc b/AMDiS/src/Quadrature.cc index 0c1c5502..31a25526 100644 --- a/AMDiS/src/Quadrature.cc +++ b/AMDiS/src/Quadrature.cc @@ -18,7 +18,7 @@ namespace AMDiS { n_points = q.n_points; // copy barycentric coordinates - lambda = NEW VectorOfFixVecs<DimVec<double> >(*(q.lambda)); + lambda = new VectorOfFixVecs<DimVec<double> >(*(q.lambda)); // copy weights w = GET_MEMORY(double, n_points); @@ -50,8 +50,8 @@ namespace AMDiS { } else { if (static_cast<int>( size) < n_points) { size_t new_size = std::max(maxNQuadPoints[dim], n_points); - DELETE [] quad_vec_d; - quad_vec_d = NEW WorldVector<double>[new_size]; + delete [] quad_vec_d; + quad_vec_d = new WorldVector<double>[new_size]; size = new_size; } val = quad_vec_d; @@ -184,7 +184,7 @@ namespace AMDiS { w_0d = createAndInitArray(1, StdVol * 1.0); - Quadrature::quad_0d[0] = NEW Quadrature("0d", 0, 0, 1, Quadrature::x_0d, Quadrature::w_0d); + Quadrature::quad_0d[0] = new Quadrature("0d", 0, 0, 1, Quadrature::x_0d, Quadrature::w_0d); /****************************************************************************/ /* 1d quadrature formulas using 2 barycentric coordinates */ @@ -369,26 +369,26 @@ namespace AMDiS { StdVol * 0.074725674575291, StdVol * 0.033335672154344); - Quadrature::quad_1d[0]= NEW Quadrature("1d-Gauss: P_1", 1, 1, 1, Quadrature::x0_1d, Quadrature::w0_1d); /* P_0 */ - Quadrature::quad_1d[1]= NEW Quadrature("1d-Gauss: P_1", 1, 1, 1, Quadrature::x0_1d, Quadrature::w0_1d); /* P_1 */ - Quadrature::quad_1d[2]= NEW Quadrature("1d-Gauss: P_3", 3, 1, 2, Quadrature::x1_1d, Quadrature::w1_1d); /* P_2 */ - Quadrature::quad_1d[3]= NEW Quadrature("1d-Gauss: P_3", 3, 1, 2, Quadrature::x1_1d, Quadrature::w1_1d); /* P_3 */ - Quadrature::quad_1d[4]= NEW Quadrature("1d-Gauss: P_5", 5, 1, 3, Quadrature::x2_1d, Quadrature::w2_1d); /* P_4 */ - Quadrature::quad_1d[5]= NEW Quadrature("1d-Gauss: P_5", 5, 1, 3, Quadrature::x2_1d, Quadrature::w2_1d); /* P_5 */ - Quadrature::quad_1d[6]= NEW Quadrature("1d-Gauss: P_7", 7, 1, 4, Quadrature::x3_1d, Quadrature::w3_1d); /* P_6 */ - Quadrature::quad_1d[7]= NEW Quadrature("1d-Gauss: P_7", 7, 1, 4, Quadrature::x3_1d, Quadrature::w3_1d); /* P_7 */ - Quadrature::quad_1d[8]= NEW Quadrature("1d-Gauss: P_9", 9, 1, 5, Quadrature::x4_1d, Quadrature::w4_1d); /* P_8 */ - Quadrature::quad_1d[9]= NEW Quadrature("1d-Gauss: P_9", 9, 1, 5, Quadrature::x4_1d, Quadrature::w4_1d); /* P_9 */ - Quadrature::quad_1d[10]= NEW Quadrature("1d-Gauss: P_11", 11, 1, 6, Quadrature::x5_1d, Quadrature::w5_1d); /* P_10 */ - Quadrature::quad_1d[11]= NEW Quadrature("1d-Gauss: P_11", 11, 1, 6, Quadrature::x5_1d, Quadrature::w5_1d); /* P_11 */ - Quadrature::quad_1d[12]= NEW Quadrature("1d-Gauss: P_13", 13, 1, 7, Quadrature::x6_1d, Quadrature::w6_1d); /* P_12 */ - Quadrature::quad_1d[13]= NEW Quadrature("1d-Gauss: P_13", 13, 1, 7, Quadrature::x6_1d, Quadrature::w6_1d); /* P_13 */ - Quadrature::quad_1d[14]= NEW Quadrature("1d-Gauss: P_15", 15, 1, 8, Quadrature::x7_1d, Quadrature::w7_1d); /* P_14 */ - Quadrature::quad_1d[15]= NEW Quadrature("1d-Gauss: P_15", 15, 1, 8, Quadrature::x7_1d, Quadrature::w7_1d); /* P_15 */ - Quadrature::quad_1d[16]= NEW Quadrature("1d-Gauss: P_17", 17, 1, 9, Quadrature::x8_1d, Quadrature::w8_1d); /* P_16 */ - Quadrature::quad_1d[17]= NEW Quadrature("1d-Gauss: P_17", 17, 1, 9, Quadrature::x8_1d, Quadrature::w8_1d); /* P_17 */ - Quadrature::quad_1d[18]= NEW Quadrature("1d-Gauss: P_19", 19, 1, 10, Quadrature::x9_1d, Quadrature::w9_1d); /* P_18 */ - Quadrature::quad_1d[19]= NEW Quadrature("1d-Gauss: P_19", 19, 1, 10, Quadrature::x9_1d, Quadrature::w9_1d);/* P_19 */ + Quadrature::quad_1d[0]= new Quadrature("1d-Gauss: P_1", 1, 1, 1, Quadrature::x0_1d, Quadrature::w0_1d); /* P_0 */ + Quadrature::quad_1d[1]= new Quadrature("1d-Gauss: P_1", 1, 1, 1, Quadrature::x0_1d, Quadrature::w0_1d); /* P_1 */ + Quadrature::quad_1d[2]= new Quadrature("1d-Gauss: P_3", 3, 1, 2, Quadrature::x1_1d, Quadrature::w1_1d); /* P_2 */ + Quadrature::quad_1d[3]= new Quadrature("1d-Gauss: P_3", 3, 1, 2, Quadrature::x1_1d, Quadrature::w1_1d); /* P_3 */ + Quadrature::quad_1d[4]= new Quadrature("1d-Gauss: P_5", 5, 1, 3, Quadrature::x2_1d, Quadrature::w2_1d); /* P_4 */ + Quadrature::quad_1d[5]= new Quadrature("1d-Gauss: P_5", 5, 1, 3, Quadrature::x2_1d, Quadrature::w2_1d); /* P_5 */ + Quadrature::quad_1d[6]= new Quadrature("1d-Gauss: P_7", 7, 1, 4, Quadrature::x3_1d, Quadrature::w3_1d); /* P_6 */ + Quadrature::quad_1d[7]= new Quadrature("1d-Gauss: P_7", 7, 1, 4, Quadrature::x3_1d, Quadrature::w3_1d); /* P_7 */ + Quadrature::quad_1d[8]= new Quadrature("1d-Gauss: P_9", 9, 1, 5, Quadrature::x4_1d, Quadrature::w4_1d); /* P_8 */ + Quadrature::quad_1d[9]= new Quadrature("1d-Gauss: P_9", 9, 1, 5, Quadrature::x4_1d, Quadrature::w4_1d); /* P_9 */ + Quadrature::quad_1d[10]= new Quadrature("1d-Gauss: P_11", 11, 1, 6, Quadrature::x5_1d, Quadrature::w5_1d); /* P_10 */ + Quadrature::quad_1d[11]= new Quadrature("1d-Gauss: P_11", 11, 1, 6, Quadrature::x5_1d, Quadrature::w5_1d); /* P_11 */ + Quadrature::quad_1d[12]= new Quadrature("1d-Gauss: P_13", 13, 1, 7, Quadrature::x6_1d, Quadrature::w6_1d); /* P_12 */ + Quadrature::quad_1d[13]= new Quadrature("1d-Gauss: P_13", 13, 1, 7, Quadrature::x6_1d, Quadrature::w6_1d); /* P_13 */ + Quadrature::quad_1d[14]= new Quadrature("1d-Gauss: P_15", 15, 1, 8, Quadrature::x7_1d, Quadrature::w7_1d); /* P_14 */ + Quadrature::quad_1d[15]= new Quadrature("1d-Gauss: P_15", 15, 1, 8, Quadrature::x7_1d, Quadrature::w7_1d); /* P_15 */ + Quadrature::quad_1d[16]= new Quadrature("1d-Gauss: P_17", 17, 1, 9, Quadrature::x8_1d, Quadrature::w8_1d); /* P_16 */ + Quadrature::quad_1d[17]= new Quadrature("1d-Gauss: P_17", 17, 1, 9, Quadrature::x8_1d, Quadrature::w8_1d); /* P_17 */ + Quadrature::quad_1d[18]= new Quadrature("1d-Gauss: P_19", 19, 1, 10, Quadrature::x9_1d, Quadrature::w9_1d); /* P_18 */ + Quadrature::quad_1d[19]= new Quadrature("1d-Gauss: P_19", 19, 1, 10, Quadrature::x9_1d, Quadrature::w9_1d);/* P_19 */ #undef StdVol /****************************************************************************/ @@ -1114,24 +1114,24 @@ namespace AMDiS { #undef w14 #undef w15 - Quadrature::quad_2d[0] = NEW Quadrature("2d-P_1", 1, 2, N1, Quadrature::x1_2d, Quadrature::w1_2d); /* P 0 */ - Quadrature::quad_2d[1] = NEW Quadrature("2d-P_1", 1, 2, N1, Quadrature::x1_2d, Quadrature::w1_2d); /* P 1 */ - Quadrature::quad_2d[2] = NEW Quadrature("2d Stroud: P_2", 2, 2, N2, Quadrature::x2_2d, Quadrature::w2_2d); /* P 2 */ - Quadrature::quad_2d[3] = NEW Quadrature("2d Stroud: P_3", 3, 2, N3, Quadrature::x3_2d, Quadrature::w3_2d); /* P 3 */ - Quadrature::quad_2d[4] = NEW Quadrature("2d Dunavant: P_4", 4, 2, N4, Quadrature::x4_2d, Quadrature::w4_2d); /* P 4 */ - Quadrature::quad_2d[5] = NEW Quadrature("2d Dunavant: P_5", 5, 2, N5, Quadrature::x5_2d, Quadrature::w5_2d); /* P 5 */ - Quadrature::quad_2d[6] = NEW Quadrature("2d Gattermann: P_7", 7, 2, N7, Quadrature::x7_2d, Quadrature::w7_2d); /* P 6 */ - Quadrature::quad_2d[7] = NEW Quadrature("2d Gattermann: P_7", 7, 2, N7, Quadrature::x7_2d, Quadrature::w7_2d); /* P 7 */ - Quadrature::quad_2d[8] = NEW Quadrature("2d Dunavant: P_8", 8, 2, N8, Quadrature::x8_2d, Quadrature::w8_2d); /* P 8 */ - Quadrature::quad_2d[9] = NEW Quadrature("2d Dunavant: P_9", 9, 2, N9, Quadrature::x9_2d, Quadrature::w9_2d); /* P 9 */ - Quadrature::quad_2d[10] = NEW Quadrature("2d Dunavant: P_10", 10, 2, N10, Quadrature::x10_2d, Quadrature::w10_2d);/* P 10 */ - Quadrature::quad_2d[11] = NEW Quadrature("2d Dunavant: P_11", 11, 2, N11, Quadrature::x11_2d, Quadrature::w11_2d);/* P 11 */ - Quadrature::quad_2d[12] = NEW Quadrature("2d Dunavant: P_12", 12, 2, N12, Quadrature::x12_2d, Quadrature::w12_2d);/* P 12 */ - Quadrature::quad_2d[13] = NEW Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 13 */ - Quadrature::quad_2d[14] = NEW Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 14 */ - Quadrature::quad_2d[15] = NEW Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 15 */ - Quadrature::quad_2d[16] = NEW Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 16 */ - Quadrature::quad_2d[17] = NEW Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d); /* P 17 */ + Quadrature::quad_2d[0] = new Quadrature("2d-P_1", 1, 2, N1, Quadrature::x1_2d, Quadrature::w1_2d); /* P 0 */ + Quadrature::quad_2d[1] = new Quadrature("2d-P_1", 1, 2, N1, Quadrature::x1_2d, Quadrature::w1_2d); /* P 1 */ + Quadrature::quad_2d[2] = new Quadrature("2d Stroud: P_2", 2, 2, N2, Quadrature::x2_2d, Quadrature::w2_2d); /* P 2 */ + Quadrature::quad_2d[3] = new Quadrature("2d Stroud: P_3", 3, 2, N3, Quadrature::x3_2d, Quadrature::w3_2d); /* P 3 */ + Quadrature::quad_2d[4] = new Quadrature("2d Dunavant: P_4", 4, 2, N4, Quadrature::x4_2d, Quadrature::w4_2d); /* P 4 */ + Quadrature::quad_2d[5] = new Quadrature("2d Dunavant: P_5", 5, 2, N5, Quadrature::x5_2d, Quadrature::w5_2d); /* P 5 */ + Quadrature::quad_2d[6] = new Quadrature("2d Gattermann: P_7", 7, 2, N7, Quadrature::x7_2d, Quadrature::w7_2d); /* P 6 */ + Quadrature::quad_2d[7] = new Quadrature("2d Gattermann: P_7", 7, 2, N7, Quadrature::x7_2d, Quadrature::w7_2d); /* P 7 */ + Quadrature::quad_2d[8] = new Quadrature("2d Dunavant: P_8", 8, 2, N8, Quadrature::x8_2d, Quadrature::w8_2d); /* P 8 */ + Quadrature::quad_2d[9] = new Quadrature("2d Dunavant: P_9", 9, 2, N9, Quadrature::x9_2d, Quadrature::w9_2d); /* P 9 */ + Quadrature::quad_2d[10] = new Quadrature("2d Dunavant: P_10", 10, 2, N10, Quadrature::x10_2d, Quadrature::w10_2d);/* P 10 */ + Quadrature::quad_2d[11] = new Quadrature("2d Dunavant: P_11", 11, 2, N11, Quadrature::x11_2d, Quadrature::w11_2d);/* P 11 */ + Quadrature::quad_2d[12] = new Quadrature("2d Dunavant: P_12", 12, 2, N12, Quadrature::x12_2d, Quadrature::w12_2d);/* P 12 */ + Quadrature::quad_2d[13] = new Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 13 */ + Quadrature::quad_2d[14] = new Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 14 */ + Quadrature::quad_2d[15] = new Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 15 */ + Quadrature::quad_2d[16] = new Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d);/* P 16 */ + Quadrature::quad_2d[17] = new Quadrature("2d Dunavant: P_17", 17, 2, N17, Quadrature::x17_2d, Quadrature::w17_2d); /* P 17 */ #undef StdVol @@ -1384,14 +1384,14 @@ namespace AMDiS { /* use that of degree (only on function evaluation also) */ /****************************************************************************/ - Quadrature::quad_3d[0] = NEW Quadrature("3d Stroud: P_1", 1, 3, 1, Quadrature::x1_3d, Quadrature::w1_3d); /* P_0 */ - Quadrature::quad_3d[1] = NEW Quadrature("3d Stroud: P_1", 1, 3, 1, Quadrature::x1_3d, Quadrature::w1_3d); /* P_1 */ - Quadrature::quad_3d[2] = NEW Quadrature("3d Stroud: P_2", 2, 3, 4, Quadrature::x2_3d, Quadrature::w2_3d); /* P_2 */ - Quadrature::quad_3d[3] = NEW Quadrature("3d Stroud: P_3", 3, 3, 8, Quadrature::x3_3d, Quadrature::w3_3d); /* P_3 */ - Quadrature::quad_3d[4] = NEW Quadrature("3d ???: P_5", 5, 3, 15, Quadrature::x5_3d, Quadrature::w5_3d); /* P_4 */ - Quadrature::quad_3d[5] = NEW Quadrature("3d ???: P_5", 5, 3, 15, Quadrature::x5_3d, Quadrature::w5_3d); /* P_5 */ - Quadrature::quad_3d[6] = NEW Quadrature("3d ???: P_7", 7, 3, 64, Quadrature::x7_3d, Quadrature::w7_3d); /* P_6 */ - Quadrature::quad_3d[7] = NEW Quadrature("3d ???: P_7", 7, 3, 64, Quadrature::x7_3d, Quadrature::w7_3d); /* P_7 */ + Quadrature::quad_3d[0] = new Quadrature("3d Stroud: P_1", 1, 3, 1, Quadrature::x1_3d, Quadrature::w1_3d); /* P_0 */ + Quadrature::quad_3d[1] = new Quadrature("3d Stroud: P_1", 1, 3, 1, Quadrature::x1_3d, Quadrature::w1_3d); /* P_1 */ + Quadrature::quad_3d[2] = new Quadrature("3d Stroud: P_2", 2, 3, 4, Quadrature::x2_3d, Quadrature::w2_3d); /* P_2 */ + Quadrature::quad_3d[3] = new Quadrature("3d Stroud: P_3", 3, 3, 8, Quadrature::x3_3d, Quadrature::w3_3d); /* P_3 */ + Quadrature::quad_3d[4] = new Quadrature("3d ???: P_5", 5, 3, 15, Quadrature::x5_3d, Quadrature::w5_3d); /* P_4 */ + Quadrature::quad_3d[5] = new Quadrature("3d ???: P_5", 5, 3, 15, Quadrature::x5_3d, Quadrature::w5_3d); /* P_5 */ + Quadrature::quad_3d[6] = new Quadrature("3d ???: P_7", 7, 3, 64, Quadrature::x7_3d, Quadrature::w7_3d); /* P_6 */ + Quadrature::quad_3d[7] = new Quadrature("3d ???: P_7", 7, 3, 64, Quadrature::x7_3d, Quadrature::w7_3d); /* P_7 */ #undef StdVol @@ -1435,8 +1435,8 @@ namespace AMDiS { Quadrature::~Quadrature() { - DELETE lambda; - DELETE[] w; + delete lambda; + delete[] w; } double Quadrature::integrateStdSimplex(AbstractFunction<double, DimVec<double> > *f) @@ -1480,7 +1480,7 @@ namespace AMDiS { quad_fast = *fast; } else { if (fast == fastQuadList.end()) { - quad_fast = NEW FastQuadrature(const_cast<BasisFunction*>(bas_fcts), const_cast<Quadrature*>(&quad), 0); + quad_fast = new FastQuadrature(const_cast<BasisFunction*>(bas_fcts), const_cast<Quadrature*>(&quad), 0); fastQuadList.push_front(quad_fast); @@ -1531,7 +1531,7 @@ namespace AMDiS { if (!grdPhi && init_flag.isSet(INIT_GRD_PHI)) { // check flag // allocate memory - grdPhi = NEW MatrixOfFixVecs<DimVec<double> >(dim, nPoints, nBasFcts, NO_INIT); + grdPhi = new MatrixOfFixVecs<DimVec<double> >(dim, nPoints, nBasFcts, NO_INIT); // fill memory for (int i = 0; i< nPoints; i++) { @@ -1550,7 +1550,7 @@ namespace AMDiS { if (!D2Phi && init_flag.isSet(INIT_D2_PHI)) { // check flag // allocate memory - D2Phi = NEW MatrixOfFixVecs<DimMat<double> >(dim, nPoints, nBasFcts, NO_INIT); + D2Phi = new MatrixOfFixVecs<DimMat<double> >(dim, nPoints, nBasFcts, NO_INIT); // fill memory for (int i = 0; i < nPoints; i++) { @@ -1594,7 +1594,7 @@ namespace AMDiS { } if (fastQuad.grdPhi) { - grdPhi = NEW MatrixOfFixVecs<DimVec<double> >(dim, nPoints, nBasFcts, NO_INIT); + grdPhi = new MatrixOfFixVecs<DimVec<double> >(dim, nPoints, nBasFcts, NO_INIT); for (int i = 0; i < nPoints; i++) { for (int j = 0; j < nBasFcts; j++) { (*grdPhi)[i][j] = (*(fastQuad.grdPhi))[i][j]; @@ -1603,7 +1603,7 @@ namespace AMDiS { } if (fastQuad.D2Phi) { - D2Phi = NEW MatrixOfFixVecs<DimMat<double> >(dim, nPoints, nBasFcts, NO_INIT); + D2Phi = new MatrixOfFixVecs<DimMat<double> >(dim, nPoints, nBasFcts, NO_INIT); for (int i = 0; i < nPoints; i++) { for (int j = 0; j < nBasFcts; j++) { (*D2Phi)[i][j] = (*(fastQuad.D2Phi))[i][j]; @@ -1621,8 +1621,8 @@ namespace AMDiS { } FREE_MEMORY(phi, double*, nPoints); - DELETE grdPhi; - DELETE D2Phi; + delete grdPhi; + delete D2Phi; } const double FastQuadrature::getSecDer(int q,int i ,int j, int m) const { diff --git a/AMDiS/src/Quadrature.hh b/AMDiS/src/Quadrature.hh index 50adc2c8..be08be4b 100644 --- a/AMDiS/src/Quadrature.hh +++ b/AMDiS/src/Quadrature.hh @@ -27,8 +27,8 @@ namespace AMDiS { } else { if (size < nPoints) { int newSize = std::max(Quadrature::maxNQuadPoints[dim], nPoints); - if(quadVec) DELETE [] quadVec; - quadVec = NEW T[size](vecSize); + if(quadVec) delete [] quadVec; + quadVec = new T[size](vecSize); size = newSize; } val = quadVec; @@ -74,8 +74,8 @@ namespace AMDiS { } else { if(size < nPoints) { int newSize = std::max(Quadrature::maxNQuadPoints[dim], nPoints); - if(quadVec) DELETE [] quadVec; - quadVec = NEW GrdT[newSize](vecSize); + if(quadVec) delete [] quadVec; + quadVec = new GrdT[newSize](vecSize); size = newSize; } val = quadVec; @@ -131,8 +131,8 @@ namespace AMDiS { } else { if(size < nPoints) { int newSize = std::max(Quadrature::maxNQuadPoints[dim], nPoints); - if(quadVec) DELETE [] quadVec; - quadVec = NEW D2T[newSize](vecSize); + if(quadVec) delete [] quadVec; + quadVec = new D2T[newSize](vecSize); size = newSize; } val = quadVec; diff --git a/AMDiS/src/RCNeighbourList.cc b/AMDiS/src/RCNeighbourList.cc index 4ae838ba..9ec42078 100644 --- a/AMDiS/src/RCNeighbourList.cc +++ b/AMDiS/src/RCNeighbourList.cc @@ -364,7 +364,7 @@ namespace AMDiS { (*n_neigh_periodic)++; if (!periodicList) { - periodicList = NEW RCNeighbourList; + periodicList = new RCNeighbourList; insertIt = periodicList->rclist.end(); periodicList->coarseningManager = coarseningManager; } else { diff --git a/AMDiS/src/Recovery.cc b/AMDiS/src/Recovery.cc index e7c6af1b..65dbabab 100644 --- a/AMDiS/src/Recovery.cc +++ b/AMDiS/src/Recovery.cc @@ -5,56 +5,56 @@ RecoveryStructure& RecoveryStructure::operator=(const RecoveryStructure& rhs) { if (rhs.coords) { if (!coords) { - coords = NEW WorldVector<double>; + coords = new WorldVector<double>; } *coords = *rhs.coords; } else { if (coords) { - DELETE coords; + delete coords; coords = NULL; } } if (rhs.A) { if (!A) - A = NEW Matrix<double>(rhs.A->getNumRows(), rhs.A->getNumCols()); + A = new Matrix<double>(rhs.A->getNumRows(), rhs.A->getNumCols()); *A = *rhs.A; } else { if (A) { - DELETE A; + delete A; A = NULL; } } if (rhs.rec_uh) { if (!rec_uh) - rec_uh = NEW Vector<double>(rhs.rec_uh->getSize()); + rec_uh = new Vector<double>(rhs.rec_uh->getSize()); *rec_uh = *rhs.rec_uh; } else { if (rec_uh) { - DELETE rec_uh; + delete rec_uh; rec_uh=NULL; } } if (rhs.rec_grdUh) { if (!rec_grdUh) - rec_grdUh = NEW Vector<WorldVector<double> >(rhs.rec_grdUh->getSize()); + rec_grdUh = new Vector<WorldVector<double> >(rhs.rec_grdUh->getSize()); *rec_grdUh = *rhs.rec_grdUh; } else { if (rec_grdUh) { - DELETE rec_grdUh; + delete rec_grdUh; rec_grdUh = NULL; } } if (rhs.neighbors) { if (!neighbors) - neighbors = NEW std::set<DegreeOfFreedom>; + neighbors = new std::set<DegreeOfFreedom>; *neighbors = *rhs.neighbors ; } else { if (neighbors) { - DELETE neighbors; + delete neighbors; neighbors = NULL; } } @@ -154,14 +154,14 @@ void Recovery::set_feSpace(const FiniteElemSpace *fe_space) { if (struct_vec) { - DELETE struct_vec; + delete struct_vec; struct_vec = NULL; } feSpace = fe_space; // create new structure vector - struct_vec = NEW DOFVector<RecoveryStructure>(feSpace, "struct vec"); + struct_vec = new DOFVector<RecoveryStructure>(feSpace, "struct vec"); } return; @@ -196,7 +196,7 @@ int Recovery::set_exponents(int degree) if (matrix_fcts) matrix_fcts->resize(n_monomials, n_monomials); else - matrix_fcts = NEW Matrix<Monomial*>(n_monomials, n_monomials); + matrix_fcts = new Matrix<Monomial*>(n_monomials, n_monomials); } // Setting vector of exponents. @@ -243,7 +243,7 @@ int Recovery::set_exponents(int degree) { // Computing exponent vector of monomial. sum = exponents[i] + exponents[j]; - (*matrix_fcts)[i][j] = NEW Monomial(sum); + (*matrix_fcts)[i][j] = new Monomial(sum); } return n_monomials; @@ -317,7 +317,7 @@ void Recovery::compute_integrals(DOFVector<double> *uh, ElInfo *elInfo, } // Get gradient at quadrature points - WorldVector<double> *grdAtQP = NEW WorldVector<double>[n_points]; + WorldVector<double> *grdAtQP = new WorldVector<double>[n_points]; uh->getGrdAtQPs(elInfo, quad, NULL, grdAtQP); vec_sum = 0.0; for (k=0; k<n_points; k++) @@ -334,7 +334,7 @@ void Recovery::compute_integrals(DOFVector<double> *uh, ElInfo *elInfo, (*rec_struct->rec_grdUh)[i] = (*rec_struct->rec_grdUh)[i] + vec_sum * elInfo->getDet(); - DELETE [] grdAtQP; + delete [] grdAtQP; } else // For recovery of DOFVector. { @@ -375,7 +375,7 @@ void Recovery::compute_interior_sums(DOFVector<double> *uh, ElInfo *elInfo, WorldVector<double> quad_pts; // For world coordinates of quadrature points. double *uhAtQP = GET_MEMORY(double, n_points); - WorldVector<double> *grdAtQP = NEW WorldVector<double>[n_points]; + WorldVector<double> *grdAtQP = new WorldVector<double>[n_points]; for (i=0; i<n_monomials; i++) { @@ -419,7 +419,7 @@ void Recovery::compute_interior_sums(DOFVector<double> *uh, ElInfo *elInfo, } FREE_MEMORY(uhAtQP, double, n_points); - DELETE [] grdAtQP; + delete [] grdAtQP; return; } @@ -612,7 +612,7 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, // Setting world coordinates of node. if (!(*struct_vec)[k].coords) { - (*struct_vec)[k].coords = NEW WorldVector<double>; + (*struct_vec)[k].coords = new WorldVector<double>; *(*struct_vec)[k].coords = el_info->getCoord(i); } @@ -621,19 +621,19 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, // Allocating memory for matrix and right hand side. if (!(*struct_vec)[k].A) { - (*struct_vec)[k].A = NEW Matrix<double>(n_monomials, n_monomials); + (*struct_vec)[k].A = new Matrix<double>(n_monomials, n_monomials); *(*struct_vec)[k].A = 0.0; if (gradient) { (*struct_vec)[k].rec_grdUh - = NEW Vector<WorldVector<double> >(n_monomials); + = new Vector<WorldVector<double> >(n_monomials); for (j=0; j<n_monomials; j++) (*(*struct_vec)[k].rec_grdUh)[j] = 0.0; } else { - (*struct_vec)[k].rec_uh = NEW Vector<double>(n_monomials); + (*struct_vec)[k].rec_uh = new Vector<double>(n_monomials); *(*struct_vec)[k].rec_uh = 0.0; } } @@ -648,7 +648,7 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, else { if (!(*struct_vec)[k].neighbors) - (*struct_vec)[k].neighbors = NEW std::set<DegreeOfFreedom>; + (*struct_vec)[k].neighbors = new std::set<DegreeOfFreedom>; if (degree==2 && dim>1) compute_sums_linear(uh, el_info, &(*struct_vec)[k], @@ -661,7 +661,7 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, else // Setting list of adjacent interior vertices. { if (!(*struct_vec)[k].neighbors) - (*struct_vec)[k].neighbors = NEW std::set<DegreeOfFreedom>; + (*struct_vec)[k].neighbors = new std::set<DegreeOfFreedom>; for (j=0; j<n_neighbors; j++) (*struct_vec)[k].neighbors->insert(interior_vertices[j]); @@ -681,11 +681,11 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, // Setting world coordinates of node. el_info->coordToWorld(*basis_fcts->getCoords(n_count), coordinates); - (*struct_vec)[k].coords = NEW WorldVector<double>; + (*struct_vec)[k].coords = new WorldVector<double>; *(*struct_vec)[k].coords = coordinates; // Setting list of adjacent interior vertices. - (*struct_vec)[k].neighbors = NEW std::set<DegreeOfFreedom>; + (*struct_vec)[k].neighbors = new std::set<DegreeOfFreedom>; if (el_info->getBoundary(EDGE, i) == INTERIOR) for (m=0; m<2; m++) @@ -713,11 +713,11 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, // Setting world coordinates of node. el_info->coordToWorld(*basis_fcts->getCoords(n_count), coordinates); - (*struct_vec)[k].coords = NEW WorldVector<double>; + (*struct_vec)[k].coords = new WorldVector<double>; *(*struct_vec)[k].coords = coordinates; // Setting list of adjacent interior vertices. - (*struct_vec)[k].neighbors = NEW std::set<DegreeOfFreedom>; + (*struct_vec)[k].neighbors = new std::set<DegreeOfFreedom>; if (el_info->getBoundary(FACE, i) == INTERIOR) for (m=0; m<3; m++) @@ -742,11 +742,11 @@ void Recovery::fill_struct_vec(DOFVector<double> *uh, // Setting world coordinates of node. el_info->coordToWorld(*basis_fcts->getCoords(n_count), coordinates); - (*struct_vec)[k].coords = NEW WorldVector<double>; + (*struct_vec)[k].coords = new WorldVector<double>; *(*struct_vec)[k].coords = coordinates; // Setting list of adjacent interior vertices. - (*struct_vec)[k].neighbors = NEW std::set<DegreeOfFreedom>; + (*struct_vec)[k].neighbors = new std::set<DegreeOfFreedom>; for (m=0; m<n_neighbors; m++) (*struct_vec)[k].neighbors->insert(interior_vertices[m]); @@ -853,11 +853,11 @@ Recovery::recoveryUh(DOFVector<double> *uh, const FiniteElemSpace *fe_space) // Allocate memory for result vector if (vec && vec->getFESpace() != feSpace) { - DELETE vec; + delete vec; vec = NULL; } if (!vec) - vec = NEW DOFVector<double>(feSpace, "gradient"); + vec = new DOFVector<double>(feSpace, "gradient"); result = vec; result->set(0.0); @@ -929,12 +929,12 @@ Recovery::recovery(DOFVector<double> *uh, const FiniteElemSpace *fe_space, // Allocate memory for result vector if (vec && vec->getFESpace() != feSpace) { - DELETE vec; + delete vec; vec = NULL; } if (!vec) - vec = NEW DOFVector<WorldVector<double> >(feSpace, "gradient"); + vec = new DOFVector<WorldVector<double> >(feSpace, "gradient"); result = vec; @@ -980,11 +980,11 @@ Recovery::recovery(DOFVector<double> *uh, // Allocate memory for result vector if (vec && vec->getFESpace() != fe_space) { - DELETE vec; + delete vec; vec = NULL; } if (!vec) { - vec = NEW DOFVector<WorldVector<double> >(fe_space, "gradient"); + vec = new DOFVector<WorldVector<double> >(fe_space, "gradient"); } result = vec; diff --git a/AMDiS/src/Recovery.h b/AMDiS/src/Recovery.h index 4bd223c3..f65c322d 100644 --- a/AMDiS/src/Recovery.h +++ b/AMDiS/src/Recovery.h @@ -102,31 +102,31 @@ public: // construtor, destructor { if (coords) { - DELETE coords; + delete coords; coords = NULL; } if (A) { - DELETE A; + delete A; A = NULL; } if (rec_uh) { - DELETE rec_uh; + delete rec_uh; rec_uh = NULL; } if (rec_grdUh) { - DELETE rec_grdUh; + delete rec_grdUh; rec_grdUh = NULL; } if (neighbors) { - DELETE neighbors; + delete neighbors; neighbors = NULL; } }; diff --git a/AMDiS/src/RecoveryEstimator.cc b/AMDiS/src/RecoveryEstimator.cc index 32c8d58b..479977f3 100644 --- a/AMDiS/src/RecoveryEstimator.cc +++ b/AMDiS/src/RecoveryEstimator.cc @@ -52,7 +52,7 @@ RecoveryEstimator::RecoveryEstimator(std::string name, DOFVector<double> *uh, in method = 0; } - rec_struct = NEW Recovery(norm, method); + rec_struct = new Recovery(norm, method); } double RecoveryEstimator::estimate(double timestep) @@ -93,8 +93,8 @@ double RecoveryEstimator::estimate(double timestep) int numPoints = quad->getNumPoints(); WorldVector<double> quad_pt; - WorldVector<double> *grdAtQP = NEW WorldVector<double>[numPoints]; - WorldVector<double> *recoveryGrdAtQP = NEW WorldVector<double>[numPoints]; + WorldVector<double> *grdAtQP = new WorldVector<double>[numPoints]; + WorldVector<double> *recoveryGrdAtQP = new WorldVector<double>[numPoints]; double *uhAtQP = GET_MEMORY(double, numPoints); double *recoveryUhAtQP = GET_MEMORY(double, numPoints); @@ -213,8 +213,8 @@ double RecoveryEstimator::estimate(double timestep) MSG("estimate = %.8e\n", est_sum); - DELETE [] grdAtQP; - DELETE [] recoveryGrdAtQP; + delete [] grdAtQP; + delete [] recoveryGrdAtQP; FREE_MEMORY(uhAtQP, double, numPoints); FREE_MEMORY(recoveryUhAtQP, double, numPoints); diff --git a/AMDiS/src/RecoveryEstimator.h b/AMDiS/src/RecoveryEstimator.h index cf2d4bb6..3b6799ba 100644 --- a/AMDiS/src/RecoveryEstimator.h +++ b/AMDiS/src/RecoveryEstimator.h @@ -57,7 +57,7 @@ namespace AMDiS { */ Estimator* create() { - return NEW RecoveryEstimator(name, uh, row); + return new RecoveryEstimator(name, uh, row); }; protected: diff --git a/AMDiS/src/RefinementManager.cc b/AMDiS/src/RefinementManager.cc index 7971f528..a5fed07c 100644 --- a/AMDiS/src/RefinementManager.cc +++ b/AMDiS/src/RefinementManager.cc @@ -50,7 +50,7 @@ namespace AMDiS { int n_elements = mesh->getNumberOfLeaves(); ElInfo *elInfo; newCoords = false; - stack = NEW TraverseStack; + stack = new TraverseStack; doMoreRecursiveRefine = true; while (doMoreRecursiveRefine) { @@ -71,7 +71,7 @@ namespace AMDiS { setNewCoords(); // call of sub-class method } - DELETE stack; + delete stack; n_elements = mesh->getNumberOfLeaves() - n_elements; diff --git a/AMDiS/src/RefinementManager1d.cc b/AMDiS/src/RefinementManager1d.cc index 51f00c70..f41c1c7b 100644 --- a/AMDiS/src/RefinementManager1d.cc +++ b/AMDiS/src/RefinementManager1d.cc @@ -126,7 +126,7 @@ namespace AMDiS { Projection *projector = elInfo->getProjection(0); if (el->getFirstChild() && projector && (!el->isNewCoordSet())) { - WorldVector<double> *new_coord = NEW WorldVector<double>; + WorldVector<double> *new_coord = new WorldVector<double>; for (int j = 0; j < dow; j++) (*new_coord)[j] = (elInfo->getCoord(0)[j] + elInfo->getCoord(1)[j]) * 0.5; diff --git a/AMDiS/src/RefinementManager3d.cc b/AMDiS/src/RefinementManager3d.cc index d47efcdb..7a0997d7 100644 --- a/AMDiS/src/RefinementManager3d.cc +++ b/AMDiS/src/RefinementManager3d.cc @@ -273,7 +273,7 @@ namespace AMDiS { } if (el->getFirstChild() && projector && (!el->isNewCoordSet())) { - WorldVector<double> *new_coord = NEW WorldVector<double>; + WorldVector<double> *new_coord = new WorldVector<double>; for (j = 0; j < dow; j++) (*new_coord)[j] = (el_info->getCoord(0)[j] + el_info->getCoord(1)[j])*0.5; @@ -319,9 +319,9 @@ namespace AMDiS { Mesh::FILL_COORDS; if (refList) - DELETE refList; + delete refList; - refList = NEW RCNeighbourList(mesh->getMaxEdgeNeigh()); + refList = new RCNeighbourList(mesh->getMaxEdgeNeigh()); fillFlag |= Mesh::FILL_NEIGH; el_info = stack->traverseFirst(mesh, -1, fillFlag); @@ -633,7 +633,7 @@ namespace AMDiS { /****************************************************************************/ /* get memory for a list of all elements at the refinement edge */ /****************************************************************************/ - ref_list = NEW RCNeighbourList(mesh->getMaxEdgeNeigh()); + ref_list = new RCNeighbourList(mesh->getMaxEdgeNeigh()); ref_list->setElType(0, (dynamic_cast<ElInfo3d*>(el_info))->getType()); ref_list->setElement(0, el_info->getElement()); n_neigh = 1; @@ -754,7 +754,7 @@ namespace AMDiS { stack->update(); - DELETE ref_list; + delete ref_list; return(el_info); } diff --git a/AMDiS/src/ResidualEstimator.cc b/AMDiS/src/ResidualEstimator.cc index 1b1af2ba..66151c8d 100644 --- a/AMDiS/src/ResidualEstimator.cc +++ b/AMDiS/src/ResidualEstimator.cc @@ -118,8 +118,8 @@ namespace AMDiS { jump_.resize(nPointsSurface_); localJump_.resize(nPointsSurface_); neighbours_ = Global::getGeo(NEIGH, dim); - lambdaNeigh_ = NEW DimVec<WorldVector<double> >(dim, NO_INIT); - lambda_ = NEW DimVec<double>(dim, NO_INIT); + lambdaNeigh_ = new DimVec<WorldVector<double> >(dim, NO_INIT); + lambda_ = new DimVec<double>(dim, NO_INIT); } } @@ -169,11 +169,11 @@ namespace AMDiS { } if (C1 && (dim > 1)) { - DELETE lambdaNeigh_; - DELETE lambda_; + delete lambdaNeigh_; + delete lambda_; } - DELETE neighInfo; + delete neighInfo; } void ResidualEstimator::estimateElement(ElInfo *elInfo) diff --git a/AMDiS/src/ResidualEstimator.h b/AMDiS/src/ResidualEstimator.h index 0c637442..1b484210 100644 --- a/AMDiS/src/ResidualEstimator.h +++ b/AMDiS/src/ResidualEstimator.h @@ -83,7 +83,7 @@ namespace AMDiS { * Returns a new ODirSolver object. */ Estimator* create() { - return NEW ResidualEstimator(name, row); + return new ResidualEstimator(name, row); } }; diff --git a/AMDiS/src/ResidualParallelEstimator.cc b/AMDiS/src/ResidualParallelEstimator.cc index 6e18ed62..92c73509 100644 --- a/AMDiS/src/ResidualParallelEstimator.cc +++ b/AMDiS/src/ResidualParallelEstimator.cc @@ -17,14 +17,14 @@ namespace AMDiS { seqEstimators_.resize(omp_get_overall_max_threads()); for (int i = 0; i < omp_get_overall_max_threads(); i++) { - seqEstimators_[i] = NEW ResidualEstimator(name, r); + seqEstimators_[i] = new ResidualEstimator(name, r); } } ResidualParallelEstimator::~ResidualParallelEstimator() { for (int i = 0; i < static_cast<int>(seqEstimators_.size()); i++) { - DELETE seqEstimators_[i]; + delete seqEstimators_[i]; } } diff --git a/AMDiS/src/ResidualParallelEstimator.h b/AMDiS/src/ResidualParallelEstimator.h index f8c076a6..d05cd0fc 100644 --- a/AMDiS/src/ResidualParallelEstimator.h +++ b/AMDiS/src/ResidualParallelEstimator.h @@ -56,7 +56,7 @@ namespace AMDiS { * Returns a new ODirSolver object. */ Estimator* create() { - return NEW ResidualParallelEstimator(name, row); + return new ResidualParallelEstimator(name, row); } }; diff --git a/AMDiS/src/RobinBC.cc b/AMDiS/src/RobinBC.cc index cb6dd5f3..46912617 100644 --- a/AMDiS/src/RobinBC.cc +++ b/AMDiS/src/RobinBC.cc @@ -29,7 +29,7 @@ namespace AMDiS { // for all element sides for(i=0; i < dim+1; i++) { coords[i] = - NEW VectorOfFixVecs<DimVec<double> >(dim, + new VectorOfFixVecs<DimVec<double> >(dim, dim, DEFAULT_VALUE, DimVec<double>(dim, @@ -44,28 +44,28 @@ namespace AMDiS { } if(j) { - Operator *jOp = NEW Operator(Operator::VECTOR_OPERATOR, rowFESpace); + Operator *jOp = new Operator(Operator::VECTOR_OPERATOR, rowFESpace); jOp->addZeroOrderTerm(new CoordsAtQP_ZOT(j)); - neumannOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); + neumannOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); for(i=0; i < dim+1; i++) { - (*neumannOperators)[i] = NEW SurfaceOperator(jOp, *coords[i]); + (*neumannOperators)[i] = new SurfaceOperator(jOp, *coords[i]); } - DELETE jOp; + delete jOp; } if(alpha) { - Operator *alphaOp = NEW Operator(Operator::MATRIX_OPERATOR, + Operator *alphaOp = new Operator(Operator::MATRIX_OPERATOR, rowFESpace, colFESpace); alphaOp->addZeroOrderTerm(new CoordsAtQP_ZOT(alpha)); - robinOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); + robinOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); for(i=0; i < dim + 1; i++) { - (*robinOperators)[i] = NEW SurfaceOperator(alphaOp, *coords[i]); + (*robinOperators)[i] = new SurfaceOperator(alphaOp, *coords[i]); } - DELETE alphaOp; + delete alphaOp; } } @@ -89,7 +89,7 @@ namespace AMDiS { // for all element sides for(i=0; i < dim+1; i++) { coords[i] = - NEW VectorOfFixVecs<DimVec<double> >(dim, + new VectorOfFixVecs<DimVec<double> >(dim, dim, DEFAULT_VALUE, DimVec<double>(dim, @@ -105,28 +105,28 @@ namespace AMDiS { } if(j) { - Operator *jOp = NEW Operator(Operator::VECTOR_OPERATOR, rowFESpace); + Operator *jOp = new Operator(Operator::VECTOR_OPERATOR, rowFESpace); jOp->addZeroOrderTerm(new VecAtQP_ZOT(j, NULL)); - neumannOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); + neumannOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); for(i=0; i < dim+1; i++) { - (*neumannOperators)[i] = NEW SurfaceOperator(jOp, *coords[i]); + (*neumannOperators)[i] = new SurfaceOperator(jOp, *coords[i]); } - DELETE jOp; + delete jOp; } if(alpha) { - Operator *alphaOp = NEW Operator(Operator::MATRIX_OPERATOR, + Operator *alphaOp = new Operator(Operator::MATRIX_OPERATOR, rowFESpace, colFESpace); alphaOp->addZeroOrderTerm(new VecAtQP_ZOT(alpha, NULL)); - robinOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); + robinOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); for(i=0; i < dim + 1; i++) { - (*robinOperators)[i] = NEW SurfaceOperator(alphaOp, *coords[i]); + (*robinOperators)[i] = new SurfaceOperator(alphaOp, *coords[i]); } - DELETE alphaOp; + delete alphaOp; } } @@ -149,7 +149,7 @@ namespace AMDiS { // for all element sides for(i=0; i < dim+1; i++) { coords[i] = - NEW VectorOfFixVecs<DimVec<double> >(dim, + new VectorOfFixVecs<DimVec<double> >(dim, dim, DEFAULT_VALUE, DimVec<double>(dim, @@ -163,14 +163,14 @@ namespace AMDiS { } } - neumannOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); - robinOperators = NEW DimVec<SurfaceOperator*>(dim, NO_INIT); + neumannOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); + robinOperators = new DimVec<SurfaceOperator*>(dim, NO_INIT); for(i=0; i < dim + 1; i++) { if(jOp) - (*neumannOperators)[i] = NEW SurfaceOperator(jOp, *coords[i]); + (*neumannOperators)[i] = new SurfaceOperator(jOp, *coords[i]); if(alphaOp) - (*robinOperators)[i] = NEW SurfaceOperator(alphaOp, *coords[i]); + (*robinOperators)[i] = new SurfaceOperator(alphaOp, *coords[i]); } } @@ -303,8 +303,8 @@ namespace AMDiS { 1.0); } - WorldVector<double> *grdUh = NEW WorldVector<double>[numPoints]; - WorldVector<double> *A_grdUh = NEW WorldVector<double>[numPoints]; + WorldVector<double> *grdUh = new WorldVector<double>[numPoints]; + WorldVector<double> *A_grdUh = new WorldVector<double>[numPoints]; for (iq = 0; iq < numPoints; iq++) { A_grdUh[iq].set(0.0); @@ -327,8 +327,8 @@ namespace AMDiS { val += quadrature->getWeight(iq)*sqr(n_A_grdUh); } - DELETE [] grdUh; - DELETE [] A_grdUh; + delete [] grdUh; + delete [] A_grdUh; } } diff --git a/AMDiS/src/ScalableQuadrature.cc b/AMDiS/src/ScalableQuadrature.cc index aa2f6e18..22558e8d 100644 --- a/AMDiS/src/ScalableQuadrature.cc +++ b/AMDiS/src/ScalableQuadrature.cc @@ -10,7 +10,7 @@ namespace AMDiS { name = "Scalable" + getName(); // copy quadrature->lambda to oldLambda - oldLambda = NEW VectorOfFixVecs<DimVec<double> >(*(quadrature->getLambda())); + oldLambda = new VectorOfFixVecs<DimVec<double> >(*(quadrature->getLambda())); // First assume all quadrature points to be valid. valid.resize(n_points); diff --git a/AMDiS/src/ScalableQuadrature.h b/AMDiS/src/ScalableQuadrature.h index 06953b42..00b084f3 100644 --- a/AMDiS/src/ScalableQuadrature.h +++ b/AMDiS/src/ScalableQuadrature.h @@ -44,7 +44,7 @@ namespace AMDiS { /// Destructor ~ScalableQuadrature() { - DELETE oldLambda; + delete oldLambda; } /// Manipulates the quadrature points for the assemblage of a subelement. diff --git a/AMDiS/src/SolutionDataStorage.h b/AMDiS/src/SolutionDataStorage.h index 83ebb55f..5cf2fa86 100644 --- a/AMDiS/src/SolutionDataStorage.h +++ b/AMDiS/src/SolutionDataStorage.h @@ -64,7 +64,7 @@ namespace AMDiS { ~SolutionData() { if (!serialized) { - //DELETE solution; + //delete solution; //deleteFeSpace(feSpace); } } @@ -80,7 +80,7 @@ namespace AMDiS { serialized = true; filename = fn; - DELETE solution; + delete solution; deleteFeSpace(feSpace); } @@ -215,8 +215,8 @@ namespace AMDiS { void deleteFeSpace(FiniteElemSpace* fe) { if (fe) { - DELETE fe->getMesh(); - DELETE fe; + delete fe->getMesh(); + delete fe; fe = NULL; } } diff --git a/AMDiS/src/SolutionDataStorage.hh b/AMDiS/src/SolutionDataStorage.hh index 42afe93e..948cdca1 100644 --- a/AMDiS/src/SolutionDataStorage.hh +++ b/AMDiS/src/SolutionDataStorage.hh @@ -52,7 +52,7 @@ namespace AMDiS { } if (found == -1) { - feSpace[i] = NEW FiniteElemSpace(); + feSpace[i] = new FiniteElemSpace(); *(feSpace[i]) = *(solution->getFESpace(i)); memoryUsage += feSpace[i]->calcMemoryUsage(); } else { @@ -60,7 +60,7 @@ namespace AMDiS { } } - SystemVector *vec = NEW SystemVector("tmp", feSpace, solution->getFESpaces().size()); + SystemVector *vec = new SystemVector("tmp", feSpace, solution->getFESpaces().size()); vec->createNewDOFVectors("tmp"); vec->setCoarsenOperation(COARSE_INTERPOL); vec->interpol(solution, 1.0); @@ -104,7 +104,7 @@ namespace AMDiS { void SolutionDataStorage<T>::clear() { for (int i = 0; i < static_cast<int>(solutions.size()); i++) { - DELETE solutions[i]; + delete solutions[i]; } solutions.clear(); diff --git a/AMDiS/src/SubAssembler.cc b/AMDiS/src/SubAssembler.cc index 3c238fd8..16273256 100644 --- a/AMDiS/src/SubAssembler.cc +++ b/AMDiS/src/SubAssembler.cc @@ -128,12 +128,12 @@ namespace AMDiS { if (coordsAtQPs) { if (coordsNumAllocated != nPoints) { - DELETE [] coordsAtQPs; - coordsAtQPs = NEW WorldVector<double>[nPoints]; + delete [] coordsAtQPs; + coordsAtQPs = new WorldVector<double>[nPoints]; coordsNumAllocated = nPoints; } } else { - coordsAtQPs = NEW WorldVector<double>[nPoints]; + coordsAtQPs = new WorldVector<double>[nPoints]; coordsNumAllocated = nPoints; } diff --git a/AMDiS/src/SubElInfo.cc b/AMDiS/src/SubElInfo.cc index 5abe6d4b..e36db469 100644 --- a/AMDiS/src/SubElInfo.cc +++ b/AMDiS/src/SubElInfo.cc @@ -18,7 +18,7 @@ namespace AMDiS { FixVec<WorldVector<double>, VERTEX> worldCoords(dim, NO_INIT); - lambda = NEW VectorOfFixVecs<DimVec<double> >(dim, dim + 1, NO_INIT); + lambda = new VectorOfFixVecs<DimVec<double> >(dim, dim + 1, NO_INIT); for (int i = 0; i <= dim; i++) { (*lambda)[i] = (*lambda_)[i]; } diff --git a/AMDiS/src/SubElInfo.h b/AMDiS/src/SubElInfo.h index 868943b3..1ba496cc 100644 --- a/AMDiS/src/SubElInfo.h +++ b/AMDiS/src/SubElInfo.h @@ -31,7 +31,7 @@ namespace AMDiS { /// Destructor ~SubElInfo() { - DELETE lambda; + delete lambda; } /// Get b-th coordinate of the a-th vertex of subelement (barycentriccoordinates). diff --git a/AMDiS/src/SubQuadrature.h b/AMDiS/src/SubQuadrature.h index e05d8356..4362d434 100644 --- a/AMDiS/src/SubQuadrature.h +++ b/AMDiS/src/SubQuadrature.h @@ -47,7 +47,7 @@ namespace AMDiS { inline void scaleQuadrature(VectorOfFixVecs<DimVec<double> > &coords) { if(!lambda || (lambda == quad_->getLambda())) { - lambda = NEW VectorOfFixVecs<DimVec<double> >(dim, n_points, NO_INIT); + lambda = new VectorOfFixVecs<DimVec<double> >(dim, n_points, NO_INIT); } TEST_EXIT_DBG(coords.getSize() == (subDim_ + 1)) diff --git a/AMDiS/src/SurfaceAssembler.h b/AMDiS/src/SurfaceAssembler.h index 35fa9b17..31f330f3 100644 --- a/AMDiS/src/SurfaceAssembler.h +++ b/AMDiS/src/SurfaceAssembler.h @@ -51,25 +51,25 @@ namespace AMDiS { SubQuadrature *subQuadrature; if(rowQuad11_) { - subQuadrature = NEW SubQuadrature(rowQuad11_, rowDim_); + subQuadrature = new SubQuadrature(rowQuad11_, rowDim_); rowQuad11_ = colQuad11_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo11_ = colQPInfo11_ = QPInfo::provideQPInfo(rowQuad11_, NULL); } if(rowQuad10_) { - subQuadrature = NEW SubQuadrature(rowQuad10_, rowDim_); + subQuadrature = new SubQuadrature(rowQuad10_, rowDim_); rowQuad10_ = colQuad10_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo10_ = colQPInfo10_ = QPInfo::provideQPInfo(rowQuad10_, NULL); } if(rowQuad01_) { - subQuadrature = NEW SubQuadrature(rowQuad01_, rowDim_); + subQuadrature = new SubQuadrature(rowQuad01_, rowDim_); rowQuad01_ = colQuad01_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo01_ = colQPInfo01_ = QPInfo::provideQPInfo(rowQuad01_, NULL); } if(rowQuad00_) { - subQuadrature = NEW SubQuadrature(rowQuad00_, rowDim_); + subQuadrature = new SubQuadrature(rowQuad00_, rowDim_); rowQuad00_ = colQuad00_ = subQuadrature; subQuadrature->scaleQuadrature(coords_); rowQPInfo00_ = colQPInfo00_ = QPInfo::provideQPInfo(rowQuad00_, NULL); @@ -79,10 +79,10 @@ namespace AMDiS { /// Destructor ~SurfaceAssembler() { - if (rowQuad11_) DELETE rowQuad11_; - if (rowQuad10_) DELETE rowQuad10_; - if (rowQuad01_) DELETE rowQuad01_; - if (rowQuad00_) DELETE rowQuad00_; + if (rowQuad11_) delete rowQuad11_; + if (rowQuad10_) delete rowQuad10_; + if (rowQuad01_) delete rowQuad01_; + if (rowQuad00_) delete rowQuad00_; } /// Adapt surface quadratures to \ref coords. diff --git a/AMDiS/src/SurfaceOperator.h b/AMDiS/src/SurfaceOperator.h index c939d1c5..54194cd6 100644 --- a/AMDiS/src/SurfaceOperator.h +++ b/AMDiS/src/SurfaceOperator.h @@ -65,27 +65,27 @@ namespace AMDiS { if (secondOrder[myRank].size() > 0) { degree = getQuadratureDegree(2); // quad2 = SurfaceQuadrature::provideSurfaceQuadrature(dim, degree, coords); - quad2 = NEW SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), + quad2 = new SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), coords); } if (firstOrderGrdPsi[myRank].size() > 0) { degree = getQuadratureDegree(1, GRD_PSI); - quad1GrdPsi = NEW SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), + quad1GrdPsi = new SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), coords); //SurfaceQuadrature::provideSurfaceQuadrature(dim, degree, coords); } if (firstOrderGrdPhi[myRank].size() > 0) { degree = getQuadratureDegree(1, GRD_PHI); - quad1GrdPhi = NEW SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), + quad1GrdPhi = new SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), coords); //SurfaceQuadrature::provideSurfaceQuadrature(dim, degree, coords); } if (zeroOrder[myRank].size() > 0) { degree = getQuadratureDegree(0); - quad0 = NEW SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), + quad0 = new SurfaceQuadrature(Quadrature::provideQuadrature(dim - 1, degree), coords); //SurfaceQuadrature::provideSurfaceQuadrature(dim, degree, coords); } diff --git a/AMDiS/src/SurfaceQuadrature.cc b/AMDiS/src/SurfaceQuadrature.cc index e4f214e5..06d418c3 100644 --- a/AMDiS/src/SurfaceQuadrature.cc +++ b/AMDiS/src/SurfaceQuadrature.cc @@ -21,12 +21,12 @@ namespace AMDiS { int i, j, k; // copy coords - // coords_ = NEW DimVec<double>[dim](dim, NO_INIT); + // coords_ = new DimVec<double>[dim](dim, NO_INIT); // for(i = 0; i < dim; i++) { // coords_[i] = coords[i]; // } - lambda = NEW VectorOfFixVecs<DimVec<double> >(dim, n_points, NO_INIT); + lambda = new VectorOfFixVecs<DimVec<double> >(dim, n_points, NO_INIT); // for each integration point for(i=0; i < n_points; i++) { diff --git a/AMDiS/src/SurfaceRegion_ED.h b/AMDiS/src/SurfaceRegion_ED.h index b929846d..76b40b88 100644 --- a/AMDiS/src/SurfaceRegion_ED.h +++ b/AMDiS/src/SurfaceRegion_ED.h @@ -40,7 +40,7 @@ namespace AMDiS { { public: ElementData* create() { - return NEW SurfaceRegion_ED; + return new SurfaceRegion_ED; } }; @@ -62,7 +62,7 @@ namespace AMDiS { sideOfChild = parent->getSideOfChild(0, side_, elType); if(sideOfChild >= 0) { - surfaceRegion = NEW SurfaceRegion_ED(child1->getElementData()); + surfaceRegion = new SurfaceRegion_ED(child1->getElementData()); surfaceRegion->setSide(sideOfChild); surfaceRegion->setRegion(region_); child1->setElementData(surfaceRegion); @@ -70,7 +70,7 @@ namespace AMDiS { sideOfChild = parent->getSideOfChild(1, side_, elType); if(sideOfChild >= 0) { - surfaceRegion = NEW SurfaceRegion_ED(child2->getElementData()); + surfaceRegion = new SurfaceRegion_ED(child2->getElementData()); surfaceRegion->side_ = sideOfChild; surfaceRegion->region_ = region_; child2->setElementData(surfaceRegion); @@ -80,7 +80,7 @@ namespace AMDiS { }; ElementData *clone() const { - SurfaceRegion_ED *newObj = NEW SurfaceRegion_ED; + SurfaceRegion_ED *newObj = new SurfaceRegion_ED; newObj->side_ = side_; newObj->region_ = region_; newObj->decorated_ = ElementData::clone(); diff --git a/AMDiS/src/SystemVector.h b/AMDiS/src/SystemVector.h index 6ca85272..3d53aedd 100644 --- a/AMDiS/src/SystemVector.h +++ b/AMDiS/src/SystemVector.h @@ -65,11 +65,11 @@ namespace AMDiS { SystemVector *create() { char number[10]; std::string numberedName; - SystemVector *result = NEW SystemVector(name, feSpace, size); + SystemVector *result = new SystemVector(name, feSpace, size); for (int i = 0; i < size; i++) { sprintf(number, "[%d]", i); numberedName = name + std::string(number); - result->setDOFVector(i, NEW DOFVector<double>(feSpace[i], numberedName)); + result->setDOFVector(i, new DOFVector<double>(feSpace[i], numberedName)); } return result; } @@ -79,10 +79,10 @@ namespace AMDiS { */ void free(SystemVector *vec) { for (int i = 0; i < size; i++) { - DELETE vec->getDOFVector(i); + delete vec->getDOFVector(i); vec->setDOFVector(i, NULL); } - DELETE vec; + delete vec; } private: @@ -127,21 +127,21 @@ namespace AMDiS { { for (int i = 0; i < vectors.getSize(); i++) { - vectors[i] = NEW DOFVector<double>(*rhs.vectors[i]); + vectors[i] = new DOFVector<double>(*rhs.vectors[i]); } } ~SystemVector() { for (int i = 0; i < vectors.getSize(); i++) { - DELETE vectors[i]; + delete vectors[i]; } } void createNewDOFVectors(std::string name) { for (int i = 0; i < vectors.getSize(); i++) { - vectors[i] = NEW DOFVector<double>(feSpace[i], "tmp"); + vectors[i] = new DOFVector<double>(feSpace[i], "tmp"); } } @@ -290,7 +290,7 @@ namespace AMDiS { in.read(reinterpret_cast<char*>(&size), sizeof(int)); vectors.resize(size); for (int i = oldSize; i < size; i++) { - vectors[i] = NEW DOFVector<double>(feSpace[i], ""); + vectors[i] = new DOFVector<double>(feSpace[i], ""); } for (int i = 0; i < size; i++) { vectors[i]->deserialize(in); diff --git a/AMDiS/src/Tetrahedron.cc b/AMDiS/src/Tetrahedron.cc index 43878846..8ceaa988 100644 --- a/AMDiS/src/Tetrahedron.cc +++ b/AMDiS/src/Tetrahedron.cc @@ -103,7 +103,7 @@ namespace AMDiS { vof = vertexOfFace[face]; if(NULL == sorted_3d) { - sorted_3d = NEW MatrixOfFixVecs<FixVec<int,WORLD> >(3,4,7,NO_INIT); + sorted_3d = new MatrixOfFixVecs<FixVec<int,WORLD> >(3,4,7,NO_INIT); (*sorted_3d)[0][0][0]=(*sorted_3d)[0][0][1]= (*sorted_3d)[0][0][2]=(*sorted_3d)[1][0][0]= diff --git a/AMDiS/src/Tetrahedron.h b/AMDiS/src/Tetrahedron.h index 3c57c4b9..e2c4eae4 100644 --- a/AMDiS/src/Tetrahedron.h +++ b/AMDiS/src/Tetrahedron.h @@ -45,7 +45,7 @@ namespace AMDiS { /// implements Element::clone inline Element *clone() { - return NEW Tetrahedron(mesh); + return new Tetrahedron(mesh); } /// implements Element::getVertexOfEdge diff --git a/AMDiS/src/Traverse.cc b/AMDiS/src/Traverse.cc index 6dee2f61..9bfa1514 100644 --- a/AMDiS/src/Traverse.cc +++ b/AMDiS/src/Traverse.cc @@ -776,7 +776,7 @@ namespace AMDiS { } if (save_stack_used > stack2_used) { /* `refine' both el and el2 */ - TEST_EXIT_DBG(el->getChild(0))("invalid NEW refinement?\n"); + TEST_EXIT_DBG(el->getChild(0))("invalid new refinement?\n"); if (el->getDOF(0) == el2->getDOF(0)) i = save_info_stack[stack2_used] - 1; @@ -915,7 +915,7 @@ namespace AMDiS { /* First phase: go up in tree until we can go down again. */ /* */ /* During this first phase, nb is the neighbour index which points from an */ - /* element of the OLD hierarchy branch to the NEW branch */ + /* element of the OLD hierarchy branch to the new branch */ /****************************************************************************/ nb = neighbour; @@ -978,7 +978,7 @@ namespace AMDiS { /****************************************************************************/ /* Second phase: go down in a new hierarchy branch until leaf level. */ /* Now, nb is the neighbour index which points from an element of the */ - /* NEW hierarchy branch to the OLD branch. */ + /* new hierarchy branch to the OLD branch. */ /****************************************************************************/ elinfo = elinfo_stack[stack_used]; @@ -996,7 +996,7 @@ namespace AMDiS { } if (save_stack_used > stack2_used) { /* `refine' both el and el2 */ - TEST_EXIT_DBG(el->getFirstChild())("invalid NEW refinement?"); + TEST_EXIT_DBG(el->getFirstChild())("invalid new refinement?"); /* use child i, neighbour of el2->child[nb-1] */ i = 2 - save_info_stack[stack2_used]; diff --git a/AMDiS/src/Traverse.h b/AMDiS/src/Traverse.h index c95695b1..4c9227b7 100644 --- a/AMDiS/src/Traverse.h +++ b/AMDiS/src/Traverse.h @@ -69,10 +69,10 @@ namespace AMDiS { ~TraverseStack() { for (int i = 0; i < static_cast<int>(elinfo_stack.size()); i++) - DELETE elinfo_stack[i]; + delete elinfo_stack[i]; for (int i = 0; i < static_cast<int>(save_elinfo_stack.size()); i++) - DELETE save_elinfo_stack[i]; + delete save_elinfo_stack[i]; } public: diff --git a/AMDiS/src/TraverseParallel.cc b/AMDiS/src/TraverseParallel.cc index 92afbb17..cd2a1d00 100644 --- a/AMDiS/src/TraverseParallel.cc +++ b/AMDiS/src/TraverseParallel.cc @@ -20,7 +20,7 @@ namespace AMDiS { it != stacks_.end(); ++it) { - (*it) = NEW TraverseStack(); + (*it) = new TraverseStack(); (*it)->setMyThreadId(i++); (*it)->setMaxThreads(nThreads_); @@ -33,7 +33,7 @@ namespace AMDiS { it != stacks_.end(); ++it) { - DELETE (*it); + delete (*it); } } diff --git a/AMDiS/src/Triangle.h b/AMDiS/src/Triangle.h index d5f697d8..91c8094e 100644 --- a/AMDiS/src/Triangle.h +++ b/AMDiS/src/Triangle.h @@ -50,7 +50,7 @@ namespace AMDiS { * implements Element::clone */ inline Element *clone() { - return NEW Triangle(mesh); + return new Triangle(mesh); } diff --git a/AMDiS/src/UmfPackSolver.h b/AMDiS/src/UmfPackSolver.h index 7b0d26d0..62a88f09 100644 --- a/AMDiS/src/UmfPackSolver.h +++ b/AMDiS/src/UmfPackSolver.h @@ -52,7 +52,7 @@ namespace AMDiS { * Returns a new UmfPackSolver object. */ OEMSolver* create() { - return NEW UmfPackSolver(this->name); + return new UmfPackSolver(this->name); } }; diff --git a/AMDiS/src/VtkWriter.cc b/AMDiS/src/VtkWriter.cc index 7d4616fd..c995213e 100644 --- a/AMDiS/src/VtkWriter.cc +++ b/AMDiS/src/VtkWriter.cc @@ -78,16 +78,16 @@ namespace AMDiS { void VtkWriter::writeFile(DOFVector<double> *values, const char *filename) { - DataCollector *dc = NEW DataCollector(values->getFESpace(), values); + DataCollector *dc = new DataCollector(values->getFESpace(), values); std::vector<DataCollector*> dcList(0); dcList.push_back(dc); - VtkWriter *writer = NEW VtkWriter(&dcList); + VtkWriter *writer = new VtkWriter(&dcList); writer->writeFile(filename); - DELETE writer; - DELETE dc; + delete writer; + delete dc; } } diff --git a/AMDiS/src/ZeroOrderAssembler.cc b/AMDiS/src/ZeroOrderAssembler.cc index 1e5210d7..72f1c56f 100644 --- a/AMDiS/src/ZeroOrderAssembler.cc +++ b/AMDiS/src/ZeroOrderAssembler.cc @@ -67,12 +67,12 @@ namespace AMDiS { // create new assembler if (!optimized) { - newAssembler = NEW StandardZOA(op, assembler, quad); + newAssembler = new StandardZOA(op, assembler, quad); } else { if (pwConst) { - newAssembler = NEW PrecalcZOA(op, assembler, quad); + newAssembler = new PrecalcZOA(op, assembler, quad); } else { - newAssembler = NEW FastQuadZOA(op, assembler, quad); + newAssembler = new FastQuadZOA(op, assembler, quad); } } -- GitLab