Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to viz docs and update plotfile so nu is corret #321

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading