diff options
author | 2018-02-06 13:56:38 -0800 | |
---|---|---|
committer | 2018-02-06 13:56:38 -0800 | |
commit | ec6dd873d46a87707c20aa09b58c691d37a36f98 (patch) | |
tree | cfa6a71947445b185f9d197bfeec356ddbbadffb /Source/WarpXBoostedFrameDiagnostic.cpp | |
parent | c081449f8f1729ef6f635743e95e96c345ae5d2c (diff) | |
parent | 2d3cca8885f44fe4f8829e1f066e83cffce82c57 (diff) | |
download | WarpX-ec6dd873d46a87707c20aa09b58c691d37a36f98.tar.gz WarpX-ec6dd873d46a87707c20aa09b58c691d37a36f98.tar.zst WarpX-ec6dd873d46a87707c20aa09b58c691d37a36f98.zip |
Merge branch 'master' into with_python
Diffstat (limited to 'Source/WarpXBoostedFrameDiagnostic.cpp')
-rw-r--r-- | Source/WarpXBoostedFrameDiagnostic.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/WarpXBoostedFrameDiagnostic.cpp b/Source/WarpXBoostedFrameDiagnostic.cpp index d58ed0be7..a617961ee 100644 --- a/Source/WarpXBoostedFrameDiagnostic.cpp +++ b/Source/WarpXBoostedFrameDiagnostic.cpp @@ -46,7 +46,10 @@ BoostedFrameDiagnostic:: writeLabFrameData(const MultiFab& cell_centered_data, const Geometry& geom, Real t_boost) { BL_PROFILE("BoostedFrameDiagnostic::writeLabFrameData"); - + + VisMF::Header::Version current_version = VisMF::GetHeaderVersion(); + VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1); + const RealBox& domain_z_boost = geom.ProbDomain(); const Real zlo_boost = domain_z_boost.lo(boost_direction_); const Real zhi_boost = domain_z_boost.hi(boost_direction_); @@ -119,6 +122,8 @@ writeLabFrameData(const MultiFab& cell_centered_data, const Geometry& geom, Real buff_counter_[i] = 0; } } + + VisMF::SetHeaderVersion(current_version); } void @@ -167,20 +172,23 @@ LabSnapShot(Real t_lab_in, Real zmin_lab_in, current_z_boost = 0.0; file_name = Concatenate("lab_frame_data/snapshot", file_num, 5); - const int nlevels = 1; - const std::string level_prefix = "Level_"; - - if (!UtilCreateDirectory(file_name, 0755)) - CreateDirectoryFailed(file_name); - for(int i(0); i < nlevels; ++i) { - const std::string &fullpath = LevelFullPath(i, file_name); - if (!UtilCreateDirectory(fullpath, 0755)) - CreateDirectoryFailed(fullpath); + if (ParallelDescriptor::IOProcessor()) { + + const int nlevels = 1; + const std::string level_prefix = "Level_"; + + if (!UtilCreateDirectory(file_name, 0755)) + CreateDirectoryFailed(file_name); + for(int i(0); i < nlevels; ++i) { + const std::string &fullpath = LevelFullPath(i, file_name); + if (!UtilCreateDirectory(fullpath, 0755)) + CreateDirectoryFailed(fullpath); + } } ParallelDescriptor::Barrier(); - writeSnapShotHeader(); + if (ParallelDescriptor::IOProcessor()) writeSnapShotHeader(); } void |