diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 32b7bfc47f069bb8ee672a1c9d3953e06287eb03..8fdb314f8c61eff345c3e2797df24fcff846b381 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -356,10 +356,24 @@ int main(int argc, char *argv[]) { // Choose an initial iterate that is admissable // and non-zero in as many places as possible if (run == 1) - for (size_t i = 0; i < ignoreNodes.size(); ++i) - if (!ignoreNodes[i][1]) // Leave out partial DOF-restrictions as - // well - u4_diff[i] = 1; + for (size_t i = 0; i < ignoreNodes.size(); ++i) { + size_t const count = ignoreNodes[i].count(); + + if (count == dim) + continue; + + if (count == 0) { + u4_diff[i] = 1e-4; + continue; + } + + assert(count == 1); + assert(ignoreNodes[i][1]); // Only the y coordinate is allowed to be + // fixed + for (int j = 0; j < dim; ++j) + if (j != 1) + u4_diff[i][j] = 1e-4; + } MyBlockProblemType myBlockProblem(parset, myConvexProblem); multigridStep->setProblem(u4_diff, myBlockProblem);