Skip to content

Commit

Permalink
add to viz docs and update plotfile so nu is corret
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Dec 21, 2024
1 parent f416914 commit 3f663af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
24 changes: 19 additions & 5 deletions Docs/sphinx_doc/Visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ Visualization
=============

By default, REMORA currently generates plotfile in the native AMReX format, but
they can also be written in HDF5 or NetCDF.
they can also be written in NetCDF. For NetCDF, you can use your favorite reader or
analysis tool. The files contain the attributes necessary to, e.g. calculate the
stretched vertical grid as one would from a ROMS NetCDF file.

There are several visualization tools that can be used for AMReX plotfiles, specifically
ParaView, VisIt and yt.
ParaView, VisIt and yt. The plotfile output does not currently explicitly include
the sea surface height. We instead output the transformation from the logical z-grid
(similar to the S-grid). We also do not yet include bathymetry or other 2D variables.
These will be included in a later release. If you need these, we encourage you to use
the NetCDF output.

.. _section-1:

Expand All @@ -29,10 +35,12 @@ To open a plotfile
Open multiple plotfile at once by selecting ``plt..`` Paraview will load the plotfiles as a time series.
ParaView will ask you about the file type -- choose "AMReX/BoxLib Grid Reader".

#. If you have run the REMORA executable with terrain, then the mapped grid information will
# Check the available nodal and cell data sets, and click "Apply".

#. The mapped grid information will
be stored as nodal data. Choose the "point data" called "nu", then click on "Warp by Vector"
which can be found via Filters-->Alphabetical. This will then plot data onto the mapped grid
locations.
locations. If "Warp by Vector" is not available, make sure the plotfile is highlighted in the pipeline browser. If your depth is very thin compared to the x- and y-extent, you may want to adjust the z-scale (search for scale in the search bar of the Properties tab).

#. Under the "Cell Arrays" field, select a variable (e.g., "x_velocity") and click
"Apply". Note that the default number of refinement levels loaded and visualized is 1.
Expand Down Expand Up @@ -74,7 +82,7 @@ VisIt

AMReX data can also be visualized by VisIt, an open source visualization and
analysis software. To follow along with this example, first build and run the
first `heat equation`_ tutorial code.
first `heat equation`_ tutorial code from the AMReX tutorials.

.. _`heat equation`: https://github.com/AMReX-Codes/amrex-tutorials/tree/main/GuidedTutorials/HeatEquation

Expand Down Expand Up @@ -180,8 +188,14 @@ AMReX codes. Some of the AMReX developers are also yt project members. Below
we describe how to use on both a local workstation, as well as at the NERSC
HPC facility for high-throughput visualization of large data sets.

Note that yt cannot currently
access the nodal grid data used by Paraview. Future development will include
a REMORA-specific interface that will be able to be used to read the expected
2D data fields from plotfiles.

Note - AMReX datasets require yt version 3.4 or greater.


Using on a local workstation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 3 additions & 1 deletion Source/IO/REMORA_Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,14 @@ REMORA::WritePlotFile ()

MultiFab::Copy(mf_nd[lev],*vec_z_phys_nd[lev],0,2,1,0);
Real dz = Geom()[lev].CellSizeArray()[2];
int N = Geom()[lev].Domain().size()[2];

for (MFIter mfi(mf_nd[lev], TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
const Box& bx = mfi.tilebox();
Array4<Real> mf_arr = mf_nd[lev].array(mfi);
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
mf_arr(i,j,k,2) -= k * dz;
mf_arr(i,j,k,2) = mf_arr(i,j,k,2) + (N-k) * dz;
});
} // mfi

Expand Down

0 comments on commit 3f663af

Please sign in to comment.