| 773 | } |
| 774 | |
| 775 | void |
| 776 | StateData::checkPoint (const std::string& name, |
| 777 | const std::string& fullpathname, |
| 778 | std::ostream& os, |
| 779 | VisMF::How how, |
| 780 | bool dump_old) |
| 781 | { |
| 782 | BL_PROFILE("StateData::checkPoint()"); |
| 783 | static const std::string NewSuffix("_New_MF"); |
| 784 | static const std::string OldSuffix("_Old_MF"); |
| 785 | |
| 786 | if (dump_old == true && old_data == nullptr) |
| 787 | { |
| 788 | dump_old = false; |
| 789 | } |
| 790 | |
| 791 | if (ParallelDescriptor::IOProcessor()) |
| 792 | { |
| 793 | // |
| 794 | // The relative name gets written to the Header file. |
| 795 | // |
| 796 | std::string mf_name_old(name + OldSuffix); |
| 797 | std::string mf_name_new(name + NewSuffix); |
| 798 | |
| 799 | os << domain << '\n'; |
| 800 | |
| 801 | grids.writeOn(os); |
| 802 | |
| 803 | os << old_time.start << '\n' |
| 804 | << old_time.stop << '\n' |
| 805 | << new_time.start << '\n' |
| 806 | << new_time.stop << '\n'; |
| 807 | |
| 808 | if (desc->store_in_checkpoint()) |
| 809 | { |
| 810 | if (dump_old) |
| 811 | { |
| 812 | os << 2 << '\n' << mf_name_new << '\n' << mf_name_old << '\n'; |
| 813 | fabArrayHeaderNames.push_back(std::move(mf_name_new)); |
| 814 | fabArrayHeaderNames.push_back(std::move(mf_name_old)); |
| 815 | } |
| 816 | else |
| 817 | { |
| 818 | os << 1 << '\n' << mf_name_new << '\n'; |
| 819 | fabArrayHeaderNames.push_back(std::move(mf_name_new)); |
| 820 | } |
| 821 | } |
| 822 | else |
| 823 | { |
| 824 | os << 0 << '\n'; |
| 825 | } |
| 826 | } |
| 827 | |
| 828 | if (desc->store_in_checkpoint()) |
| 829 | { |
| 830 | BL_ASSERT(new_data); |
| 831 | std::string mf_fullpath_new(fullpathname + NewSuffix); |
| 832 | if (AsyncOut::UseAsyncOut()) { |
nothing calls this directly
no test coverage detected