Skip to content
Snippets Groups Projects
Commit d49b1348 authored by podlesny's avatar podlesny
Browse files

init public members with nullptr for more meaningful fault messages if not set

parent 9788b61b
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ template<class MatrixType, class VectorType> ...@@ -5,6 +5,8 @@ template<class MatrixType, class VectorType>
inline inline
void ProjectedBlockGSStep<MatrixType, VectorType>::iterate() void ProjectedBlockGSStep<MatrixType, VectorType>::iterate()
{ {
assert(hasObstacle_!=nullptr);
if (hasObstacle_->size()!= (unsigned int)this->x_->size()) if (hasObstacle_->size()!= (unsigned int)this->x_->size())
DUNE_THROW(SolverError, "Size of hasObstacle (" << hasObstacle_->size() DUNE_THROW(SolverError, "Size of hasObstacle (" << hasObstacle_->size()
<< ") doesn't match solution vector (" << this->x_->size() << ")"); << ") doesn't match solution vector (" << this->x_->size() << ")");
...@@ -46,6 +48,8 @@ void ProjectedBlockGSStep<MatrixType, VectorType>::iterate() ...@@ -46,6 +48,8 @@ void ProjectedBlockGSStep<MatrixType, VectorType>::iterate()
// Solve the local constraint minimization problem // Solve the local constraint minimization problem
// We use a projected Gauss-Seidel, for lack of anything better // We use a projected Gauss-Seidel, for lack of anything better
assert(obstacles_!=nullptr);
Obstacle defectObstacle = (*obstacles_)[i]; Obstacle defectObstacle = (*obstacles_)[i];
defectObstacle -= x; defectObstacle -= x;
......
...@@ -48,8 +48,8 @@ public: ...@@ -48,8 +48,8 @@ public:
using HasObstacle = Dune::BitSetVector<BlockSize>; using HasObstacle = Dune::BitSetVector<BlockSize>;
using Obstacle = BoxConstraint<Field, BlockSize>; using Obstacle = BoxConstraint<Field, BlockSize>;
const HasObstacle* hasObstacle_; const HasObstacle* hasObstacle_ = nullptr;
const std::vector<Obstacle>* obstacles_; const std::vector<Obstacle>* obstacles_ = nullptr;
}; };
#include "projectedblockgsstep.cc" #include "projectedblockgsstep.cc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment