()
| 2564 | |
| 2565 | |
| 2566 | bool Foam::meshRefinement::write() const |
| 2567 | { |
| 2568 | bool writeOk = mesh_.write(); |
| 2569 | |
| 2570 | // Make sure that any distributed surfaces (so ones which probably have |
| 2571 | // been changed) get written as well. |
| 2572 | // Note: should ideally have some 'modified' flag to say whether it |
| 2573 | // has been changed or not. |
| 2574 | searchableSurfaces& geometry = |
| 2575 | const_cast<searchableSurfaces&>(surfaces_.geometry()); |
| 2576 | |
| 2577 | forAll(geometry, i) |
| 2578 | { |
| 2579 | searchableSurface& s = geometry[i]; |
| 2580 | |
| 2581 | // Check if instance() of surface is not constant or system. |
| 2582 | // Is good hint that surface is distributed. |
| 2583 | if |
| 2584 | ( |
| 2585 | s.instance() != s.time().system() |
| 2586 | && s.instance() != s.time().caseSystem() |
| 2587 | && s.instance() != s.time().constant() |
| 2588 | && s.instance() != s.time().caseConstant() |
| 2589 | ) |
| 2590 | { |
| 2591 | // Make sure it gets written to current time, not constant. |
| 2592 | s.instance() = s.time().timeName(); |
| 2593 | writeOk = writeOk && s.write(); |
| 2594 | } |
| 2595 | } |
| 2596 | |
| 2597 | return writeOk; |
| 2598 | } |
no test coverage detected