Skip to content
Snippets Groups Projects
Commit ce74702b authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Use a while loop and no temporary

parent f7de7f2a
No related branches found
No related tags found
No related merge requests found
...@@ -243,13 +243,10 @@ int main(int argc, char *argv[]) { ...@@ -243,13 +243,10 @@ int main(int argc, char *argv[]) {
auto const &neumannFunction = functions.get("neumannCondition"); auto const &neumannFunction = functions.get("neumannCondition");
// Find a (somewhat random) frictional node // Find a (somewhat random) frictional node
size_t first_frictional_node; size_t first_frictional_node = 0;
for (size_t i = 0; i < frictionalNodes.size(); ++i) { while (!frictionalNodes[first_frictional_node][0] &&
if (frictionalNodes[i][0]) { first_frictional_node < frictionalNodes.size())
first_frictional_node = i; ++first_frictional_node;
break;
}
}
for (size_t run = 1; run <= timesteps; ++run) { for (size_t run = 1; run <= timesteps; ++run) {
double const time = h * run; double const time = h * run;
......
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