--------------------------------------------------------------------
| 323 | |
| 324 | // -------------------------------------------------------------------- |
| 325 | void WritePlotfile2DFrom3D(const std::string &pfversion, |
| 326 | const Vector<MultiFab> &data, |
| 327 | const Real time, |
| 328 | const Vector<Real> &probLo, |
| 329 | const Vector<Real> &probHi, |
| 330 | const Vector<int> &refRatio, |
| 331 | const Vector<Box> &probDomain, |
| 332 | const Vector<Vector<Real> > &dxLevel, |
| 333 | const int coordSys, |
| 334 | const std::string &oFile, |
| 335 | const Vector<std::string> &names, |
| 336 | const bool verbose, |
| 337 | const bool isCartGrid, |
| 338 | const Real *vfeps, |
| 339 | const int *levelSteps) |
| 340 | { |
| 341 | |
| 342 | int whichPlane; |
| 343 | if(probDomain[0].length(0) == 1) { |
| 344 | whichPlane = 0; |
| 345 | } else if(probDomain[0].length(1) == 1) { |
| 346 | whichPlane = 1; |
| 347 | } else if(probDomain[0].length(2) == 1) { |
| 348 | whichPlane = 2; |
| 349 | } else { |
| 350 | Abort("Error: no length = 1 plane."); |
| 351 | } |
| 352 | |
| 353 | if(ParallelDescriptor::IOProcessor()) { |
| 354 | if( ! UtilCreateDirectory(oFile,0755)) { |
| 355 | CreateDirectoryFailed(oFile); |
| 356 | } |
| 357 | } |
| 358 | // Force other processors to wait till directory is built. |
| 359 | ParallelDescriptor::Barrier(); |
| 360 | |
| 361 | std::string oFileHeader(oFile); |
| 362 | oFileHeader += "/Header"; |
| 363 | |
| 364 | VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); |
| 365 | |
| 366 | std::ofstream os; |
| 367 | |
| 368 | //os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); |
| 369 | |
| 370 | if(verbose && ParallelDescriptor::IOProcessor()) { |
| 371 | std::cout << "Opening file = " << oFileHeader << '\n'; |
| 372 | } |
| 373 | |
| 374 | os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); |
| 375 | |
| 376 | if(os.fail()) { |
| 377 | FileOpenFailed(oFileHeader); |
| 378 | } |
| 379 | // |
| 380 | // Start writing plotfile. |
| 381 | // |
| 382 | int spacedim(2); |
nothing calls this directly
no test coverage detected