Skip to content
Snippets Groups Projects
Commit 26f98571 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

bugfix: only the set of leaf Dirichlet nodes is needed nowadays

[[Imported from SVN: r5677]]
parent 0803ad85
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,7 @@ int main (int argc, char *argv[]) try ...@@ -99,7 +99,7 @@ int main (int argc, char *argv[]) try
std::vector<std::vector<BoxConstraint<double,3> > > trustRegionObstacles(1); std::vector<std::vector<BoxConstraint<double,3> > > trustRegionObstacles(1);
std::vector<BitSetVector<1> > hasObstacle(1); std::vector<BitSetVector<1> > hasObstacle(1);
std::vector<BitSetVector<blocksize> > dirichletNodes(1); BitSetVector<blocksize> dirichletNodes;
// //////////////////////////////// // ////////////////////////////////
// Create a multigrid solver // Create a multigrid solver
...@@ -123,7 +123,7 @@ int main (int argc, char *argv[]) try ...@@ -123,7 +123,7 @@ int main (int argc, char *argv[]) try
MonotoneMGStep<MatrixType, CorrectionType> multigridStep(1); MonotoneMGStep<MatrixType, CorrectionType> multigridStep(1);
multigridStep.setMGType(mu, nu1, nu2); multigridStep.setMGType(mu, nu1, nu2);
multigridStep.ignoreNodes_ = &dirichletNodes[0]; multigridStep.ignoreNodes_ = &dirichletNodes;
multigridStep.basesolver_ = &baseSolver; multigridStep.basesolver_ = &baseSolver;
multigridStep.setSmoother(&presmoother, &postsmoother); multigridStep.setSmoother(&presmoother, &postsmoother);
multigridStep.hasObstacle_ = &hasObstacle; multigridStep.hasObstacle_ = &hasObstacle;
...@@ -167,15 +167,13 @@ int main (int argc, char *argv[]) try ...@@ -167,15 +167,13 @@ int main (int argc, char *argv[]) try
std::cout << " Solving on level: " << toplevel << std::endl; std::cout << " Solving on level: " << toplevel << std::endl;
std::cout << "####################################################" << std::endl; std::cout << "####################################################" << std::endl;
dirichletNodes.resize(toplevel+1); dirichletNodes.resize( grid.size(1) );
for (int i=0; i<=toplevel; i++) { dirichletNodes.unsetAll();
dirichletNodes[i].resize( grid.size(i,1), false ); dirichletNodes[0] = true;
dirichletNodes.back() = true;
dirichletNodes[i][0] = true;
dirichletNodes[i].back() = true;
} multigridStep.ignoreNodes_ = &dirichletNodes;
// //////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////
// Create solution and rhs vectors // Create solution and rhs vectors
...@@ -260,7 +258,7 @@ int main (int argc, char *argv[]) try ...@@ -260,7 +258,7 @@ int main (int argc, char *argv[]) try
setTrustRegionObstacles(trustRegionRadius, setTrustRegionObstacles(trustRegionRadius,
trustRegionObstacles[toplevel], trustRegionObstacles[toplevel],
trueObstacles[toplevel], trueObstacles[toplevel],
dirichletNodes[toplevel]); dirichletNodes);
dynamic_cast<MultigridStep<MatrixType,CorrectionType>*>(solver.iterationStep_)->setProblem(hessianMatrix, corr, rhs, toplevel+1); dynamic_cast<MultigridStep<MatrixType,CorrectionType>*>(solver.iterationStep_)->setProblem(hessianMatrix, corr, rhs, toplevel+1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment