Skip to content
Snippets Groups Projects
Commit 56986c50 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Move obstacle creation to where it is set

parent 69949da4
Branches
No related tags found
No related merge requests found
......@@ -39,16 +39,6 @@ void solveObstacleProblemByMMGSolver(const GridType& grid, const MatrixType& mat
// create double obstacle constraints
const int blockSize = VectorType::block_type::dimension;
std::vector<BoxConstraint<typename Vector::field_type,blockSize> > boxConstraints(rhs.size());
for (int i = 0; i < boxConstraints.size(); ++i)
{
for (int j = 0; j < blockSize; ++j)
{
boxConstraints[i].lower(j) = -1;
boxConstraints[i].upper(j) = +1;
}
}
/////////////////////////////////////////////////////////////
// Create a monotone multigrid solver
/////////////////////////////////////////////////////////////
......@@ -79,6 +69,16 @@ void solveObstacleProblemByMMGSolver(const GridType& grid, const MatrixType& mat
Dune::BitSetVector<blockSize> hasObstacle(x.size(),true);
mmgStep->hasObstacle_ = &hasObstacle;
std::vector<BoxConstraint<typename Vector::field_type,blockSize> > boxConstraints(rhs.size());
for (int i = 0; i < boxConstraints.size(); ++i)
{
for (int j = 0; j < blockSize; ++j)
{
boxConstraints[i].lower(j) = -1;
boxConstraints[i].upper(j) = +1;
}
}
mmgStep->obstacles_ = &boxConstraints;
// we need a vector of pointers to the transfer operator base class
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment