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

Function writePlotFile

Src/Extern/amrdata/AMReX_WritePlotFile.cpp:27–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void
28writePlotFile (const std::string& dir,
29 std::ostream& os,
30 int level,
31 const MultiFab& mf,
32 const Geometry& geom,
33 const IntVect& refRatio,
34 Real bgVal,
35 const Vector<std::string>& names)
36{
37 amrex::ignore_unused(bgVal);
38 //
39 // Fake a level 0 data set, and then use incoming multifab as
40 // level 1 data.
41 //
42 const int NUM_STATE = mf.nComp();
43 const Real cumTime = 0.0;
44 const Real curTime = cumTime;
45 const int finestLevel = 1;
46 Vector< Box > domain(finestLevel+1);
47 const IndexType& ixType = mf.boxArray().ixType();
48 if (ixType != IndexType::TheCellType())
49 amrex::Error("writePlotfile unable to handle non cell-centered data for now");
50 Box tmpb = Box(geom.Domain()).convert(ixType);
51 Vector<int> corr(BL_SPACEDIM);
52 for (int d = 0; d < BL_SPACEDIM; d++)
53 {
54 corr[d] = (ixType.ixType(d) == IndexType::CELL ? 1 : 0);
55 }
56 for (int M = 0; M < finestLevel; M++)
57 {
58 tmpb.coarsen(refRatio);
59 }
60 domain[0] = tmpb;
61 const int levelSteps = 0;
62 Vector< Vector< Real > > dx(finestLevel+1);
63 Vector< Vector<RealBox> > grid_loc(finestLevel+1);
64 const BoxArray& grids = mf.boxArray();
65 for (int j = 0; j<= finestLevel; j++)
66 {
67 if (j!=0)
68 domain[j] = Box( domain[j-1] ).refine(refRatio);
69 dx[j].resize(BL_SPACEDIM);
70 for (int k = 0; k < BL_SPACEDIM; k++)
71 {
72 dx[j][k] = (geom.ProbHi(k) - geom.ProbLo(k))/domain[j].length(k);
73 }
74 if (j==0)
75 {
76 grid_loc[j].resize(1);
77 grid_loc[j][0] = RealBox(geom.ProbLo(),geom.ProbHi());
78 } else {
79 grid_loc[j].resize(grids.size());
80 for (int L=0; L < grids.size(); L++)
81 {
82 const Box& bx = grids[L];
83 grid_loc[j][L] = RealBox(AMREX_D_DECL( dx[j][0]*bx.smallEnd(0),
84 dx[j][1]*bx.smallEnd(1),

Callers 8

writePlotFileMethod · 0.85
writePlotFileMethod · 0.85
writePlotFileMethod · 0.85
writePlotFileMethod · 0.85
initMethod · 0.85
RegridOnlyMethod · 0.85
timeStepMethod · 0.85
coarseTimeStepMethod · 0.85

Calls 15

ConcatenateFunction · 0.85
IOProcessorFunction · 0.85
BarrierFunction · 0.85
thePlotFileTypeFunction · 0.85
secondFunction · 0.85
refineMethod · 0.80
RealBoxClass · 0.50
BoxArrayClass · 0.50
WriteFunction · 0.50
ReduceRealMaxFunction · 0.50
nCompMethod · 0.45
ixTypeMethod · 0.45

Tested by

no test coverage detected