MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / WritePlotfile2DFrom3D

Function WritePlotfile2DFrom3D

Src/Extern/ProfParser/AMReX_BLWritePlotFile.cpp:325–536  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

323
324// --------------------------------------------------------------------
325void 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);

Callers

nothing calls this directly

Calls 15

AbortFunction · 0.85
IOProcessorFunction · 0.85
BarrierFunction · 0.85
Write2DBoxFrom3DFunction · 0.85
ConcatenateFunction · 0.85
VisMFBaseNameFunction · 0.85
VisMFWriteFunction · 0.85
VisMFWriteHeaderFunction · 0.85
InitializeFunction · 0.50
lengthMethod · 0.45
nCompMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected