Skip to content
Snippets Groups Projects
Commit 5bb31f99 authored by Uli Sack's avatar Uli Sack Committed by usack
Browse files

empty setNumberOfLevels; tweak destructor such that it won't produce a...

empty setNumberOfLevels; tweak destructor such that it won't produce a segfault for a MultigridStep that never called preprocess; remove dysfunct newline marks in deprecation warnings

[[Imported from SVN: r7399]]
parent 1b6c65ec
Branches
Tags
No related merge requests found
......@@ -39,7 +39,7 @@
LinearIterationStep<MatrixType, VectorType>* postSmoother,
Solver* baseSolver,
const BitVectorType* ignoreNodes)
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators.\n Just erase the number of levels from the argument list in your constructor call.") :
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators. Just erase the number of levels from the argument list in your constructor call.") :
LinearIterationStep<MatrixType, VectorType>(mat, x, rhs),
presmoother_(numLevels), postsmoother_(numLevels),
matrixHierarchy_(numLevels),
......@@ -88,7 +88,7 @@
MultigridStep(const MatrixType& mat,
VectorType& x,
VectorType& rhs, int numLevels)
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators.\n Just erase the number of levels from the argument list in your constructor call.") :
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators. Just erase the number of levels from the argument list in your constructor call.") :
LinearIterationStep<MatrixType, VectorType>(mat, x, rhs),
presmoother_(numLevels),postsmoother_(numLevels),
basesolver_(0),
......@@ -112,43 +112,25 @@
virtual ~MultigridStep()
{
for (size_t i=0; i<matrixHierarchy_.size()-1; i++)
delete(ignoreNodesHierarchy_[i]);
for (int i=0; i<int(ignoreNodesHierarchy_.size()-1); i++)
{
if (ignoreNodesHierarchy_[i])
delete(ignoreNodesHierarchy_[i]);
}
}
virtual void setProblem(const MatrixType& mat,
VectorType& x,
VectorType& rhs,
int numLevels)
DUNE_DEPRECATED_MSG("Use setProblem(const MatrixType& mat,VectorType& x,const VectorType& rhs).\n The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators.")
DUNE_DEPRECATED_MSG("Use setProblem(const MatrixType& mat,VectorType& x,const VectorType& rhs). The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators.")
{
setProblem(mat, x, rhs);
}
virtual void setNumberOfLevels(int numLevels)
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators.\n The functionality of this function is now performed in preprocess().")
{
numLevels_ = numLevels;
for (int i=0; i<int(ignoreNodesHierarchy_.size())-1; i++)
if (ignoreNodesHierarchy_[i])
delete(ignoreNodesHierarchy_[i]);
matrixHierarchy_.resize(numLevels);
ignoreNodesHierarchy_.resize(numLevels);
for (int i=0; i<int(matrixHierarchy_.size())-1; i++)
{
matrixHierarchy_[i].reset();
ignoreNodesHierarchy_[i] = NULL;
}
presmoother_.resize(numLevels);
postsmoother_.resize(numLevels);
xHierarchy_.resize(numLevels);
rhsHierarchy_.resize(numLevels);
}
DUNE_DEPRECATED_MSG("The number of levels is no longer set explicitely, but instead inferred from the number of transfer operators. The functionality of this function is now performed in preprocess().")
{}
virtual void setProblem(const MatrixType& mat,
VectorType& x,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment