Skip to content

Commit

Permalink
fgradient: A new plotfile tool for computing gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Aug 12, 2023
1 parent 9bceb99 commit ca387a9
Show file tree
Hide file tree
Showing 5 changed files with 376 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Docs/sphinx_documentation/source/Post_Processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,22 @@ Typing ``./faverage.gnu.ex`` without inputs will bring up usage and options.
will compute the average density as a function of height, outputting a data file
``plt0000000.slice``.

fgradient
---------

Compute the gradient of variables in a plotfile.

**How to build and run**

In ``amrex/Tools/Plotfile``, type ``make programs=fgradient`` and then ``./fgradient.gnu.ex`` to run.
Typing ``./fgradient.gnu.ex`` without inputs will bring up usage and options.

**Example**

.. code-block:: console
user@:~/AMReX/amrex/Tools/Plotfile$ ./fgradient.gnu.ex -v density plt0000000
will compute the gradient of density as a function of height, outputting a
new plotfile ``grad.plt0000000``.
9 changes: 9 additions & 0 deletions Src/Base/AMReX_PhysBCFunct.H
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ protected:
F m_user_f;
};

struct FabFillNoOp
{
AMREX_GPU_DEVICE
void operator() (const amrex::IntVect&, amrex::Array4<amrex::Real> const&,
int, int, amrex::GeometryData const&, amrex::Real,
const amrex::BCRec*, int, int) const
{}
};

//! This cpu version calls function working on FArrayBox
class CpuBndryFuncFab
{
Expand Down
1 change: 1 addition & 0 deletions Tools/Plotfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(_exe_names
fcompare
fextract
fextrema
fgradient
fnan
fsnapshot
ftime
Expand Down
3 changes: 3 additions & 0 deletions Tools/Plotfile/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ifeq ($(strip $(programs)),)
programs += fcompare
programs += fextract
programs += fextrema
programs += fgradient
programs += fnan
programs += fsnapshot
programs += ftime
Expand All @@ -31,6 +32,8 @@ default: $(multiple_executables)

include ./Make.package
include $(AMREX_HOME)/Src/Base/Make.package
include $(AMREX_HOME)/Src/Boundary/Make.package
include $(AMREX_HOME)/Src/AmrCore/Make.package

include $(AMREX_HOME)/Tools/GNUMake/Make.rules

Expand Down
Loading

0 comments on commit ca387a9

Please sign in to comment.